@weppy/roblox-mcp 2.15.1 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +6 -4
- package/dashboard/dist/assets/{AssetsPage-DX9x9SC-.js → AssetsPage-y9ob34oQ.js} +1 -1
- package/dashboard/dist/assets/{ChangelogDetailPage-BAdkFH4m.js → ChangelogDetailPage-B7dy6kfX.js} +1 -1
- package/dashboard/dist/assets/{ChangelogPage-DVa66CAx.js → ChangelogPage-CTzv0TSI.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-Cx4qxCjl.js → ConfirmModal-BCthkdVV.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-DD8NfK5Z.js → ConnectionPage-C5kFQ8k3.js} +1 -1
- package/dashboard/dist/assets/ContentScopedDialog-Be71g2ql.js +1 -0
- package/dashboard/dist/assets/ContentScopedDialog-DCgVfmeB.css +1 -0
- package/dashboard/dist/assets/{ControlsPage-o8R5xChG.js → ControlsPage-CAQx3UR_.js} +1 -1
- package/dashboard/dist/assets/{CurrentPlaceScope-B2YvP18E.js → CurrentPlaceScope-CMhgXKOx.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-CANQ7TH0.js → GameChangeDetail-AUqSoK_K.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-D2VbqMgH.js → InfoLabel-CI6bHOeU.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-BszeTJIo.js → OverviewPage-QU6C8Jn2.js} +1 -1
- package/dashboard/dist/assets/{PageHeader-BgyqIJ0Z.js → PageHeader-CDCcXu8v.js} +2 -2
- package/dashboard/dist/assets/PlaytestPage-C-WO2SsY.css +1 -0
- package/dashboard/dist/assets/PlaytestPage-Djj9Z4yq.js +11 -0
- package/dashboard/dist/assets/{SettingsPage-BAA3Fxdm.js → SettingsPage-u168hqTU.js} +1 -1
- package/dashboard/dist/assets/{StatusBadge-Cq69Lfvg.js → StatusBadge-PkthVJ8-.js} +1 -1
- package/dashboard/dist/assets/{SyncPage-C99qM5zE.js → SyncPage-DCSjeijW.js} +1 -1
- package/dashboard/dist/assets/{Tabs-3VHO8Be_.js → Tabs-PO1vvwQv.js} +1 -1
- package/dashboard/dist/assets/ToolsPage-Agg2KLl4.js +1 -0
- package/dashboard/dist/assets/ToolsPage-B4t6LvfV.css +1 -0
- package/dashboard/dist/assets/{TooltipText-D25g5AsX.js → TooltipText-d7cAgyJE.js} +1 -1
- package/dashboard/dist/assets/{UiPrimitive-CjC02gTX.js → UiPrimitive-BTuxHpyB.js} +1 -1
- package/dashboard/dist/assets/UiStudioPage-DopaYXcf.js +11 -0
- package/dashboard/dist/assets/{UiStudioPage-Cej06eXQ.css → UiStudioPage-Ds-eaGvd.css} +1 -1
- package/dashboard/dist/assets/{WhatsNewPage-DljMthtl.js → WhatsNewPage-DZNySLP6.js} +1 -1
- package/dashboard/dist/assets/{copy-DHFJbo01.js → copy-DfHRl3VR.js} +1 -1
- package/dashboard/dist/assets/{index-BZHTEq5I.js → index-Dj2NvZgn.js} +79 -31
- package/dashboard/dist/assets/{sample-requests-iDE7PC0n.js → sample-requests-CG4hsqBb.js} +1 -1
- package/dashboard/dist/assets/{useLiveUptime-Cz8E27FS.js → useLiveUptime-BH4xRx9-.js} +1 -1
- package/dashboard/dist/assets/useSettings-Q2tOR4bH.js +1 -0
- package/dashboard/dist/index.html +1 -1
- package/dist/index.js +128 -121
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/PlaytestPage-CVEtQ4dU.css +0 -1
- package/dashboard/dist/assets/PlaytestPage-_4RJNxRW.js +0 -11
- package/dashboard/dist/assets/ToolsPage-BgbHb62d.js +0 -1
- package/dashboard/dist/assets/ToolsPage-CAaH9fIQ.css +0 -1
- package/dashboard/dist/assets/UiStudioPage-9yMweHNP.js +0 -11
- package/dashboard/dist/assets/useSettings-C3cj-P0g.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weppy/roblox-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.1",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server for Roblox Studio integration - enables AI coding agents to interact with Roblox Studio in real-time",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._page_18pmo_2{display:flex;flex-direction:column;gap:16px;max-width:900px}._sampleBanner_18pmo_9{display:flex;flex-direction:column;gap:12px;padding:18px 20px;border:1px solid var(--pro-border);border-radius:var(--radius);background:linear-gradient(135deg,#f0bd5829,#f0bd5808 55%),var(--bg-card)}._sampleBannerRow_18pmo_21{display:flex;align-items:center;justify-content:space-between;gap:20px}._sampleBannerMain_18pmo_28{display:flex;flex-direction:column;gap:8px;min-width:0}._sampleBadge_18pmo_35{width:fit-content;padding:0;border-radius:0;background:none;border:none;color:var(--pro-text);font-family:var(--font-label);font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:none;opacity:.92}._sampleTitle_18pmo_50{font-family:var(--font-label);font-size:16px;font-weight:600;color:var(--text-primary)}._sampleMessage_18pmo_57{max-width:560px;color:var(--text-secondary);font-size:13px;line-height:1.5}._sampleActions_18pmo_64{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}._primaryAction_18pmo_72,._secondaryAction_18pmo_73{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 14px;border-radius:var(--radius-control);font-family:var(--font-label);font-size:12px;text-decoration:none;transition:background var(--transition),border-color var(--transition),opacity var(--transition)}._secondaryAction_18pmo_73{border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer}._secondaryAction_18pmo_73:hover{border-color:var(--accent);background:var(--accent-dim)}._primaryAction_18pmo_72{border:1px solid var(--pro-badge);background:var(--pro-badge);color:var(--pro-text-on-badge)}._primaryAction_18pmo_72:hover{opacity:.9}._card_18pmo_109{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._cardHeader_18pmo_116{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--text-primary);margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:8px}._clearButton_18pmo_128{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-control);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._clearButton_18pmo_128:hover:not(:disabled){background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_18pmo_128:focus-visible{outline:none;box-shadow:var(--focus-ring)}._clearButton_18pmo_128:disabled{cursor:not-allowed;opacity:.55}._statusRow_18pmo_157{display:flex;align-items:center;gap:12px;margin-bottom:8px}._statusIndicator_18pmo_164{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0}._statusRunning_18pmo_172{background:var(--success);box-shadow:0 0 6px var(--success)}._statusPaused_18pmo_177{background:var(--warning)}._statusNotRunning_18pmo_181{background:var(--text-muted)}._statusLabel_18pmo_185{font-family:var(--font-code);font-size:13px;font-weight:600;color:var(--text-primary)}._statusMeta_18pmo_192{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._controlButtons_18pmo_198{display:flex;gap:8px;margin-top:12px}._btn_18pmo_205{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:var(--radius-control);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_18pmo_205:hover{border-color:var(--accent);background:var(--accent-dim)}._btn_18pmo_205:disabled{opacity:.4;pointer-events:none}._btnPrimary_18pmo_227{background:var(--accent);color:var(--bg-card);border-color:var(--accent)}._btnPrimary_18pmo_227:hover{opacity:.9}._btnDanger_18pmo_237{border-color:var(--danger-border);background:var(--danger-bg);color:var(--danger-text)}._btnDanger_18pmo_237:hover{border-color:var(--danger);background:var(--danger-hover-bg)}._historyList_18pmo_249{display:flex;flex-direction:column;gap:4px;max-height:320px;overflow-y:auto}._historyItem_18pmo_257{display:flex;flex-direction:column;gap:4px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);cursor:pointer;text-align:left;width:100%;font-family:inherit;transition:border-color var(--transition)}._historyItem_18pmo_257:hover{border-color:var(--accent)}._historyItemSelected_18pmo_276{border-color:var(--accent);background:var(--accent-dim)}._historyItemHeader_18pmo_281{display:flex;align-items:center;gap:8px}._historyIcon_18pmo_287{font-size:14px;flex-shrink:0}._historyTimestamp_18pmo_292{font-family:var(--font-code);font-size:11px;color:var(--text-muted);flex-shrink:0}._historyName_18pmo_299{font-family:var(--font-label);font-size:12px;font-weight:500;color:var(--text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._historyItemMeta_18pmo_309{display:flex;gap:12px;font-family:var(--font-code);font-size:11px;color:var(--text-secondary);padding-left:22px}._historyMode_18pmo_318{color:var(--text-muted)}._historyDuration_18pmo_322{color:var(--text-secondary)}._historyStatus_18pmo_326{font-weight:500;text-transform:uppercase;font-size:10px;letter-spacing:.04em}._status_passed_18pmo_333{color:var(--success)}._status_failed_18pmo_337{color:var(--error)}._status_running_18pmo_341{color:var(--accent)}._historyError_18pmo_345{font-family:var(--font-code);font-size:11px;color:var(--error);padding-left:22px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._historyContext_18pmo_355{display:flex;flex-direction:column;gap:4px;padding-left:22px;color:var(--text-secondary);font-size:11px}._historyContextLine_18pmo_364{display:flex;flex-direction:column;gap:2px}._historyContextLabel_18pmo_370{font-family:var(--font-label);font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}._reportContainer_18pmo_379{display:flex;flex-direction:column;gap:12px}._reportContextPanel_18pmo_385{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-secondary)}._reportContextRow_18pmo_395{display:flex;flex-direction:column;gap:4px;color:var(--text-primary);font-size:12px}._reportContextLabel_18pmo_403{font-family:var(--font-label);font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}._reportSection_18pmo_411{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}._reportSectionHeader_18pmo_417{font-family:var(--font-label);font-size:11px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.06em;padding:6px 12px;background:var(--bg-secondary);border-bottom:1px solid var(--border)}._reportMarkdown_18pmo_429{padding:12px;margin:0;font-family:var(--font-code);font-size:12px;line-height:1.6;color:var(--text-primary);white-space:pre-wrap;word-break:break-word;max-height:400px;overflow-y:auto}._reportLogs_18pmo_442{padding:12px;margin:0;font-family:var(--font-code);font-size:11px;line-height:1.5;color:var(--text-secondary);white-space:pre-wrap;word-break:break-word;max-height:240px;overflow-y:auto;background:var(--bg-secondary)}._emptyState_18pmo_457{text-align:center;padding:32px 16px;color:var(--text-muted);font-size:13px}._emptyStateTitle_18pmo_464{font-family:var(--font-label);font-size:14px;font-weight:600;color:var(--text-secondary);margin-bottom:8px}._emptyStateMessage_18pmo_472{font-size:12px;color:var(--text-muted);max-width:360px;margin:0 auto;line-height:1.5}._upgradePanel_18pmo_481{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:32px 24px;text-align:center}._upgradePanelIcon_18pmo_489{font-size:32px;margin-bottom:12px}._upgradePanelTitle_18pmo_494{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--text-primary);margin-bottom:8px}._upgradePanelDesc_18pmo_502{font-size:13px;color:var(--text-secondary);margin-bottom:16px;max-width:400px;margin-left:auto;margin-right:auto;line-height:1.5}._benefitList_18pmo_512{list-style:none;padding:0;margin:0 auto 16px;display:flex;flex-direction:column;gap:4px;max-width:360px;text-align:left}._benefitItem_18pmo_523{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_18pmo_523:before{content:"+";position:absolute;left:0;color:var(--accent);font-weight:600}._upgradeActions_18pmo_538{display:flex;gap:8px;justify-content:center}@media(max-width:720px){._sampleBannerRow_18pmo_21{flex-direction:column;align-items:stretch}._sampleActions_18pmo_64{justify-content:stretch}._primaryAction_18pmo_72,._secondaryAction_18pmo_73{width:100%}}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{r as l,a as v,u as N,j as t,e as D,h as E,l as $,T as U}from"./index-BZHTEq5I.js";import{P as O}from"./PageHeader-BgyqIJ0Z.js";import{I as B}from"./InfoLabel-D2VbqMgH.js";import{C as F}from"./CurrentPlaceScope-B2YvP18E.js";import{T as S}from"./TooltipText-D25g5AsX.js";import{C as V}from"./ConfirmModal-Cx4qxCjl.js";import"./UiPrimitive-CjC02gTX.js";import"./ConfirmModal.module-DJksQHBd.js";const W=5e3;function T(e){if(typeof e=="number")return{placeId:String(e)}}function z(e,o){return typeof o!="number"?e:`${e}?placeId=${encodeURIComponent(String(o))}`}function G(e){const o=(e==null?void 0:e.enabled)??!0,r=(e==null?void 0:e.placeId)??null,[n,a]=l.useState([]),[m,i]=l.useState(null),[p,c]=l.useState(o),d=l.useRef(null),u=l.useCallback(async()=>{try{const y=T(r),x=y?await v.get("/api/dashboard/playtest/history",y):await v.get("/api/dashboard/playtest/history");a(x.entries??[])}catch{}},[r]),h=l.useCallback(async()=>{if(!o){c(!1);return}await u(),c(!1)},[o,u]),g=l.useCallback(async()=>{o&&(await v.post(z("/api/dashboard/playtest/history/clear",r)),a([]),i(null))},[o,r]);l.useEffect(()=>{i(null)},[r]);const f=l.useCallback(async y=>{if(o)try{const x=T(r),w=x?await v.get(`/api/dashboard/playtest/report/${y}`,x):await v.get(`/api/dashboard/playtest/report/${y}`);i(w)}catch{i(null)}},[o,r]);return l.useEffect(()=>{if(!o){c(!1);return}return h(),d.current=setInterval(h,W),()=>{d.current&&clearInterval(d.current)}},[o,h]),{history:n,selectedReport:m,loading:p,loadReport:f,clearHistory:g}}function Q(e){const o="2026-03-27T15:26:00.000Z",r={testScenario:e("playtest.sample.context.why","Spawn into the arena, survive the opener, and verify the HUD responds immediately."),expectedBehavior:e("playtest.sample.context.expected","The player spawns safely, the countdown UI appears within one second, and the first wave starts without errors."),observedBehavior:e("playtest.sample.context.observed","Spawn protection held, the HUD updated on time, and wave one completed with no gameplay regressions.")};return{history:[{timestamp:o,testName:e("playtest.sample.history.name","Sample Arena Smoke Test"),mode:"play",status:"passed",durationMs:4820,contextId:"sample_playtest_preview",contextSummary:r}],report:{markdown:e("playtest.sample.report.markdown",`# Sample Arena Smoke Test
|
|
2
|
-
|
|
3
|
-
- Spawn flow: PASS
|
|
4
|
-
- HUD countdown: PASS
|
|
5
|
-
- Wave bootstrap: PASS
|
|
6
|
-
|
|
7
|
-
This is a sample preview. Live playtests and real reports are available with Pro.`),logs:e("playtest.sample.report.logs",`[sample] boot playtest preview
|
|
8
|
-
[sample] spawn protection active
|
|
9
|
-
[sample] hud countdown rendered
|
|
10
|
-
[sample] wave one completed
|
|
11
|
-
[sample] preview report finished`),contextId:"sample_playtest_preview",contextSummary:r}}}const Y="_page_18pmo_2",Z="_sampleBanner_18pmo_9",q="_sampleBannerRow_18pmo_21",J="_sampleBannerMain_18pmo_28",K="_sampleBadge_18pmo_35",X="_sampleTitle_18pmo_50",ee="_sampleMessage_18pmo_57",te="_sampleActions_18pmo_64",se="_primaryAction_18pmo_72",ae="_secondaryAction_18pmo_73",oe="_card_18pmo_109",re="_cardHeader_18pmo_116",ne="_clearButton_18pmo_128",le="_statusRow_18pmo_157",ie="_statusIndicator_18pmo_164",ce="_statusRunning_18pmo_172",pe="_statusPaused_18pmo_177",me="_statusNotRunning_18pmo_181",de="_statusLabel_18pmo_185",ue="_statusMeta_18pmo_192",he="_controlButtons_18pmo_198",ye="_btn_18pmo_205",_e="_btnPrimary_18pmo_227",xe="_btnDanger_18pmo_237",ge="_historyList_18pmo_249",ve="_historyItem_18pmo_257",Se="_historyItemSelected_18pmo_276",fe="_historyItemHeader_18pmo_281",be="_historyIcon_18pmo_287",je="_historyTimestamp_18pmo_292",we="_historyName_18pmo_299",Ne="_historyItemMeta_18pmo_309",Ce="_historyMode_18pmo_318",Ie="_historyDuration_18pmo_322",Le="_historyStatus_18pmo_326",Pe="_status_passed_18pmo_333",Re="_status_failed_18pmo_337",Be="_status_running_18pmo_341",Te="_historyError_18pmo_345",Me="_historyContext_18pmo_355",ke="_historyContextLine_18pmo_364",Ae="_historyContextLabel_18pmo_370",He="_reportContainer_18pmo_379",De="_reportContextPanel_18pmo_385",Ee="_reportContextRow_18pmo_395",$e="_reportContextLabel_18pmo_403",Ue="_reportSection_18pmo_411",Oe="_reportSectionHeader_18pmo_417",Fe="_reportMarkdown_18pmo_429",Ve="_reportLogs_18pmo_442",We="_emptyState_18pmo_457",ze="_emptyStateTitle_18pmo_464",Ge="_emptyStateMessage_18pmo_472",Qe="_upgradePanel_18pmo_481",Ye="_upgradePanelIcon_18pmo_489",Ze="_upgradePanelTitle_18pmo_494",qe="_upgradePanelDesc_18pmo_502",Je="_benefitList_18pmo_512",Ke="_benefitItem_18pmo_523",Xe="_upgradeActions_18pmo_538",s={page:Y,sampleBanner:Z,sampleBannerRow:q,sampleBannerMain:J,sampleBadge:K,sampleTitle:X,sampleMessage:ee,sampleActions:te,primaryAction:se,secondaryAction:ae,card:oe,cardHeader:re,clearButton:ne,statusRow:le,statusIndicator:ie,statusRunning:ce,statusPaused:pe,statusNotRunning:me,statusLabel:de,statusMeta:ue,controlButtons:he,btn:ye,btnPrimary:_e,btnDanger:xe,historyList:ge,historyItem:ve,historyItemSelected:Se,historyItemHeader:fe,historyIcon:be,historyTimestamp:je,historyName:we,historyItemMeta:Ne,historyMode:Ce,historyDuration:Ie,historyStatus:Le,status_passed:Pe,status_failed:Re,status_running:Be,historyError:Te,historyContext:Me,historyContextLine:ke,historyContextLabel:Ae,reportContainer:He,reportContextPanel:De,reportContextRow:Ee,reportContextLabel:$e,reportSection:Ue,reportSectionHeader:Oe,reportMarkdown:Fe,reportLogs:Ve,emptyState:We,emptyStateTitle:ze,emptyStateMessage:Ge,upgradePanel:Qe,upgradePanelIcon:Ye,upgradePanelTitle:Ze,upgradePanelDesc:qe,benefitList:Je,benefitItem:Ke,upgradeActions:Xe};function j(e){return e.trim().toLowerCase()}function et(e){switch(j(e)){case"passed":return"✅";case"failed":return"❌";case"running":return"⏱";default:return"❓"}}function tt(e,o){switch(j(o)){case"run":return e("playtest.status.mode.run","Run");case"server":return e("playtest.status.mode.server","Server");case"edit":return e("playtest.status.mode.edit","Edit");case"play":return e("playtest.status.mode.play","Play");default:return o}}function st(e,o){switch(j(o)){case"passed":return e("playtest.history.status.passed","Passed");case"failed":return e("playtest.history.status.failed","Failed");case"running":return e("playtest.history.status.running","Running");default:return e("playtest.history.status.unknown","Unknown")}}function at(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function ot({entries:e,onSelect:o,selectedTimestamp:r}){const{t:n}=N();return e.length===0?t.jsx("div",{className:s.emptyState,children:n("playtest.history.empty","No test results yet")}):t.jsx("div",{className:s.historyList,children:e.map(a=>{var i,p,c,d,u,h;const m=a.timestamp===r;return t.jsxs("button",{className:`${s.historyItem} ${m?s.historyItemSelected:""}`,onClick:()=>o(a.timestamp),children:[t.jsxs("div",{className:s.historyItemHeader,children:[t.jsx("span",{className:s.historyIcon,children:et(a.status)}),t.jsx("span",{className:s.historyTimestamp,children:a.timestamp}),t.jsx("span",{className:s.historyName,children:a.testName})]}),t.jsxs("div",{className:s.historyItemMeta,children:[t.jsx(S,{text:n("playtest.history.mode.tooltip","Playtest mode used for this recorded test run."),children:t.jsxs("span",{className:s.historyMode,children:[n("playtest.history.mode","Mode"),": ",tt(n,a.mode)]})}),t.jsx("span",{className:s.historyDuration,children:at(a.durationMs)}),t.jsx(S,{text:n("playtest.history.status.tooltip","Recorded result state for this automated playtest run."),children:t.jsx("span",{className:`${s.historyStatus} ${s[`status_${j(a.status)}`]??""}`,children:st(n,a.status)})})]}),a.errorMessage&&t.jsx("div",{className:s.historyError,children:a.errorMessage}),(a.contextId||((i=a.contextSummary)==null?void 0:i.testScenario)||((p=a.contextSummary)==null?void 0:p.expectedBehavior)||((c=a.contextSummary)==null?void 0:c.observedBehavior))&&t.jsxs("div",{className:s.historyContext,children:[a.contextId&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:n("playtest.context.contextId","Context ID")}),t.jsx("span",{children:a.contextId})]}),((d=a.contextSummary)==null?void 0:d.testScenario)&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:n("playtest.context.why","Why this test ran")}),t.jsx("span",{children:a.contextSummary.testScenario})]}),((u=a.contextSummary)==null?void 0:u.expectedBehavior)&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:n("playtest.context.expected","Expected")}),t.jsx("span",{children:a.contextSummary.expectedBehavior})]}),((h=a.contextSummary)==null?void 0:h.observedBehavior)&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:n("playtest.context.observed","Observed")}),t.jsx("span",{children:a.contextSummary.observedBehavior})]})]})]},a.timestamp)})})}function rt({report:e}){var n,a,m,i,p,c;const{t:o}=N(),r=!!((n=e.contextSummary)!=null&&n.testScenario||(a=e.contextSummary)!=null&&a.expectedBehavior||(m=e.contextSummary)!=null&&m.observedBehavior);return t.jsxs("div",{className:s.reportContainer,children:[r&&t.jsxs("div",{className:s.reportContextPanel,children:[((i=e.contextSummary)==null?void 0:i.testScenario)&&t.jsxs("div",{className:s.reportContextRow,children:[t.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.why","Why this test ran")}),t.jsx("span",{children:e.contextSummary.testScenario})]}),((p=e.contextSummary)==null?void 0:p.expectedBehavior)&&t.jsxs("div",{className:s.reportContextRow,children:[t.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.expected","Expected")}),t.jsx("span",{children:e.contextSummary.expectedBehavior})]}),((c=e.contextSummary)==null?void 0:c.observedBehavior)&&t.jsxs("div",{className:s.reportContextRow,children:[t.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.observed","Observed")}),t.jsx("span",{children:e.contextSummary.observedBehavior})]})]}),e.markdown&&t.jsxs("div",{className:s.reportSection,children:[t.jsx("div",{className:s.reportSectionHeader,children:t.jsx(S,{text:o("playtest.report.content.tooltip","Markdown summary for the selected automated playtest run."),children:t.jsx("span",{children:o("playtest.report.content","Report")})})}),t.jsx("pre",{className:s.reportMarkdown,children:e.markdown})]}),e.logs&&t.jsxs("div",{className:s.reportSection,children:[t.jsx("div",{className:s.reportSectionHeader,children:t.jsx(S,{text:o("playtest.report.logs.tooltip","Execution logs captured for the selected automated playtest run."),children:t.jsx("span",{children:o("playtest.report.logs","Logs")})})}),t.jsx("pre",{className:s.reportLogs,children:e.logs})]}),!e.markdown&&!e.logs&&t.jsx("div",{className:s.emptyState,children:o("playtest.report.empty","No report content available")})]})}function ht(){var R;const{t:e}=N(),{trackEvent:o}=D(),{tier:r,loading:n}=E(),a=!n&&r==="basic",[m,i]=l.useState(null),p=G({enabled:!a,placeId:m}),{show:c}=$(),[d,u]=l.useState(null),[h,g]=l.useState(!1),[f,y]=l.useState(!1),{history:x,selectedReport:w,loading:M}=p,_=a?Q(e):null,C=((R=_==null?void 0:_.history[0])==null?void 0:R.timestamp)??null,I=a?d??C:d,L=(_==null?void 0:_.history)??x,P=_&&I===C?_.report:w,k=a?!1:M,A=b=>{u(b),!a&&p.loadReport(b)},H=async()=>{y(!0);try{await p.clearHistory(),c(e("toast.clearSuccess","Cleared successfully"),"success"),g(!1),u(null)}catch{c(e("toast.clearFailed","Failed to clear data"),"error")}finally{y(!1)}};return t.jsxs("div",{className:s.page,children:[t.jsx(O,{title:e("page.playtest.title","Playtest"),description:e("page.playtest.description","Review automated playtest runs, saved reports, and result history."),helpTopicId:"playtest",helpState:{tier:r}}),!a&&t.jsx(F,{surface:"playtest",selectable:!0,selectedPlaceId:m,onSelectedPlaceIdChange:b=>{i(b),u(null)}}),a&&t.jsx("div",{className:s.sampleBanner,children:t.jsxs("div",{className:s.sampleBannerRow,children:[t.jsxs("div",{className:s.sampleBannerMain,children:[t.jsx("div",{className:s.sampleBadge,children:e("playtest.sample.badge","Preview of the Pro playtest view")}),t.jsx("div",{className:s.sampleTitle,children:e("playtest.sample.title","You are previewing the report viewer that becomes available after upgrading to Pro.")}),t.jsx("div",{className:s.sampleMessage,children:e("playtest.sample.message","This preview uses sample data. Real playtest history management and stored reports unlock with Pro.")})]}),t.jsx("div",{className:s.sampleActions,children:t.jsx("a",{className:s.primaryAction,href:U.playtest,target:"_blank",rel:"noreferrer",onClick:()=>o("dashboard_click_event",{click_target:"upgrade_cta",placement:"playtest_sample_banner",page:"playtest"}),children:e("tier.upgrade","View Pro")})})]})}),t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx(B,{label:e("playtest.history.title","Test History"),tooltip:e("playtest.history.title.tooltip","Recorded automated playtest runs for this project.")}),a?t.jsx(S,{text:e("playtest.sample.clearDisabled","Available with Pro for live playtest history."),children:t.jsx("span",{children:t.jsx("button",{className:s.clearButton,disabled:!0,children:e("common.clear","Clear")})})}):t.jsx("button",{className:s.clearButton,onClick:()=>{o("dashboard_click_event",{click_target:"playtest_clear_history",page:"playtest"}),g(!0)},children:e("common.clear","Clear")})]}),k?t.jsx("div",{className:s.emptyState,children:e("common.loading","Loading...")}):L.length===0?t.jsxs("div",{className:s.emptyState,children:[t.jsx("div",{className:s.emptyStateTitle,children:e("playtest.empty.title","No playtest results yet")}),t.jsx("div",{className:s.emptyStateMessage,children:e("playtest.empty.message","Test results for this place will appear here after the AI Agent runs a Playtest.")})]}):t.jsx(ot,{entries:L,onSelect:A,selectedTimestamp:I??void 0})]}),P&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:t.jsx(B,{label:e("playtest.report.title","Selected Report"),tooltip:e("playtest.report.title.tooltip","Detailed output for the currently selected automated playtest run.")})}),t.jsx(rt,{report:P})]}),!a&&t.jsx(V,{open:h,title:e("playtest.clear.title","Clear test history?"),message:e("playtest.clear.message","This permanently removes the stored playtest reports for the current place."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:f,onCancel:()=>!f&&g(!1),onConfirm:H})]})}export{ht as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,r as n,a as O,D as nt,u as ct,e as dt,l as ut}from"./index-BZHTEq5I.js";import{P as pt}from"./PageHeader-BgyqIJ0Z.js";import{T as M}from"./TooltipText-D25g5AsX.js";import{C as ht}from"./ConfirmModal-Cx4qxCjl.js";import{C as mt}from"./CurrentPlaceScope-B2YvP18E.js";import{T as bt}from"./Tabs-3VHO8Be_.js";import"./UiPrimitive-CjC02gTX.js";import"./ConfirmModal.module-DJksQHBd.js";const xt="_wrapper_hzgda_2",ft="_table_hzgda_7",gt="_sortable_hzgda_32",_t="_sortArrow_hzgda_41",wt="_clickable_hzgda_52",yt="_empty_hzgda_57",Ct="_expandedRow_hzgda_65",jt="_expandedCell_hzgda_74",T={wrapper:xt,table:ft,sortable:gt,sortArrow:_t,clickable:wt,empty:yt,expandedRow:Ct,expandedCell:jt};function kt({columns:t,data:a,sortBy:x,sortDir:z="asc",onSort:P,onRowClick:i,rowKey:j,emptyMessage:k,expandedKey:B,renderExpandedRow:N}){return s.jsx("div",{className:T.wrapper,children:s.jsxs("table",{className:T.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map(u=>s.jsxs("th",{style:u.width?{width:u.width}:void 0,className:u.sortable?T.sortable:void 0,onClick:u.sortable&&P?()=>P(u.key):void 0,children:[s.jsx("span",{children:u.label}),u.sortable&&x===u.key&&s.jsx("span",{className:T.sortArrow,children:z==="asc"?"▴":"▾"})]},u.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length,className:T.empty,children:k||"No data"})}):a.map((u,E)=>{const R=j?j(u):String(E),h=B!=null&&R===B&&N?N(u):null;return s.jsxs(n.Fragment,{children:[s.jsx("tr",{className:i?T.clickable:void 0,onClick:i?()=>i(u):void 0,children:t.map(y=>s.jsx("td",{children:y.render?y.render(u):String(u[y.key]??"")},y.key))}),h&&s.jsx("tr",{className:T.expandedRow,children:s.jsx("td",{colSpan:t.length,className:T.expandedCell,children:h})})]},R)})})]})})}function St(t){return{...t,sequenceNumber:typeof t.sequenceNumber=="number"?t.sequenceNumber:void 0,executionTimeMs:typeof t.executionTimeMs=="number"?t.executionTimeMs:void 0}}const Tt=50;function Nt(t){if(typeof t=="number")return{placeId:String(t)}}function Z(t,a){return typeof a!="number"?t:`${t}?placeId=${encodeURIComponent(String(a))}`}function vt(t){const a=(t==null?void 0:t.placeId)??null,[x,z]=n.useState(null),[P,i]=n.useState(!0),[j,k]=n.useState([]),[B,N]=n.useState(0),[u,E]=n.useState(!1),[R,w]=n.useState(!0),[h,y]=n.useState(0),[f,L]=n.useState(""),F=n.useRef(null),m=n.useCallback(async()=>{i(!0);try{const c=Nt(a),C=c?await O.get("/api/dashboard/tool-stats",c):await O.get("/api/dashboard/tool-stats");z(C)}catch{}finally{i(!1)}},[a]),_=n.useCallback(async(c,C)=>{w(!0);try{const H={limit:String(Tt),offset:String(c)};C&&(H.tool=C),typeof a=="number"&&(H.placeId=String(a));const I=await O.get("/api/dashboard/history",H);k(I.entries.map(St)),N(I.total),E(I.hasMore)}catch{k([]),N(0),E(!1)}finally{w(!1)}},[a]),U=n.useCallback(()=>{m(),_(h,f)},[_,m,h,f]),V=n.useCallback(async()=>{await O.post(Z("/api/dashboard/tools/history/clear",a)),_(h,f)},[_,h,f,a]),$=n.useCallback(async()=>{await O.post(Z("/api/dashboard/tools/statistics/clear",a)),m()},[m,a]);return n.useEffect(()=>{m()},[m]),n.useEffect(()=>{_(h,f)},[_,h,f]),n.useEffect(()=>{const c=new nt;F.current=c,c.connect();const C=c.on("command",()=>{m(),_(h,f)});return()=>{C(),c.disconnect(),F.current=null}},[_,m,h,f]),{statistics:x,statsLoading:P,history:j,historyTotal:B,historyHasMore:u,historyLoading:R,historyOffset:h,historyToolFilter:f,setHistoryOffset:y,setHistoryToolFilter:L,refresh:U,clearHistory:V,clearStatistics:$}}const Mt="_page_1wi3z_2",zt="_card_1wi3z_12",Pt="_cardToolbar_1wi3z_19",Bt="_sectionTitle_1wi3z_27",Et="_dangerButton_1wi3z_33",Rt="_proBadge_1wi3z_52",Lt="_statusOk_1wi3z_67",It="_statusFallback_1wi3z_80",At="_statusUnsupported_1wi3z_93",Ht="_statusWarning_1wi3z_106",Ot="_statusError_1wi3z_119",Ft="_tierBasic_1wi3z_133",$t="_tierPro_1wi3z_137",qt="_tierMixed_1wi3z_142",Dt="_filterRow_1wi3z_153",Wt="_filterLabel_1wi3z_160",Ut="_filterSelect_1wi3z_169",Vt="_expandedRow_1wi3z_185",Kt="_expandedSection_1wi3z_190",Gt="_detailList_1wi3z_200",Jt="_detailItem_1wi3z_206",Qt="_detailLabel_1wi3z_212",Zt="_detailValue_1wi3z_217",Xt="_pre_1wi3z_222",Yt="_pagination_1wi3z_239",te="_pageInfo_1wi3z_247",ee="_btn_1wi3z_253",se="_tierDistribution_1wi3z_281",oe="_tierBarWrap_1wi3z_285",ae="_tierBarBasic_1wi3z_293",re="_tierBarPro_1wi3z_298",le="_tierLabels_1wi3z_303",ie="_statsTableWrap_1wi3z_312",ne="_statsTable_1wi3z_312",ce="_sortableHeader_1wi3z_343",de="_sortArrow_1wi3z_348",ue="_statsToolRow_1wi3z_352",pe="_statsActionRow_1wi3z_360",he="_expandButton_1wi3z_364",me="_expandIcon_1wi3z_376",be="_actionLabel_1wi3z_381",xe="_emptyStats_1wi3z_388",fe="_summaryLine_1wi3z_394",o={page:Mt,card:zt,cardToolbar:Pt,sectionTitle:Bt,dangerButton:Et,proBadge:Rt,statusOk:Lt,statusFallback:It,statusUnsupported:At,statusWarning:Ht,statusError:Ot,tierBasic:Ft,tierPro:$t,tierMixed:qt,filterRow:Dt,filterLabel:Wt,filterSelect:Ut,expandedRow:Vt,expandedSection:Kt,detailList:Gt,detailItem:Jt,detailLabel:Qt,detailValue:Zt,pre:Xt,pagination:Yt,pageInfo:te,btn:ee,tierDistribution:se,tierBarWrap:oe,tierBarBasic:ae,tierBarPro:re,tierLabels:le,statsTableWrap:ie,statsTable:ne,sortableHeader:ce,sortArrow:de,statsToolRow:ue,statsActionRow:pe,expandButton:he,expandIcon:me,actionLabel:be,emptyStats:xe,summaryLine:fe},K=50,ge=new Set(["clientId","placeId","pinnedTarget","recentPriority","globalQueue"]);function _e(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function W(t){return typeof t!="number"||!Number.isFinite(t)?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function A(t,a){return a==="pro"?t("tier.pro","Pro"):a==="mixed"?t("tier.mixed","Mixed"):t("tier.basic","Basic")}function tt(t,a){return a!==t&&a.startsWith(`${t}_`)?a.slice(t.length+1):""}function we(t,a){const x=tt(t,a);return x?`${t}.${x}`:t}function X(t){return typeof t=="string"&&t.length>0?t:void 0}function ye(t){if(!Array.isArray(t))return;const a=t.filter(x=>typeof x=="string"&&x.length>0);return a.length>0?a:void 0}function Ce(t){const a=t.result??{};return{requestedCommand:t.requestedCommand??X(a.requestedCommand),executedCommand:t.executedCommand??X(a.executedCommand),alternatives:t.alternatives??ye(a.alternatives)}}function je(t,a){switch(t.status){case"fallback":return{label:a("tools.badge.fallback","FALLBACK"),tooltip:a("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:o.statusFallback};case"unsupported":return{label:a("tools.badge.unsupported","UNSUPPORTED"),tooltip:a("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:o.statusUnsupported};case"warning":return{label:a("tools.badge.warn","WARN"),tooltip:a("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:o.statusWarning};case"error":return{label:a("tools.badge.err","FAILED"),tooltip:a("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:a("tools.status.ok","OK"),tooltip:a("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function g(t,a){return s.jsxs("div",{className:o.detailItem,children:[s.jsx("span",{className:o.detailLabel,children:t}),s.jsx("span",{className:o.detailValue,children:a})]})}function ke(t){if(!t||typeof t!="object")return;const a=t;if(typeof a.selectionMode=="string"&&ge.has(a.selectionMode))return a}function Y(t){if(!(!t||typeof t!="object"||!("routing"in t)))return ke(t.routing)}function Se(t){return t.routing??Y(t.result)??Y(t.data)}function Te(t,a){return t.requestedClientId?t.requestedClientId:t.requestedPlaceId!==void 0?t.requestedPlaceId:a("tools.history.routing.none","No Studio target named")}function Ne(t){return t.actualPlaceName?`${t.actualPlaceName} · ${t.actualPlaceId??"-"}`:t.actualClientId??"-"}function Ae(){const{t}=ct(),{trackEvent:a,trackPageView:x}=dt(),[z,P]=n.useState(null),i=vt({placeId:z}),{show:j}=ut(),[k,B]=n.useState("history"),[N,u]=n.useState(null),[E,R]=n.useState(null),[w,h]=n.useState(null),[y,f]=n.useState(!1),[L,F]=n.useState("totalCalls"),[m,_]=n.useState("desc"),U=n.useCallback(e=>{F(r=>r===e?(_(l=>l==="asc"?"desc":"asc"),e):(_("desc"),e))},[]),V=n.useMemo(()=>{var r;const e=new Set;return Object.keys(((r=i.statistics)==null?void 0:r.tools)??{}).forEach(l=>e.add(l)),i.history.forEach(l=>{l.tool&&e.add(l.tool)}),i.historyToolFilter&&e.add(i.historyToolFilter),Array.from(e).sort()},[i.history,i.historyToolFilter,i.statistics]),$=n.useMemo(()=>{var e;return(e=i.statistics)!=null&&e.tools?Object.values(i.statistics.tools).map(r=>{var Q;const l=Object.entries(r.commands??{}).map(([p,d])=>({toolName:r.tool,commandName:d.command??p,label:tt(r.tool,d.command??p)||(d.command??p),tier:d.tier,totalCalls:d.totalCalls,successCount:d.successCount,fallbackCount:d.fallbackCount,unsupportedCount:d.unsupportedCount,warningCount:d.warningCount??0,failureCount:d.failureCount,totalExecutionTimeMs:d.totalExecutionTimeMs,avgExecutionTimeMs:d.avgExecutionTimeMs})),b=l.reduce((p,d)=>p+d.totalCalls,0),S=l.reduce((p,d)=>p+d.successCount,0),q=l.reduce((p,d)=>p+d.fallbackCount,0),D=l.reduce((p,d)=>p+d.unsupportedCount,0),rt=l.reduce((p,d)=>p+d.warningCount,0),lt=l.reduce((p,d)=>p+d.failureCount,0),J=l.reduce((p,d)=>p+d.totalExecutionTimeMs,0),it=new Set(l.map(p=>p.tier)).size>1?"mixed":((Q=l[0])==null?void 0:Q.tier)??r.tier;return{toolName:r.tool,tier:it,commands:l,totalCalls:b,successCount:S,fallbackCount:q,unsupportedCount:D,warningCount:rt,failureCount:lt,totalExecutionTimeMs:J,avgExecutionTimeMs:b>0?Math.round(J/b):0}}):[]},[i.statistics]),c=n.useCallback((e,r,l,b)=>s.jsx(M,{text:t(l,b),children:t(e,r)}),[t]),C=n.useMemo(()=>[...$].sort((r,l)=>{const b=r[L],S=l[L];if(typeof b=="number"&&typeof S=="number")return m==="asc"?b-S:S-b;const q=String(b??""),D=String(S??"");return m==="asc"?q.localeCompare(D):D.localeCompare(q)}),[$,L,m]),H=n.useMemo(()=>[{key:"timestamp",label:c("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:e=>_e(e.timestamp)},{key:"toolName",label:c("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:e=>s.jsxs("span",{children:[we(e.tool,e.command),e.tier==="pro"&&s.jsx(M,{text:t("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:o.proBadge,children:t("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:c("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:e=>W(e.executionTimeMs)},{key:"status",label:c("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:e=>{const r=je(e,t);return s.jsx(M,{text:r.tooltip,children:s.jsx("span",{className:r.className,children:r.label})})}},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:e=>s.jsx("span",{className:e.tier==="pro"?o.tierPro:o.tierBasic,children:A(t,e.tier)})}],[t,c]),I=n.useMemo(()=>[{key:"toolName",label:c("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:c("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:c("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:c("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:c("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"warningCount",label:c("tools.col.warn","WARN","tools.col.warn.tooltip","Number of expected failures caused by caller input, project state, Roblox policy, or user code."),sortable:!0,width:"80px"},{key:"failureCount",label:c("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:c("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:e=>W(e.avgExecutionTimeMs)},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:e=>s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:A(t,e.tier)})})}],[t,c]),v=n.useMemo(()=>{if(!i.statistics)return null;const e=i.statistics.tierSummary.basic.totalCalls,r=i.statistics.tierSummary.pro.totalCalls,l=e+r;if(l===0)return null;const b=Math.round(e/l*100),S=100-b;return{basic:e,pro:r,basicPct:b,proPct:S}},[i.statistics]),G=n.useCallback(e=>{R(r=>r===e?null:e)},[]),et=n.useCallback(async()=>{if(w){f(!0);try{w==="history"?await i.clearHistory():await i.clearStatistics(),j(t("toast.clearSuccess","Cleared successfully"),"success"),h(null)}catch{j(t("toast.clearFailed","Failed to clear data"),"error")}finally{f(!1)}}},[w,j,t,i]),st=n.useCallback(e=>{const r=e==="history"?"tools_history":"tools_statistics";a("dashboard_click_event",{click_target:e==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:r}),x({page:"tools",tab:r}),B(e)},[a,x]),ot=n.useCallback(e=>{const r=Ce(e),l=Se(e);return s.jsxs("div",{className:o.expandedRow,children:[s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:t("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.parameters,null,2)})]}),e.result&&s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.result.tooltip","Returned result payload for this tool run."),children:t("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.result,null,2)})]}),l?s.jsxs("div",{className:o.expandedSection,children:[s.jsx("strong",{children:t("tools.history.routing","Routing")}),s.jsxs("div",{className:o.detailList,children:[g(t("tools.history.routing.mode","Mode"),l.selectionMode),g(t("tools.history.routing.requested","Requested"),Te(l,t)),g(t("tools.history.routing.actual","Actual"),Ne(l))]})]}):null,(e.status==="fallback"||e.status==="unsupported"||e.status==="warning"||e.status==="error")&&s.jsx("div",{className:o.expandedSection,children:s.jsxs("div",{className:o.detailList,children:[e.status==="fallback"&&(r==null?void 0:r.requestedCommand)&&g(t("tools.detail.requestedCommand","Requested Command"),r.requestedCommand),e.status==="fallback"&&(r==null?void 0:r.executedCommand)&&g(t("tools.detail.executedCommand","Executed Command"),r.executedCommand),e.status==="fallback"&&(r==null?void 0:r.alternatives)&&g(t("tools.detail.alternatives","Alternatives"),r.alternatives.join(", ")),e.status==="unsupported"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="unsupported"&&g(t("tools.detail.noFallback","No Fallback"),t("tools.detail.noFallback.value","No fallback ran.")),e.status==="warning"&&e.warningMessage&&g(t("tools.detail.warningMessage","Warning Message"),e.warningMessage),e.status==="error"&&e.errorMessage&&g(t("tools.detail.errorMessage","Error Message"),e.errorMessage),e.status==="error"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="error"&&e.fallbackCommand&&g(t("tools.detail.executedCommand","Executed Command"),e.fallbackCommand)]})})]})},[t]),at=["history","statistics"].map(e=>({key:e,label:t(`tools.tab.${e}`,e.charAt(0).toUpperCase()+e.slice(1))}));return s.jsxs("div",{className:o.page,children:[s.jsx(pt,{title:t("page.tools.title","Tools"),description:t("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),s.jsx(mt,{surface:"tools",selectable:!0,selectedPlaceId:z,onSelectedPlaceIdChange:e=>{P(e),i.setHistoryOffset(0)}}),s.jsx(bt,{items:at,value:k,onChange:st}),k==="history"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.history","History")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),h("history")},children:t("common.clear","Clear")})]}),s.jsx("div",{className:o.filterRow,children:s.jsxs("label",{className:o.filterLabel,children:[t("tools.filter.tool","Tool"),":",s.jsxs("select",{className:o.filterSelect,value:i.historyToolFilter,onChange:e=>{i.setHistoryToolFilter(e.target.value),i.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:t("tools.filter.all","All")}),V.map(e=>s.jsx("option",{value:e,children:e},e))]})]})}),s.jsx(kt,{columns:H,data:i.history,rowKey:e=>e.id,onRowClick:e=>u(r=>r===e.id?null:e.id),emptyMessage:t("tools.empty.history","No tool history entries for this place"),expandedKey:N,renderExpandedRow:ot}),s.jsxs("div",{className:o.pagination,children:[s.jsx("button",{className:o.btn,disabled:i.historyOffset===0,title:t("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>i.setHistoryOffset(Math.max(0,i.historyOffset-K)),children:t("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[i.historyOffset+1,"–",Math.min(i.historyOffset+K,i.historyTotal)," / ",i.historyTotal]}),s.jsx("button",{className:o.btn,disabled:!i.historyHasMore,title:t("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>i.setHistoryOffset(i.historyOffset+K),children:t("tools.page.next","Next")})]})]}),k==="statistics"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.statistics","Statistics")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),h("statistics")},children:t("common.clear","Clear")})]}),v&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${v.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${v.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[A(t,"basic")," ",v.basicPct,"% (",v.basic,")"]}),s.jsxs("span",{children:[A(t,"pro")," ",v.proPct,"% (",v.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:I.map(e=>s.jsxs("th",{style:e.width?{width:e.width}:void 0,className:e.sortable?o.sortableHeader:void 0,onClick:e.sortable?()=>U(e.key):void 0,children:[s.jsx("span",{children:e.label}),e.sortable&&L===e.key&&s.jsx("span",{className:o.sortArrow,children:m==="asc"?"▴":"▾"})]},e.key))})}),s.jsx("tbody",{children:C.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:I.length,className:o.emptyStats,children:t("tools.empty.stats","No tool statistics for this place")})}):C.map(e=>{const r=E===e.toolName;return s.jsxs(n.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>G(e.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":r,"aria-label":`${e.toolName} ${r?t("common.collapse","Collapse"):t("common.expand","Expand")}`,onClick:l=>{l.stopPropagation(),G(e.toolName)},children:[s.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:e.toolName})]})}),s.jsx("td",{children:e.totalCalls}),s.jsx("td",{children:e.successCount}),s.jsx("td",{children:e.fallbackCount}),s.jsx("td",{children:e.unsupportedCount}),s.jsx("td",{children:e.warningCount}),s.jsx("td",{children:e.failureCount}),s.jsx("td",{children:W(e.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:A(t,e.tier)})})})]}),r&&e.commands.map(l=>s.jsxs("tr",{className:o.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:o.actionLabel,children:l.label})}),s.jsx("td",{children:l.totalCalls}),s.jsx("td",{children:l.successCount}),s.jsx("td",{children:l.fallbackCount}),s.jsx("td",{children:l.unsupportedCount}),s.jsx("td",{children:l.warningCount}),s.jsx("td",{children:l.failureCount}),s.jsx("td",{children:W(l.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:l.tier==="pro"?o.tierPro:o.tierBasic,children:A(t,l.tier)})})]},`${e.toolName}:${l.commandName}`))]},e.toolName)})})]})}),i.statistics&&s.jsxs("div",{className:o.summaryLine,children:[t("tools.summary.total","Total"),": ",i.statistics.totalCalls," ",t("tools.summary.calls","calls")," | ",t("tools.summary.sessions","Sessions"),": ",i.statistics.totalSessions]})]}),s.jsx(ht,{open:w!==null,title:w==="history"?t("tools.clear.history.title","Clear history?"):t("tools.clear.statistics.title","Clear statistics?"),message:w==="history"?t("tools.clear.history.message","This permanently removes the current place tools history."):t("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:y,onCancel:()=>!y&&h(null),onConfirm:et})]})}export{Ae as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._wrapper_hzgda_2{overflow-x:auto}._table_hzgda_7{width:100%;border-collapse:collapse;font-family:var(--font-code);font-size:12px}._table_hzgda_7 th{text-align:left;color:var(--text-muted);font-weight:500;padding:6px 8px;border-bottom:1px solid var(--border);background:var(--bg-secondary);white-space:nowrap;-webkit-user-select:none;user-select:none}._table_hzgda_7 td{padding:6px 8px;color:var(--text-primary);border-bottom:1px solid var(--border-dim, rgba(255, 255, 255, .04))}._sortable_hzgda_32{cursor:pointer;transition:color var(--transition)}._sortable_hzgda_32:hover{color:var(--accent)}._sortArrow_hzgda_41{margin-left:4px;font-size:10px}._table_hzgda_7 tbody tr:hover td{background:var(--accent-dim)}._clickable_hzgda_52{cursor:pointer}._empty_hzgda_57{text-align:center;color:var(--text-muted);font-style:italic;padding:24px 8px}._expandedRow_hzgda_65 td{padding:0!important;border-bottom:1px solid var(--border)}._expandedRow_hzgda_65:hover td{background:transparent!important}._expandedCell_hzgda_74{padding:0!important}._page_1wi3z_2{display:flex;flex-direction:column;gap:var(--content-gap);max-width:var(--content-max)}._card_1wi3z_12{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._cardToolbar_1wi3z_19{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}._sectionTitle_1wi3z_27{font-family:var(--font-label);font-size:13px;color:var(--text-primary)}._dangerButton_1wi3z_33{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-control);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:500;cursor:pointer;transition:background var(--transition),border-color var(--transition)}._dangerButton_1wi3z_33:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._proBadge_1wi3z_52{display:inline-block;margin-left:6px;padding:1px 5px;font-size:9px;font-weight:600;letter-spacing:.05em;color:var(--pro-text-on-badge);background:var(--pro-badge);border-radius:3px;vertical-align:middle}._statusOk_1wi3z_67{display:inline-flex;align-items:center;min-height:22px;padding:2px 8px;border:1px solid var(--success-border);border-radius:var(--radius-control);background:var(--success-bg);color:var(--success-text);font-weight:500;cursor:default}._statusFallback_1wi3z_80{display:inline-flex;align-items:center;min-height:22px;padding:2px 8px;border:1px solid var(--info-border);border-radius:var(--radius-control);background:var(--info-bg);color:var(--info-text);font-weight:600;cursor:default}._statusUnsupported_1wi3z_93,._statusWarning_1wi3z_106{display:inline-flex;align-items:center;min-height:22px;padding:2px 8px;border:1px solid var(--warning-border);border-radius:var(--radius-control);background:var(--warning-bg);color:var(--warning-text);font-weight:600;cursor:default}._statusError_1wi3z_119{display:inline-flex;align-items:center;min-height:22px;padding:2px 8px;border:1px solid var(--error-border);border-radius:var(--radius-control);background:var(--error-bg);color:var(--error-text);font-weight:600;cursor:default}._tierBasic_1wi3z_133{color:var(--text-secondary)}._tierPro_1wi3z_137{color:var(--pro-badge);font-weight:500}._tierMixed_1wi3z_142{color:var(--text-primary);font-weight:500}._errorText_1wi3z_148{color:var(--error)}._filterRow_1wi3z_153{display:flex;align-items:center;gap:12px;margin-bottom:12px}._filterLabel_1wi3z_160{font-family:var(--font-label);font-size:11px;color:var(--text-secondary);display:flex;align-items:center;gap:6px}._filterSelect_1wi3z_169{font-family:var(--font-code);font-size:12px;padding:3px 8px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary)}._filterSelect_1wi3z_169:focus-visible{outline:none;box-shadow:var(--focus-ring)}._expandedRow_1wi3z_185{background:var(--bg-secondary);padding:12px 16px}._expandedSection_1wi3z_190{margin-bottom:8px;font-size:12px;color:var(--text-secondary)}._expandedSection_1wi3z_190:last-child{margin-bottom:0}._detailList_1wi3z_200{display:flex;flex-direction:column;gap:6px}._detailItem_1wi3z_206{display:flex;flex-wrap:wrap;gap:6px}._detailLabel_1wi3z_212{font-family:var(--font-label);color:var(--text-muted)}._detailValue_1wi3z_217{color:var(--text-primary);word-break:break-word}._pre_1wi3z_222{font-family:var(--font-code);font-size:11px;color:var(--text-primary);background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-control);padding:8px;margin-top:4px;overflow-x:auto;max-height:200px;overflow-y:auto;white-space:pre-wrap;word-break:break-all}._pagination_1wi3z_239{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:12px}._pageInfo_1wi3z_247{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._btn_1wi3z_253{font-family:var(--font-label);font-size:12px;padding:4px 12px;border-radius:var(--radius-control);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_1wi3z_253:hover:not(:disabled){border-color:var(--accent);background:var(--accent-dim)}._btn_1wi3z_253:disabled{opacity:.4;cursor:default}._btn_1wi3z_253:focus-visible{outline:none;box-shadow:var(--focus-ring)}._tierDistribution_1wi3z_281{margin-bottom:16px}._tierBarWrap_1wi3z_285{display:flex;height:12px;border-radius:6px;overflow:hidden;background:var(--bg-secondary)}._tierBarBasic_1wi3z_293{background:var(--text-secondary);transition:width .3s ease}._tierBarPro_1wi3z_298{background:var(--accent);transition:width .3s ease}._tierLabels_1wi3z_303{display:flex;justify-content:space-between;margin-top:4px;font-family:var(--font-code);font-size:11px;color:var(--text-secondary)}._statsTableWrap_1wi3z_312{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}._statsTable_1wi3z_312{width:100%;border-collapse:collapse}._statsTable_1wi3z_312 th,._statsTable_1wi3z_312 td{padding:10px 12px;font-size:12px;text-align:left;border-bottom:1px solid var(--border)}._statsTable_1wi3z_312 th{font-family:var(--font-label);font-size:11px;font-weight:500;color:var(--text-secondary);background:var(--bg-secondary)}._statsTable_1wi3z_312 tbody tr:last-child td{border-bottom:none}._sortableHeader_1wi3z_343{cursor:pointer;-webkit-user-select:none;user-select:none}._sortArrow_1wi3z_348{margin-left:4px}._statsToolRow_1wi3z_352{cursor:pointer}._statsToolRow_1wi3z_352:hover td{background:var(--bg-secondary)}._statsActionRow_1wi3z_360 td{background:color-mix(in srgb,var(--bg-secondary) 72%,transparent)}._expandButton_1wi3z_364{display:inline-flex;align-items:center;gap:8px;padding:0;border:none;background:transparent;color:inherit;font:inherit;cursor:pointer}._expandIcon_1wi3z_376{width:10px;color:var(--text-secondary)}._actionLabel_1wi3z_381{display:inline-block;padding-left:18px;font-family:var(--font-code);color:var(--text-secondary)}._emptyStats_1wi3z_388{text-align:center;color:var(--text-muted)}._summaryLine_1wi3z_394{margin-top:12px;font-family:var(--font-code);font-size:12px;color:var(--text-muted);text-align:right}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{i as ve,o as V,m as Ee,r as _,u as I,j as t,e as q,R as qe,X as He,T as je,h as Ue,t as Oe}from"./index-BZHTEq5I.js";import{I as D}from"./InfoLabel-D2VbqMgH.js";import{T as y}from"./TooltipText-D25g5AsX.js";import{C as Fe}from"./UiPrimitive-CjC02gTX.js";import{D as re,c as ne,e as ze,g as Ve,h as We,i as le,j as Ce,k as Ke,l as ce,d as Ye}from"./sample-requests-iDE7PC0n.js";import{T as Qe}from"./Tabs-3VHO8Be_.js";import{P as Je}from"./PageHeader-BgyqIJ0Z.js";import{C as Xe}from"./CurrentPlaceScope-B2YvP18E.js";/**
|
|
2
|
-
* @license lucide-react v1.8.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Ze=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],et=ve("camera",Ze);/**
|
|
7
|
-
* @license lucide-react v1.8.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const tt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],it=ve("ellipsis",tt);async function we(e){const i=await fetch(`${V}${e}`);if(!i.ok){let s=null;try{s=await i.json()}catch{}throw new Ee(i.status,(s==null?void 0:s.message)??i.statusText,(s==null?void 0:s.error)??null,s)}return await i.json()}function H(e){return typeof e=="number"&&Number.isFinite(e)?e:0}const st=["structure","visual","interaction","primary_view_context","responsive_viewport"];function ue(e){const i=e.coverage_dimensions,s={structure:{status:e.deterministic_status==="failed"?"failed":"completed",reasons:[]},visual:{status:e.visual_status??"not_requested",reasons:[]},interaction:{status:"skipped",reasons:[]},primary_view_context:{status:"skipped",reasons:[]},responsive_viewport:{status:"skipped",reasons:[]}};if(!i)return s;for(const o of st){const l=i[o];l&&["completed","not_requested","skipped","failed"].includes(l.status)&&(s[o]={status:l.status,reasons:Array.isArray(l.reasons)?l.reasons.filter(a=>typeof a=="string"):[]})}return s}function at(e,i){return e.readiness==="ready"||e.readiness==="review_required"||e.readiness==="insufficient_evidence"?e.readiness:"insufficient_evidence"}function rt(e){return e==="recompose"||e==="refine"||e==="approved"?e:void 0}function ot(e){return e==="recommended"||e==="required"?e:void 0}function nt(e){if(Array.isArray(e))return e.filter(i=>i==="primary_visual"||i==="functional_safe"||i==="responsive_ready")}function lt(e){if(e.design_check_summary){const o={priority_high:H(e.design_check_summary.priority_high),priority_medium:H(e.design_check_summary.priority_medium),priority_low:H(e.design_check_summary.priority_low),deterministic_status:e.design_check_summary.deterministic_status==="failed"?"failed":"completed",visual_status:e.design_check_summary.visual_status??"not_requested",coverage:e.design_check_summary.coverage==="structural_and_visual"?"structural_and_visual":"structural_only",skipped_reasons:Array.isArray(e.design_check_summary.skipped_reasons)?e.design_check_summary.skipped_reasons.filter(a=>typeof a=="string"):[],primary_visual_status:e.design_check_summary.primary_visual_status,primary_visual_verdict:rt(e.design_check_summary.primary_visual_verdict),critic_summary:typeof e.design_check_summary.critic_summary=="string"?e.design_check_summary.critic_summary:void 0,functional_safe:typeof e.design_check_summary.functional_safe=="boolean"?e.design_check_summary.functional_safe:void 0,responsive_requirement:ot(e.design_check_summary.responsive_requirement),responsive_ready:typeof e.design_check_summary.responsive_ready=="boolean"?e.design_check_summary.responsive_ready:void 0,required_dimensions:nt(e.design_check_summary.required_dimensions)},l=ue({...o,coverage_dimensions:e.design_check_summary.coverage_dimensions});return{...o,coverage_dimensions:l,viewport_profiles_tested:Array.isArray(e.design_check_summary.viewport_profiles_tested)?e.design_check_summary.viewport_profiles_tested.filter(a=>typeof a=="string"):[],readiness:at(e.design_check_summary)}}if(!e.lint_summary)return null;const i={priority_high:H(e.lint_summary.errors),priority_medium:H(e.lint_summary.warnings),priority_low:0,deterministic_status:"completed",visual_status:"not_requested",coverage:"structural_only",skipped_reasons:[]},s=ue(i);return{...i,coverage_dimensions:s,viewport_profiles_tested:[],readiness:"insufficient_evidence"}}function ct(e){return{rule:e.rule,path:e.path,displayPriority:e.displayPriority??(e.severity==="error"?"priority_high":"priority_medium"),actual:e.actual,expected:e.expected,hint:e.hint}}function be(e){return{snapshot_id:e.snapshot_id,captured_at:e.captured_at,brief_id:e.brief_id,thresholds_source:e.thresholds_source,scope:e.scope,target:e.target,design_check_summary:lt(e),primary_view_context:e.primary_view_context,image:e.image}}function ut(e){const i=e.check_results??e.lint_results??[];return{...be(e),check_results:i.map(ct),image_url:e.image_url,meta:e.meta,layout_metadata:e.layout_metadata,target_profiles:e.target_profiles,profile_simulations:e.profile_simulations,design_check_context:e.design_check_context}}async function de(e,i){const s=new URLSearchParams;i!==void 0&&s.set("limit",String(i));const o=s.toString()?`?${s.toString()}`:"",l=await we(`/api/ui-studio/snapshots${o}`);return{...l,snapshots:l.snapshots.map(be)}}async function dt(e,i){const s=i!==void 0?`?placeId=${i}`:"",o=await we(`/api/ui-studio/snapshots/${encodeURIComponent(e)}${s}`);return ut(o)}function ke(e,i){const s=i!==void 0?`?placeId=${i}`:"";return`${V}/api/ui-studio/snapshots/${encodeURIComponent(e)}/image${s}`}const ht=1e4;function Ie(e=50){const[i,s]=_.useState(null),[o,l]=_.useState(!0),[a,n]=_.useState(null),u=_.useCallback(async()=>{try{const d=await de(void 0,e);s(d),n(null)}catch(d){n(d instanceof Error?d.message:String(d))}finally{l(!1)}},[e]);return _.useEffect(()=>{let d=!1;const g=async()=>{try{const p=await de(void 0,e);d||(s(p),n(null))}catch(p){d||n(p instanceof Error?p.message:String(p))}finally{d||l(!1)}};g();const m=setInterval(()=>{g()},ht);return()=>{d=!0,clearInterval(m)}},[e]),{data:i,loading:o,error:a,refresh:u}}const pt="_page_jec7x_2",_t="_grid_jec7x_9",mt="_card_jec7x_16",gt="_cardBodyButton_jec7x_31",yt="_thumb_jec7x_48",xt="_badges_jec7x_57",ft="_priorityHighBadge_jec7x_65",St="_priorityMediumBadge_jec7x_66",vt="_priorityLowBadge_jec7x_67",jt="_cardMeta_jec7x_97",Ct="_target_jec7x_103",wt="_time_jec7x_110",bt="_drawer_jec7x_115",kt="_drawerToolbar_jec7x_132",It="_drawerTitleBlock_jec7x_143",Nt="_drawerEyebrow_jec7x_150",Pt="_drawerTarget_jec7x_159",Tt="_drawerToolbarActions_jec7x_169",Bt="_closeBtn_jec7x_177",Rt="_detailBody_jec7x_198",Dt="_screenshotPreviewFrame_jec7x_205",Gt="_fullImg_jec7x_218",Mt="_metaDl_jec7x_225",At="_errorMsg_jec7x_237",Lt="_suggestionsWrap_jec7x_242",$t="_prioritySection_jec7x_249",Et="_sectionHighHeader_jec7x_253",qt="_sectionLowHeader_jec7x_259",Ht="_sectionMediumHeader_jec7x_265",Ut="_groupCard_jec7x_271",Ot="_groupHeader_jec7x_278",Ft="_groupLabel_jec7x_294",zt="_groupCount_jec7x_299",Vt="_groupChevron_jec7x_306",Wt="_groupBody_jec7x_310",Kt="_groupDescription_jec7x_313",Yt="_groupFix_jec7x_318",Qt="_falsePositive_jec7x_327",Jt="_itemList_jec7x_335",Xt="_suggestionItem_jec7x_343",Zt="_suggestionInfo_jec7x_353",ei="_pathBreadcrumb_jec7x_359",ti="_currentValue_jec7x_368",ii="_copyFixBtn_jec7x_372",si="_emptySuggestions_jec7x_386",ai="_sampleBanner_jec7x_394",ri="_sampleBannerRow_jec7x_407",oi="_sampleBannerMain_jec7x_415",ni="_sampleBadge_jec7x_423",li="_sampleTitle_jec7x_433",ci="_sampleMessage_jec7x_440",ui="_sampleActions_jec7x_447",di="_primaryAction_jec7x_455",hi="_secondaryAction_jec7x_456",pi="_emptyState_jec7x_491",_i="_pluginGuideCard_jec7x_499",mi="_pluginGuideMarker_jec7x_510",gi="_pluginGuideBody_jec7x_525",yi="_pluginGuideTitle_jec7x_529",xi="_pluginGuideMessage_jec7x_537",fi="_pluginGuideChecklist_jec7x_544",Si="_pluginGuideWaiting_jec7x_567",vi="_pluginGuideDot_jec7x_576",ji="_analysisWorkspace_jec7x_584",Ci="_analysisMainColumn_jec7x_589",wi="_analysisDetailPopupLayer_jec7x_593",bi="_analysisDetailDialog_jec7x_610",ki="_analysisSummaryPanel_jec7x_629",Ii="_recentCapturesHeader_jec7x_642",Ni="_analysisSummaryText_jec7x_649",Pi="_recentCapturesMeta_jec7x_650",Ti="_analysisReportGrid_jec7x_656",Bi="_analysisReportGroup_jec7x_663",Ri="_analysisReportCard_jec7x_667",Di="_analysisReportThumb_jec7x_689",Gi="_analysisReportBody_jec7x_698",Mi="_analysisReportTopline_jec7x_705",Ai="_analysisVerdict_jec7x_712",Li="_analysisVerdict_needsFix_jec7x_723",$i="_analysisVerdict_review_jec7x_724",Ei="_analysisVerdict_incomplete_jec7x_729",qi="_analysisVerdict_passed_jec7x_734",Hi="_analysisReportCounts_jec7x_739",Ui="_readinessSummary_jec7x_744",Oi="_readinessChip_jec7x_750",Fi="_readinessChipReady_jec7x_765",zi="_readinessChipPending_jec7x_771",Vi="_primaryReadinessBlock_jec7x_777",Wi="_criticSummary_jec7x_784",Ki="_analysisReportTarget_jec7x_803",Yi="_analysisReportIssue_jec7x_812",Qi="_analysisReportCoverage_jec7x_818",Ji="_coverageChips_jec7x_824",Xi="_coverageChip_jec7x_824",Zi="_coverageChip_completed_jec7x_845",es="_coverageChip_failed_jec7x_850",ts="_coverageChip_skipped_jec7x_855",is="_coverageChip_not_requested_jec7x_856",ss="_analysisReportMeta_jec7x_861",as="_analysisChildList_jec7x_868",rs="_analysisChildRow_jec7x_879",os="_analysisChildPath_jec7x_900",ns="_analysisChildSummary_jec7x_909",ls="_analysisChildDetailHint_jec7x_910",cs="_drawerAnalysisSummary_jec7x_919",us="_drawerAnalysisSummaryItem_jec7x_930",ds="_drawerAnalysisLabel_jec7x_937",hs="_drawerAnalysisCounts_jec7x_943",ps="_drawerAnalysisValue_jec7x_944",_s="_recentCapturesSection_jec7x_949",ms="_drawerPrimaryActions_jec7x_961",gs="_drawerActionBtn_jec7x_968",ys="_drawerMoreMenu_jec7x_997",xs="_drawerMoreButton_jec7x_1002",fs="_drawerMoreMenuBody_jec7x_1027",Ss="_drawerMenuItem_jec7x_1040",vs="_drawerMenuItemDanger_jec7x_1063",js="_actionErrMsg_jec7x_1072",Cs="_actionStatusMsg_jec7x_1081",ws="_actionStatus_info_jec7x_1095",bs="_actionStatus_success_jec7x_1101",ks="_actionStatus_warning_jec7x_1107",Is="_actionStatusDetail_jec7x_1113",Ns="_galleryHeader_jec7x_1119",Ps="_cardChecked_jec7x_1132",Ts="_cardCheckbox_jec7x_1139",Bs="_captureSelectionActions_jec7x_1154",Rs="_selectionToolbar_jec7x_1163",Ds="_selectionBar_jec7x_1164",Gs="_selectionToolbarCount_jec7x_1183",Ms="_selectionToolbarActions_jec7x_1190",As="_selectionBarBtn_jec7x_1197",Ls="_selectionBarBtnDanger_jec7x_1223",r={page:pt,grid:_t,card:mt,cardBodyButton:gt,thumb:yt,badges:xt,priorityHighBadge:ft,priorityMediumBadge:St,priorityLowBadge:vt,cardMeta:jt,target:Ct,time:wt,drawer:bt,drawerToolbar:kt,drawerTitleBlock:It,drawerEyebrow:Nt,drawerTarget:Pt,drawerToolbarActions:Tt,closeBtn:Bt,detailBody:Rt,screenshotPreviewFrame:Dt,fullImg:Gt,metaDl:Mt,errorMsg:At,suggestionsWrap:Lt,prioritySection:$t,sectionHighHeader:Et,sectionLowHeader:qt,sectionMediumHeader:Ht,groupCard:Ut,groupHeader:Ot,groupLabel:Ft,groupCount:zt,groupChevron:Vt,groupBody:Wt,groupDescription:Kt,groupFix:Yt,falsePositive:Qt,itemList:Jt,suggestionItem:Xt,suggestionInfo:Zt,pathBreadcrumb:ei,currentValue:ti,copyFixBtn:ii,emptySuggestions:si,sampleBanner:ai,sampleBannerRow:ri,sampleBannerMain:oi,sampleBadge:ni,sampleTitle:li,sampleMessage:ci,sampleActions:ui,primaryAction:di,secondaryAction:hi,emptyState:pi,pluginGuideCard:_i,pluginGuideMarker:mi,pluginGuideBody:gi,pluginGuideTitle:yi,pluginGuideMessage:xi,pluginGuideChecklist:fi,pluginGuideWaiting:Si,pluginGuideDot:vi,analysisWorkspace:ji,analysisMainColumn:Ci,analysisDetailPopupLayer:wi,analysisDetailDialog:bi,analysisSummaryPanel:ki,recentCapturesHeader:Ii,analysisSummaryText:Ni,recentCapturesMeta:Pi,analysisReportGrid:Ti,analysisReportGroup:Bi,analysisReportCard:Ri,analysisReportThumb:Di,analysisReportBody:Gi,analysisReportTopline:Mi,analysisVerdict:Ai,analysisVerdict_needsFix:Li,analysisVerdict_review:$i,analysisVerdict_incomplete:Ei,analysisVerdict_passed:qi,analysisReportCounts:Hi,readinessSummary:Ui,readinessChip:Oi,readinessChipReady:Fi,readinessChipPending:zi,primaryReadinessBlock:Vi,criticSummary:Wi,analysisReportTarget:Ki,analysisReportIssue:Yi,analysisReportCoverage:Qi,coverageChips:Ji,coverageChip:Xi,coverageChip_completed:Zi,coverageChip_failed:es,coverageChip_skipped:ts,coverageChip_not_requested:is,analysisReportMeta:ss,analysisChildList:as,analysisChildRow:rs,analysisChildPath:os,analysisChildSummary:ns,analysisChildDetailHint:ls,drawerAnalysisSummary:cs,drawerAnalysisSummaryItem:us,drawerAnalysisLabel:ds,drawerAnalysisCounts:hs,drawerAnalysisValue:ps,recentCapturesSection:_s,drawerPrimaryActions:ms,drawerActionBtn:gs,drawerMoreMenu:ys,drawerMoreButton:xs,drawerMoreMenuBody:fs,drawerMenuItem:Ss,drawerMenuItemDanger:vs,actionErrMsg:js,actionStatusMsg:Cs,actionStatus_info:ws,actionStatus_success:bs,actionStatus_warning:ks,actionStatusDetail:Is,galleryHeader:Ns,cardChecked:Ps,cardCheckbox:Ts,captureSelectionActions:Bs,selectionToolbar:Rs,selectionBar:Ds,selectionToolbarCount:Gs,selectionToolbarActions:Ms,selectionBarBtn:As,selectionBarBtnDanger:Ls};function $s({snapshot:e,placeId:i,onClick:s,imageUrlOverride:o,selectable:l,selected:a,onToggleSelect:n}){var j,b,G;const{t:u}=I(),d=((j=e.design_check_summary)==null?void 0:j.priority_high)??0,g=((b=e.design_check_summary)==null?void 0:b.priority_medium)??0,m=((G=e.design_check_summary)==null?void 0:G.priority_low)??0,p=new Date(e.captured_at*1e3).toLocaleString(),x=o??ke(e.snapshot_id,i),v=()=>{n==null||n(e.snapshot_id)};return t.jsxs("div",{className:`${r.card} ${a?r.cardChecked:""}`,children:[l&&t.jsx(y,{text:u("uiStudio.gallery.cardCheckbox.tooltip","Select this capture. Pick multiple to delete them together."),children:t.jsx(Fe,{className:r.cardCheckbox,"aria-label":u("uiStudio.gallery.cardCheckbox","Select screenshot"),checked:!!a,onChange:v})}),t.jsxs("button",{className:r.cardBodyButton,onClick:k=>s(k.currentTarget),type:"button",children:[t.jsx("img",{className:r.thumb,src:x,alt:e.snapshot_id,loading:"lazy"}),t.jsxs("div",{className:r.badges,children:[d>0&&t.jsx(y,{text:u("uiStudio.gallery.priorityHighBadge.tooltip","Number of suggestions to review first. Click for details."),children:t.jsx("span",{className:r.priorityHighBadge,children:d})}),g>0&&t.jsx(y,{text:u("uiStudio.gallery.priorityMediumBadge.tooltip","Number of recommended suggestions."),children:t.jsx("span",{className:r.priorityMediumBadge,children:g})}),m>0&&t.jsx(y,{text:u("uiStudio.gallery.priorityLowBadge.tooltip","Number of optional improvements."),children:t.jsx("span",{className:r.priorityLowBadge,children:m})})]}),t.jsxs("div",{className:r.cardMeta,children:[t.jsx("div",{className:r.target,children:e.target??e.scope}),t.jsx("div",{className:r.time,children:p})]})]})]})}const Es={touch_target:"touchTarget",contrast:"contrast",text_scaled:"textScaled",safezone:"safezone",min_text_size:"minTextSize"};function qs(e){return e.rule==="contrast"&&/\.(Icon|Avatar|EmptyIcon|GoldIcon|[A-Za-z]*Icon)$/.test(e.path)}const Hs={touch_target:{checkLabel:"터치 타겟 크기",description:"모바일에서 손가락으로 누르기 편한 최소 크기를 만족하는지 확인합니다.",howToFix:"버튼 Size 를 44x44 px 이상으로 키우거나 UIPadding 으로 터치 영역을 확장하세요.",buildUpdateCommand:e=>JSON.stringify({action:"update",targetPath:e.path,changes:{properties:{Size:{xScale:0,xOffset:44,yScale:0,yOffset:44}}}},null,2)},contrast:{checkLabel:"텍스트 대비",description:"텍스트와 배경의 명암 비율이 WCAG 접근성 기준을 만족하는지 확인합니다.",howToFix:"TextColor3 를 더 밝은 색(예: #FFFFFF) 으로 바꾸거나, 배경(BackgroundColor3)을 어둡게 조정하세요.",falsePositiveNote:"이모지 아이콘의 경우 색이 고정되어 대비 규칙이 오탐하는 경우가 많습니다. 실제 가독성에 문제 없으면 무시해도 됩니다.",buildUpdateCommand:e=>JSON.stringify({action:"update",targetPath:e.path,changes:{properties:{TextColor3:{r:255,g:255,b:255}}}},null,2)},text_scaled:{checkLabel:"TextScaled 사용",description:"TextScaled 가 켜져 있으나 UITextSizeConstraint 가 없으면 언어 확장 시 레이아웃이 깨질 수 있습니다.",howToFix:"해당 TextLabel 에 UITextSizeConstraint 자식을 추가하고 MaxTextSize 를 지정하세요.",buildUpdateCommand:e=>JSON.stringify({action:"update",targetPath:e.path,changes:{addChildren:[{className:"UITextSizeConstraint",name:"SizeConstraint",properties:{MaxTextSize:24,MinTextSize:10}}]}},null,2)},safezone:{checkLabel:"세이프존 배치",description:"버튼이 플랫폼별 세이프존(노치·홈 인디케이터·TV safe margin) 안에 있는지 확인합니다.",howToFix:"Position 을 세이프존 안쪽으로 이동하거나, 부모 Frame 을 축소하세요.",buildUpdateCommand:()=>null},min_text_size:{checkLabel:"최소 폰트 크기",description:"텍스트가 너무 작아 가독성이 떨어지는지 확인합니다. 브리프 기준 하한을 사용합니다.",howToFix:"TextSize 를 14 이상(본문 기준)으로 올리세요.",buildUpdateCommand:e=>{const i=typeof e.expected=="string"?parseInt(e.expected.replace(/[^\d]/g,""),10):14;return JSON.stringify({action:"update",targetPath:e.path,changes:{properties:{TextSize:Number.isFinite(i)?i:14}}},null,2)}}};function Us(e,i,s){const o=Es[e];return o?{...i,checkLabel:s(`uiStudio.fix.${o}.label`,i.checkLabel),description:s(`uiStudio.fix.${o}.description`,i.description),howToFix:s(`uiStudio.fix.${o}.howToFix`,i.howToFix),falsePositiveNote:i.falsePositiveNote?s(`uiStudio.fix.${o}.falsePositive`,i.falsePositiveNote):void 0}:i}function Os(e,i){const s=Hs[e]??null;return s?i?Us(e,s,i):s:null}function Fs(e){return qs(e)}function zs(e,i){const s=new Map;for(const l of e){const a=`${l.displayPriority}::${l.rule}`,n=s.get(a)??[];n.push(l),s.set(a,n)}const o=[];for(const[l,a]of s){const[n,u]=l.split("::"),d=a.filter(Fs).length;o.push({rule:u??"unknown",priority:n,items:a,fixTemplate:Os(u??"",i),falsePositiveRatio:a.length>0?d/a.length:0})}return o.sort((l,a)=>{const n={priority_high:0,priority_medium:1,priority_low:2};return l.priority!==a.priority?n[l.priority]-n[a.priority]:a.items.length-l.items.length}),{high:o.filter(l=>l.priority==="priority_high"),medium:o.filter(l=>l.priority==="priority_medium"),low:o.filter(l=>l.priority==="priority_low")}}function Ne(e){const i=e.split("."),s=i[i.length-1]??e,o=i[i.length-2],l=o?`${o} > ${s}`:s;return{full:e,breadcrumb:l,leaf:s}}function Pe(e){return typeof e=="object"&&e!==null}function he(e){return Pe(e.data)?e.data:{}}function ee(e,i){const s=e[i];return Pe(s)?s:{}}function W(e,i){const s=e[i];return typeof s=="string"?s:null}function K(e,i){const s=e[i];return typeof s=="number"&&Number.isFinite(s)?s:0}function Vs(e){const i=ee(e,"design_check_summary");return{priority_high:K(i,"priority_high"),priority_medium:K(i,"priority_medium"),priority_low:K(i,"priority_low")}}function pe(e){if(!(e.success??e.ok??!e.error))throw new Error(e.error??"UI Studio action failed")}function _e(e,i){return Te(e,Vs(i))}function U(e,i,s,o,l){const a=e(i,s);return l?`${a}: ${l} · ${o}`:`${a}: ${o}`}function Ws(e){const i=e.design_check_summary;return((i==null?void 0:i.priority_high)??0)>0?"needsFix":(i==null?void 0:i.readiness)==="insufficient_evidence"?"incomplete":((i==null?void 0:i.priority_medium)??0)>0||((i==null?void 0:i.priority_low)??0)>0?"review":"passed"}function Ks(e,i){return i==="needsFix"||i==="review"?e("uiStudio.analysis.verdict.hasSuggestions","개선 제안 있음"):i==="incomplete"?e("uiStudio.analysis.verdict.incomplete","검토 증거 부족"):e("uiStudio.analysis.verdict.passed","현재 개선 제안 없음")}function Y(e,i){return`${i}${e("uiStudio.storage.countSuffix","개")}`}function Te(e,i){return`${e("uiStudio.priorityHigh","우선 검토")} ${Y(e,(i==null?void 0:i.priority_high)??0)} · ${e("uiStudio.priorityMedium","검토 권장")} ${Y(e,(i==null?void 0:i.priority_medium)??0)} · ${e("uiStudio.priorityLow","선택 개선")} ${Y(e,(i==null?void 0:i.priority_low)??0)}`}function Ys(e,i){return Te(e,i.design_check_summary)}function Qs(e,i){return i==="recompose"?e("uiStudio.primaryVisual.recompose","Recompose"):i==="refine"?e("uiStudio.primaryVisual.refine","Refine"):i==="approved"?e("uiStudio.primaryVisual.approved","Approved"):e("uiStudio.primaryVisual.unknown","Unknown")}function Js(e,i){return i==="ready"?e("uiStudio.readiness.ready","Ready"):i==="review_required"?e("uiStudio.readiness.reviewRequired","Review required"):i==="insufficient_evidence"?e("uiStudio.readiness.insufficient","Evidence incomplete"):e("uiStudio.readiness.unknown","Readiness unknown")}function Xs({snapshotId:e,placeId:i,onClose:s,sampleDetail:o,tier:l,onActionDone:a}){const[n,u]=_.useState(o??null),[d,g]=_.useState(null),[m,p]=_.useState(null),[x,v]=_.useState(null),[j,b]=_.useState(null),[G,k]=_.useState(null),{t:h}=I(),{trackEvent:T}=q(),N=l==="pro";_.useEffect(()=>{if(o){u(o),g(null);return}let w=!1;return dt(e,i).then(B=>{w||u(B)}).catch(B=>{w||g(B instanceof Error?B.message:String(B))}),()=>{w=!0}},[e,i,o]);const S=async()=>{if(n!=null&&n.target){T("dashboard_click_event",{click_target:"ui_studio_capture_current",page:"ui-studio",tab:"ui_studio_analysis"}),p(null),b("preview"),v({tone:"info",message:h("uiStudio.actions.previewRunning","캡처 중..."),detail:h("uiStudio.actions.previewRunningDetail","완료되면 새 화면 캡처 파일 ID를 표시합니다.")});try{const w=await ne("preview",{targetPath:n.target,placeId:i});pe(w);const B=he(w),E=W(B,"snapshot_id"),f=ee(B,"screenshot"),A=ee(B,"meta"),R=W(f,"saved_path"),oe=W(A,"persist_warning"),O=_e(h,B);v(oe?{tone:"warning",message:U(h,"uiStudio.actions.previewNeedsSaveCheck","캡처 완료, 저장 확인 필요",O,E),detail:oe}:E&&R?{tone:"success",message:U(h,"uiStudio.actions.previewSaved","새 화면 캡처 저장 완료",O,E),detail:h("uiStudio.actions.previewSavedDetail","기존 화면 캡처는 변경하지 않고 새 파일로 저장했습니다.")}:E?{tone:"warning",message:U(h,"uiStudio.actions.previewComplete","캡처 완료",O,E),detail:h("uiStudio.actions.previewSavedPathMissing","새 화면 캡처 ID는 받았지만 저장 경로를 확인하지 못했습니다.")}:{tone:"warning",message:U(h,"uiStudio.actions.previewComplete","캡처 완료",O),detail:h("uiStudio.actions.previewSnapshotIdMissing","새 화면 캡처 ID를 확인하지 못했습니다. 목록을 새로고침해 저장 여부를 확인해 주세요.")}),await(a==null?void 0:a())}catch(w){p(w instanceof Error?w.message:String(w))}finally{b(null)}}},P=async()=>{if(n!=null&&n.target){T("dashboard_click_event",{click_target:"ui_studio_check_again",page:"ui-studio",tab:"ui_studio_analysis"}),p(null),b("check"),v({tone:"info",message:h("uiStudio.actions.designCheckRunning","개선 제안 확인 중..."),detail:h("uiStudio.actions.designCheckRunningDetail","완료되면 우선 검토/검토 권장/선택 개선 항목 수를 표시합니다.")});try{const w=await ne("check",{targetPath:n.target,placeId:i});pe(w);const B=he(w),E=_e(h,B);v({tone:"success",message:U(h,"uiStudio.actions.designCheckComplete","개선 제안 확인 완료",E),detail:h("uiStudio.actions.designCheckNoSnapshotSaved","이 작업은 화면 캡처 파일을 새로 저장하지 않습니다.")}),await(a==null?void 0:a())}catch(w){p(w instanceof Error?w.message:String(w))}finally{b(null)}}},L=async()=>{p(null),v(null);try{await ze(i,e),await(a==null?void 0:a()),k(null),s()}catch(w){throw p(w instanceof Error?w.message:String(w)),w}},M=N?void 0:h("uiStudio.actions.proRequired","Pro에서 사용 가능"),C=n!=null&&n.target?Ne(n.target):null;return t.jsxs("div",{className:r.drawer,children:[t.jsxs("div",{className:r.drawerToolbar,"data-testid":"snapshot-detail-toolbar",children:[t.jsxs("div",{className:r.drawerTitleBlock,children:[t.jsx("span",{className:r.drawerEyebrow,children:h("uiStudio.analysis.detailDialog","Analysis detail")}),t.jsx("span",{className:r.drawerTarget,title:(C==null?void 0:C.full)??e,children:(C==null?void 0:C.breadcrumb)??e})]}),t.jsxs("div",{className:r.drawerToolbarActions,children:[n&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:r.drawerPrimaryActions,children:[t.jsx(y,{text:M??h("uiStudio.actions.captureCurrentState.tooltip","Save the UI currently shown in Studio as a new capture. Existing captures are kept."),children:t.jsxs("button",{className:r.drawerActionBtn,onClick:()=>void S(),disabled:!N||!n.target||j!==null,type:"button",children:[t.jsx(et,{size:15,"aria-hidden":"true"}),t.jsx("span",{children:h("uiStudio.actions.captureCurrentState","현재 상태 캡처")})]})}),t.jsx(y,{text:M??h("uiStudio.actions.checkSuggestionsAgain.tooltip","Recompute suggestions for this capture without taking a new screenshot."),children:t.jsxs("button",{className:r.drawerActionBtn,onClick:()=>void P(),disabled:!N||!n.target||j!==null,type:"button",children:[t.jsx(qe,{size:15,"aria-hidden":"true"}),t.jsx("span",{children:h("uiStudio.actions.checkSuggestionsAgain","개선 제안 다시 확인")})]})})]}),t.jsxs("details",{className:r.drawerMoreMenu,children:[t.jsx("summary",{className:r.drawerMoreButton,title:h("uiStudio.actions.more.tooltip","Open additional actions."),"aria-label":h("uiStudio.actions.more","More"),children:t.jsx(it,{size:18,"aria-hidden":"true"})}),t.jsx("div",{className:r.drawerMoreMenuBody,children:t.jsx(y,{text:M??h("uiStudio.actions.deleteSnapshot.tooltip","Delete only this capture file. The actual UI in Roblox Studio is not affected."),children:t.jsx("button",{className:`${r.drawerMenuItem} ${r.drawerMenuItemDanger}`,onClick:()=>{T("dashboard_click_event",{click_target:"ui_studio_delete_snapshot",page:"ui-studio",tab:"ui_studio_analysis"}),k("deleteSnapshot")},disabled:!N,type:"button",children:h("uiStudio.actions.deleteSnapshot","이 화면 캡처 삭제")})})})]})]}),t.jsx(y,{text:h("uiStudio.detailClose.tooltip","Close this detail panel."),children:t.jsx("button",{className:r.closeBtn,onClick:s,type:"button","aria-label":h("uiStudio.detailClose","Close"),children:t.jsx(He,{size:18,"aria-hidden":"true"})})})]})]}),d&&t.jsx("div",{className:r.errorMsg,children:d}),n&&t.jsxs("div",{className:r.detailBody,children:[m&&t.jsx("div",{className:r.actionErrMsg,children:m}),x&&t.jsxs("div",{className:`${r.actionStatusMsg} ${r[`actionStatus_${x.tone}`]??""}`,children:[t.jsx("div",{children:x.message}),x.detail&&t.jsx("div",{className:r.actionStatusDetail,children:x.detail})]}),t.jsx(Zs,{detail:n}),t.jsx("div",{className:r.screenshotPreviewFrame,"data-testid":"analysis-screenshot-preview",children:t.jsx("img",{className:r.fullImg,src:n.image_url,alt:n.snapshot_id})}),t.jsx(ia,{items:n.check_results,summary:n.design_check_summary}),t.jsxs("dl",{className:r.metaDl,children:[t.jsx("dt",{children:t.jsx(D,{label:h("uiStudio.capturedAt","Captured"),tooltip:h("uiStudio.capturedAt.tooltip","When this screen was captured.")})}),t.jsx("dd",{children:new Date(n.captured_at*1e3).toLocaleString()}),t.jsx("dt",{children:t.jsx(D,{label:h("uiStudio.scope","Scope"),tooltip:h("uiStudio.scope.tooltip","Capture scope (full screen or a specific UI).")})}),t.jsx("dd",{children:n.scope}),n.target&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(D,{label:h("uiStudio.target","Target"),tooltip:h("uiStudio.target.tooltip","Exact path of the captured UI instance.")})}),t.jsx("dd",{children:n.target})]}),n.brief_id&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(D,{label:h("uiStudio.briefId","Brief"),tooltip:h("uiStudio.briefId.tooltip","Identifier of the design brief that produced this UI.")})}),t.jsx("dd",{children:n.brief_id})]})]})]}),G==="deleteSnapshot"&&t.jsx(re,{title:h("uiStudio.confirm.deleteSnapshotTitle","화면 캡처 삭제"),message:h("uiStudio.confirm.deleteSnapshotMessage","이 화면 캡처 파일만 삭제됩니다 (Studio 인스턴스 보존)."),danger:!0,confirmLabel:h("common.delete","삭제"),onConfirm:L,onClose:()=>k(null)})]})}function Zs({detail:e}){const{t:i}=I(),s=Ws(e);return t.jsxs("section",{className:r.drawerAnalysisSummary,children:[t.jsxs("div",{className:r.drawerAnalysisSummaryItem,children:[t.jsx("span",{className:r.drawerAnalysisLabel,children:t.jsx(D,{label:i("uiStudio.analysis.verdictLabel","개선 요약"),tooltip:i("uiStudio.analysis.verdictLabel.tooltip","Overall improvement verdict for this capture.")})}),t.jsx("span",{className:`${r.analysisVerdict} ${r[`analysisVerdict_${s}`]??""}`,children:Ks(i,s)}),t.jsx("span",{className:r.drawerAnalysisCounts,children:Ys(i,e)})]}),t.jsxs("div",{className:r.drawerAnalysisSummaryItem,children:[t.jsx("span",{className:r.drawerAnalysisLabel,children:t.jsx(D,{label:i("uiStudio.analysis.thresholds","검토 기준"),tooltip:i("uiStudio.analysis.thresholds.tooltip","The threshold set used for this review (default or custom).")})}),t.jsx("span",{className:r.drawerAnalysisValue,children:e.thresholds_source})]}),t.jsx(ea,{summary:e.design_check_summary}),t.jsx(ta,{summary:e.design_check_summary})]})}function ea({summary:e}){const{t:i}=I();if(!e)return null;const s=e.functional_safe===!0?i("uiStudio.functional.safe","Safe"):e.functional_safe===!1?i("uiStudio.functional.risk","Risk found"):i("uiStudio.functional.unknown","Unknown"),o=e.responsive_requirement==="required"?i("uiStudio.responsive.required","Required"):e.responsive_requirement==="recommended"?i("uiStudio.responsive.recommended","Recommended"):i("uiStudio.responsive.unknown","Unknown");return t.jsxs("div",{className:r.primaryReadinessBlock,children:[t.jsxs("div",{className:r.readinessSummary,"aria-label":i("uiStudio.readiness.summary","UI readiness"),children:[t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.primaryVisual.label","Primary visual")," · ",Qs(i,e.primary_visual_verdict)]}),t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.functional.label","Functional")," · ",s]}),t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.responsive.label","Responsive")," · ",o]}),t.jsx("span",{className:`${r.readinessChip} ${e.readiness==="ready"?r.readinessChipReady:r.readinessChipPending}`,children:Js(i,e.readiness)})]}),e.critic_summary&&t.jsxs("p",{className:r.criticSummary,children:[t.jsx("span",{children:i("uiStudio.criticSummary","Critic summary")}),e.critic_summary]})]})}function ta({summary:e}){const{t:i}=I(),s=e==null?void 0:e.coverage_dimensions;if(!s)return null;const o=[["Structure",s.structure],["Visual",s.visual],["Interaction",s.interaction],["Primary view",s.primary_view_context],["Responsive",s.responsive_viewport]];return t.jsx("div",{className:r.coverageChips,"aria-label":i("uiStudio.analysis.coverageDimensions","검토 범위"),children:o.map(([l,a])=>t.jsxs("span",{className:`${r.coverageChip} ${r[`coverageChip_${a.status}`]??""}`,title:a.reasons.join(", "),children:[l," · ",a.status==="completed"?i("uiStudio.analysis.coverageStatus.completed","완료"):a.status==="failed"?i("uiStudio.analysis.coverageStatus.failed","실패"):i("uiStudio.analysis.coverageStatus.skipped","생략")]},l))})}function ia({items:e,summary:i}){const{t:s}=I();if(e.length===0)return t.jsx("p",{className:r.emptySuggestions,children:(i==null?void 0:i.readiness)==="insufficient_evidence"?s("uiStudio.noSuggestionsIncomplete","제안은 없지만 검토되지 않은 범위가 남아 있습니다."):s("uiStudio.noSuggestions","현재 개선 제안 없음")});const{high:o,medium:l,low:a}=zs(e,s);return t.jsxs("div",{className:r.suggestionsWrap,children:[t.jsx("h3",{children:t.jsx(D,{label:s("uiStudio.designCheckResultsTitle","Design Check suggestions"),tooltip:s("uiStudio.designCheckResultsTitle.tooltip","All improvement suggestions found in this capture.")})}),o.length>0&&t.jsxs("section",{className:r.prioritySection,children:[t.jsx("h4",{className:r.sectionHighHeader,children:s("uiStudio.highPrioritySection","우선 검토")}),o.map(n=>t.jsx(Q,{group:n},`h-${n.rule}`))]}),l.length>0&&t.jsxs("section",{className:r.prioritySection,children:[t.jsx("h4",{className:r.sectionMediumHeader,children:s("uiStudio.mediumPrioritySection","검토 권장")}),l.map(n=>t.jsx(Q,{group:n},`m-${n.rule}`))]}),a.length>0&&t.jsxs("section",{className:r.prioritySection,children:[t.jsx("h4",{className:r.sectionLowHeader,children:s("uiStudio.lowPrioritySection","선택 개선")}),a.map(n=>t.jsx(Q,{group:n},`l-${n.rule}`))]})]})}function Q({group:e}){var n,u,d;const{t:i}=I(),[s,o]=_.useState(e.priority==="priority_high"&&e.items.length<=5),l=e.falsePositiveRatio>=.5&&!!((n=e.fixTemplate)!=null&&n.falsePositiveNote),a=((u=e.fixTemplate)==null?void 0:u.checkLabel)??e.rule;return t.jsxs("div",{className:r.groupCard,children:[t.jsx(y,{text:i("uiStudio.suggestionGroup.tooltip","Suggestions of the same kind grouped together. Click to expand or collapse."),children:t.jsxs("button",{className:r.groupHeader,onClick:()=>o(g=>!g),type:"button",children:[t.jsx("span",{className:r.groupLabel,children:a}),t.jsx(y,{text:i("uiStudio.groupSummary.tooltip","Number of UI elements matching this group."),children:t.jsxs("span",{className:r.groupCount,children:[e.items.length," ",i("uiStudio.groupSummary","items")]})}),t.jsx("span",{className:r.groupChevron,children:s?"▾":"▸"})]})}),s&&t.jsxs("div",{className:r.groupBody,children:[e.fixTemplate&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:r.groupDescription,children:e.fixTemplate.description}),t.jsx("p",{className:r.groupFix,children:e.fixTemplate.howToFix})]}),l&&t.jsx(y,{text:i("uiStudio.falsePositiveWarning.tooltip","This check can produce false positives — verify before applying."),children:t.jsxs("p",{className:r.falsePositive,children:[i("uiStudio.falsePositiveWarning","May contain false positives"),":"," ",(d=e.fixTemplate)==null?void 0:d.falsePositiveNote]})}),t.jsx("ul",{className:r.itemList,children:e.items.map((g,m)=>t.jsx(sa,{item:g,group:e},`${g.path}-${m}`))})]})]})}function sa({item:e,group:i}){var g;const{t:s}=I(),{trackEvent:o}=q(),[l,a]=_.useState(!1),n=Ne(e.path),u=((g=i.fixTemplate)==null?void 0:g.buildUpdateCommand(e))??null,d=async()=>{if(u)try{await navigator.clipboard.writeText(u),o("dashboard_click_event",{click_target:"ui_studio_copy_ai_instruction",page:"ui-studio",tab:"ui_studio_analysis"}),a(!0),setTimeout(()=>a(!1),2e3)}catch{}};return t.jsxs("li",{className:r.suggestionItem,children:[t.jsxs("div",{className:r.suggestionInfo,children:[t.jsx("code",{className:r.pathBreadcrumb,title:`${s("uiStudio.fullPath","Full path")}: ${n.full}`,children:n.breadcrumb}),t.jsxs("span",{className:r.currentValue,children:[t.jsx(y,{text:s("uiStudio.colCurrent.tooltip","The currently applied value."),children:t.jsx("span",{children:s("uiStudio.colCurrent","Current")})}),": ",t.jsx("strong",{children:String(e.actual)})," → ",t.jsx(y,{text:s("uiStudio.colRecommended.tooltip","The recommended value."),children:t.jsx("span",{children:s("uiStudio.colRecommended","Recommended")})}),": ",t.jsx("strong",{children:String(e.expected)})]})]}),u&&t.jsx(y,{text:s("uiStudio.copyFixCommand.tooltip","Copy a prompt that asks the AI to fix this issue."),children:t.jsx("button",{className:r.copyFixBtn,onClick:d,type:"button",children:l?s("uiStudio.copiedToClipboard","Copied"):s("uiStudio.copyFixCommand","Copy AI instruction")})})]})}function J(e,i){return Object.entries(i).reduce((s,[o,l])=>s.split(`{${o}}`).join(String(l)),e)}function aa(e,i){return i.rule==="contrast"?J(e("uiStudio.sample.designCheck.contrast","Text contrast is below {expected} (current {actual}). Adjust TextColor3 or BackgroundColor3."),{expected:String(i.expected),actual:String(i.actual)}):i.rule==="touch_target"?J(e("uiStudio.sample.designCheck.touchTarget","Touch targets should be at least {expected} px (current {actual}). Increase Size or padding."),{expected:String(i.expected),actual:String(i.actual)}):i.rule==="min_text_size"?J(e("uiStudio.sample.designCheck.minTextSize","TextSize is below {expected} (current {actual}). Increase it for readability."),{expected:String(i.expected),actual:String(i.actual)}):i.hint}const Be="sample_inventory_preview",te=Ve,ra=[{path:"StarterGui.InventoryGame.Overlay.Modal.Header.GoldBox.Icon",hint:"텍스트 대비 4.5:1 미만 (현재 1.24). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥4.5:1",rule:"contrast",actual:"1.24"},{path:"StarterGui.InventoryGame.Overlay.Modal.Header.CloseBtn",hint:"텍스트 대비 4.5:1 미만 (현재 4.11). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥4.5:1",rule:"contrast",actual:"4.11"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.Portrait.Avatar",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot1.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot2.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot3.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot4.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot5.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot6.EmptyIcon",hint:"텍스트 대비 3.0:1 미만 (현재 2.53). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"2.53"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabAll",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabWeapon",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabArmor",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabConsume",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabMisc",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I1.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I1.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I2.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I3.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I4.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I5.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I6.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I7.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I8.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I9.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I10.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I11.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I12.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I13.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I13.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I14.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I14.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I15.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I15.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I16.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I16.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I17.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I17.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I18.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I19.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I19.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I20.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I20.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.DetailPanel.ItemIconBox.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.DetailPanel.Rarity",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.DetailPanel.StatsBox.Passive",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12}];function oa(e){const o={snapshot_id:Be,captured_at:1776757908,brief_id:null,thresholds_source:"default",scope:"targetPath",target:"StarterGui.InventoryGame",design_check_summary:{priority_high:35,priority_medium:10,priority_low:0},image:{file:"ui-studio-sample.png",width:402,height:252}},l={...o,check_results:ra.map(n=>({...n,hint:aa(e,n)})),image_url:te};return{list:{placeId:0,snapshots:[o],totalCount:1},detail:l}}const na=/plugin not connected|sync not started/i;function ie(e){return typeof e=="string"&&na.test(e)}function Re(){const{t:e}=I();return t.jsxs("section",{className:r.pluginGuideCard,role:"status","aria-live":"polite",children:[t.jsx("div",{className:r.pluginGuideMarker,"aria-hidden":"true",children:"!"}),t.jsxs("div",{className:r.pluginGuideBody,children:[t.jsx("h2",{className:r.pluginGuideTitle,children:e("uiStudio.pluginGuide.title","Roblox Studio 플러그인이 연결되지 않았습니다")}),t.jsx("p",{className:r.pluginGuideMessage,children:e("uiStudio.pluginGuide.message","UI Studio는 연결된 Studio place의 화면 캡처와 변경 이력을 표시합니다. Studio와 WEPPY Plugin을 연결하면 자동으로 갱신됩니다.")}),t.jsxs("ul",{className:r.pluginGuideChecklist,children:[t.jsx("li",{children:e("uiStudio.pluginGuide.check1","Roblox Studio가 실행 중인가요?")}),t.jsx("li",{children:e("uiStudio.pluginGuide.check2","WEPPY Plugin이 설치되어 실행 중인가요?")})]}),t.jsxs("div",{className:r.pluginGuideWaiting,children:[t.jsx("span",{className:r.pluginGuideDot,"aria-hidden":"true"}),e("uiStudio.pluginGuide.waiting","플러그인 연결을 기다리는 중...")]})]})]})}function De(e){return e.target??e.scope}function la(e){const i=De(e),s=i.split(".").filter(l=>l.length>0),o=s.findIndex(l=>l==="StarterGui");return o>=0&&s[o+1]?["StarterGui",s[o+1]].join("."):i}function Ge(e){return((e==null?void 0:e.priority_high)??0)>0?"needsFix":(e==null?void 0:e.readiness)==="insufficient_evidence"?"incomplete":((e==null?void 0:e.priority_medium)??0)>0||((e==null?void 0:e.priority_low)??0)>0?"review":"passed"}function ca(e){return Ge(e.design_check_summary)}function me(e){return se(e.design_check_summary)}function se(e){return((e==null?void 0:e.priority_high)??0)>0?0:(e==null?void 0:e.readiness)==="insufficient_evidence"?1:((e==null?void 0:e.priority_medium)??0)>0?2:((e==null?void 0:e.priority_low)??0)>0?3:4}function ua(e){var s,o,l;if(e.length===0)return null;if(e.length===1)return((s=e[0])==null?void 0:s.latest.design_check_summary)??null;const i=e.reduce((a,n)=>{const u=n.latest.design_check_summary;a.priority_high+=(u==null?void 0:u.priority_high)??0,a.priority_medium+=(u==null?void 0:u.priority_medium)??0,a.priority_low+=(u==null?void 0:u.priority_low)??0,(u==null?void 0:u.deterministic_status)==="failed"&&(a.deterministic_status="failed"),(u==null?void 0:u.visual_status)==="failed"?a.visual_status="failed":(u==null?void 0:u.visual_status)==="skipped"&&a.visual_status!=="failed"?a.visual_status="skipped":(u==null?void 0:u.visual_status)==="completed"&&a.visual_status==="completed"?a.visual_status="completed":(u==null?void 0:u.visual_status)!=="completed"&&a.visual_status==="completed"&&(a.visual_status="not_requested"),(u==null?void 0:u.coverage)!=="structural_and_visual"&&(a.coverage="structural_only");for(const d of(u==null?void 0:u.skipped_reasons)??[])a.skipped_reasons.add(d);(u==null?void 0:u.readiness)==="insufficient_evidence"?a.readiness="insufficient_evidence":(u==null?void 0:u.readiness)==="review_required"&&a.readiness==="ready"&&(a.readiness="review_required");for(const d of(u==null?void 0:u.viewport_profiles_tested)??[])a.viewport_profiles_tested.add(d);return a},{priority_high:0,priority_medium:0,priority_low:0,deterministic_status:"completed",visual_status:"completed",coverage:"structural_and_visual",skipped_reasons:new Set,readiness:"ready",viewport_profiles_tested:new Set});return{priority_high:i.priority_high,priority_medium:i.priority_medium,priority_low:i.priority_low,deterministic_status:i.deterministic_status,visual_status:i.visual_status,coverage:i.coverage,skipped_reasons:[...i.skipped_reasons],readiness:i.readiness,viewport_profiles_tested:[...i.viewport_profiles_tested],coverage_dimensions:e.length===1?(l=(o=e[0])==null?void 0:o.latest.design_check_summary)==null?void 0:l.coverage_dimensions:void 0}}function da(e){const i=new Map;for(const l of e){const a=De(l),n=i.get(a);if(!n){i.set(a,{latest:l,snapshotCount:1});continue}n.snapshotCount+=1,l.captured_at>n.latest.captured_at&&(n.latest=l)}const s=[...i.entries()].map(([l,a])=>({key:l,latest:a.latest,snapshotCount:a.snapshotCount,verdict:ca(a.latest)})),o=new Map;for(const l of s){const a=la(l.latest),n=o.get(a)??[];n.push(l),o.set(a,n)}return[...o.entries()].map(([l,a])=>{var g;const n=a.sort((m,p)=>{const x=me(m.latest)-me(p.latest);return x!==0?x:p.latest.captured_at-m.latest.captured_at}),u=n.reduce((m,p)=>p.latest.captured_at>m.captured_at?p.latest:m,((g=n[0])==null?void 0:g.latest)??a[0].latest),d=ua(n);return{key:l,latest:u,snapshotCount:n.reduce((m,p)=>m+p.snapshotCount,0),children:n,summary:d,verdict:Ge(d)}}).sort((l,a)=>{const n=se(l.summary)-se(a.summary);return n!==0?n:a.latest.captured_at-l.latest.captured_at})}function ha(e){return e.reduce((i,s)=>(s.verdict==="passed"?i.noSuggestions+=1:s.verdict==="incomplete"?i.evidenceIncomplete+=1:i.hasSuggestions+=1,i),{hasSuggestions:0,evidenceIncomplete:0,noSuggestions:0})}function $(e,i){return`${i}${e("uiStudio.storage.countSuffix","개")}`}function ae(e,i){return`${e("uiStudio.priorityHigh","우선 검토")} ${$(e,(i==null?void 0:i.priority_high)??0)} · ${e("uiStudio.priorityMedium","검토 권장")} ${$(e,(i==null?void 0:i.priority_medium)??0)} · ${e("uiStudio.priorityLow","선택 개선")} ${$(e,(i==null?void 0:i.priority_low)??0)}`}function pa(e,i){return i==="recompose"?e("uiStudio.primaryVisual.recompose","Recompose"):i==="refine"?e("uiStudio.primaryVisual.refine","Refine"):i==="approved"?e("uiStudio.primaryVisual.approved","Approved"):e("uiStudio.primaryVisual.unknown","Unknown")}function _a(e,i){return i==="ready"?e("uiStudio.readiness.ready","Ready"):i==="review_required"?e("uiStudio.readiness.reviewRequired","Review required"):i==="insufficient_evidence"?e("uiStudio.readiness.insufficient","Evidence incomplete"):e("uiStudio.readiness.unknown","Readiness unknown")}function ma(e,i,s){const o=s.evidenceIncomplete>0?` · ${z(e,"incomplete")} ${$(e,s.evidenceIncomplete)}`:"";return`${e("uiStudio.analysis.targetCountLabel","분석 대상")} ${$(e,i)} · ${z(e,"needsFix")} ${$(e,s.hasSuggestions)}${o} · ${z(e,"passed")} ${$(e,s.noSuggestions)}`}function ge(e,i){return(i==null?void 0:i.deterministic_status)==="failed"?e("uiStudio.analysis.coverage.deterministicFailed","구조 검사 실패"):(i==null?void 0:i.coverage)==="structural_and_visual"&&i.visual_status==="completed"?e("uiStudio.analysis.coverage.full","구조·시각 검사 완료"):(i==null?void 0:i.visual_status)==="skipped"?e("uiStudio.analysis.coverage.visualSkipped","구조 검사만 완료 · 시각 검사 생략"):(i==null?void 0:i.visual_status)==="failed"?e("uiStudio.analysis.coverage.visualFailed","구조 검사 완료 · 시각 검사 실패"):e("uiStudio.analysis.coverage.structuralOnly","구조 검사만 완료")}function ga({tier:e}){const{t:i}=I(),{trackEvent:s}=q(),o=e==="basic",l=Ie(50),a=_.useRef(null),[n,u]=_.useState(null),[d,g]=_.useState(new Set),[m,p]=_.useState(new Set),[x,v]=_.useState(!1),j=_.useCallback((f,A)=>{u(n===f?null:f)},[n]),b=_.useCallback(()=>{u(null)},[]),G=_.useCallback(f=>{g(A=>{const R=new Set(A);return R.has(f)?R.delete(f):R.add(f),R})},[]);_.useEffect(()=>{var A;if(!n)return;(A=a.current)==null||A.focus();const f=R=>{R.key==="Escape"&&!document.getElementById("delete-confirm-title")&&b()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[b,n]);const k=o?oa(i):null,h=(k==null?void 0:k.list)??l.data,T=o?!1:l.loading,N=_.useCallback(f=>{p(A=>{const R=new Set(A);return R.has(f)?R.delete(f):R.add(f),R})},[]),S=f=>{p(new Set(f))},P=()=>{p(new Set)},L=async()=>{const f=(h==null?void 0:h.placeId)??0;s("dashboard_click_event",{click_target:"ui_studio_delete_selected_snapshots",page:"ui-studio",tab:"ui_studio_analysis"}),await We(f,{ids:[...m]}),await l.refresh(),v(!1),p(new Set)};if(T)return t.jsx("div",{className:r.page,children:i("uiStudio.loading","Loading...")});if(!o&&ie(l.error))return t.jsx(Re,{});if(!o&&l.error)return t.jsxs("div",{className:r.page,children:[i("uiStudio.error","Error"),": ",l.error]});const M=(h==null?void 0:h.snapshots)??[],C=(h==null?void 0:h.placeId)??0,w=M.map(f=>f.snapshot_id),B=da(M),E=ha(B);return t.jsxs("div",{children:[t.jsxs("div",{className:r.analysisWorkspace,"data-detail-open":n?"true":"false",children:[t.jsxs("div",{className:r.analysisMainColumn,"data-testid":"analysis-main-column",children:[o&&t.jsx("div",{className:r.sampleBanner,children:t.jsxs("div",{className:r.sampleBannerRow,children:[t.jsxs("div",{className:r.sampleBannerMain,children:[t.jsx("div",{className:r.sampleBadge,children:i("uiStudio.sample.badge","Preview of the Pro UI gallery")}),t.jsx("div",{className:r.sampleTitle,children:i("uiStudio.sample.title","You are previewing the UI screenshot gallery that unlocks after upgrading to Pro.")}),t.jsx("div",{className:r.sampleMessage,children:i("uiStudio.sample.message","This preview uses sample data from a demo inventory UI. Real screenshots, review history, and AI-driven fixes unlock with Pro.")})]}),t.jsx("div",{className:r.sampleActions,children:t.jsx("a",{className:r.primaryAction,href:je.uiStudioAnalysis,target:"_blank",rel:"noreferrer",onClick:()=>s("dashboard_click_event",{click_target:"upgrade_cta",placement:"ui_studio_analysis_banner",page:"ui-studio",tab:"ui_studio_analysis"}),children:i("tier.upgrade","View Pro")})})]})}),t.jsx("div",{className:r.galleryHeader,children:t.jsx("h1",{children:t.jsx(D,{label:i("uiStudio.title","UI Studio"),tooltip:i("uiStudio.title.tooltip","A central place to review AI-generated UI screens and improvement suggestions.")})})}),M.length===0?t.jsx("div",{className:r.emptyState,children:i("uiStudio.empty","No screenshots saved yet. They are created automatically when an AI agent captures the current UI state.")}):t.jsxs(t.Fragment,{children:[t.jsx("section",{className:r.analysisSummaryPanel,children:t.jsxs("div",{children:[t.jsx("h2",{children:t.jsx(D,{label:i("uiStudio.analysis.reportsTitle","UI 루트별 최신 분석"),tooltip:i("uiStudio.analysis.reportsTitle.tooltip","Shows the latest capture and suggestion summary per UI (e.g., Inventory window, Main menu).")})}),t.jsx("p",{className:r.analysisSummaryText,children:ma(i,B.length,E)})]})}),t.jsx("div",{className:r.analysisReportGrid,"data-testid":"analysis-report-grid",children:B.map(f=>t.jsx(xa,{report:f,placeId:C,imageUrlOverride:o?te:void 0,expanded:d.has(f.key),onPrimaryClick:A=>{f.children.length>1?G(f.key):j(f.latest.snapshot_id,A)},onChildClick:(A,R)=>j(A,R)},f.key))}),t.jsxs("section",{className:r.recentCapturesSection,children:[t.jsxs("div",{className:r.recentCapturesHeader,children:[t.jsxs("div",{children:[t.jsx("h2",{children:t.jsx(D,{label:i("uiStudio.analysis.recentCapturesTitle","최근 캡처"),tooltip:i("uiStudio.analysis.recentCapturesTitle.tooltip","All recently saved captures in chronological order.")})}),t.jsxs("p",{className:r.recentCapturesMeta,children:[i("uiStudio.storage.snapshotCount","화면 캡처")," ",$(i,M.length)]})]}),!o&&M.length>0&&t.jsxs("div",{className:r.captureSelectionActions,children:[t.jsx(y,{text:i("uiStudio.gallery.selectAll.tooltip","Select every visible capture at once."),children:t.jsx("button",{className:r.selectionBarBtn,onClick:()=>S(w),type:"button",children:i("uiStudio.gallery.selectAll","모두 선택")})}),m.size>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:r.selectionToolbarCount,children:[m.size,i("uiStudio.gallery.selection.selectedCount"," selected")]}),t.jsx(y,{text:i("uiStudio.gallery.clearSelection.tooltip","Clear the current selection."),children:t.jsx("button",{className:r.selectionBarBtn,onClick:P,type:"button",children:i("uiStudio.gallery.clearSelection","선택 해제")})}),t.jsx(y,{text:i("uiStudio.gallery.deleteSelected.tooltip","Delete only the selected capture files. The actual UI in Roblox Studio is not affected."),children:t.jsx("button",{className:`${r.selectionBarBtn} ${r.selectionBarBtnDanger}`,onClick:()=>v(!0),type:"button",children:i("common.delete","삭제")})})]})]})]}),t.jsx("div",{className:r.grid,children:M.map(f=>t.jsx($s,{snapshot:f,placeId:C,onClick:A=>j(f.snapshot_id,A),imageUrlOverride:o?te:void 0,selectable:!o,selected:m.has(f.snapshot_id),onToggleSelect:N},f.snapshot_id))})]})]})]}),n&&t.jsx("div",{className:r.analysisDetailPopupLayer,"data-testid":"analysis-detail-popup-layer",onClick:b,role:"presentation",children:t.jsx("section",{ref:a,className:r.analysisDetailDialog,role:"dialog","aria-modal":"true","aria-label":i("uiStudio.analysis.detailDialog","Analysis detail"),tabIndex:-1,onClick:f=>f.stopPropagation(),children:t.jsx(Xs,{snapshotId:n,placeId:C,onClose:b,sampleDetail:o&&n===Be?(k==null?void 0:k.detail)??null:null,tier:e,onActionDone:o?void 0:l.refresh})})})]}),x&&t.jsx(re,{title:i("uiStudio.confirm.deleteBatchTitle","화면 캡처 일괄 삭제"),message:i("uiStudio.confirm.deleteBatchMessage",`선택한 ${m.size}개의 화면 캡처를 삭제합니다. 이 작업은 되돌릴 수 없습니다.`),danger:!0,confirmLabel:i("common.delete","삭제"),onConfirm:L,onClose:()=>v(!1)})]})}function z(e,i){return i==="needsFix"||i==="review"?e("uiStudio.analysis.verdict.hasSuggestions","개선 제안 있음"):i==="incomplete"?e("uiStudio.analysis.verdict.incomplete","검토 증거 부족"):e("uiStudio.analysis.verdict.passed","현재 개선 제안 없음")}function ya(e,i){return((i==null?void 0:i.priority_high)??0)>0||((i==null?void 0:i.priority_medium)??0)>0||((i==null?void 0:i.priority_low)??0)>0?ae(e,i):(i==null?void 0:i.readiness)==="insufficient_evidence"?e("uiStudio.analysis.issueSummary.incomplete","제안은 없지만 interaction·responsive 검토가 남아 있습니다."):e("uiStudio.analysis.issueSummary.passed","현재 검토 기준에서 추가 개선 제안은 없습니다.")}function xa({report:e,placeId:i,imageUrlOverride:s,expanded:o,onPrimaryClick:l,onChildClick:a}){const{t:n}=I(),u=e.latest,d=s??ke(u.snapshot_id,i),g=new Date(u.captured_at*1e3).toLocaleString(),m=z(n,e.verdict),p=e.children.length>1;return t.jsxs("div",{className:r.analysisReportGroup,children:[t.jsxs("button",{className:r.analysisReportCard,"aria-expanded":p?o:void 0,"aria-label":`${e.key} ${p?n("uiStudio.analysis.expandChildren","하위 대상 보기"):n("uiStudio.analysis.openDetail","상세 보기")}`,onClick:x=>l(x.currentTarget),type:"button",children:[t.jsx("img",{className:r.analysisReportThumb,src:d,alt:u.snapshot_id,loading:"lazy"}),t.jsxs("div",{className:r.analysisReportBody,children:[t.jsxs("div",{className:r.analysisReportTopline,children:[t.jsx(y,{text:e.verdict==="passed"?n("uiStudio.analysis.verdict.passed.tooltip","No improvements suggested under the current review thresholds."):n("uiStudio.analysis.verdict.hasSuggestions.tooltip","Some improvements were found in this UI. Click the card for details."),children:t.jsx("span",{className:`${r.analysisVerdict} ${r[`analysisVerdict_${e.verdict}`]??""}`,children:m})}),t.jsx(y,{text:n("uiStudio.analysis.counts.tooltip","Shows how many suggestions are marked review first, recommended, or optional."),children:t.jsx("span",{className:r.analysisReportCounts,children:ae(n,e.summary)})})]}),t.jsx("div",{className:r.analysisReportTarget,children:e.key}),t.jsx(fa,{summary:e.summary}),t.jsx("div",{className:r.analysisReportIssue,children:ya(n,e.summary)}),t.jsx("div",{className:r.analysisReportCoverage,children:ge(n,e.summary)}),t.jsx(Sa,{summary:e.summary}),t.jsxs("div",{className:r.analysisReportMeta,children:[g," ·"," ",t.jsx(y,{text:n("uiStudio.analysis.thresholds.tooltip","The threshold set used for this review (default or custom)."),children:t.jsx("span",{children:n("uiStudio.analysis.thresholds","검토 기준")})}),": ",u.thresholds_source,e.snapshotCount>1?` · ${n("uiStudio.analysis.captureLabel","캡처")} ${$(n,e.snapshotCount)}`:"",p?` · ${n("uiStudio.analysis.childTargets","하위 대상")} ${$(n,e.children.length)}`:""]})]})]}),p&&o&&t.jsx("div",{className:r.analysisChildList,children:e.children.map(x=>t.jsxs("button",{className:r.analysisChildRow,onClick:v=>a(x.latest.snapshot_id,v.currentTarget),type:"button",children:[t.jsx("span",{className:r.analysisChildPath,children:x.key}),t.jsx("span",{className:r.analysisChildSummary,children:ae(n,x.latest.design_check_summary)}),t.jsx("span",{className:r.analysisChildSummary,children:ge(n,x.latest.design_check_summary)}),t.jsx("span",{className:r.analysisChildDetailHint,children:n("uiStudio.analysis.childDetailHint","하위 대상 상세 보기")})]},x.key))})]})}function fa({summary:e}){const{t:i}=I();if(!e)return null;const s=e.functional_safe===!0?i("uiStudio.functional.safe","Safe"):e.functional_safe===!1?i("uiStudio.functional.risk","Risk found"):i("uiStudio.functional.unknown","Unknown"),o=e.responsive_requirement==="required"?i("uiStudio.responsive.required","Required"):e.responsive_requirement==="recommended"?i("uiStudio.responsive.recommended","Recommended"):i("uiStudio.responsive.unknown","Unknown");return t.jsxs("div",{className:r.readinessSummary,"aria-label":i("uiStudio.readiness.summary","UI readiness"),children:[t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.primaryVisual.label","Primary visual")," · ",pa(i,e.primary_visual_verdict)]}),t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.functional.label","Functional")," · ",s]}),t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.responsive.label","Responsive")," · ",o]}),t.jsx("span",{className:`${r.readinessChip} ${e.readiness==="ready"?r.readinessChipReady:r.readinessChipPending}`,children:_a(i,e.readiness)})]})}function Sa({summary:e}){const{t:i}=I(),s=e==null?void 0:e.coverage_dimensions;if(!s)return null;const o=[["Structure",s.structure],["Visual",s.visual],["Interaction",s.interaction],["Primary view",s.primary_view_context],["Responsive",s.responsive_viewport]];return t.jsx("div",{className:r.coverageChips,"aria-label":i("uiStudio.analysis.coverageDimensions","검토 범위"),children:o.map(([l,a])=>t.jsxs("span",{className:`${r.coverageChip} ${r[`coverageChip_${a.status}`]??""}`,title:a.reasons.join(", "),children:[l," · ",a.status==="completed"?i("uiStudio.analysis.coverageStatus.completed","완료"):a.status==="failed"?i("uiStudio.analysis.coverageStatus.failed","실패"):i("uiStudio.analysis.coverageStatus.skipped","생략")]},l))})}function va(e,i,s=1e4){const[o,l]=_.useState(null),[a,n]=_.useState(!0),[u,d]=_.useState(null),g=JSON.stringify(i),m=_.useCallback(async()=>{if(e===null){l(null),d(null),n(!1);return}try{const p=await le(e,i);l(p),d(null)}catch(p){d(p.message)}finally{n(!1)}},[e,g]);return _.useEffect(()=>{let p=!0;if(e===null)return l(null),d(null),n(!1),()=>{p=!1};const x=async()=>{try{const j=await le(e,i);p&&(l(j),d(null))}catch(j){p&&d(j.message)}finally{p&&n(!1)}};x();const v=setInterval(()=>{x()},s);return()=>{p=!1,clearInterval(v)}},[e,g,s]),{data:o,loading:a,error:u,refresh:m}}const ja="_filterBar_1ohov_4",Ca="_filterGroup_1ohov_14",wa="_filterLabel_1ohov_21",ba="_filterCheckbox_1ohov_28",ka="_segmentGroup_1ohov_45",Ia="_segmentBtn_1ohov_55",Na="_segmentBtnActive_1ohov_73",Pa="_filterInput_1ohov_79",Ta="_filterResetBtn_1ohov_95",Ba="_requestRow_1ohov_114",Ra="_requestRowMain_1ohov_127",Da="_requestDetailToggle_1ohov_134",Ga="_thumbPair_1ohov_156",Ma="_thumbPairButton_1ohov_164",Aa="_thumbSlot_1ohov_179",La="_thumbImg_1ohov_204",$a="_thumbPlaceholder_1ohov_211",Ea="_thumbArrow_1ohov_219",qa="_extraPathsBadge_1ohov_225",Ha="_requestMeta_1ohov_239",Ua="_requestLabel_1ohov_247",Oa="_requestTime_1ohov_256",Fa="_requestStats_1ohov_261",za="_statDot_1ohov_269",Va="_summaryPill_1ohov_273",Wa="_requestReadiness_1ohov_277",Ka="_requestReadinessPill_1ohov_283",Ya="_requestReadinessReady_1ohov_297",Qa="_requestReadinessPending_1ohov_303",Ja="_requestActions_1ohov_310",Xa="_expandHint_1ohov_317",Za="_mutationsArea_1ohov_330",er="_mutLoading_1ohov_339",tr="_mutEmpty_1ohov_340",ir="_mutError_1ohov_346",sr="_mutationRow_1ohov_352",ar="_mutationLine_1ohov_362",rr="_mutTs_1ohov_369",or="_mutCommand_1ohov_375",nr="_mutPath_1ohov_381",lr="_mutDiff_1ohov_391",cr="_mutErr_1ohov_346",ur="_changeDetails_1ohov_406",dr="_changeDetailRow_1ohov_414",hr="_changeDetailRowNoBefore_1ohov_423",pr="_changeDetailBadge_1ohov_427",_r="_changeDetail_text_1ohov_444",mr="_changeDetail_color_1ohov_449",gr="_changeDetail_size_1ohov_454",yr="_changeDetail_layout_1ohov_459",xr="_changeDetail_state_1ohov_464",fr="_changeDetail_asset_1ohov_469",Sr="_changeDetail_property_1ohov_474",vr="_changeDetailProperty_1ohov_478",jr="_changeDetailArrow_1ohov_486",Cr="_changeDetailOldValue_1ohov_492",wr="_changeDetailNewValue_1ohov_493",br="_compareDialogLayer_1ohov_511",kr="_compareDialog_1ohov_511",Ir="_beforeAfterDrawer_1ohov_542",Nr="_drawerHeader_1ohov_552",Pr="_drawerTitle_1ohov_561",Tr="_drawerCloseBtn_1ohov_568",Br="_drawerBody_1ohov_584",Rr="_pathTabs_1ohov_591",Dr="_pathTab_1ohov_591",Gr="_pathTabActive_1ohov_620",Mr="_comparePanel_1ohov_626",Ar="_compareHalf_1ohov_636",Lr="_compareLabel_1ohov_643",$r="_compareImg_1ohov_654",Er="_comparePlaceholder_1ohov_662",qr="_compareDetailsPanel_1ohov_674",Hr="_compareDetailsHeader_1ohov_683",Ur="_drawerFooter_1ohov_701",Or="_drawerActionBtn_1ohov_709",Fr="_historyTabWrap_1ohov_727",zr="_historyWorkspace_1ohov_733",Vr="_historyMainColumn_1ohov_738",Wr="_requestList_1ohov_742",Kr="_emptyHistory_1ohov_747",Yr="_historyError_1ohov_754",Qr="_historyLoading_1ohov_760",Jr="_listHeader_1ohov_768",Xr="_listHeaderTitle_1ohov_777",Zr="_clearBtn_1ohov_784",eo="_deleteErrBanner_1ohov_808",c={filterBar:ja,filterGroup:Ca,filterLabel:wa,filterCheckbox:ba,segmentGroup:ka,segmentBtn:Ia,segmentBtnActive:Na,filterInput:Pa,filterResetBtn:Ta,requestRow:Ba,requestRowMain:Ra,requestDetailToggle:Da,thumbPair:Ga,thumbPairButton:Ma,thumbSlot:Aa,thumbImg:La,thumbPlaceholder:$a,thumbArrow:Ea,extraPathsBadge:qa,requestMeta:Ha,requestLabel:Ua,requestTime:Oa,requestStats:Fa,statDot:za,summaryPill:Va,requestReadiness:Wa,requestReadinessPill:Ka,requestReadinessReady:Ya,requestReadinessPending:Qa,requestActions:Ja,expandHint:Xa,mutationsArea:Za,mutLoading:er,mutEmpty:tr,mutError:ir,mutationRow:sr,mutationLine:ar,mutTs:rr,mutCommand:or,mutPath:nr,mutDiff:lr,mutErr:cr,changeDetails:ur,changeDetailRow:dr,changeDetailRowNoBefore:hr,changeDetailBadge:pr,changeDetail_text:_r,changeDetail_color:mr,changeDetail_size:gr,changeDetail_layout:yr,changeDetail_state:xr,changeDetail_asset:fr,changeDetail_property:Sr,changeDetailProperty:vr,changeDetailArrow:jr,changeDetailOldValue:Cr,changeDetailNewValue:wr,compareDialogLayer:br,compareDialog:kr,beforeAfterDrawer:Ir,drawerHeader:Nr,drawerTitle:Pr,drawerCloseBtn:Tr,drawerBody:Br,pathTabs:Rr,pathTab:Dr,pathTabActive:Gr,comparePanel:Mr,compareHalf:Ar,compareLabel:Lr,compareImg:$r,comparePlaceholder:Er,compareDetailsPanel:qr,compareDetailsHeader:Hr,drawerFooter:Ur,drawerActionBtn:Or,historyTabWrap:Fr,historyWorkspace:zr,historyMainColumn:Vr,requestList:Wr,emptyHistory:Kr,historyError:Yr,historyLoading:Qr,listHeader:Jr,listHeaderTitle:Xr,clearBtn:Zr,deleteErrBanner:eo};function to(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function ye(e){return e==null?"nil":typeof e=="string"?`"${e}"`:typeof e=="object"?JSON.stringify(e):String(e)}function Me({mutations:e,emptyLabel:i}){const{t:s}=I();return e.length===0?t.jsx("div",{className:c.mutEmpty,children:i??s("uiStudio.history.row.mutationsEmpty","No change details")}):t.jsx(t.Fragment,{children:e.map(o=>t.jsx(io,{mutation:o},o.mutationId))})}function io({mutation:e}){return t.jsxs("div",{className:c.mutationRow,children:[t.jsxs("div",{className:c.mutationLine,children:[t.jsx("span",{className:c.mutTs,children:to(e.ts)}),t.jsx("span",{className:c.mutCommand,children:e.command}),e.targetPath&&t.jsx("span",{className:c.mutPath,children:e.targetPath}),e.diffSummary&&t.jsx("span",{className:c.mutDiff,children:e.diffSummary})]}),e.changeDetails&&e.changeDetails.length>0&&t.jsx("div",{className:c.changeDetails,children:e.changeDetails.map(i=>t.jsx(so,{detail:i},`${i.property}:${i.category}`))}),!e.ok&&e.error&&t.jsx("span",{className:c.mutErr,children:e.error})]})}function so({detail:e}){const i=Object.prototype.hasOwnProperty.call(e,"before");return t.jsxs("div",{className:`${c.changeDetailRow} ${i?"":c.changeDetailRowNoBefore}`,children:[t.jsx("span",{className:`${c.changeDetailBadge} ${c[`changeDetail_${e.category}`]??""}`,children:e.label}),t.jsx("span",{className:c.changeDetailProperty,children:e.property}),i&&t.jsx("span",{className:c.changeDetailOldValue,children:ye(e.before)}),t.jsx("span",{className:c.changeDetailArrow,children:"→"}),t.jsx("span",{className:c.changeDetailNewValue,children:ye(e.after)})]})}function xe(e,i){return`${V}/api/ui-studio/snapshots/${encodeURIComponent(e)}/image?placeId=${i}`}function ao(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function ro(e){if(!e)return null;const i=e.split(/[./]/).filter(o=>o.length>0);if(i.length===0)return null;const s=i.findIndex(o=>o==="StarterGui");return s>=0&&i[s+1]?i[s+1]:i[i.length-1]??null}function X(e,i){if(i.label)return i.label;const s=ro(i.affectedPaths[0]);if(s){const o=i.mutationCount===1?"uiStudio.history.row.pathLabelOne":"uiStudio.history.row.pathLabelMany",l=i.mutationCount===1?"{path} · {n} change detail":"{path} · {n} change details";return e(o,l).replace("{path}",s).replace("{n}",String(i.mutationCount))}return e("uiStudio.history.row.toolLabel","UI changes ({n})").replace("{n}",String(i.mutationCount))}function Z(e,i){return`${i}${e("uiStudio.storage.countSuffix","")}`}function oo(e,i){if(!i)return null;const s=[i.style_family,i.layout_family,i.device_policy,i.safe_area_policy].filter(o=>typeof o=="string"&&o.length>0);return s.length===0?null:`${e("uiStudio.history.row.qualityPlan","Design direction")}: ${s.join(" · ")}`}function no(e,i,s){if(!i)return null;if(i.source==="unavailable")return e("uiStudio.history.row.designCheckUnavailable","Suggestions: unavailable");if(s==="insufficient_evidence"||i.readiness==="insufficient_evidence")return e("uiStudio.history.row.readinessIncomplete","Readiness: evidence incomplete");if(i.total===0)return e("uiStudio.history.row.designCheckNone","Suggestions: none");const o=`${e("uiStudio.priorityHigh","Priority")} ${Z(e,i.priority_high)}`,l=`${e("uiStudio.priorityMedium","Recommended")} ${Z(e,i.priority_medium)}`,a=`${e("uiStudio.priorityLow","Optional")} ${Z(e,i.priority_low)}`;return`${e("uiStudio.history.row.designCheck","Suggestions")}: ${o} · ${l} · ${a}`}function lo(e,i){return i==="recompose"?e("uiStudio.primaryVisual.recompose","Recompose"):i==="refine"?e("uiStudio.primaryVisual.refine","Refine"):i==="approved"?e("uiStudio.primaryVisual.approved","Approved"):e("uiStudio.primaryVisual.unknown","Unknown")}function Ae({req:e,placeId:i,onOpenCompare:s,imageUrlOverride:o,sampleMutations:l}){const{t:a}=I(),[n,u]=_.useState(!1),[d,g]=_.useState(null),[m,p]=_.useState(!1),[x,v]=_.useState(null),j=o!=null,b=e.affectedPaths[0]??null,G=e.affectedPaths.length-1,k=b?e.beforeSnapshots[b]??null:null,h=b?e.afterSnapshots[b]??null:null,T=k?j?o:xe(k,i):null,N=h?j?o:xe(h,i):null,S=oo(a,e.qualityPlanSummary),P=no(a,e.postChangeDesignCheckSummary,e.readiness),L=e.postChangeDesignCheckSummary,M=async()=>{if(!n&&d===null)if(j&&l!=null)g(l);else{p(!0),v(null);try{const C=await Ce(i,e.requestId);g(C.mutations)}catch(C){v(C.message)}finally{p(!1)}}u(C=>!C)};return t.jsxs("div",{className:c.requestRow,children:[t.jsxs("div",{className:c.requestRowMain,children:[t.jsx(y,{text:a("uiStudio.history.row.compare.tooltip","Compare the before and after screens. Click to open the full comparison view."),children:t.jsxs("button",{className:`${c.thumbPair} ${c.thumbPairButton}`,onClick:C=>s(C.currentTarget),disabled:!b,"aria-label":`${X(a,e)} ${a("uiStudio.history.row.compare","Before / After")}`,type:"button",children:[t.jsx("div",{className:c.thumbSlot,children:T?t.jsx("img",{className:c.thumbImg,src:T,alt:a("uiStudio.compare.before","Before"),loading:"lazy"}):t.jsx(y,{text:a("uiStudio.history.row.noBeforeState.tooltip","No capture saved before this change."),children:t.jsx("span",{className:c.thumbPlaceholder,children:a("uiStudio.history.row.noBeforeState","이전 없음")})})}),t.jsx("span",{className:c.thumbArrow,children:"→"}),t.jsx("div",{className:c.thumbSlot,children:N?t.jsx("img",{className:c.thumbImg,src:N,alt:a("uiStudio.compare.after","After"),loading:"lazy"}):t.jsx(y,{text:a("uiStudio.history.row.noAfterState.tooltip","No capture saved after this change."),children:t.jsx("span",{className:c.thumbPlaceholder,children:a("uiStudio.history.row.noAfterState","이후 없음")})})}),G>0&&t.jsx(y,{text:a("uiStudio.history.row.extraPaths.tooltip","Number of additional UIs changed in this action."),children:t.jsxs("span",{className:c.extraPathsBadge,children:["+",G]})})]})}),t.jsxs("button",{className:c.requestDetailToggle,type:"button","aria-expanded":n,"aria-label":`${X(a,e)} ${a("uiStudio.history.row.toggleDetails","Toggle change details")}`,onClick:()=>void M(),children:[t.jsxs("span",{className:c.requestMeta,children:[t.jsx("span",{className:c.requestLabel,children:X(a,e)}),t.jsx("span",{className:c.requestTime,children:ao(e.startedAt)}),t.jsxs("span",{className:c.requestStats,children:[t.jsx(y,{text:a("uiStudio.history.row.affectedPaths.tooltip","Number of UIs affected by this action."),children:t.jsxs("span",{children:[a("uiStudio.history.row.affectedPaths","Paths")," ",e.affectedPaths.length,a("uiStudio.storage.countSuffix","")]})}),t.jsx("span",{className:c.statDot,children:"·"}),t.jsx(y,{text:a("uiStudio.history.row.mutations.tooltip","Number of detailed changes (e.g., property edits)."),children:t.jsxs("span",{children:[a("uiStudio.history.row.mutations","Change details")," ",e.mutationCount,a("uiStudio.storage.countSuffix","")]})}),S&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:c.statDot,children:"·"}),t.jsx(y,{text:a("uiStudio.history.row.qualityPlan.tooltip","Brief design direction used for this change."),children:t.jsx("span",{className:c.summaryPill,children:S})})]}),P&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:c.statDot,children:"·"}),t.jsx(y,{text:a("uiStudio.history.row.designCheck.tooltip","Post-change Design Check suggestion summary."),children:t.jsx("span",{className:c.summaryPill,children:P})})]})]}),L&&t.jsxs("span",{className:c.requestReadiness,"aria-label":a("uiStudio.readiness.summary","UI readiness"),children:[t.jsx("span",{className:c.requestReadinessPill,children:lo(a,L.primary_visual_verdict)}),t.jsx("span",{className:c.requestReadinessPill,children:L.functional_safe===!0?a("uiStudio.functional.safeCompact","Functional safe"):L.functional_safe===!1?a("uiStudio.functional.riskCompact","Functional risk"):a("uiStudio.functional.unknownCompact","Functional unknown")}),t.jsx("span",{className:c.requestReadinessPill,children:L.responsive_requirement==="required"?a("uiStudio.responsive.requiredCompact","Responsive required"):L.responsive_requirement==="recommended"?a("uiStudio.responsive.recommendedCompact","Responsive recommended"):a("uiStudio.responsive.unknownCompact","Responsive unknown")}),L.readiness==="ready"&&t.jsx("span",{className:`${c.requestReadinessPill} ${c.requestReadinessReady}`,children:a("uiStudio.readiness.ready","Ready")}),L.readiness==="review_required"&&t.jsx("span",{className:`${c.requestReadinessPill} ${c.requestReadinessPending}`,children:a("uiStudio.readiness.reviewRequired","Review required")})]})]}),t.jsx("span",{className:c.requestActions,children:t.jsx(y,{text:a("uiStudio.history.row.toggleDetails.tooltip","Show or hide a per-line breakdown of what changed."),children:t.jsx("span",{className:c.expandHint,children:n?a("uiStudio.history.row.collapseDetails","Hide change details"):a("uiStudio.history.row.expandDetails","Show {n} change details").replace("{n}",String(e.mutationCount))})})})]})]}),n&&t.jsxs("div",{className:c.mutationsArea,children:[m&&t.jsx("div",{className:c.mutLoading,children:a("uiStudio.history.loading","로딩 중...")}),x&&t.jsx("div",{className:c.mutError,children:x}),d&&t.jsx(Me,{mutations:d,emptyLabel:a("uiStudio.history.row.mutationsEmpty","No change details")})]})]})}function fe(e,i){return`${V}/api/ui-studio/snapshots/${encodeURIComponent(e)}/image?placeId=${i}`}function Le({requestId:e,placeId:i,onClose:s,imageUrlOverride:o,sampleDetail:l}){const{t:a}=I(),n=_.useRef(null),u=l!=null,[d,g]=_.useState(u?l:null),[m,p]=_.useState(!u),[x,v]=_.useState(null),[j,b]=_.useState(u&&l.affectedPaths.length>0?l.affectedPaths[0]:null);_.useEffect(()=>{var S;(S=n.current)==null||S.focus()},[]),_.useEffect(()=>{const S=P=>{P.key==="Escape"&&(P.preventDefault(),s())};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[s]),_.useEffect(()=>{if(u)return;let S=!0;return p(!0),v(null),Ce(i,e).then(P=>{S&&(g(P),P.affectedPaths.length>0&&b(P.affectedPaths[0]))}).catch(P=>{S&&v(P.message)}).finally(()=>{S&&p(!1)}),()=>{S=!1}},[e,i,u]);const G=j&&d?d.beforeSnapshots[j]??null:null,k=j&&d?d.afterSnapshots[j]??null:null,h=G?o??fe(G,i):null,T=k?o??fe(k,i):null,N=a("uiStudio.history.row.compare","전후 비교");return t.jsx("div",{className:c.compareDialogLayer,"data-testid":"history-compare-dialog-layer",onClick:s,role:"presentation",children:t.jsx("section",{ref:n,className:c.compareDialog,role:"dialog","aria-modal":"true","aria-label":N,tabIndex:-1,onClick:S=>S.stopPropagation(),children:t.jsxs("div",{className:c.beforeAfterDrawer,children:[t.jsxs("div",{className:c.drawerHeader,children:[t.jsx("h2",{className:c.drawerTitle,children:N}),t.jsx("button",{className:c.drawerCloseBtn,onClick:s,type:"button",children:a("uiStudio.history.drawer.close","닫기")})]}),m&&t.jsx("div",{className:c.drawerBody,children:a("uiStudio.history.loading","로딩 중...")}),x&&t.jsx("div",{className:c.drawerBody,children:t.jsx("span",{className:c.mutErr,children:x})}),!m&&!x&&d&&t.jsxs(t.Fragment,{children:[d.affectedPaths.length>0&&t.jsx("div",{className:c.pathTabs,role:"tablist",children:d.affectedPaths.map(S=>t.jsx(y,{text:`${a("uiStudio.compare.path.tooltip","The UI instance path for this screen.")} ${S}`,children:t.jsx("button",{role:"tab","aria-selected":j===S,className:`${c.pathTab} ${j===S?c.pathTabActive:""}`,onClick:()=>b(S),type:"button",children:S.split("/").pop()??S})},S))}),t.jsxs("div",{className:c.comparePanel,children:[t.jsxs("div",{className:c.compareHalf,children:[t.jsx(y,{text:a("uiStudio.compare.before.tooltip","The screen saved just before AI made the change."),children:t.jsx("div",{className:c.compareLabel,children:a("uiStudio.compare.before","Before")})}),h?t.jsx("img",{className:c.compareImg,src:h,alt:a("uiStudio.compare.before","Before")}):t.jsx("div",{className:c.comparePlaceholder,children:a("uiStudio.history.row.noBeforeState","이전 상태 없음")})]}),t.jsxs("div",{className:c.compareHalf,children:[t.jsx(y,{text:a("uiStudio.compare.after.tooltip","The screen saved just after AI made the change."),children:t.jsx("div",{className:c.compareLabel,children:a("uiStudio.compare.after","After")})}),T?t.jsx("img",{className:c.compareImg,src:T,alt:a("uiStudio.compare.after","After")}):t.jsx("div",{className:c.comparePlaceholder,children:a("uiStudio.history.row.noAfterState","이후 상태 없음")})]})]}),t.jsxs("section",{className:c.compareDetailsPanel,children:[t.jsx("div",{className:c.compareDetailsHeader,children:a("uiStudio.history.drawer.changeDetails","Change details")}),t.jsx(Me,{mutations:d.mutations,emptyLabel:a("uiStudio.history.row.mutationsEmpty","No change details")})]})]}),t.jsx("div",{className:c.drawerFooter,children:t.jsx("button",{className:c.drawerActionBtn,onClick:s,type:"button",children:a("uiStudio.history.drawer.close","닫기")})})]})})})}function F(e){const i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0),s=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999);return{start:i,end:s}}function Se(e,i){const s=e.split("-").map(Number);if(s.length!==3||s.some(n=>Number.isNaN(n)))return;const[o,l,a]=s;return new Date(o,l-1,a,i?23:0,i?59:0,i?59:0,i?999:0).toISOString()}function co(e){const i={limit:50};if(e.action!=="all"&&(i.action=e.action),e.datePreset==="custom"){const s=e.from?Se(e.from,!1):void 0,o=e.to?Se(e.to,!0):void 0;s&&(i.from=s),o&&(i.to=o)}else if(e.datePreset!=="all"){const s=new Date;if(e.datePreset==="today"){const{start:o,end:l}=F(s);i.from=o.toISOString(),i.to=l.toISOString()}else if(e.datePreset==="yesterday"){const o=new Date(s);o.setDate(o.getDate()-1);const{start:l,end:a}=F(o);i.from=l.toISOString(),i.to=a.toISOString()}else{const o=e.datePreset==="7d"?6:29,l=new Date(s);l.setDate(l.getDate()-o);const{start:a}=F(l),{end:n}=F(s);i.from=a.toISOString(),i.to=n.toISOString()}}return i}function $e(){return{action:"all",datePreset:"all"}}function uo(){const{t:e}=I(),{trackEvent:i}=q(),s=Ke(e),[o,l]=_.useState(null),a=o?s.requests.find(d=>d.requestId===o)??null:null,n=_.useCallback((d,g)=>{l(d)},[]),u=_.useCallback(()=>{l(null)},[]);return t.jsxs("div",{className:c.historyTabWrap,children:[t.jsx("div",{className:r.sampleBanner,children:t.jsxs("div",{className:r.sampleBannerRow,children:[t.jsxs("div",{className:r.sampleBannerMain,children:[t.jsx("div",{className:r.sampleBadge,children:e("uiStudio.history.sample.bannerBadge","Preview of the Pro change history")}),t.jsx("div",{className:r.sampleTitle,children:e("uiStudio.history.sample.bannerTitle","You are previewing the UI change history that unlocks after upgrading to Pro.")}),t.jsx("div",{className:r.sampleMessage,children:e("uiStudio.history.sample.bannerMessage","This preview uses sample data. Real change history, before/after comparison, and batch delete unlock with Pro.")})]}),t.jsx("div",{className:r.sampleActions,children:t.jsx("a",{className:r.primaryAction,href:je.uiStudioHistory,target:"_blank",rel:"noreferrer",title:e("uiStudio.history.sample.tooltip","Full history is available with Pro"),onClick:()=>i("dashboard_click_event",{click_target:"upgrade_cta",placement:"ui_studio_history_banner",page:"ui-studio",tab:"ui_studio_history"}),children:e("tier.upgrade","View Pro")})})]})}),t.jsxs("div",{className:c.historyWorkspace,"data-compare-open":o?"true":"false",children:[t.jsxs("div",{className:c.historyMainColumn,"data-testid":"history-main-column",children:[t.jsx("div",{className:c.listHeader,children:t.jsx("h2",{className:c.listHeaderTitle,children:t.jsx(D,{label:e("uiStudio.history.title","변경 이력"),tooltip:e("uiStudio.history.title.tooltip","A timeline of every UI change made by AI.")})})}),t.jsx("div",{className:c.requestList,children:s.requests.map(d=>t.jsx(Ae,{req:d,placeId:0,onOpenCompare:g=>n(d.requestId,g),imageUrlOverride:ce,sampleMutations:s.mutationsByRequest[d.requestId]},d.requestId))})]}),o&&a&&t.jsx(Le,{requestId:o,placeId:0,onClose:u,imageUrlOverride:ce,sampleDetail:{...a,mutations:s.mutationsByRequest[a.requestId]??[]}})]})]})}function ho({filter:e,onChange:i}){const{t:s}=I(),o=[{value:"all",label:s("uiStudio.history.filter.actionAll","All"),tooltip:s("uiStudio.history.filter.actionAll.tooltip","Show every kind of action.")},{value:"create_tree",label:s("uiStudio.history.filter.actionCreate","Create"),tooltip:s("uiStudio.history.filter.actionCreate.tooltip","Show only actions that created a new UI.")},{value:"update",label:s("uiStudio.history.filter.actionUpdate","Update"),tooltip:s("uiStudio.history.filter.actionUpdate.tooltip","Show only actions that updated an existing UI.")},{value:"delete",label:s("uiStudio.history.filter.actionDelete","Delete"),tooltip:s("uiStudio.history.filter.actionDelete.tooltip","Show only actions that deleted a UI.")}],l=[{value:"all",label:s("uiStudio.history.filter.dateAll","All"),tooltip:s("uiStudio.history.filter.dateAll.tooltip","Show the full history.")},{value:"today",label:s("uiStudio.history.filter.today","Today"),tooltip:s("uiStudio.history.filter.today.tooltip","Show only changes from today.")},{value:"yesterday",label:s("uiStudio.history.filter.yesterday","Yesterday"),tooltip:s("uiStudio.history.filter.yesterday.tooltip","Show only changes from yesterday.")},{value:"7d",label:s("uiStudio.history.filter.last7Days","Last 7 days"),tooltip:s("uiStudio.history.filter.last7Days.tooltip","Show changes from the last 7 days.")},{value:"30d",label:s("uiStudio.history.filter.last30Days","Last 30 days"),tooltip:s("uiStudio.history.filter.last30Days.tooltip","Show changes from the last 30 days.")},{value:"custom",label:s("uiStudio.history.filter.customRange","Custom range"),tooltip:s("uiStudio.history.filter.customRange.tooltip","Pick a custom start and end date.")}];return t.jsxs("div",{className:c.filterBar,children:[t.jsxs("div",{className:c.filterGroup,children:[t.jsx("span",{className:c.filterLabel,children:t.jsx(D,{label:s("uiStudio.history.filter.actions","작업 유형"),tooltip:s("uiStudio.history.filter.actions.tooltip","Filter records by the kind of change AI made.")})}),t.jsx("div",{className:c.segmentGroup,children:o.map(a=>t.jsx(y,{text:a.tooltip,children:t.jsx("button",{className:`${c.segmentBtn} ${e.action===a.value?c.segmentBtnActive:""}`,onClick:()=>i({...e,action:a.value}),"aria-pressed":e.action===a.value,type:"button",children:a.label})},a.value))})]}),t.jsxs("div",{className:c.filterGroup,children:[t.jsx("span",{className:c.filterLabel,children:t.jsx(D,{label:s("uiStudio.history.filter.period","Period"),tooltip:s("uiStudio.history.filter.period.tooltip","Filter records by time range.")})}),t.jsx("div",{className:c.segmentGroup,children:l.map(a=>t.jsx(y,{text:a.tooltip,children:t.jsx("button",{className:`${c.segmentBtn} ${e.datePreset===a.value?c.segmentBtnActive:""}`,onClick:()=>i({...e,datePreset:a.value,from:a.value==="custom"?e.from:void 0,to:a.value==="custom"?e.to:void 0}),"aria-pressed":e.datePreset===a.value,type:"button",children:a.label})},a.value))})]}),e.datePreset==="custom"&&t.jsxs("div",{className:c.filterGroup,children:[t.jsx("label",{className:c.filterLabel,htmlFor:"ui-history-from-date",children:t.jsx(D,{label:s("uiStudio.history.filter.from","시작일"),tooltip:s("uiStudio.history.filter.from.tooltip","Start date for the query.")})}),t.jsx("input",{id:"ui-history-from-date",type:"date",className:c.filterInput,value:e.from??"",onChange:a=>i({...e,from:a.target.value||void 0})}),t.jsx("label",{className:c.filterLabel,htmlFor:"ui-history-to-date",children:t.jsx(D,{label:s("uiStudio.history.filter.to","종료일"),tooltip:s("uiStudio.history.filter.to.tooltip","End date for the query.")})}),t.jsx("input",{id:"ui-history-to-date",type:"date",className:c.filterInput,value:e.to??"",onChange:a=>i({...e,to:a.target.value||void 0})})]}),t.jsx(y,{text:s("uiStudio.history.filter.reset.tooltip","Reset all filters to defaults."),children:t.jsx("button",{className:c.filterResetBtn,onClick:()=>i($e()),type:"button",children:s("uiStudio.history.filter.reset","Reset")})})]})}function po(){var M;const{t:e}=I(),{trackEvent:i}=q(),s=Ie(1),o=((M=s.data)==null?void 0:M.placeId)??null,[l,a]=_.useState($e),{data:n,loading:u,error:d,refresh:g}=va(o,co(l)),[m,p]=_.useState(null),[x,v]=_.useState(!1),[j,b]=_.useState(!1),[G,k]=_.useState(null),h=async()=>{if(k(null),o===null){k(e("uiStudio.history.noPlaceAction","Current place is not available yet."));return}try{await Ye(o,{all:!0,alsoSnapshots:j}),await g(),v(!1)}catch(C){throw k(C.message),C}},T=(n==null?void 0:n.requests)??[],N=o===null&&s.loading,S=ie(s.error)||ie(d),P=_.useCallback((C,w)=>{i("dashboard_click_event",{click_target:"ui_studio_compare_before_after",page:"ui-studio",tab:"ui_studio_history"}),p(C)},[i]),L=_.useCallback(()=>{p(null)},[]);return t.jsxs("div",{className:c.historyTabWrap,children:[S?t.jsx(Re,{}):t.jsxs("div",{className:c.historyWorkspace,"data-compare-open":m?"true":"false",children:[t.jsxs("div",{className:c.historyMainColumn,"data-testid":"history-main-column",children:[t.jsx(ho,{filter:l,onChange:a}),t.jsxs("div",{className:c.listHeader,children:[t.jsx("h2",{className:c.listHeaderTitle,children:t.jsx(D,{label:e("uiStudio.history.title","변경 이력"),tooltip:e("uiStudio.history.title.tooltip","A timeline of every UI change made by AI.")})}),T.length>0&&t.jsx(y,{text:e("uiStudio.history.clear.tooltip","Delete every change record for this project. The actual UI in Roblox Studio is not affected."),children:t.jsx("button",{className:c.clearBtn,onClick:()=>{i("dashboard_click_event",{click_target:"ui_studio_clear_history",page:"ui-studio",tab:"ui_studio_history"}),v(!0)},type:"button",children:e("uiStudio.history.clear","Clear")})})]}),N&&t.jsx("div",{className:c.historyLoading,children:e("uiStudio.history.loadingPlace","Loading current place...")}),!N&&u&&t.jsx("div",{className:c.historyLoading,children:e("uiStudio.history.loading","로딩 중...")}),!N&&!u&&d&&t.jsxs("div",{className:c.historyError,children:[e("uiStudio.history.error","오류"),": ",d]}),!N&&!u&&!d&&o===null&&t.jsx("div",{className:c.emptyHistory,children:e("uiStudio.history.noPlace","No current place data is available yet. Connect WEPPY Plugin and sync a place to view UI change history.")}),!N&&!u&&!d&&o!==null&&T.length===0&&t.jsx("div",{className:c.emptyHistory,children:e("uiStudio.history.empty","아직 변경 이력이 없습니다. AI 에이전트가 manage_ui 로 UI 를 수정하면 자동으로 기록됩니다.")}),!N&&!u&&o!==null&&T.length>0&&t.jsx("div",{className:c.requestList,children:T.map(C=>t.jsx(Ae,{req:C,placeId:o,onOpenCompare:w=>P(C.requestId,w)},C.requestId))}),G&&t.jsx("div",{className:c.deleteErrBanner,children:G})]}),m&&o!==null&&t.jsx(Le,{requestId:m,placeId:o,onClose:L})]}),x&&t.jsx(re,{title:e("uiStudio.history.confirm.clearRequestsTitle","변경 이력 삭제"),message:e("uiStudio.history.confirm.clearRequestsMessage","현재 place의 변경 이력을 삭제합니다. Studio 인스턴스에는 영향을 주지 않습니다."),danger:!0,cascadeOption:{label:e("uiStudio.history.confirm.cascadeOption","연결된 화면 캡처도 함께 삭제"),checked:j,onChange:b},confirmLabel:e("common.delete","삭제"),onConfirm:h,onClose:()=>v(!1)})]})}function _o({tier:e}){return e==="basic"?t.jsx(uo,{}):t.jsx(po,{})}const mo=["analysis","history"];function wo(){const{t:e}=I(),{trackEvent:i}=q(),{tier:s,loading:o}=Ue(),[l,a]=Oe(),n=l.get("tab"),u=n&&mo.includes(n)?n:"analysis",d=m=>{i("dashboard_click_event",{click_target:m==="analysis"?"ui_studio_tab_analysis":"ui_studio_tab_history",page:"ui-studio",tab:m==="analysis"?"ui_studio_analysis":"ui_studio_history"}),a(p=>{const x=new URLSearchParams(p);return x.set("tab",m),x})},g=[{key:"analysis",label:t.jsx(y,{text:e("uiStudio.tabs.analysis.tooltip","Browse AI-captured UI screens and quickly find which UIs need improvement."),children:e("uiStudio.tabs.analysis","Analysis")})},{key:"history",label:t.jsx(y,{text:e("uiStudio.tabs.history.tooltip","Every UI change AI made, in order. Compare before and after screens."),children:e("uiStudio.tabs.history","History")})}];return t.jsxs("div",{className:r.page,children:[t.jsx(Je,{title:e("page.uiStudio.title","UI Studio"),description:e("page.uiStudio.description","Review UI captures, improvement suggestions, and before/after change history."),helpTopicId:"uiStudio",helpState:{tier:s}}),!o&&s==="pro"&&t.jsx(Xe,{surface:"uiStudio"}),t.jsx(Qe,{items:g,value:u,onChange:d}),o?t.jsx("div",{className:r.emptyState,children:e("uiStudio.loading","Loading...")}):u==="analysis"?t.jsx(ga,{tier:s}):t.jsx(_o,{tier:s})]})}export{wo as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as D,r as n,z as P,D as I,B as k,C as A,G,a as b}from"./index-BZHTEq5I.js";const F="_page_16202_2",E="_card_16202_10",M="_licenseCardTarget_16202_26",N="_licenseCardPro_16202_31",U="_dashboardCard_16202_41",W="_dashboardCardTarget_16202_45",x="_dashboardSettingRow_16202_49",O="_dashboardSettingCopy_16202_56",K="_dashboardSettingLabel_16202_62",Q="_dashboardSettingDescription_16202_70",$="_dashboardSettingMeta_16202_71",q="_dashboardSaveFeedback_16202_72",z="_dashboardToggleTarget_16202_86",V="_dashboardDetails_16202_92",J="_dashboardDetailRow_16202_100",X="_dashboardSettingsFilePath_16202_119",Y="_dashboardAgentPrompt_16202_120",Z="_dashboardSaveFeedbackError_16202_145",tt="_cardHeader_16202_150",et="_cardHeaderActions_16202_163",ot="_cardHeaderTitleGroup_16202_169",at="_cardHelpButton_16202_176",nt="_validationCard_16202_208",st="_validationSettingRow_16202_212",rt="_validationSettingCopy_16202_219",it="_validationSettingLabel_16202_225",ct="_validationSettingStatus_16202_233",_t="_validationPolicyControl_16202_240",dt="_validationToggleTarget_16202_248",gt="_touchTarget44_16202_254",lt="_collapseButton_16202_259",ut="_headerBadge_16202_286",ht="_headerBadgeLive_16202_300",pt="_licenseGrid_16202_306",Ct="_statusDot_16202_324",bt="_statusActive_16202_333",yt="_statusGrace_16202_338",St="_statusInactive_16202_343",jt="_statusError_16202_347",mt="_proBadge_16202_352",Lt="_upgradeLink_16202_366",ft="_licenseControls_16202_380",vt="_licenseControlRow_16202_389",Ht="_licenseField_16202_396",Rt="_licenseFieldGrow_16202_402",wt="_controlLabel_16202_407",Tt="_textInput_16202_413",Bt="_actionBtn_16202_433",Dt="_licenseMessage_16202_460",Pt="_licenseNotice_16202_467",It="_licenseNoticeInfo_16202_477",kt="_licenseNoticeWarning_16202_483",At="_licenseNoticeMuted_16202_489",Gt="_controlGrid_16202_494",Ft="_controlHint_16202_516",Et="_routingOverview_16202_524",Mt="_routingOverviewCopy_16202_536",Nt="_routingEyebrow_16202_543",Ut="_priorityTargetSummary_16202_568",Wt="_routingFeedback_16202_596",xt="_tableWrap_16202_601",Ot="_table_16202_601",Kt="_routingTargetsTable_16202_612",Qt="_routingActionColumn_16202_617",$t="_routingActionSlot_16202_621",qt="_studioRoutingChoiceControl_16202_643",zt="_segment_16202_652",Vt="_segmentActive_16202_653",Jt="_segmentCopy_16202_674",Xt="_segmentLabel_16202_680",Yt="_segmentDescription_16202_687",Zt="_segmentIndicator_16202_694",te="_routingDisabledReason_16202_733",ee="_routingWarning_16202_741",oe="_monoMuted_16202_749",ae="_copyIconButton_16202_753",ne="_routingBadge_16202_778",se="_routingTargetRadio_16202_792",re="_routingTargetRadioActive_16202_813",ie="_routingRadioIndicator_16202_829",ce="_emptyRow_16202_845",_e="_settingRow_16202_898",de="_settingLabel_16202_912",ge="_settingControl_16202_919",le="_select_16202_928",ue="_numberInput_16202_950",he="_toggleSwitch_16202_972",pe="_toggleInput_16202_979",Ce="_toggleTrack_16202_987",be="_toggleThumb_16202_1009",ye="_savedIndicator_16202_1058",Se="_savedIndicatorHidden_16202_1070",je="_savedIndicatorFailed_16202_1074",me="_dataHistoryIntro_16202_1079",Le="_dataHistoryList_16202_1087",fe="_dataHistoryRow_16202_1093",ve="_dataHistoryDetail_16202_1102",He="_dataHistoryRowExpanded_16202_1113",Re="_projectChangesDataHistoryDetail_16202_1120",we="_uiStudioDataHistoryDetail_16202_1124",Te="_dataHistoryMain_16202_1128",Be="_dataHistoryTitle_16202_1132",De="_dataHistoryDescription_16202_1138",Pe="_dataHistoryMetric_16202_1146",Ie="_dataHistoryActions_16202_1153",ke="_linkButton_16202_1159",Ae="_manageStorageButton_16202_1160",Ge="_dangerButton_16202_1161",Fe="_inlineStatus_16202_1228",Ee="_projectChangesPanel_16202_1236",Me="_projectChangesConsoleGrid_16202_1247",Ne="_projectChangesUsageColumn_16202_1254",Ue="_projectChangesPolicyColumn_16202_1255",We="_projectChangesPanelTitle_16202_1266",xe="_projectChangesScope_16202_1273",Oe="_projectChangesUsageBlock_16202_1279",Ke="_projectChangesUsageSummary_16202_1285",Qe="_projectChangesQuotaRail_16202_1294",$e="_projectChangesSessionRail_16202_1303",qe="_projectChangesContextRail_16202_1304",ze="_projectChangesUsageLegend_16202_1319",Ve="_projectChangesPolicyFieldset_16202_1335",Je="_projectChangesPolicyLegend_16202_1349",Xe="_projectChangesPresetGroup_16202_1358",Ye="_projectChangesPresetButton_16202_1364",Ze="_projectChangesPresetButtonActive_16202_1391",to="_projectChangesActions_16202_1398",eo="_projectChangesSaveButton_16202_1405",oo="_projectChangesSecondaryButton_16202_1406",ao="_projectChangesSaved_16202_1463",no="_projectChangesWarning_16202_1469",so="_projectChangesError_16202_1470",ro="_projectChangesEmpty_16202_1471",io="_projectChangesLastRun_16202_1491",co="_projectChangesLastRunLabel_16202_1502",_o="_coldGrid_16202_1508",go="_coldHint_16202_1526",lo="_langRow_16202_1535",uo="_loading_16202_1548",ho="_unit_16202_1557",Co={page:F,card:E,licenseCardTarget:M,licenseCardPro:N,dashboardCard:U,dashboardCardTarget:W,dashboardSettingRow:x,dashboardSettingCopy:O,dashboardSettingLabel:K,dashboardSettingDescription:Q,dashboardSettingMeta:$,dashboardSaveFeedback:q,dashboardToggleTarget:z,dashboardDetails:V,dashboardDetailRow:J,dashboardSettingsFilePath:X,dashboardAgentPrompt:Y,dashboardSaveFeedbackError:Z,cardHeader:tt,cardHeaderActions:et,cardHeaderTitleGroup:ot,cardHelpButton:at,validationCard:nt,validationSettingRow:st,validationSettingCopy:rt,validationSettingLabel:it,validationSettingStatus:ct,validationPolicyControl:_t,validationToggleTarget:dt,touchTarget44:gt,collapseButton:lt,headerBadge:ut,headerBadgeLive:ht,licenseGrid:pt,statusDot:Ct,statusActive:bt,statusGrace:yt,statusInactive:St,statusError:jt,proBadge:mt,upgradeLink:Lt,licenseControls:ft,licenseControlRow:vt,licenseField:Ht,licenseFieldGrow:Rt,controlLabel:wt,textInput:Tt,actionBtn:Bt,licenseMessage:Dt,licenseNotice:Pt,licenseNoticeInfo:It,licenseNoticeWarning:kt,licenseNoticeMuted:At,controlGrid:Gt,controlHint:Ft,routingOverview:Et,routingOverviewCopy:Mt,routingEyebrow:Nt,priorityTargetSummary:Ut,routingFeedback:Wt,tableWrap:xt,table:Ot,routingTargetsTable:Kt,routingActionColumn:Qt,routingActionSlot:$t,studioRoutingChoiceControl:qt,segment:zt,segmentActive:Vt,segmentCopy:Jt,segmentLabel:Xt,segmentDescription:Yt,segmentIndicator:Zt,routingDisabledReason:te,routingWarning:ee,monoMuted:oe,copyIconButton:ae,routingBadge:ne,routingTargetRadio:se,routingTargetRadioActive:re,routingRadioIndicator:ie,emptyRow:ce,settingRow:_e,settingLabel:de,settingControl:ge,select:le,numberInput:ue,toggleSwitch:he,toggleInput:pe,toggleTrack:Ce,toggleThumb:be,savedIndicator:ye,savedIndicatorHidden:Se,savedIndicatorFailed:je,dataHistoryIntro:me,dataHistoryList:Le,dataHistoryRow:fe,dataHistoryDetail:ve,dataHistoryRowExpanded:He,projectChangesDataHistoryDetail:Re,uiStudioDataHistoryDetail:we,dataHistoryMain:Te,dataHistoryTitle:Be,dataHistoryDescription:De,dataHistoryMetric:Pe,dataHistoryActions:Ie,linkButton:ke,manageStorageButton:Ae,dangerButton:Ge,inlineStatus:Fe,projectChangesPanel:Ee,projectChangesConsoleGrid:Me,projectChangesUsageColumn:Ne,projectChangesPolicyColumn:Ue,projectChangesPanelTitle:We,projectChangesScope:xe,projectChangesUsageBlock:Oe,projectChangesUsageSummary:Ke,projectChangesQuotaRail:Qe,projectChangesSessionRail:$e,projectChangesContextRail:qe,projectChangesUsageLegend:ze,projectChangesPolicyFieldset:Ve,projectChangesPolicyLegend:Je,projectChangesPresetGroup:Xe,projectChangesPresetButton:Ye,projectChangesPresetButtonActive:Ze,projectChangesActions:to,projectChangesSaveButton:eo,projectChangesSecondaryButton:oo,projectChangesSaved:ao,projectChangesWarning:no,projectChangesError:so,projectChangesEmpty:ro,projectChangesLastRun:io,projectChangesLastRunLabel:co,coldGrid:_o,coldHint:go,langRow:lo,loading:uo,unit:ho};function bo(){const{level:y}=D(),[r,c]=n.useState(null),[S,C]=n.useState(null),[j,l]=n.useState(!1),[m,L]=n.useState(!0),[f,_]=n.useState(!1),[v,g]=n.useState(null),i=y==="disconnected",s=n.useCallback(t=>{t&&C(e=>({...e,...t,maskedKey:t.maskedKey??(e==null?void 0:e.maskedKey),provider:t.provider??(e==null?void 0:e.provider)??"auto"}))},[]),u=n.useCallback(t=>{if(!t){C(null);return}C({...t,provider:t.provider??"auto"})},[]),h=n.useCallback(async()=>{try{return await P()}catch{return null}},[]);n.useEffect(()=>{let t=!1;async function e(){try{const[o,a]=await Promise.all([b.get("/api/dashboard/settings").catch(()=>null),h()]);if(t)return;o&&c(o),a&&s(a)}catch{}finally{t||L(!1)}}return e(),()=>{t=!0}},[h,s]),n.useEffect(()=>{const t=new I;t.connect();const e=t.on("license",o=>{h().then(a=>{if(a){if((o==null?void 0:o.cleared)===!0){u(a);return}s(a)}})});return()=>{e(),t.disconnect()}},[h,s,u]);const d=n.useCallback((t,e)=>{g(t??e)},[]),H=n.useCallback(async t=>{if(i)return!1;if(!t.trim())return g("License key is required."),!1;_(!0);try{const e=await k({licenseKey:t.trim()});return s(e.license),d(e.message,e.ok?"License updated.":"License activation failed."),e.ok}catch{return g("License activation failed."),!1}finally{_(!1)}},[d,i,s]),R=n.useCallback(async()=>{if(!i){_(!0);try{const t=await A();s(t.license),d(t.message,t.ok?"License updated.":"License refresh failed.")}catch{g("License refresh failed.")}finally{_(!1)}}},[d,i,s]),w=n.useCallback(async()=>{if(!i){_(!0);try{const t=await G();u(t.license),d(t.message,t.ok?"License reset.":"License reset failed.")}catch{g("License reset failed.")}finally{_(!1)}}},[d,i,u]),T=n.useCallback(async(t,e)=>{if(!r)return;const o=r.hot[t];c(a=>a&&{...a,hot:{...a.hot,[t]:e}}),l(!0);try{await b.patch("/api/dashboard/settings",{[t]:e})}catch(a){throw c(p=>p&&{...p,hot:{...p.hot,[t]:o}}),a}finally{l(!1)}},[r]),B=n.useCallback(async t=>{if(!r)return;const e=r.dashboard;c(o=>o&&{...o,dashboard:{...o.dashboard,...t}}),l(!0);try{const o=await b.patch("/api/dashboard/preferences",t);c(o)}catch(o){throw c(a=>a&&{...a,dashboard:e}),o}finally{l(!1)}},[r]);return{settings:r,license:S,saving:j,licenseControlsDisabled:i,licenseSubmitting:f,licenseMessage:v,activateLicense:H,refreshLicense:R,resetLicense:w,updateHotSetting:T,updateDashboardPreferences:B,loading:m}}export{Co as s,bo as u};
|