@weppy/roblox-mcp 2.7.10 → 2.7.12

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +3 -3
  3. package/dashboard/dist/assets/{ChangelogDetailPage-B7ugySeq.js → ChangelogDetailPage-DvPPM9T3.js} +1 -1
  4. package/dashboard/dist/assets/ChangelogPage-Bcs7jwin.js +1 -0
  5. package/dashboard/dist/assets/ChangelogPage-DsP0fTsc.css +1 -0
  6. package/dashboard/dist/assets/{ConfirmModal-Dg8_uxRE.js → ConfirmModal-DuQQ9DXj.js} +1 -1
  7. package/dashboard/dist/assets/{ConnectionPage-COgl_4EK.js → ConnectionPage-Cn93dfbJ.js} +1 -1
  8. package/dashboard/dist/assets/{GameChangeDetail-D31gfmkK.js → GameChangeDetail-oLGK_BBE.js} +1 -1
  9. package/dashboard/dist/assets/{InfoLabel-Bp3j_i44.js → InfoLabel-BcS5cIV_.js} +1 -1
  10. package/dashboard/dist/assets/{OverviewPage-Bl67HNuU.js → OverviewPage-E8WwwGNq.js} +1 -1
  11. package/dashboard/dist/assets/PlaytestPage-BWsipUQn.js +11 -0
  12. package/dashboard/dist/assets/SettingsPage-DwbN1aSf.js +1 -0
  13. package/dashboard/dist/assets/{StatusBadge-4qs9buFz.js → StatusBadge-BSLWjWJC.js} +1 -1
  14. package/dashboard/dist/assets/SyncPage-COxqxAjv.css +1 -0
  15. package/dashboard/dist/assets/SyncPage-x5VxuyyM.js +4 -0
  16. package/dashboard/dist/assets/{Tabs-BCiSXsKz.js → Tabs-CQJ_0DaJ.js} +1 -1
  17. package/dashboard/dist/assets/{ToolsPage-BHGtm0IX.js → ToolsPage-BhDP0i6y.js} +1 -1
  18. package/dashboard/dist/assets/TooltipText-baLGgLqW.js +1 -0
  19. package/dashboard/dist/assets/UiStudioPage-CFrAh41s.js +16 -0
  20. package/dashboard/dist/assets/WhatsNewPage-D6bLZq0v.js +1 -0
  21. package/dashboard/dist/assets/index-CZ4Jn6CC.css +1 -0
  22. package/dashboard/dist/assets/index-IFwX560t.js +449 -0
  23. package/dashboard/dist/assets/{sample-requests-BSEgt_Th.js → sample-requests-DeMovtVY.js} +1 -1
  24. package/dashboard/dist/assets/{useLiveUptime-gW3LP94r.js → useLiveUptime-BVeJvePr.js} +1 -1
  25. package/dashboard/dist/index.html +2 -2
  26. package/dist/index.js +71 -71
  27. package/package.json +1 -1
  28. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  29. package/dashboard/dist/assets/ChangelogPage-B7-iV5Ir.js +0 -1
  30. package/dashboard/dist/assets/ChangelogPage-CNxAGfwG.css +0 -1
  31. package/dashboard/dist/assets/PlaytestPage-D-gmWEk9.js +0 -11
  32. package/dashboard/dist/assets/SettingsPage-BdUpzUq9.js +0 -1
  33. package/dashboard/dist/assets/SyncPage-BaOvmPdn.js +0 -4
  34. package/dashboard/dist/assets/SyncPage-Dm7Ni3j_.css +0 -1
  35. package/dashboard/dist/assets/TierComparison-DGh9vLz0.css +0 -1
  36. package/dashboard/dist/assets/TierComparison-Lkag7n54.js +0 -1
  37. package/dashboard/dist/assets/TooltipText-Bgk-NYKr.js +0 -1
  38. package/dashboard/dist/assets/UiStudioPage-CvpsOKcP.js +0 -16
  39. package/dashboard/dist/assets/WhatsNewPage-g_24s3hx.js +0 -1
  40. package/dashboard/dist/assets/index-C9gmLH8z.js +0 -401
  41. package/dashboard/dist/assets/index-CX4MHzNt.css +0 -1
@@ -0,0 +1,4 @@
1
+ import{r as c,a as P,D as R,i as L,n as S,o as k,j as e,u as $,d as E,l as A,m as D,p as O,T as B}from"./index-IFwX560t.js";import{I as u}from"./InfoLabel-BcS5cIV_.js";import{T as b}from"./TooltipText-baLGgLqW.js";import{C as H}from"./ConfirmModal-DuQQ9DXj.js";import{S as M}from"./StatusBadge-BSLWjWJC.js";const F=5e3;function U(){const[t,i]=c.useState(null),[h,d]=c.useState([]),[p,o]=c.useState(!0),[y,w]=c.useState(null),m=c.useRef(null),g=c.useRef(null),l=c.useCallback(async()=>{var r;try{const[T,a]=await Promise.all([P.get("/sync/status"),P.get("/api/dashboard/place-summary")]);i(T);const x=(r=a.places)==null?void 0:r.find(I=>I.isActive);w((x==null?void 0:x.placeDirName)??null)}catch{}},[]),f=c.useCallback(async()=>{try{const r=await P.get("/sync/history",{limit:"30"});d(r.entries??[])}catch{d([])}},[]),j=c.useCallback(async()=>{await Promise.all([l(),f()]),o(!1)},[l,f]),n=c.useCallback(()=>{j()},[j]),N=c.useCallback(async()=>{await P.post("/api/dashboard/sync/history/clear"),d([]),l()},[l]);return c.useEffect(()=>(j(),g.current=setInterval(j,F),()=>{g.current&&clearInterval(g.current)}),[j]),c.useEffect(()=>{const r=new R;m.current=r,r.connect();const T=r.on("sync",()=>{l(),f()});return()=>{T(),r.disconnect(),m.current=null}},[l,f]),{status:t,history:h,loading:p,activePlaceDirName:y,refresh:n,clearHistory:N}}const W="_actions_1j3p3_60",q="_btn_1j3p3_68",G="_btnPrimary_1j3p3_99",z="_panel_1j3p3_109",V="_panelIcon_1j3p3_116",Y="_panelTitle_1j3p3_122",J="_panelDesc_1j3p3_131",Q="_benefitList_1j3p3_139",X="_benefitItem_1j3p3_148",_={actions:W,btn:q,btnPrimary:G,panel:z,panelIcon:V,panelTitle:Y,panelDesc:J,benefitList:Q,benefitItem:X};function Z({icon:t,title:i,description:h,benefits:d,upgradeLabel:p,upgradeHref:o}){const{trackEvent:y}=L(),{pathname:w,search:m}=S(),g=k(w,m);return e.jsxs("div",{className:_.panel,children:[t&&e.jsx("div",{className:_.panelIcon,children:t}),e.jsx("div",{className:_.panelTitle,children:i}),e.jsx("div",{className:_.panelDesc,children:h}),e.jsx("ul",{className:_.benefitList,children:d.map(l=>e.jsx("li",{className:_.benefitItem,children:l},l))}),e.jsx("div",{className:_.actions,children:e.jsx("a",{className:`${_.btn} ${_.btnPrimary}`,href:o,target:"_blank",rel:"noreferrer",onClick:()=>y("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...g}),children:p})})]})}const K="_page_siyu4_2",ee="_card_siyu4_10",te="_cardHeader_siyu4_17",se="_clearButton_siyu4_29",ne="_statusRow_siyu4_39",ie="_metaItem_siyu4_46",ae="_statusGrid_siyu4_52",ce="_table_siyu4_71",oe="_directionRail_siyu4_99",le="_endpointLabel_siyu4_105",re="_optionRail_siyu4_109",de="_directionOption_siyu4_115",pe="_directionOptionActive_siyu4_129",ye="_directionOptionInactive_siyu4_133",ue="_direction_forward_siyu4_139",_e="_direction_bidirectional_siyu4_143",he="_direction_reverse_siyu4_147",me="_lockBadge_siyu4_152",ge="_proBadge_siyu4_160",fe="_forwardBadge_siyu4_174",xe="_logContainer_siyu4_187",be="_logEntry_siyu4_194",je="_logTime_siyu4_206",ve="_logType_siyu4_212",we="_logTypeWrite_siyu4_221",Te="_logTypeUpdate_siyu4_225",Ne="_logTypeDelete_siyu4_229",Ie="_logTypeIdle_siyu4_233",Pe="_logPath_siyu4_237",Ce="_logEmpty_siyu4_244",Le="_overlay_siyu4_251",Re="_overlayTitle_siyu4_261",Se="_overlayMessage_siyu4_268",ke="_checklist_siyu4_274",$e="_checkItem_siyu4_284",Ee="_upgradePanel_siyu4_300",Ae="_upgradePanelHeader_siyu4_307",De="_benefitList_siyu4_315",Oe="_benefitItem_siyu4_324",Be="_upgradeActions_siyu4_339",He="_btn_siyu4_344",Me="_btnPrimary_siyu4_361",Fe="_disabled_siyu4_372",s={page:K,card:ee,cardHeader:te,clearButton:se,statusRow:ne,metaItem:ie,statusGrid:ae,table:ce,directionRail:oe,endpointLabel:le,optionRail:re,directionOption:de,directionOptionActive:pe,directionOptionInactive:ye,direction_forward:ue,direction_bidirectional:_e,direction_reverse:he,lockBadge:me,proBadge:ge,forwardBadge:fe,logContainer:xe,logEntry:be,logTime:je,logType:ve,logTypeWrite:we,logTypeUpdate:Te,logTypeDelete:Ne,logTypeIdle:Ie,logPath:Pe,logEmpty:Ce,overlay:Le,overlayTitle:Re,overlayMessage:Se,checklist:ke,checkItem:$e,upgradePanel:Ee,upgradePanelHeader:Ae,benefitList:De,benefitItem:Oe,upgradeActions:Be,btn:He,btnPrimary:Me,disabled:Fe},Ue=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function We(t){const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function qe(t){switch(t){case"write":return s.logTypeWrite;case"update":return s.logTypeUpdate;case"delete":return s.logTypeDelete;default:return s.logTypeIdle}}function Ge(t){switch(t){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function ze(t,i,h,d){const p=t(`sync.directions.cat.${i}`,i.charAt(0).toUpperCase()+i.slice(1)),o=t("sync.directions.endpoint.local","Local"),y=t("sync.directions.endpoint.studio","Studio");switch(h){case"forward":return[`${p}: ${o} <- ${y}`,t("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
2
+ `);case"bidirectional":return[`${p}: ${o} <-> ${y}`,t("sync.directions.tooltip.bidirectional.body","Two-way sync between Local and Studio"),d?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
3
+ `);case"reverse":return[`${p}: ${o} -> ${y}`,t("sync.directions.tooltip.reverse.body","Push local file changes to Studio"),d?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
4
+ `);default:return p}}const Ve=["scripts","values","containers","data","services"];function Ye(t,i){return i==="manual"?t("sync.directions.mode.manual","Manual"):i==="auto"?t("sync.directions.mode.auto","Auto"):"-"}function Je(t,i){return i==="manual"?t("sync.directions.mode.manual.tooltip","Applies sync changes only when you trigger them manually."):i==="auto"?t("sync.directions.mode.auto.tooltip","Applies sync changes automatically when updates arrive."):""}function Qe(t,i){switch(i){case"write":return t("sync.log.type.write","WRITE");case"update":return t("sync.log.type.update","UPDATE");case"delete":return t("sync.log.type.delete","DELETE");default:return t("sync.log.type.idle","IDLE")}}function Xe(t,i){switch(i){case"write":return t("sync.log.type.write.tooltip","A new sync output was written to disk.");case"update":return t("sync.log.type.update.tooltip","An existing synced file or instance was updated.");case"delete":return t("sync.log.type.delete.tooltip","A synced file or instance was removed.");default:return t("sync.log.type.idle.tooltip","A sync event was recorded without a file mutation.")}}function nt(){const{t}=$(),{trackEvent:i}=L(),{level:h}=E(),{tier:d,loading:p}=A(),o=U(),{show:y}=D(),[w,m]=c.useState(!1),[g,l]=c.useState(!1),f=!p&&d==="basic";if(h==="disconnected"||h==="serverOnly")return e.jsx("div",{className:s.page,children:e.jsx("div",{className:s.card,children:e.jsxs("div",{className:s.overlay,children:[e.jsx("div",{className:s.overlayTitle,children:t("sync.overlay.title","Roblox Studio plugin required")}),e.jsx("div",{className:s.overlayMessage,children:t("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),e.jsxs("ul",{className:s.checklist,children:[e.jsx("li",{className:s.checkItem,children:t("sync.overlay.check1","Is Roblox Studio running?")}),e.jsx("li",{className:s.checkItem,children:t("sync.overlay.check2","Is the WEPPY Plugin installed?")})]})]})})});const n=o.status,N=o.history,r=Ge(n==null?void 0:n.state),T=async()=>{l(!0);try{await o.clearHistory(),y(t("toast.clearSuccess","Cleared successfully"),"success"),m(!1)}catch{y(t("toast.clearFailed","Failed to clear data"),"error")}finally{l(!1)}};return e.jsxs("div",{className:s.page,children:[e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(b,{text:t("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:t("sync.status.title","Sync Status")}),f&&e.jsx(b,{text:t("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:e.jsx("span",{className:s.forwardBadge,children:t("sync.status.forwardOnly","Forward Only")})})]}),e.jsxs("div",{className:s.statusRow,children:[e.jsx(M,{status:r}),(n==null?void 0:n.placeName)&&e.jsxs("span",{className:s.metaItem,children:[e.jsx(u,{label:t("sync.status.place","Place"),tooltip:t("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",n.placeName,n.placeId?` (${n.placeId})`:""]})]}),e.jsxs("dl",{className:s.statusGrid,children:[(n==null?void 0:n.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(u,{label:t("sync.status.path","Path"),tooltip:t("sync.status.path.tooltip","Local filesystem root currently used for sync output.")})}),e.jsx("dd",{children:n.syncRoot})]}),o.activePlaceDirName&&(n==null?void 0:n.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(u,{label:t("sync.status.placePath","Place Path"),tooltip:t("sync.status.placePath.tooltip","Active place directory where explorer files are synced.")})}),e.jsx("dd",{children:`${n.syncRoot}/${o.activePlaceDirName}/explorer`})]}),(n==null?void 0:n.instanceCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(u,{label:t("sync.status.instances","Instances"),tooltip:t("sync.status.instances.tooltip","Total synced Roblox instances tracked in the local mirror.")})}),e.jsx("dd",{children:n.instanceCount})]}),(n==null?void 0:n.scriptCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(u,{label:t("sync.status.scripts","Scripts"),tooltip:t("sync.status.scripts.tooltip","Total synced script files currently indexed for this place.")})}),e.jsx("dd",{children:n.scriptCount})]}),(n==null?void 0:n.state)==="syncing"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(u,{label:t("sync.status.state","State"),tooltip:t("sync.status.state.tooltip","Current runtime sync state reported by the server.")})}),e.jsx("dd",{children:t("status.syncing","Syncing")})]})]})]}),(n==null?void 0:n.directions)&&e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:e.jsx(b,{text:t("sync.directions.title.tooltip","Per-category sync direction and apply behavior between Local and Studio."),children:t("sync.directions.title","Sync Directions")})}),e.jsxs("table",{className:s.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx(u,{label:t("sync.directions.type","Type"),tooltip:t("sync.directions.type.tooltip","Sync category affected by this rule.")})}),e.jsx("th",{children:e.jsx(u,{label:t("sync.directions.direction","Direction"),tooltip:t("sync.directions.direction.tooltip","Whether each category syncs from Studio, to Studio, or both ways.")})}),e.jsx("th",{children:e.jsx(u,{label:t("sync.directions.applyMode","Apply Mode"),tooltip:t("sync.directions.applyMode.tooltip","How incoming sync changes are applied for this category.")})})]})}),e.jsx("tbody",{children:Ve.map(a=>{var C;const x=n.directions[a],I=(C=n.applyModes)==null?void 0:C[a];return e.jsxs("tr",{children:[e.jsx("td",{children:t(`sync.directions.cat.${a}`,a.charAt(0).toUpperCase()+a.slice(1))}),e.jsx("td",{children:e.jsxs("div",{className:s.directionRail,"aria-label":`${a}-direction-rail`,children:[e.jsx(b,{text:t("sync.directions.endpoint.local.tooltip","Local files on disk are always shown on the left side of the direction rail."),children:e.jsx("span",{className:s.endpointLabel,children:t("sync.directions.endpoint.local","Local")})}),e.jsx("span",{className:s.optionRail,children:Ue.map(v=>e.jsx(O,{text:ze(t,a,v.key,f),children:e.jsx("span",{className:`${s.directionOption} ${x===v.key?s.directionOptionActive:s.directionOptionInactive} ${s[`direction_${v.key}`]??""}`,"data-active":x===v.key?"true":"false",children:v.symbol})},v.key))}),e.jsx(b,{text:t("sync.directions.endpoint.studio.tooltip","Roblox Studio is always shown on the right side of the direction rail."),children:e.jsx("span",{className:s.endpointLabel,children:t("sync.directions.endpoint.studio","Studio")})})]})}),e.jsx("td",{children:e.jsx(b,{text:Je(t,I),children:Ye(t,I)})})]},a)})})]})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx("span",{children:t("sync.log.title","Sync Log")}),e.jsx("button",{className:s.clearButton,onClick:()=>{i("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),m(!0)},children:t("common.clear","Clear")})]}),e.jsx("div",{className:s.logContainer,children:N.length===0?e.jsx("div",{className:s.logEmpty,children:t("sync.log.empty","No sync events yet")}):N.map((a,x)=>e.jsxs("div",{className:s.logEntry,children:[e.jsx("span",{className:s.logTime,children:We(a.timestamp)}),e.jsx(b,{text:Xe(t,a.type),children:e.jsx("span",{className:`${s.logType} ${qe(a.type)}`,children:Qe(t,a.type)})}),e.jsxs("span",{className:s.logPath,children:[a.path,a.details?` — ${a.details}`:""]})]},x))})]}),f&&e.jsx(Z,{title:t("sync.upgrade.title","Explore Full Sync with Pro"),description:t("tier.banner.save","Save AI tokens with Pro!"),benefits:[t("sync.upgrade.benefit1","Bidirectional sync — edit files, auto-apply to Studio"),t("sync.upgrade.benefit2","Reverse sync — push file changes back to Studio"),t("sync.upgrade.benefit3","Full sync history and detailed change log")],upgradeLabel:t("sync.upgrade.buy","View Pro"),upgradeHref:B.sync}),e.jsx(H,{open:w,title:t("sync.clear.title","Clear sync log?"),message:t("sync.clear.message","This permanently removes the stored sync log for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:g,onCancel:()=>!g&&m(!1),onConfirm:T})]})}export{nt as Component};
@@ -1 +1 @@
1
- import{j as s}from"./index-C9gmLH8z.js";const r="_tabBar_1o4kh_2",_="_tabs_1o4kh_9",d="_actions_1o4kh_14",k="_tab_1o4kh_2",h="_tabActive_1o4kh_39",a={tabBar:r,tabs:_,actions:d,tab:k,tabActive:h};function v({items:n,value:c,onChange:l,ariaLabel:b,className:i,rightActions:e}){return s.jsxs("div",{className:[a.tabBar,i].filter(Boolean).join(" "),role:"tablist","aria-label":b,children:[s.jsx("div",{className:a.tabs,children:n.map(t=>{const o=t.key===c;return s.jsx("button",{type:"button",role:"tab","aria-selected":o,"data-testid":t.testId,className:[a.tab,o?a.tabActive:""].filter(Boolean).join(" "),onClick:()=>l(t.key),children:t.label},t.key)})}),e?s.jsx("div",{className:a.actions,children:e}):null]})}export{v as T};
1
+ import{j as s}from"./index-IFwX560t.js";const r="_tabBar_1o4kh_2",_="_tabs_1o4kh_9",d="_actions_1o4kh_14",k="_tab_1o4kh_2",h="_tabActive_1o4kh_39",a={tabBar:r,tabs:_,actions:d,tab:k,tabActive:h};function v({items:n,value:c,onChange:l,ariaLabel:b,className:i,rightActions:e}){return s.jsxs("div",{className:[a.tabBar,i].filter(Boolean).join(" "),role:"tablist","aria-label":b,children:[s.jsx("div",{className:a.tabs,children:n.map(t=>{const o=t.key===c;return s.jsx("button",{type:"button",role:"tab","aria-selected":o,"data-testid":t.testId,className:[a.tab,o?a.tabActive:""].filter(Boolean).join(" "),onClick:()=>l(t.key),children:t.label},t.key)})}),e?s.jsx("div",{className:a.actions,children:e}):null]})}export{v as T};
@@ -1 +1 @@
1
- import{j as e,r as n,a as D,D as ot,u as lt,i as rt,m as it}from"./index-C9gmLH8z.js";import{T as M}from"./TooltipText-Bgk-NYKr.js";import{C as nt}from"./ConfirmModal-Dg8_uxRE.js";import{T as ct}from"./Tabs-BCiSXsKz.js";const dt="_wrapper_hzgda_2",ut="_table_hzgda_7",pt="_sortable_hzgda_32",xt="_sortArrow_hzgda_41",ht="_clickable_hzgda_52",mt="_empty_hzgda_57",bt="_expandedRow_hzgda_65",_t="_expandedCell_hzgda_74",T={wrapper:dt,table:ut,sortable:pt,sortArrow:xt,clickable:ht,empty:mt,expandedRow:bt,expandedCell:_t};function ft({columns:s,data:l,sortBy:_,sortDir:r="asc",onSort:v,onRowClick:y,rowKey:B,emptyMessage:E,expandedKey:L,renderExpandedRow:w}){return e.jsx("div",{className:T.wrapper,children:e.jsxs("table",{className:T.table,children:[e.jsx("thead",{children:e.jsx("tr",{children:s.map(u=>e.jsxs("th",{style:u.width?{width:u.width}:void 0,className:u.sortable?T.sortable:void 0,onClick:u.sortable&&v?()=>v(u.key):void 0,children:[e.jsx("span",{children:u.label}),u.sortable&&_===u.key&&e.jsx("span",{className:T.sortArrow,children:r==="asc"?"▴":"▾"})]},u.key))})}),e.jsx("tbody",{children:l.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:T.empty,children:E||"No data"})}):l.map((u,f)=>{const x=B?B(u):String(f),h=L!=null&&x===L&&w?w(u):null;return e.jsxs(n.Fragment,{children:[e.jsx("tr",{className:y?T.clickable:void 0,onClick:y?()=>y(u):void 0,children:s.map(g=>e.jsx("td",{children:g.render?g.render(u):String(u[g.key]??"")},g.key))}),h&&e.jsx("tr",{className:T.expandedRow,children:e.jsx("td",{colSpan:s.length,className:T.expandedCell,children:h})})]},x)})})]})})}function gt(s){return{...s,sequenceNumber:typeof s.sequenceNumber=="number"?s.sequenceNumber:void 0,executionTimeMs:typeof s.executionTimeMs=="number"?s.executionTimeMs:void 0}}const Ct=50;function yt(){const[s,l]=n.useState(null),[_,r]=n.useState(!0),[v,y]=n.useState([]),[B,E]=n.useState(0),[L,w]=n.useState(!1),[u,f]=n.useState(!0),[x,P]=n.useState(0),[h,g]=n.useState(""),H=n.useRef(null),m=n.useCallback(async()=>{r(!0);try{const d=await D.get("/api/dashboard/tool-stats");l(d)}catch{}finally{r(!1)}},[]),C=n.useCallback(async(d,N)=>{f(!0);try{const O={limit:String(Ct),offset:String(d)};N&&(O.tool=N);const A=await D.get("/api/dashboard/history",O);y(A.entries.map(gt)),E(A.total),w(A.hasMore)}catch{y([]),E(0),w(!1)}finally{f(!1)}},[]),q=n.useCallback(()=>{m(),C(x,h)},[C,m,x,h]),z=n.useCallback(async()=>{await D.post("/api/dashboard/tools/history/clear"),C(x,h)},[C,x,h]),F=n.useCallback(async()=>{await D.post("/api/dashboard/tools/statistics/clear"),m()},[m]);return n.useEffect(()=>{m()},[m]),n.useEffect(()=>{C(x,h)},[C,x,h]),n.useEffect(()=>{const d=new ot;H.current=d,d.connect();const N=d.on("command",()=>{m(),C(x,h)});return()=>{N(),d.disconnect(),H.current=null}},[C,m,x,h]),{statistics:s,statsLoading:_,history:v,historyTotal:B,historyHasMore:L,historyLoading:u,historyOffset:x,historyToolFilter:h,setHistoryOffset:P,setHistoryToolFilter:g,refresh:q,clearHistory:z,clearStatistics:F}}const jt="_page_16x6v_2",vt="_card_16x6v_12",kt="_cardToolbar_16x6v_19",Tt="_sectionTitle_16x6v_27",wt="_dangerButton_16x6v_33",Nt="_proBadge_16x6v_52",St="_statusOk_16x6v_67",Mt="_statusFallback_16x6v_76",Bt="_statusUnsupported_16x6v_85",Et="_statusWarning_16x6v_94",Lt="_statusError_16x6v_103",At="_tierBasic_16x6v_113",Rt="_tierPro_16x6v_117",Pt="_tierMixed_16x6v_122",Ht="_filterRow_16x6v_133",Ft="_filterLabel_16x6v_140",Ot="_filterSelect_16x6v_149",It="_expandedRow_16x6v_160",$t="_expandedSection_16x6v_165",Dt="_detailList_16x6v_175",Wt="_detailItem_16x6v_181",qt="_detailLabel_16x6v_187",zt="_detailValue_16x6v_192",Ut="_pre_16x6v_197",Vt="_pagination_16x6v_214",Kt="_pageInfo_16x6v_222",Gt="_btn_16x6v_228",Jt="_tierDistribution_16x6v_251",Zt="_tierBarWrap_16x6v_255",Qt="_tierBarBasic_16x6v_263",Xt="_tierBarPro_16x6v_268",Yt="_tierLabels_16x6v_273",ts="_statsTableWrap_16x6v_282",ss="_statsTable_16x6v_282",es="_sortableHeader_16x6v_313",as="_sortArrow_16x6v_318",os="_statsToolRow_16x6v_322",ls="_statsActionRow_16x6v_330",rs="_expandButton_16x6v_334",is="_expandIcon_16x6v_346",ns="_actionLabel_16x6v_351",cs="_emptyStats_16x6v_358",ds="_summaryLine_16x6v_364",a={page:jt,card:vt,cardToolbar:kt,sectionTitle:Tt,dangerButton:wt,proBadge:Nt,statusOk:St,statusFallback:Mt,statusUnsupported:Bt,statusWarning:Et,statusError:Lt,tierBasic:At,tierPro:Rt,tierMixed:Pt,filterRow:Ht,filterLabel:Ft,filterSelect:Ot,expandedRow:It,expandedSection:$t,detailList:Dt,detailItem:Wt,detailLabel:qt,detailValue:zt,pre:Ut,pagination:Vt,pageInfo:Kt,btn:Gt,tierDistribution:Jt,tierBarWrap:Zt,tierBarBasic:Qt,tierBarPro:Xt,tierLabels:Yt,statsTableWrap:ts,statsTable:ss,sortableHeader:es,sortArrow:as,statsToolRow:os,statsActionRow:ls,expandButton:rs,expandIcon:is,actionLabel:ns,emptyStats:cs,summaryLine:ds},U=50;function us(s){const l=new Date(s);return`${String(l.getHours()).padStart(2,"0")}:${String(l.getMinutes()).padStart(2,"0")}:${String(l.getSeconds()).padStart(2,"0")}`}function W(s){return typeof s!="number"||!Number.isFinite(s)?"-":s<1e3?`${s}ms`:`${(s/1e3).toFixed(1)}s`}function R(s,l){return l==="pro"?s("tier.pro","Pro"):l==="mixed"?s("tier.mixed","Mixed"):s("tier.basic","Basic")}function Z(s,l){return l!==s&&l.startsWith(`${s}_`)?l.slice(s.length+1):""}function ps(s,l){const _=Z(s,l);return _?`${s}.${_}`:s}function J(s){return typeof s=="string"&&s.length>0?s:void 0}function xs(s){if(!Array.isArray(s))return;const l=s.filter(_=>typeof _=="string"&&_.length>0);return l.length>0?l:void 0}function hs(s){const l=s.result??{};return{requestedCommand:s.requestedCommand??J(l.requestedCommand),executedCommand:s.executedCommand??J(l.executedCommand),alternatives:s.alternatives??xs(l.alternatives)}}function ms(s,l){switch(s.status){case"fallback":return{label:l("tools.badge.fallback","FALLBACK"),tooltip:l("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:a.statusFallback};case"unsupported":return{label:l("tools.badge.unsupported","UNSUPPORTED"),tooltip:l("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:a.statusUnsupported};case"warning":return{label:l("tools.badge.warn","WARN"),tooltip:l("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:a.statusWarning};case"error":return{label:l("tools.badge.err","FAILED"),tooltip:l("tools.badge.err.tooltip","The tool run failed."),className:a.statusError};default:return{label:l("tools.status.ok","OK"),tooltip:l("tools.status.ok.tooltip","The tool run completed successfully."),className:a.statusOk}}}function j(s,l){return e.jsxs("div",{className:a.detailItem,children:[e.jsx("span",{className:a.detailLabel,children:s}),e.jsx("span",{className:a.detailValue,children:l})]})}function ys(){const{t:s}=lt(),{trackEvent:l,trackPageView:_}=rt(),r=yt(),{show:v}=it(),[y,B]=n.useState("history"),[E,L]=n.useState(null),[w,u]=n.useState(null),[f,x]=n.useState(null),[P,h]=n.useState(!1),[g,H]=n.useState("totalCalls"),[m,C]=n.useState("desc"),q=n.useCallback(t=>{H(o=>o===t?(C(i=>i==="asc"?"desc":"asc"),t):(C("desc"),t))},[]),z=n.useMemo(()=>{var o;const t=new Set;return Object.keys(((o=r.statistics)==null?void 0:o.tools)??{}).forEach(i=>t.add(i)),r.history.forEach(i=>{i.tool&&t.add(i.tool)}),r.historyToolFilter&&t.add(r.historyToolFilter),Array.from(t).sort()},[r.history,r.historyToolFilter,r.statistics]),F=n.useMemo(()=>{var t;return(t=r.statistics)!=null&&t.tools?Object.values(r.statistics.tools).map(o=>{var G;const i=Object.entries(o.commands??{}).map(([p,c])=>({toolName:o.tool,commandName:c.command??p,label:Z(o.tool,c.command??p)||(c.command??p),tier:c.tier,totalCalls:c.totalCalls,successCount:c.successCount,fallbackCount:c.fallbackCount,unsupportedCount:c.unsupportedCount,warningCount:c.warningCount??0,failureCount:c.failureCount,totalExecutionTimeMs:c.totalExecutionTimeMs,avgExecutionTimeMs:c.avgExecutionTimeMs})),b=i.reduce((p,c)=>p+c.totalCalls,0),k=i.reduce((p,c)=>p+c.successCount,0),I=i.reduce((p,c)=>p+c.fallbackCount,0),$=i.reduce((p,c)=>p+c.unsupportedCount,0),st=i.reduce((p,c)=>p+c.warningCount,0),et=i.reduce((p,c)=>p+c.failureCount,0),K=i.reduce((p,c)=>p+c.totalExecutionTimeMs,0),at=new Set(i.map(p=>p.tier)).size>1?"mixed":((G=i[0])==null?void 0:G.tier)??o.tier;return{toolName:o.tool,tier:at,commands:i,totalCalls:b,successCount:k,fallbackCount:I,unsupportedCount:$,warningCount:st,failureCount:et,totalExecutionTimeMs:K,avgExecutionTimeMs:b>0?Math.round(K/b):0}}):[]},[r.statistics]),d=n.useCallback((t,o,i,b)=>e.jsx(M,{text:s(i,b),children:s(t,o)}),[s]),N=n.useMemo(()=>[...F].sort((o,i)=>{const b=o[g],k=i[g];if(typeof b=="number"&&typeof k=="number")return m==="asc"?b-k:k-b;const I=String(b??""),$=String(k??"");return m==="asc"?I.localeCompare($):$.localeCompare(I)}),[F,g,m]),O=n.useMemo(()=>[{key:"timestamp",label:d("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>us(t.timestamp)},{key:"toolName",label:d("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>e.jsxs("span",{children:[ps(t.tool,t.command),t.tier==="pro"&&e.jsx(M,{text:s("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:e.jsx("span",{className:a.proBadge,children:s("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:d("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:t=>W(t.executionTimeMs)},{key:"status",label:d("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:t=>{const o=ms(t,s);return e.jsx(M,{text:o.tooltip,children:e.jsx("span",{className:o.className,children:o.label})})}},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:t=>e.jsx("span",{className:t.tier==="pro"?a.tierPro:a.tierBasic,children:R(s,t.tier)})}],[s,d]),A=n.useMemo(()=>[{key:"toolName",label:d("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:d("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:d("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:d("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:d("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"warningCount",label:d("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:d("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:d("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:t=>W(t.avgExecutionTimeMs)},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:t=>e.jsx(M,{text:t.tier==="mixed"?s("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:t.tier==="pro"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(s,t.tier)})})}],[s,d]),S=n.useMemo(()=>{if(!r.statistics)return null;const t=r.statistics.tierSummary.basic.totalCalls,o=r.statistics.tierSummary.pro.totalCalls,i=t+o;if(i===0)return null;const b=Math.round(t/i*100),k=100-b;return{basic:t,pro:o,basicPct:b,proPct:k}},[r.statistics]),V=n.useCallback(t=>{u(o=>o===t?null:t)},[]),Q=n.useCallback(async()=>{if(f){h(!0);try{f==="history"?await r.clearHistory():await r.clearStatistics(),v(s("toast.clearSuccess","Cleared successfully"),"success"),x(null)}catch{v(s("toast.clearFailed","Failed to clear data"),"error")}finally{h(!1)}}},[f,v,s,r]),X=n.useCallback(t=>{const o=t==="history"?"tools_history":"tools_statistics";l("dashboard_click_event",{click_target:t==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:o}),_({page:"tools",tab:o}),B(t)},[l,_]),Y=n.useCallback(t=>{const o=hs(t);return e.jsxs("div",{className:a.expandedRow,children:[e.jsxs("div",{className:a.expandedSection,children:[e.jsxs("strong",{children:[e.jsx(M,{text:s("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:s("tools.detail.params","Parameters")}),":"]}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&e.jsxs("div",{className:a.expandedSection,children:[e.jsxs("strong",{children:[e.jsx(M,{text:s("tools.detail.result.tooltip","Returned result payload for this tool run."),children:s("tools.detail.result","Result")}),":"]}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.result,null,2)})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="warning"||t.status==="error")&&e.jsx("div",{className:a.expandedSection,children:e.jsxs("div",{className:a.detailList,children:[t.status==="fallback"&&(o==null?void 0:o.requestedCommand)&&j(s("tools.detail.requestedCommand","Requested Command"),o.requestedCommand),t.status==="fallback"&&(o==null?void 0:o.executedCommand)&&j(s("tools.detail.executedCommand","Executed Command"),o.executedCommand),t.status==="fallback"&&(o==null?void 0:o.alternatives)&&j(s("tools.detail.alternatives","Alternatives"),o.alternatives.join(", ")),t.status==="unsupported"&&t.blockedMessage&&j(s("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="unsupported"&&j(s("tools.detail.noFallback","No Fallback"),s("tools.detail.noFallback.value","No fallback ran.")),t.status==="warning"&&t.warningMessage&&j(s("tools.detail.warningMessage","Warning Message"),t.warningMessage),t.status==="error"&&t.errorMessage&&j(s("tools.detail.errorMessage","Error Message"),t.errorMessage),t.status==="error"&&t.blockedMessage&&j(s("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="error"&&t.fallbackCommand&&j(s("tools.detail.executedCommand","Executed Command"),t.fallbackCommand)]})})]})},[s]),tt=["history","statistics"].map(t=>({key:t,label:s(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))}));return e.jsxs("div",{className:a.page,children:[e.jsx(ct,{items:tt,value:y,onChange:X}),y==="history"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:s("tools.tab.history","History")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{l("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),x("history")},children:s("common.clear","Clear")})]}),e.jsx("div",{className:a.filterRow,children:e.jsxs("label",{className:a.filterLabel,children:[s("tools.filter.tool","Tool"),":",e.jsxs("select",{className:a.filterSelect,value:r.historyToolFilter,onChange:t=>{r.setHistoryToolFilter(t.target.value),r.setHistoryOffset(0)},children:[e.jsx("option",{value:"",children:s("tools.filter.all","All")}),z.map(t=>e.jsx("option",{value:t,children:t},t))]})]})}),e.jsx(ft,{columns:O,data:r.history,rowKey:t=>t.id,onRowClick:t=>L(o=>o===t.id?null:t.id),emptyMessage:s("tools.empty.history","No history entries"),expandedKey:E,renderExpandedRow:Y}),e.jsxs("div",{className:a.pagination,children:[e.jsx("button",{className:a.btn,disabled:r.historyOffset===0,title:s("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>r.setHistoryOffset(Math.max(0,r.historyOffset-U)),children:s("tools.page.prev","Prev")}),e.jsxs("span",{className:a.pageInfo,children:[r.historyOffset+1,"–",Math.min(r.historyOffset+U,r.historyTotal)," / ",r.historyTotal]}),e.jsx("button",{className:a.btn,disabled:!r.historyHasMore,title:s("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>r.setHistoryOffset(r.historyOffset+U),children:s("tools.page.next","Next")})]})]}),y==="statistics"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:s("tools.tab.statistics","Statistics")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{l("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),x("statistics")},children:s("common.clear","Clear")})]}),S&&e.jsxs("div",{className:a.tierDistribution,children:[e.jsxs("div",{className:a.tierBarWrap,children:[e.jsx("div",{className:a.tierBarBasic,style:{width:`${S.basicPct}%`}}),e.jsx("div",{className:a.tierBarPro,style:{width:`${S.proPct}%`}})]}),e.jsxs("div",{className:a.tierLabels,children:[e.jsxs("span",{children:[R(s,"basic")," ",S.basicPct,"% (",S.basic,")"]}),e.jsxs("span",{children:[R(s,"pro")," ",S.proPct,"% (",S.pro,")"]})]})]}),e.jsx("div",{className:a.statsTableWrap,children:e.jsxs("table",{className:a.statsTable,children:[e.jsx("thead",{children:e.jsx("tr",{children:A.map(t=>e.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?a.sortableHeader:void 0,onClick:t.sortable?()=>q(t.key):void 0,children:[e.jsx("span",{children:t.label}),t.sortable&&g===t.key&&e.jsx("span",{className:a.sortArrow,children:m==="asc"?"▴":"▾"})]},t.key))})}),e.jsx("tbody",{children:N.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:A.length,className:a.emptyStats,children:s("tools.empty.stats","No tool statistics")})}):N.map(t=>{const o=w===t.toolName;return e.jsxs(n.Fragment,{children:[e.jsxs("tr",{className:a.statsToolRow,onClick:()=>V(t.toolName),children:[e.jsx("td",{children:e.jsxs("button",{type:"button",className:a.expandButton,"aria-expanded":o,"aria-label":`${t.toolName} ${o?s("common.collapse","Collapse"):s("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),V(t.toolName)},children:[e.jsx("span",{className:a.expandIcon,"aria-hidden":"true",children:o?"▾":"▸"}),e.jsx("span",{children:t.toolName})]})}),e.jsx("td",{children:t.totalCalls}),e.jsx("td",{children:t.successCount}),e.jsx("td",{children:t.fallbackCount}),e.jsx("td",{children:t.unsupportedCount}),e.jsx("td",{children:t.warningCount}),e.jsx("td",{children:t.failureCount}),e.jsx("td",{children:W(t.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx(M,{text:t.tier==="mixed"?s("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:t.tier==="pro"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(s,t.tier)})})})]}),o&&t.commands.map(i=>e.jsxs("tr",{className:a.statsActionRow,children:[e.jsx("td",{children:e.jsx("span",{className:a.actionLabel,children:i.label})}),e.jsx("td",{children:i.totalCalls}),e.jsx("td",{children:i.successCount}),e.jsx("td",{children:i.fallbackCount}),e.jsx("td",{children:i.unsupportedCount}),e.jsx("td",{children:i.warningCount}),e.jsx("td",{children:i.failureCount}),e.jsx("td",{children:W(i.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx("span",{className:i.tier==="pro"?a.tierPro:a.tierBasic,children:R(s,i.tier)})})]},`${t.toolName}:${i.commandName}`))]},t.toolName)})})]})}),r.statistics&&e.jsxs("div",{className:a.summaryLine,children:[s("tools.summary.total","Total"),": ",r.statistics.totalCalls," ",s("tools.summary.calls","calls")," | ",s("tools.summary.sessions","Sessions"),": ",r.statistics.totalSessions]})]}),e.jsx(nt,{open:f!==null,title:f==="history"?s("tools.clear.history.title","Clear history?"):s("tools.clear.statistics.title","Clear statistics?"),message:f==="history"?s("tools.clear.history.message","This permanently removes the current place tools history."):s("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:s("common.clear","Clear"),loading:P,onCancel:()=>!P&&x(null),onConfirm:Q})]})}export{ys as Component};
1
+ import{j as e,r as n,a as D,D as ot,u as lt,i as rt,m as it}from"./index-IFwX560t.js";import{T as M}from"./TooltipText-baLGgLqW.js";import{C as nt}from"./ConfirmModal-DuQQ9DXj.js";import{T as ct}from"./Tabs-CQJ_0DaJ.js";const dt="_wrapper_hzgda_2",ut="_table_hzgda_7",pt="_sortable_hzgda_32",xt="_sortArrow_hzgda_41",ht="_clickable_hzgda_52",mt="_empty_hzgda_57",bt="_expandedRow_hzgda_65",_t="_expandedCell_hzgda_74",T={wrapper:dt,table:ut,sortable:pt,sortArrow:xt,clickable:ht,empty:mt,expandedRow:bt,expandedCell:_t};function ft({columns:s,data:l,sortBy:_,sortDir:r="asc",onSort:v,onRowClick:y,rowKey:B,emptyMessage:E,expandedKey:L,renderExpandedRow:w}){return e.jsx("div",{className:T.wrapper,children:e.jsxs("table",{className:T.table,children:[e.jsx("thead",{children:e.jsx("tr",{children:s.map(u=>e.jsxs("th",{style:u.width?{width:u.width}:void 0,className:u.sortable?T.sortable:void 0,onClick:u.sortable&&v?()=>v(u.key):void 0,children:[e.jsx("span",{children:u.label}),u.sortable&&_===u.key&&e.jsx("span",{className:T.sortArrow,children:r==="asc"?"▴":"▾"})]},u.key))})}),e.jsx("tbody",{children:l.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:T.empty,children:E||"No data"})}):l.map((u,f)=>{const x=B?B(u):String(f),h=L!=null&&x===L&&w?w(u):null;return e.jsxs(n.Fragment,{children:[e.jsx("tr",{className:y?T.clickable:void 0,onClick:y?()=>y(u):void 0,children:s.map(g=>e.jsx("td",{children:g.render?g.render(u):String(u[g.key]??"")},g.key))}),h&&e.jsx("tr",{className:T.expandedRow,children:e.jsx("td",{colSpan:s.length,className:T.expandedCell,children:h})})]},x)})})]})})}function gt(s){return{...s,sequenceNumber:typeof s.sequenceNumber=="number"?s.sequenceNumber:void 0,executionTimeMs:typeof s.executionTimeMs=="number"?s.executionTimeMs:void 0}}const Ct=50;function yt(){const[s,l]=n.useState(null),[_,r]=n.useState(!0),[v,y]=n.useState([]),[B,E]=n.useState(0),[L,w]=n.useState(!1),[u,f]=n.useState(!0),[x,P]=n.useState(0),[h,g]=n.useState(""),H=n.useRef(null),m=n.useCallback(async()=>{r(!0);try{const d=await D.get("/api/dashboard/tool-stats");l(d)}catch{}finally{r(!1)}},[]),C=n.useCallback(async(d,N)=>{f(!0);try{const O={limit:String(Ct),offset:String(d)};N&&(O.tool=N);const A=await D.get("/api/dashboard/history",O);y(A.entries.map(gt)),E(A.total),w(A.hasMore)}catch{y([]),E(0),w(!1)}finally{f(!1)}},[]),q=n.useCallback(()=>{m(),C(x,h)},[C,m,x,h]),z=n.useCallback(async()=>{await D.post("/api/dashboard/tools/history/clear"),C(x,h)},[C,x,h]),F=n.useCallback(async()=>{await D.post("/api/dashboard/tools/statistics/clear"),m()},[m]);return n.useEffect(()=>{m()},[m]),n.useEffect(()=>{C(x,h)},[C,x,h]),n.useEffect(()=>{const d=new ot;H.current=d,d.connect();const N=d.on("command",()=>{m(),C(x,h)});return()=>{N(),d.disconnect(),H.current=null}},[C,m,x,h]),{statistics:s,statsLoading:_,history:v,historyTotal:B,historyHasMore:L,historyLoading:u,historyOffset:x,historyToolFilter:h,setHistoryOffset:P,setHistoryToolFilter:g,refresh:q,clearHistory:z,clearStatistics:F}}const jt="_page_16x6v_2",vt="_card_16x6v_12",kt="_cardToolbar_16x6v_19",Tt="_sectionTitle_16x6v_27",wt="_dangerButton_16x6v_33",Nt="_proBadge_16x6v_52",St="_statusOk_16x6v_67",Mt="_statusFallback_16x6v_76",Bt="_statusUnsupported_16x6v_85",Et="_statusWarning_16x6v_94",Lt="_statusError_16x6v_103",At="_tierBasic_16x6v_113",Rt="_tierPro_16x6v_117",Pt="_tierMixed_16x6v_122",Ht="_filterRow_16x6v_133",Ft="_filterLabel_16x6v_140",Ot="_filterSelect_16x6v_149",It="_expandedRow_16x6v_160",$t="_expandedSection_16x6v_165",Dt="_detailList_16x6v_175",Wt="_detailItem_16x6v_181",qt="_detailLabel_16x6v_187",zt="_detailValue_16x6v_192",Ut="_pre_16x6v_197",Vt="_pagination_16x6v_214",Kt="_pageInfo_16x6v_222",Gt="_btn_16x6v_228",Jt="_tierDistribution_16x6v_251",Zt="_tierBarWrap_16x6v_255",Qt="_tierBarBasic_16x6v_263",Xt="_tierBarPro_16x6v_268",Yt="_tierLabels_16x6v_273",ts="_statsTableWrap_16x6v_282",ss="_statsTable_16x6v_282",es="_sortableHeader_16x6v_313",as="_sortArrow_16x6v_318",os="_statsToolRow_16x6v_322",ls="_statsActionRow_16x6v_330",rs="_expandButton_16x6v_334",is="_expandIcon_16x6v_346",ns="_actionLabel_16x6v_351",cs="_emptyStats_16x6v_358",ds="_summaryLine_16x6v_364",a={page:jt,card:vt,cardToolbar:kt,sectionTitle:Tt,dangerButton:wt,proBadge:Nt,statusOk:St,statusFallback:Mt,statusUnsupported:Bt,statusWarning:Et,statusError:Lt,tierBasic:At,tierPro:Rt,tierMixed:Pt,filterRow:Ht,filterLabel:Ft,filterSelect:Ot,expandedRow:It,expandedSection:$t,detailList:Dt,detailItem:Wt,detailLabel:qt,detailValue:zt,pre:Ut,pagination:Vt,pageInfo:Kt,btn:Gt,tierDistribution:Jt,tierBarWrap:Zt,tierBarBasic:Qt,tierBarPro:Xt,tierLabels:Yt,statsTableWrap:ts,statsTable:ss,sortableHeader:es,sortArrow:as,statsToolRow:os,statsActionRow:ls,expandButton:rs,expandIcon:is,actionLabel:ns,emptyStats:cs,summaryLine:ds},U=50;function us(s){const l=new Date(s);return`${String(l.getHours()).padStart(2,"0")}:${String(l.getMinutes()).padStart(2,"0")}:${String(l.getSeconds()).padStart(2,"0")}`}function W(s){return typeof s!="number"||!Number.isFinite(s)?"-":s<1e3?`${s}ms`:`${(s/1e3).toFixed(1)}s`}function R(s,l){return l==="pro"?s("tier.pro","Pro"):l==="mixed"?s("tier.mixed","Mixed"):s("tier.basic","Basic")}function Z(s,l){return l!==s&&l.startsWith(`${s}_`)?l.slice(s.length+1):""}function ps(s,l){const _=Z(s,l);return _?`${s}.${_}`:s}function J(s){return typeof s=="string"&&s.length>0?s:void 0}function xs(s){if(!Array.isArray(s))return;const l=s.filter(_=>typeof _=="string"&&_.length>0);return l.length>0?l:void 0}function hs(s){const l=s.result??{};return{requestedCommand:s.requestedCommand??J(l.requestedCommand),executedCommand:s.executedCommand??J(l.executedCommand),alternatives:s.alternatives??xs(l.alternatives)}}function ms(s,l){switch(s.status){case"fallback":return{label:l("tools.badge.fallback","FALLBACK"),tooltip:l("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:a.statusFallback};case"unsupported":return{label:l("tools.badge.unsupported","UNSUPPORTED"),tooltip:l("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:a.statusUnsupported};case"warning":return{label:l("tools.badge.warn","WARN"),tooltip:l("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:a.statusWarning};case"error":return{label:l("tools.badge.err","FAILED"),tooltip:l("tools.badge.err.tooltip","The tool run failed."),className:a.statusError};default:return{label:l("tools.status.ok","OK"),tooltip:l("tools.status.ok.tooltip","The tool run completed successfully."),className:a.statusOk}}}function j(s,l){return e.jsxs("div",{className:a.detailItem,children:[e.jsx("span",{className:a.detailLabel,children:s}),e.jsx("span",{className:a.detailValue,children:l})]})}function ys(){const{t:s}=lt(),{trackEvent:l,trackPageView:_}=rt(),r=yt(),{show:v}=it(),[y,B]=n.useState("history"),[E,L]=n.useState(null),[w,u]=n.useState(null),[f,x]=n.useState(null),[P,h]=n.useState(!1),[g,H]=n.useState("totalCalls"),[m,C]=n.useState("desc"),q=n.useCallback(t=>{H(o=>o===t?(C(i=>i==="asc"?"desc":"asc"),t):(C("desc"),t))},[]),z=n.useMemo(()=>{var o;const t=new Set;return Object.keys(((o=r.statistics)==null?void 0:o.tools)??{}).forEach(i=>t.add(i)),r.history.forEach(i=>{i.tool&&t.add(i.tool)}),r.historyToolFilter&&t.add(r.historyToolFilter),Array.from(t).sort()},[r.history,r.historyToolFilter,r.statistics]),F=n.useMemo(()=>{var t;return(t=r.statistics)!=null&&t.tools?Object.values(r.statistics.tools).map(o=>{var G;const i=Object.entries(o.commands??{}).map(([p,c])=>({toolName:o.tool,commandName:c.command??p,label:Z(o.tool,c.command??p)||(c.command??p),tier:c.tier,totalCalls:c.totalCalls,successCount:c.successCount,fallbackCount:c.fallbackCount,unsupportedCount:c.unsupportedCount,warningCount:c.warningCount??0,failureCount:c.failureCount,totalExecutionTimeMs:c.totalExecutionTimeMs,avgExecutionTimeMs:c.avgExecutionTimeMs})),b=i.reduce((p,c)=>p+c.totalCalls,0),k=i.reduce((p,c)=>p+c.successCount,0),I=i.reduce((p,c)=>p+c.fallbackCount,0),$=i.reduce((p,c)=>p+c.unsupportedCount,0),st=i.reduce((p,c)=>p+c.warningCount,0),et=i.reduce((p,c)=>p+c.failureCount,0),K=i.reduce((p,c)=>p+c.totalExecutionTimeMs,0),at=new Set(i.map(p=>p.tier)).size>1?"mixed":((G=i[0])==null?void 0:G.tier)??o.tier;return{toolName:o.tool,tier:at,commands:i,totalCalls:b,successCount:k,fallbackCount:I,unsupportedCount:$,warningCount:st,failureCount:et,totalExecutionTimeMs:K,avgExecutionTimeMs:b>0?Math.round(K/b):0}}):[]},[r.statistics]),d=n.useCallback((t,o,i,b)=>e.jsx(M,{text:s(i,b),children:s(t,o)}),[s]),N=n.useMemo(()=>[...F].sort((o,i)=>{const b=o[g],k=i[g];if(typeof b=="number"&&typeof k=="number")return m==="asc"?b-k:k-b;const I=String(b??""),$=String(k??"");return m==="asc"?I.localeCompare($):$.localeCompare(I)}),[F,g,m]),O=n.useMemo(()=>[{key:"timestamp",label:d("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>us(t.timestamp)},{key:"toolName",label:d("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>e.jsxs("span",{children:[ps(t.tool,t.command),t.tier==="pro"&&e.jsx(M,{text:s("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:e.jsx("span",{className:a.proBadge,children:s("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:d("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:t=>W(t.executionTimeMs)},{key:"status",label:d("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:t=>{const o=ms(t,s);return e.jsx(M,{text:o.tooltip,children:e.jsx("span",{className:o.className,children:o.label})})}},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:t=>e.jsx("span",{className:t.tier==="pro"?a.tierPro:a.tierBasic,children:R(s,t.tier)})}],[s,d]),A=n.useMemo(()=>[{key:"toolName",label:d("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:d("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:d("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:d("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:d("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"warningCount",label:d("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:d("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:d("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:t=>W(t.avgExecutionTimeMs)},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:t=>e.jsx(M,{text:t.tier==="mixed"?s("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:t.tier==="pro"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(s,t.tier)})})}],[s,d]),S=n.useMemo(()=>{if(!r.statistics)return null;const t=r.statistics.tierSummary.basic.totalCalls,o=r.statistics.tierSummary.pro.totalCalls,i=t+o;if(i===0)return null;const b=Math.round(t/i*100),k=100-b;return{basic:t,pro:o,basicPct:b,proPct:k}},[r.statistics]),V=n.useCallback(t=>{u(o=>o===t?null:t)},[]),Q=n.useCallback(async()=>{if(f){h(!0);try{f==="history"?await r.clearHistory():await r.clearStatistics(),v(s("toast.clearSuccess","Cleared successfully"),"success"),x(null)}catch{v(s("toast.clearFailed","Failed to clear data"),"error")}finally{h(!1)}}},[f,v,s,r]),X=n.useCallback(t=>{const o=t==="history"?"tools_history":"tools_statistics";l("dashboard_click_event",{click_target:t==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:o}),_({page:"tools",tab:o}),B(t)},[l,_]),Y=n.useCallback(t=>{const o=hs(t);return e.jsxs("div",{className:a.expandedRow,children:[e.jsxs("div",{className:a.expandedSection,children:[e.jsxs("strong",{children:[e.jsx(M,{text:s("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:s("tools.detail.params","Parameters")}),":"]}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&e.jsxs("div",{className:a.expandedSection,children:[e.jsxs("strong",{children:[e.jsx(M,{text:s("tools.detail.result.tooltip","Returned result payload for this tool run."),children:s("tools.detail.result","Result")}),":"]}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.result,null,2)})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="warning"||t.status==="error")&&e.jsx("div",{className:a.expandedSection,children:e.jsxs("div",{className:a.detailList,children:[t.status==="fallback"&&(o==null?void 0:o.requestedCommand)&&j(s("tools.detail.requestedCommand","Requested Command"),o.requestedCommand),t.status==="fallback"&&(o==null?void 0:o.executedCommand)&&j(s("tools.detail.executedCommand","Executed Command"),o.executedCommand),t.status==="fallback"&&(o==null?void 0:o.alternatives)&&j(s("tools.detail.alternatives","Alternatives"),o.alternatives.join(", ")),t.status==="unsupported"&&t.blockedMessage&&j(s("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="unsupported"&&j(s("tools.detail.noFallback","No Fallback"),s("tools.detail.noFallback.value","No fallback ran.")),t.status==="warning"&&t.warningMessage&&j(s("tools.detail.warningMessage","Warning Message"),t.warningMessage),t.status==="error"&&t.errorMessage&&j(s("tools.detail.errorMessage","Error Message"),t.errorMessage),t.status==="error"&&t.blockedMessage&&j(s("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="error"&&t.fallbackCommand&&j(s("tools.detail.executedCommand","Executed Command"),t.fallbackCommand)]})})]})},[s]),tt=["history","statistics"].map(t=>({key:t,label:s(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))}));return e.jsxs("div",{className:a.page,children:[e.jsx(ct,{items:tt,value:y,onChange:X}),y==="history"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:s("tools.tab.history","History")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{l("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),x("history")},children:s("common.clear","Clear")})]}),e.jsx("div",{className:a.filterRow,children:e.jsxs("label",{className:a.filterLabel,children:[s("tools.filter.tool","Tool"),":",e.jsxs("select",{className:a.filterSelect,value:r.historyToolFilter,onChange:t=>{r.setHistoryToolFilter(t.target.value),r.setHistoryOffset(0)},children:[e.jsx("option",{value:"",children:s("tools.filter.all","All")}),z.map(t=>e.jsx("option",{value:t,children:t},t))]})]})}),e.jsx(ft,{columns:O,data:r.history,rowKey:t=>t.id,onRowClick:t=>L(o=>o===t.id?null:t.id),emptyMessage:s("tools.empty.history","No history entries"),expandedKey:E,renderExpandedRow:Y}),e.jsxs("div",{className:a.pagination,children:[e.jsx("button",{className:a.btn,disabled:r.historyOffset===0,title:s("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>r.setHistoryOffset(Math.max(0,r.historyOffset-U)),children:s("tools.page.prev","Prev")}),e.jsxs("span",{className:a.pageInfo,children:[r.historyOffset+1,"–",Math.min(r.historyOffset+U,r.historyTotal)," / ",r.historyTotal]}),e.jsx("button",{className:a.btn,disabled:!r.historyHasMore,title:s("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>r.setHistoryOffset(r.historyOffset+U),children:s("tools.page.next","Next")})]})]}),y==="statistics"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:s("tools.tab.statistics","Statistics")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{l("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),x("statistics")},children:s("common.clear","Clear")})]}),S&&e.jsxs("div",{className:a.tierDistribution,children:[e.jsxs("div",{className:a.tierBarWrap,children:[e.jsx("div",{className:a.tierBarBasic,style:{width:`${S.basicPct}%`}}),e.jsx("div",{className:a.tierBarPro,style:{width:`${S.proPct}%`}})]}),e.jsxs("div",{className:a.tierLabels,children:[e.jsxs("span",{children:[R(s,"basic")," ",S.basicPct,"% (",S.basic,")"]}),e.jsxs("span",{children:[R(s,"pro")," ",S.proPct,"% (",S.pro,")"]})]})]}),e.jsx("div",{className:a.statsTableWrap,children:e.jsxs("table",{className:a.statsTable,children:[e.jsx("thead",{children:e.jsx("tr",{children:A.map(t=>e.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?a.sortableHeader:void 0,onClick:t.sortable?()=>q(t.key):void 0,children:[e.jsx("span",{children:t.label}),t.sortable&&g===t.key&&e.jsx("span",{className:a.sortArrow,children:m==="asc"?"▴":"▾"})]},t.key))})}),e.jsx("tbody",{children:N.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:A.length,className:a.emptyStats,children:s("tools.empty.stats","No tool statistics")})}):N.map(t=>{const o=w===t.toolName;return e.jsxs(n.Fragment,{children:[e.jsxs("tr",{className:a.statsToolRow,onClick:()=>V(t.toolName),children:[e.jsx("td",{children:e.jsxs("button",{type:"button",className:a.expandButton,"aria-expanded":o,"aria-label":`${t.toolName} ${o?s("common.collapse","Collapse"):s("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),V(t.toolName)},children:[e.jsx("span",{className:a.expandIcon,"aria-hidden":"true",children:o?"▾":"▸"}),e.jsx("span",{children:t.toolName})]})}),e.jsx("td",{children:t.totalCalls}),e.jsx("td",{children:t.successCount}),e.jsx("td",{children:t.fallbackCount}),e.jsx("td",{children:t.unsupportedCount}),e.jsx("td",{children:t.warningCount}),e.jsx("td",{children:t.failureCount}),e.jsx("td",{children:W(t.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx(M,{text:t.tier==="mixed"?s("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:t.tier==="pro"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(s,t.tier)})})})]}),o&&t.commands.map(i=>e.jsxs("tr",{className:a.statsActionRow,children:[e.jsx("td",{children:e.jsx("span",{className:a.actionLabel,children:i.label})}),e.jsx("td",{children:i.totalCalls}),e.jsx("td",{children:i.successCount}),e.jsx("td",{children:i.fallbackCount}),e.jsx("td",{children:i.unsupportedCount}),e.jsx("td",{children:i.warningCount}),e.jsx("td",{children:i.failureCount}),e.jsx("td",{children:W(i.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx("span",{className:i.tier==="pro"?a.tierPro:a.tierBasic,children:R(s,i.tier)})})]},`${t.toolName}:${i.commandName}`))]},t.toolName)})})]})}),r.statistics&&e.jsxs("div",{className:a.summaryLine,children:[s("tools.summary.total","Total"),": ",r.statistics.totalCalls," ",s("tools.summary.calls","calls")," | ",s("tools.summary.sessions","Sessions"),": ",r.statistics.totalSessions]})]}),e.jsx(nt,{open:f!==null,title:f==="history"?s("tools.clear.history.title","Clear history?"):s("tools.clear.statistics.title","Clear statistics?"),message:f==="history"?s("tools.clear.history.message","This permanently removes the current place tools history."):s("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:s("common.clear","Clear"),loading:P,onCancel:()=>!P&&x(null),onConfirm:Q})]})}export{ys as Component};
@@ -0,0 +1 @@
1
+ import{j as p,p as r}from"./index-IFwX560t.js";function i({text:o,children:t}){return p.jsx(r,{text:o,children:t})}export{i as T};
@@ -0,0 +1,16 @@
1
+ import{q as re,s as q,t as Le,r as p,u as D,j as t,i as H,R as $e,T as Se,l as Ee,v as He}from"./index-IFwX560t.js";import{I as B}from"./InfoLabel-BcS5cIV_.js";import{T as y}from"./TooltipText-baLGgLqW.js";import{D as ne,c as le,e as Oe,g as Fe,h as Ue,i as ce,j as je,k as ze,l as de,d as qe}from"./sample-requests-DeMovtVY.js";import{T as Ve}from"./Tabs-CQJ_0DaJ.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 We=[["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"}]],Ke=re("camera",We);/**
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 Qe=[["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"}]],Ye=re("ellipsis",Qe);/**
12
+ * @license lucide-react v1.8.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Je=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xe=re("x",Je);async function we(e){const i=await fetch(`${q}${e}`);if(!i.ok){let a=null;try{a=await i.json()}catch{}throw new Le(i.status,(a==null?void 0:a.message)??i.statusText,(a==null?void 0:a.error)??null,a)}return await i.json()}function O(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function Ze(e){return e.design_check_summary?{priority_high:O(e.design_check_summary.priority_high),priority_medium:O(e.design_check_summary.priority_medium),priority_low:O(e.design_check_summary.priority_low)}:e.lint_summary?{priority_high:O(e.lint_summary.errors),priority_medium:O(e.lint_summary.warnings),priority_low:0}:null}function et(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 ve(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:Ze(e),image:e.image}}function tt(e){const i=e.check_results??e.lint_results??[];return{...ve(e),check_results:i.map(et),image_url:e.image_url,meta:e.meta}}async function ue(e,i){const a=new URLSearchParams;i!==void 0&&a.set("limit",String(i));const o=a.toString()?`?${a.toString()}`:"",l=await we(`/api/ui-studio/snapshots${o}`);return{...l,snapshots:l.snapshots.map(ve)}}async function it(e,i){const a=i!==void 0?`?placeId=${i}`:"",o=await we(`/api/ui-studio/snapshots/${encodeURIComponent(e)}${a}`);return tt(o)}function be(e,i){const a=i!==void 0?`?placeId=${i}`:"";return`${q}/api/ui-studio/snapshots/${encodeURIComponent(e)}/image${a}`}const at=1e4;function Ce(e=50){const[i,a]=p.useState(null),[o,l]=p.useState(!0),[s,n]=p.useState(null),g=p.useCallback(async()=>{try{const d=await ue(void 0,e);a(d),n(null)}catch(d){n(d instanceof Error?d.message:String(d))}finally{l(!1)}},[e]);return p.useEffect(()=>{let d=!1;const _=async()=>{try{const h=await ue(void 0,e);d||(a(h),n(null))}catch(h){d||n(h instanceof Error?h.message:String(h))}finally{d||l(!1)}};_();const m=setInterval(()=>{_()},at);return()=>{d=!0,clearInterval(m)}},[e]),{data:i,loading:o,error:s,refresh:g}}const st="_page_1fjjw_2",rt="_grid_1fjjw_9",nt="_card_1fjjw_16",ot="_cardBodyButton_1fjjw_31",lt="_thumb_1fjjw_43",ct="_badges_1fjjw_52",dt="_priorityHighBadge_1fjjw_60",ut="_priorityMediumBadge_1fjjw_69",ht="_priorityLowBadge_1fjjw_78",pt="_cardMeta_1fjjw_87",gt="_target_1fjjw_93",mt="_time_1fjjw_100",_t="_drawer_1fjjw_105",yt="_drawerToolbar_1fjjw_122",ft="_drawerTitleBlock_1fjjw_133",xt="_drawerEyebrow_1fjjw_140",St="_drawerTarget_1fjjw_149",jt="_drawerToolbarActions_1fjjw_159",wt="_closeBtn_1fjjw_167",vt="_detailBody_1fjjw_188",bt="_screenshotPreviewFrame_1fjjw_195",Ct="_fullImg_1fjjw_208",It="_metaDl_1fjjw_215",Nt="_errorMsg_1fjjw_227",Pt="_suggestionsWrap_1fjjw_232",kt="_prioritySection_1fjjw_239",Tt="_sectionHighHeader_1fjjw_243",Bt="_sectionLowHeader_1fjjw_249",Dt="_sectionMediumHeader_1fjjw_255",Gt="_groupCard_1fjjw_261",Mt="_groupHeader_1fjjw_268",At="_groupLabel_1fjjw_284",Rt="_groupCount_1fjjw_289",Lt="_groupChevron_1fjjw_296",$t="_groupBody_1fjjw_300",Et="_groupDescription_1fjjw_303",Ht="_groupFix_1fjjw_308",Ot="_falsePositive_1fjjw_317",Ft="_itemList_1fjjw_325",Ut="_suggestionItem_1fjjw_333",zt="_suggestionInfo_1fjjw_343",qt="_pathBreadcrumb_1fjjw_349",Vt="_currentValue_1fjjw_358",Wt="_copyFixBtn_1fjjw_362",Kt="_emptySuggestions_1fjjw_376",Qt="_sampleBanner_1fjjw_384",Yt="_sampleBannerRow_1fjjw_397",Jt="_sampleBannerMain_1fjjw_405",Xt="_sampleBadge_1fjjw_413",Zt="_sampleTitle_1fjjw_423",ei="_sampleMessage_1fjjw_430",ti="_sampleActions_1fjjw_437",ii="_primaryAction_1fjjw_445",ai="_secondaryAction_1fjjw_446",si="_emptyState_1fjjw_481",ri="_pluginGuideCard_1fjjw_489",ni="_pluginGuideMarker_1fjjw_500",oi="_pluginGuideBody_1fjjw_515",li="_pluginGuideTitle_1fjjw_519",ci="_pluginGuideMessage_1fjjw_527",di="_pluginGuideChecklist_1fjjw_534",ui="_pluginGuideWaiting_1fjjw_557",hi="_pluginGuideDot_1fjjw_566",pi="_analysisWorkspace_1fjjw_574",gi="_analysisMainColumn_1fjjw_579",mi="_analysisDetailPopupLayer_1fjjw_583",_i="_analysisDetailDialog_1fjjw_600",yi="_analysisSummaryPanel_1fjjw_619",fi="_recentCapturesHeader_1fjjw_632",xi="_analysisSummaryText_1fjjw_639",Si="_recentCapturesMeta_1fjjw_640",ji="_analysisReportGrid_1fjjw_646",wi="_analysisReportGroup_1fjjw_653",vi="_analysisReportCard_1fjjw_657",bi="_analysisReportThumb_1fjjw_679",Ci="_analysisReportBody_1fjjw_688",Ii="_analysisReportTopline_1fjjw_695",Ni="_analysisVerdict_1fjjw_702",Pi="_analysisVerdict_needsFix_1fjjw_713",ki="_analysisVerdict_review_1fjjw_714",Ti="_analysisVerdict_passed_1fjjw_719",Bi="_analysisReportCounts_1fjjw_724",Di="_analysisReportTarget_1fjjw_729",Gi="_analysisReportIssue_1fjjw_738",Mi="_analysisReportMeta_1fjjw_744",Ai="_analysisChildList_1fjjw_751",Ri="_analysisChildRow_1fjjw_762",Li="_analysisChildPath_1fjjw_783",$i="_analysisChildSummary_1fjjw_792",Ei="_analysisChildDetailHint_1fjjw_793",Hi="_drawerAnalysisSummary_1fjjw_802",Oi="_drawerAnalysisSummaryItem_1fjjw_813",Fi="_drawerAnalysisLabel_1fjjw_820",Ui="_drawerAnalysisCounts_1fjjw_826",zi="_drawerAnalysisValue_1fjjw_827",qi="_recentCapturesSection_1fjjw_832",Vi="_drawerPrimaryActions_1fjjw_844",Wi="_drawerActionBtn_1fjjw_851",Ki="_drawerMoreMenu_1fjjw_880",Qi="_drawerMoreButton_1fjjw_885",Yi="_drawerMoreMenuBody_1fjjw_910",Ji="_drawerMenuItem_1fjjw_923",Xi="_drawerMenuItemDanger_1fjjw_946",Zi="_actionErrMsg_1fjjw_955",ea="_actionStatusMsg_1fjjw_964",ta="_actionStatus_info_1fjjw_978",ia="_actionStatus_success_1fjjw_984",aa="_actionStatus_warning_1fjjw_990",sa="_actionStatusDetail_1fjjw_996",ra="_galleryHeader_1fjjw_1002",na="_cardChecked_1fjjw_1015",oa="_cardCheckbox_1fjjw_1022",la="_captureSelectionActions_1fjjw_1062",ca="_selectionToolbar_1fjjw_1071",da="_selectionBar_1fjjw_1072",ua="_selectionToolbarCount_1fjjw_1091",ha="_selectionToolbarActions_1fjjw_1098",pa="_selectionBarBtn_1fjjw_1105",ga="_selectionBarBtnDanger_1fjjw_1126",r={page:st,grid:rt,card:nt,cardBodyButton:ot,thumb:lt,badges:ct,priorityHighBadge:dt,priorityMediumBadge:ut,priorityLowBadge:ht,cardMeta:pt,target:gt,time:mt,drawer:_t,drawerToolbar:yt,drawerTitleBlock:ft,drawerEyebrow:xt,drawerTarget:St,drawerToolbarActions:jt,closeBtn:wt,detailBody:vt,screenshotPreviewFrame:bt,fullImg:Ct,metaDl:It,errorMsg:Nt,suggestionsWrap:Pt,prioritySection:kt,sectionHighHeader:Tt,sectionLowHeader:Bt,sectionMediumHeader:Dt,groupCard:Gt,groupHeader:Mt,groupLabel:At,groupCount:Rt,groupChevron:Lt,groupBody:$t,groupDescription:Et,groupFix:Ht,falsePositive:Ot,itemList:Ft,suggestionItem:Ut,suggestionInfo:zt,pathBreadcrumb:qt,currentValue:Vt,copyFixBtn:Wt,emptySuggestions:Kt,sampleBanner:Qt,sampleBannerRow:Yt,sampleBannerMain:Jt,sampleBadge:Xt,sampleTitle:Zt,sampleMessage:ei,sampleActions:ti,primaryAction:ii,secondaryAction:ai,emptyState:si,pluginGuideCard:ri,pluginGuideMarker:ni,pluginGuideBody:oi,pluginGuideTitle:li,pluginGuideMessage:ci,pluginGuideChecklist:di,pluginGuideWaiting:ui,pluginGuideDot:hi,analysisWorkspace:pi,analysisMainColumn:gi,analysisDetailPopupLayer:mi,analysisDetailDialog:_i,analysisSummaryPanel:yi,recentCapturesHeader:fi,analysisSummaryText:xi,recentCapturesMeta:Si,analysisReportGrid:ji,analysisReportGroup:wi,analysisReportCard:vi,analysisReportThumb:bi,analysisReportBody:Ci,analysisReportTopline:Ii,analysisVerdict:Ni,analysisVerdict_needsFix:Pi,analysisVerdict_review:ki,analysisVerdict_passed:Ti,analysisReportCounts:Bi,analysisReportTarget:Di,analysisReportIssue:Gi,analysisReportMeta:Mi,analysisChildList:Ai,analysisChildRow:Ri,analysisChildPath:Li,analysisChildSummary:$i,analysisChildDetailHint:Ei,drawerAnalysisSummary:Hi,drawerAnalysisSummaryItem:Oi,drawerAnalysisLabel:Fi,drawerAnalysisCounts:Ui,drawerAnalysisValue:zi,recentCapturesSection:qi,drawerPrimaryActions:Vi,drawerActionBtn:Wi,drawerMoreMenu:Ki,drawerMoreButton:Qi,drawerMoreMenuBody:Yi,drawerMenuItem:Ji,drawerMenuItemDanger:Xi,actionErrMsg:Zi,actionStatusMsg:ea,actionStatus_info:ta,actionStatus_success:ia,actionStatus_warning:aa,actionStatusDetail:sa,galleryHeader:ra,cardChecked:na,cardCheckbox:oa,captureSelectionActions:la,selectionToolbar:ca,selectionBar:da,selectionToolbarCount:ua,selectionToolbarActions:ha,selectionBarBtn:pa,selectionBarBtnDanger:ga};function ma({snapshot:e,placeId:i,onClick:a,imageUrlOverride:o,selectable:l,selected:s,onToggleSelect:n}){var w,C,G;const{t:g}=D(),d=((w=e.design_check_summary)==null?void 0:w.priority_high)??0,_=((C=e.design_check_summary)==null?void 0:C.priority_medium)??0,m=((G=e.design_check_summary)==null?void 0:G.priority_low)??0,h=new Date(e.captured_at*1e3).toLocaleString(),x=o??be(e.snapshot_id,i),j=()=>{n==null||n(e.snapshot_id)};return t.jsxs("div",{className:`${r.card} ${s?r.cardChecked:""}`,children:[l&&t.jsx(y,{text:g("uiStudio.gallery.cardCheckbox.tooltip","Select this capture. Pick multiple to delete them together."),children:t.jsx("input",{className:r.cardCheckbox,type:"checkbox","aria-label":g("uiStudio.gallery.cardCheckbox","Select screenshot"),checked:!!s,onChange:j})}),t.jsxs("button",{className:r.cardBodyButton,onClick:I=>a(I.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:g("uiStudio.gallery.priorityHighBadge.tooltip","Number of suggestions to review first. Click for details."),children:t.jsx("span",{className:r.priorityHighBadge,children:d})}),_>0&&t.jsx(y,{text:g("uiStudio.gallery.priorityMediumBadge.tooltip","Number of recommended suggestions."),children:t.jsx("span",{className:r.priorityMediumBadge,children:_})}),m>0&&t.jsx(y,{text:g("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:h})]})]})]})}const _a={touch_target:"touchTarget",contrast:"contrast",text_scaled:"textScaled",safezone:"safezone",min_text_size:"minTextSize"};function ya(e){return e.rule==="contrast"&&/\.(Icon|Avatar|EmptyIcon|GoldIcon|[A-Za-z]*Icon)$/.test(e.path)}const fa={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 xa(e,i,a){const o=_a[e];return o?{...i,checkLabel:a(`uiStudio.fix.${o}.label`,i.checkLabel),description:a(`uiStudio.fix.${o}.description`,i.description),howToFix:a(`uiStudio.fix.${o}.howToFix`,i.howToFix),falsePositiveNote:i.falsePositiveNote?a(`uiStudio.fix.${o}.falsePositive`,i.falsePositiveNote):void 0}:i}function Sa(e,i){const a=fa[e]??null;return a?i?xa(e,a,i):a:null}function ja(e){return ya(e)}function wa(e,i){const a=new Map;for(const l of e){const s=`${l.displayPriority}::${l.rule}`,n=a.get(s)??[];n.push(l),a.set(s,n)}const o=[];for(const[l,s]of a){const[n,g]=l.split("::"),d=s.filter(ja).length;o.push({rule:g??"unknown",priority:n,items:s,fixTemplate:Sa(g??"",i),falsePositiveRatio:s.length>0?d/s.length:0})}return o.sort((l,s)=>{const n={priority_high:0,priority_medium:1,priority_low:2};return l.priority!==s.priority?n[l.priority]-n[s.priority]:s.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 Ie(e){const i=e.split("."),a=i[i.length-1]??e,o=i[i.length-2],l=o?`${o} > ${a}`:a;return{full:e,breadcrumb:l,leaf:a}}function Ne(e){return typeof e=="object"&&e!==null}function he(e){return Ne(e.data)?e.data:{}}function Z(e,i){const a=e[i];return Ne(a)?a:{}}function V(e,i){const a=e[i];return typeof a=="string"?a:null}function W(e,i){const a=e[i];return typeof a=="number"&&Number.isFinite(a)?a:0}function va(e){const i=Z(e,"design_check_summary");return{priority_high:W(i,"priority_high"),priority_medium:W(i,"priority_medium"),priority_low:W(i,"priority_low")}}function pe(e){if(!(e.success??e.ok??!e.error))throw new Error(e.error??"UI Studio action failed")}function ge(e,i){return Pe(e,va(i))}function F(e,i,a,o,l){const s=e(i,a);return l?`${s}: ${l} · ${o}`:`${s}: ${o}`}function ba(e){const i=e.design_check_summary;return((i==null?void 0:i.priority_high)??0)>0?"needsFix":((i==null?void 0:i.priority_medium)??0)>0||((i==null?void 0:i.priority_low)??0)>0?"review":"passed"}function Ca(e,i){return i==="needsFix"||i==="review"?e("uiStudio.analysis.verdict.hasSuggestions","개선 제안 있음"):e("uiStudio.analysis.verdict.passed","현재 개선 제안 없음")}function K(e,i){return`${i}${e("uiStudio.storage.countSuffix","개")}`}function Pe(e,i){return`${e("uiStudio.priorityHigh","우선 검토")} ${K(e,(i==null?void 0:i.priority_high)??0)} · ${e("uiStudio.priorityMedium","검토 권장")} ${K(e,(i==null?void 0:i.priority_medium)??0)} · ${e("uiStudio.priorityLow","선택 개선")} ${K(e,(i==null?void 0:i.priority_low)??0)}`}function Ia(e,i){return Pe(e,i.design_check_summary)}function Na({snapshotId:e,placeId:i,onClose:a,sampleDetail:o,tier:l,onActionDone:s}){const[n,g]=p.useState(o??null),[d,_]=p.useState(null),[m,h]=p.useState(null),[x,j]=p.useState(null),[w,C]=p.useState(null),[G,I]=p.useState(null),{t:u}=D(),{trackEvent:P}=H(),A=l==="pro";p.useEffect(()=>{if(o){g(o),_(null);return}let b=!1;return it(e,i).then(k=>{b||g(k)}).catch(k=>{b||_(k instanceof Error?k.message:String(k))}),()=>{b=!0}},[e,i,o]);const S=async()=>{if(n!=null&&n.target){P("dashboard_click_event",{click_target:"ui_studio_capture_current",page:"ui-studio",tab:"ui_studio_analysis"}),h(null),C("preview"),j({tone:"info",message:u("uiStudio.actions.previewRunning","캡처 중..."),detail:u("uiStudio.actions.previewRunningDetail","완료되면 새 화면 캡처 파일 ID를 표시합니다.")});try{const b=await le("preview",{targetPath:n.target});pe(b);const k=he(b),L=V(k,"snapshot_id"),f=Z(k,"screenshot"),M=Z(k,"meta"),T=V(f,"saved_path"),oe=V(M,"persist_warning"),U=ge(u,k);j(oe?{tone:"warning",message:F(u,"uiStudio.actions.previewNeedsSaveCheck","캡처 완료, 저장 확인 필요",U,L),detail:oe}:L&&T?{tone:"success",message:F(u,"uiStudio.actions.previewSaved","새 화면 캡처 저장 완료",U,L),detail:u("uiStudio.actions.previewSavedDetail","기존 화면 캡처는 변경하지 않고 새 파일로 저장했습니다.")}:L?{tone:"warning",message:F(u,"uiStudio.actions.previewComplete","캡처 완료",U,L),detail:u("uiStudio.actions.previewSavedPathMissing","새 화면 캡처 ID는 받았지만 저장 경로를 확인하지 못했습니다.")}:{tone:"warning",message:F(u,"uiStudio.actions.previewComplete","캡처 완료",U),detail:u("uiStudio.actions.previewSnapshotIdMissing","새 화면 캡처 ID를 확인하지 못했습니다. 목록을 새로고침해 저장 여부를 확인해 주세요.")}),await(s==null?void 0:s())}catch(b){h(b instanceof Error?b.message:String(b))}finally{C(null)}}},N=async()=>{if(n!=null&&n.target){P("dashboard_click_event",{click_target:"ui_studio_check_again",page:"ui-studio",tab:"ui_studio_analysis"}),h(null),C("check"),j({tone:"info",message:u("uiStudio.actions.designCheckRunning","개선 제안 확인 중..."),detail:u("uiStudio.actions.designCheckRunningDetail","완료되면 우선 검토/검토 권장/선택 개선 항목 수를 표시합니다.")});try{const b=await le("check",{targetPath:n.target});pe(b);const k=he(b),L=ge(u,k);j({tone:"success",message:F(u,"uiStudio.actions.designCheckComplete","개선 제안 확인 완료",L),detail:u("uiStudio.actions.designCheckNoSnapshotSaved","이 작업은 화면 캡처 파일을 새로 저장하지 않습니다.")}),await(s==null?void 0:s())}catch(b){h(b instanceof Error?b.message:String(b))}finally{C(null)}}},E=async()=>{h(null),j(null);try{await Oe(i,e),await(s==null?void 0:s()),I(null),a()}catch(b){throw h(b instanceof Error?b.message:String(b)),b}},v=A?void 0:u("uiStudio.actions.proRequired","Pro에서 사용 가능"),R=n!=null&&n.target?Ie(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:u("uiStudio.analysis.detailDialog","Analysis detail")}),t.jsx("span",{className:r.drawerTarget,title:(R==null?void 0:R.full)??e,children:(R==null?void 0:R.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:v??u("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:!A||!n.target||w!==null,type:"button",children:[t.jsx(Ke,{size:15,"aria-hidden":"true"}),t.jsx("span",{children:u("uiStudio.actions.captureCurrentState","현재 상태 캡처")})]})}),t.jsx(y,{text:v??u("uiStudio.actions.checkSuggestionsAgain.tooltip","Recompute suggestions for this capture without taking a new screenshot."),children:t.jsxs("button",{className:r.drawerActionBtn,onClick:()=>void N(),disabled:!A||!n.target||w!==null,type:"button",children:[t.jsx($e,{size:15,"aria-hidden":"true"}),t.jsx("span",{children:u("uiStudio.actions.checkSuggestionsAgain","개선 제안 다시 확인")})]})})]}),t.jsxs("details",{className:r.drawerMoreMenu,children:[t.jsx("summary",{className:r.drawerMoreButton,title:u("uiStudio.actions.more.tooltip","Open additional actions."),"aria-label":u("uiStudio.actions.more","More"),children:t.jsx(Ye,{size:18,"aria-hidden":"true"})}),t.jsx("div",{className:r.drawerMoreMenuBody,children:t.jsx(y,{text:v??u("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:()=>{P("dashboard_click_event",{click_target:"ui_studio_delete_snapshot",page:"ui-studio",tab:"ui_studio_analysis"}),I("deleteSnapshot")},disabled:!A,type:"button",children:u("uiStudio.actions.deleteSnapshot","이 화면 캡처 삭제")})})})]})]}),t.jsx(y,{text:u("uiStudio.detailClose.tooltip","Close this detail panel."),children:t.jsx("button",{className:r.closeBtn,onClick:a,type:"button","aria-label":u("uiStudio.detailClose","Close"),children:t.jsx(Xe,{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(Pa,{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(ka,{items:n.check_results}),t.jsxs("dl",{className:r.metaDl,children:[t.jsx("dt",{children:t.jsx(B,{label:u("uiStudio.capturedAt","Captured"),tooltip:u("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(B,{label:u("uiStudio.scope","Scope"),tooltip:u("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(B,{label:u("uiStudio.target","Target"),tooltip:u("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(B,{label:u("uiStudio.briefId","Brief"),tooltip:u("uiStudio.briefId.tooltip","Identifier of the design brief that produced this UI.")})}),t.jsx("dd",{children:n.brief_id})]})]})]}),G==="deleteSnapshot"&&t.jsx(ne,{title:u("uiStudio.confirm.deleteSnapshotTitle","화면 캡처 삭제"),message:u("uiStudio.confirm.deleteSnapshotMessage","이 화면 캡처 파일만 삭제됩니다 (Studio 인스턴스 보존)."),danger:!0,confirmLabel:u("common.delete","삭제"),onConfirm:E,onClose:()=>I(null)})]})}function Pa({detail:e}){const{t:i}=D(),a=ba(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(B,{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_${a}`]??""}`,children:Ca(i,a)}),t.jsx("span",{className:r.drawerAnalysisCounts,children:Ia(i,e)})]}),t.jsxs("div",{className:r.drawerAnalysisSummaryItem,children:[t.jsx("span",{className:r.drawerAnalysisLabel,children:t.jsx(B,{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})]})]})}function ka({items:e}){const{t:i}=D();if(e.length===0)return t.jsx("p",{className:r.emptySuggestions,children:i("uiStudio.noSuggestions","현재 개선 제안 없음")});const{high:a,medium:o,low:l}=wa(e,i);return t.jsxs("div",{className:r.suggestionsWrap,children:[t.jsx("h3",{children:t.jsx(B,{label:i("uiStudio.designCheckResultsTitle","Design Check suggestions"),tooltip:i("uiStudio.designCheckResultsTitle.tooltip","All improvement suggestions found in this capture.")})}),a.length>0&&t.jsxs("section",{className:r.prioritySection,children:[t.jsx("h4",{className:r.sectionHighHeader,children:i("uiStudio.highPrioritySection","우선 검토")}),a.map(s=>t.jsx(Q,{group:s},`h-${s.rule}`))]}),o.length>0&&t.jsxs("section",{className:r.prioritySection,children:[t.jsx("h4",{className:r.sectionMediumHeader,children:i("uiStudio.mediumPrioritySection","검토 권장")}),o.map(s=>t.jsx(Q,{group:s},`m-${s.rule}`))]}),l.length>0&&t.jsxs("section",{className:r.prioritySection,children:[t.jsx("h4",{className:r.sectionLowHeader,children:i("uiStudio.lowPrioritySection","선택 개선")}),l.map(s=>t.jsx(Q,{group:s},`l-${s.rule}`))]})]})}function Q({group:e}){var n,g,d;const{t:i}=D(),[a,o]=p.useState(e.priority==="priority_high"&&e.items.length<=5),l=e.falsePositiveRatio>=.5&&!!((n=e.fixTemplate)!=null&&n.falsePositiveNote),s=((g=e.fixTemplate)==null?void 0:g.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(_=>!_),type:"button",children:[t.jsx("span",{className:r.groupLabel,children:s}),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:a?"▾":"▸"})]})}),a&&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((_,m)=>t.jsx(Ta,{item:_,group:e},`${_.path}-${m}`))})]})]})}function Ta({item:e,group:i}){var _;const{t:a}=D(),{trackEvent:o}=H(),[l,s]=p.useState(!1),n=Ie(e.path),g=((_=i.fixTemplate)==null?void 0:_.buildUpdateCommand(e))??null,d=async()=>{if(g)try{await navigator.clipboard.writeText(g),o("dashboard_click_event",{click_target:"ui_studio_copy_ai_instruction",page:"ui-studio",tab:"ui_studio_analysis"}),s(!0),setTimeout(()=>s(!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:`${a("uiStudio.fullPath","Full path")}: ${n.full}`,children:n.breadcrumb}),t.jsxs("span",{className:r.currentValue,children:[t.jsx(y,{text:a("uiStudio.colCurrent.tooltip","The currently applied value."),children:t.jsx("span",{children:a("uiStudio.colCurrent","Current")})}),": ",t.jsx("strong",{children:String(e.actual)})," → ",t.jsx(y,{text:a("uiStudio.colRecommended.tooltip","The recommended value."),children:t.jsx("span",{children:a("uiStudio.colRecommended","Recommended")})}),": ",t.jsx("strong",{children:String(e.expected)})]})]}),g&&t.jsx(y,{text:a("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?a("uiStudio.copiedToClipboard","Copied"):a("uiStudio.copyFixCommand","Copy AI instruction")})})]})}function Y(e,i){return Object.entries(i).reduce((a,[o,l])=>a.split(`{${o}}`).join(String(l)),e)}function Ba(e,i){return i.rule==="contrast"?Y(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"?Y(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"?Y(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 ke="sample_inventory_preview",ee=Fe,Da=[{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 Ga(e){const o={snapshot_id:ke,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:Da.map(n=>({...n,hint:Ba(e,n)})),image_url:ee};return{list:{placeId:0,snapshots:[o],totalCount:1},detail:l}}const Ma=/plugin not connected|sync not started/i;function te(e){return typeof e=="string"&&Ma.test(e)}function Te(){const{t:e}=D();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 Be(e){return e.target??e.scope}function Aa(e){const i=Be(e),a=i.split(".").filter(l=>l.length>0),o=a.findIndex(l=>l==="StarterGui");return o>=0&&a[o+1]?["StarterGui",a[o+1]].join("."):i}function De(e){return((e==null?void 0:e.priority_high)??0)>0?"needsFix":((e==null?void 0:e.priority_medium)??0)>0||((e==null?void 0:e.priority_low)??0)>0?"review":"passed"}function Ra(e){return De(e.design_check_summary)}function me(e){return ie(e.design_check_summary)}function ie(e){return((e==null?void 0:e.priority_high)??0)>0?0:((e==null?void 0:e.priority_medium)??0)>0?1:((e==null?void 0:e.priority_low)??0)>0?2:3}function La(e){return e.length===0?null:{...e.reduce((a,o)=>{const l=o.latest.design_check_summary;return a.priority_high+=(l==null?void 0:l.priority_high)??0,a.priority_medium+=(l==null?void 0:l.priority_medium)??0,a.priority_low+=(l==null?void 0:l.priority_low)??0,a},{priority_high:0,priority_medium:0,priority_low:0})}}function $a(e){const i=new Map;for(const l of e){const s=Be(l),n=i.get(s);if(!n){i.set(s,{latest:l,snapshotCount:1});continue}n.snapshotCount+=1,l.captured_at>n.latest.captured_at&&(n.latest=l)}const a=[...i.entries()].map(([l,s])=>({key:l,latest:s.latest,snapshotCount:s.snapshotCount,verdict:Ra(s.latest)})),o=new Map;for(const l of a){const s=Aa(l.latest),n=o.get(s)??[];n.push(l),o.set(s,n)}return[...o.entries()].map(([l,s])=>{var _;const n=s.sort((m,h)=>{const x=me(m.latest)-me(h.latest);return x!==0?x:h.latest.captured_at-m.latest.captured_at}),g=n.reduce((m,h)=>h.latest.captured_at>m.captured_at?h.latest:m,((_=n[0])==null?void 0:_.latest)??s[0].latest),d=La(n);return{key:l,latest:g,snapshotCount:n.reduce((m,h)=>m+h.snapshotCount,0),children:n,summary:d,verdict:De(d)}}).sort((l,s)=>{const n=ie(l.summary)-ie(s.summary);return n!==0?n:s.latest.captured_at-l.latest.captured_at})}function Ea(e){return e.reduce((i,a)=>(a.verdict==="passed"?i.noSuggestions+=1:i.hasSuggestions+=1,i),{hasSuggestions: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 Ha(e,i,a){return`${e("uiStudio.analysis.targetCountLabel","분석 대상")} ${$(e,i)} · ${se(e,"needsFix")} ${$(e,a.hasSuggestions)} · ${se(e,"passed")} ${$(e,a.noSuggestions)}`}function Oa({tier:e}){const{t:i}=D(),{trackEvent:a}=H(),o=e==="basic",l=Ce(50),s=p.useRef(null),[n,g]=p.useState(null),[d,_]=p.useState(new Set),[m,h]=p.useState(new Set),[x,j]=p.useState(!1),w=p.useCallback((f,M)=>{g(n===f?null:f)},[n]),C=p.useCallback(()=>{g(null)},[]),G=p.useCallback(f=>{_(M=>{const T=new Set(M);return T.has(f)?T.delete(f):T.add(f),T})},[]);p.useEffect(()=>{var M;if(!n)return;(M=s.current)==null||M.focus();const f=T=>{T.key==="Escape"&&!document.getElementById("delete-confirm-title")&&C()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[C,n]);const I=o?Ga(i):null,u=(I==null?void 0:I.list)??l.data,P=o?!1:l.loading,A=p.useCallback(f=>{h(M=>{const T=new Set(M);return T.has(f)?T.delete(f):T.add(f),T})},[]),S=f=>{h(new Set(f))},N=()=>{h(new Set)},E=async()=>{const f=(u==null?void 0:u.placeId)??0;a("dashboard_click_event",{click_target:"ui_studio_delete_selected_snapshots",page:"ui-studio",tab:"ui_studio_analysis"}),await Ue(f,{ids:[...m]}),await l.refresh(),j(!1),h(new Set)};if(P)return t.jsx("div",{className:r.page,children:i("uiStudio.loading","Loading...")});if(!o&&te(l.error))return t.jsx(Te,{});if(!o&&l.error)return t.jsxs("div",{className:r.page,children:[i("uiStudio.error","Error"),": ",l.error]});const v=(u==null?void 0:u.snapshots)??[],R=(u==null?void 0:u.placeId)??0,b=v.map(f=>f.snapshot_id),k=$a(v),L=Ea(k);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:Se.uiStudioAnalysis,target:"_blank",rel:"noreferrer",onClick:()=>a("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(B,{label:i("uiStudio.title","UI Studio"),tooltip:i("uiStudio.title.tooltip","A central place to review AI-generated UI screens and improvement suggestions.")})})}),v.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(B,{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:Ha(i,k.length,L)})]})}),t.jsx("div",{className:r.analysisReportGrid,"data-testid":"analysis-report-grid",children:k.map(f=>t.jsx(Ua,{report:f,placeId:R,imageUrlOverride:o?ee:void 0,expanded:d.has(f.key),onPrimaryClick:M=>{f.children.length>1?G(f.key):w(f.latest.snapshot_id,M)},onChildClick:(M,T)=>w(M,T)},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(B,{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,v.length)]})]}),!o&&v.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(b),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:N,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:()=>j(!0),type:"button",children:i("common.delete","삭제")})})]})]})]}),t.jsx("div",{className:r.grid,children:v.map(f=>t.jsx(ma,{snapshot:f,placeId:R,onClick:M=>w(f.snapshot_id,M),imageUrlOverride:o?ee:void 0,selectable:!o,selected:m.has(f.snapshot_id),onToggleSelect:A},f.snapshot_id))})]})]})]}),n&&t.jsx("div",{className:r.analysisDetailPopupLayer,"data-testid":"analysis-detail-popup-layer",onClick:C,role:"presentation",children:t.jsx("section",{ref:s,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(Na,{snapshotId:n,placeId:R,onClose:C,sampleDetail:o&&n===ke?(I==null?void 0:I.detail)??null:null,tier:e,onActionDone:o?void 0:l.refresh})})})]}),x&&t.jsx(ne,{title:i("uiStudio.confirm.deleteBatchTitle","화면 캡처 일괄 삭제"),message:i("uiStudio.confirm.deleteBatchMessage",`선택한 ${m.size}개의 화면 캡처를 삭제합니다. 이 작업은 되돌릴 수 없습니다.`),danger:!0,confirmLabel:i("common.delete","삭제"),onConfirm:E,onClose:()=>j(!1)})]})}function se(e,i){return i==="needsFix"||i==="review"?e("uiStudio.analysis.verdict.hasSuggestions","개선 제안 있음"):e("uiStudio.analysis.verdict.passed","현재 개선 제안 없음")}function Fa(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):e("uiStudio.analysis.issueSummary.passed","현재 검토 기준에서 추가 개선 제안은 없습니다.")}function Ua({report:e,placeId:i,imageUrlOverride:a,expanded:o,onPrimaryClick:l,onChildClick:s}){const{t:n}=D(),g=e.latest,d=a??be(g.snapshot_id,i),_=new Date(g.captured_at*1e3).toLocaleString(),m=se(n,e.verdict),h=e.children.length>1;return t.jsxs("div",{className:r.analysisReportGroup,children:[t.jsxs("button",{className:r.analysisReportCard,"aria-expanded":h?o:void 0,"aria-label":`${e.key} ${h?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:g.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("div",{className:r.analysisReportIssue,children:Fa(n,e.summary)}),t.jsxs("div",{className:r.analysisReportMeta,children:[_," ·"," ",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","검토 기준")})}),": ",g.thresholds_source,e.snapshotCount>1?` · ${n("uiStudio.analysis.captureLabel","캡처")} ${$(n,e.snapshotCount)}`:"",h?` · ${n("uiStudio.analysis.childTargets","하위 대상")} ${$(n,e.children.length)}`:""]})]})]}),h&&o&&t.jsx("div",{className:r.analysisChildList,children:e.children.map(x=>t.jsxs("button",{className:r.analysisChildRow,onClick:j=>s(x.latest.snapshot_id,j.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.analysisChildDetailHint,children:n("uiStudio.analysis.childDetailHint","하위 대상 상세 보기")})]},x.key))})]})}function za(e,i,a=1e4){const[o,l]=p.useState(null),[s,n]=p.useState(!0),[g,d]=p.useState(null),_=JSON.stringify(i),m=p.useCallback(async()=>{try{const h=await ce(e,i);l(h),d(null)}catch(h){d(h.message)}finally{n(!1)}},[e,_]);return p.useEffect(()=>{let h=!0;const x=async()=>{try{const w=await ce(e,i);h&&(l(w),d(null))}catch(w){h&&d(w.message)}finally{h&&n(!1)}};x();const j=setInterval(()=>{x()},a);return()=>{h=!1,clearInterval(j)}},[e,_,a]),{data:o,loading:s,error:g,refresh:m}}const qa="_filterBar_1nnge_4",Va="_filterGroup_1nnge_14",Wa="_filterLabel_1nnge_21",Ka="_filterCheckbox_1nnge_28",Qa="_segmentGroup_1nnge_45",Ya="_segmentBtn_1nnge_55",Ja="_segmentBtnActive_1nnge_73",Xa="_filterInput_1nnge_79",Za="_filterResetBtn_1nnge_95",es="_requestRow_1nnge_114",ts="_requestRowMain_1nnge_127",is="_requestDetailToggle_1nnge_134",as="_thumbPair_1nnge_156",ss="_thumbPairButton_1nnge_164",rs="_thumbSlot_1nnge_179",ns="_thumbImg_1nnge_204",os="_thumbPlaceholder_1nnge_211",ls="_thumbArrow_1nnge_219",cs="_extraPathsBadge_1nnge_225",ds="_requestMeta_1nnge_239",us="_requestLabel_1nnge_247",hs="_requestTime_1nnge_256",ps="_requestStats_1nnge_261",gs="_statDot_1nnge_269",ms="_summaryPill_1nnge_273",_s="_requestActions_1nnge_278",ys="_expandHint_1nnge_285",fs="_mutationsArea_1nnge_298",xs="_mutLoading_1nnge_307",Ss="_mutEmpty_1nnge_308",js="_mutError_1nnge_314",ws="_mutationRow_1nnge_320",vs="_mutationLine_1nnge_330",bs="_mutTs_1nnge_337",Cs="_mutCommand_1nnge_343",Is="_mutPath_1nnge_349",Ns="_mutDiff_1nnge_359",Ps="_mutErr_1nnge_314",ks="_changeDetails_1nnge_374",Ts="_changeDetailRow_1nnge_382",Bs="_changeDetailRowNoBefore_1nnge_391",Ds="_changeDetailBadge_1nnge_395",Gs="_changeDetail_text_1nnge_412",Ms="_changeDetail_color_1nnge_417",As="_changeDetail_size_1nnge_422",Rs="_changeDetail_layout_1nnge_427",Ls="_changeDetail_state_1nnge_432",$s="_changeDetail_asset_1nnge_437",Es="_changeDetail_property_1nnge_442",Hs="_changeDetailProperty_1nnge_446",Os="_changeDetailArrow_1nnge_454",Fs="_changeDetailOldValue_1nnge_460",Us="_changeDetailNewValue_1nnge_461",zs="_compareDialogLayer_1nnge_479",qs="_compareDialog_1nnge_479",Vs="_beforeAfterDrawer_1nnge_510",Ws="_drawerHeader_1nnge_520",Ks="_drawerTitle_1nnge_529",Qs="_drawerCloseBtn_1nnge_536",Ys="_drawerBody_1nnge_552",Js="_pathTabs_1nnge_559",Xs="_pathTab_1nnge_559",Zs="_pathTabActive_1nnge_588",er="_comparePanel_1nnge_594",tr="_compareHalf_1nnge_604",ir="_compareLabel_1nnge_611",ar="_compareImg_1nnge_622",sr="_comparePlaceholder_1nnge_630",rr="_compareDetailsPanel_1nnge_642",nr="_compareDetailsHeader_1nnge_651",or="_drawerFooter_1nnge_669",lr="_drawerActionBtn_1nnge_677",cr="_historyTabWrap_1nnge_695",dr="_historyWorkspace_1nnge_701",ur="_historyMainColumn_1nnge_706",hr="_requestList_1nnge_710",pr="_emptyHistory_1nnge_715",gr="_historyError_1nnge_722",mr="_historyLoading_1nnge_728",_r="_listHeader_1nnge_736",yr="_listHeaderTitle_1nnge_745",fr="_clearBtn_1nnge_752",xr="_deleteErrBanner_1nnge_771",c={filterBar:qa,filterGroup:Va,filterLabel:Wa,filterCheckbox:Ka,segmentGroup:Qa,segmentBtn:Ya,segmentBtnActive:Ja,filterInput:Xa,filterResetBtn:Za,requestRow:es,requestRowMain:ts,requestDetailToggle:is,thumbPair:as,thumbPairButton:ss,thumbSlot:rs,thumbImg:ns,thumbPlaceholder:os,thumbArrow:ls,extraPathsBadge:cs,requestMeta:ds,requestLabel:us,requestTime:hs,requestStats:ps,statDot:gs,summaryPill:ms,requestActions:_s,expandHint:ys,mutationsArea:fs,mutLoading:xs,mutEmpty:Ss,mutError:js,mutationRow:ws,mutationLine:vs,mutTs:bs,mutCommand:Cs,mutPath:Is,mutDiff:Ns,mutErr:Ps,changeDetails:ks,changeDetailRow:Ts,changeDetailRowNoBefore:Bs,changeDetailBadge:Ds,changeDetail_text:Gs,changeDetail_color:Ms,changeDetail_size:As,changeDetail_layout:Rs,changeDetail_state:Ls,changeDetail_asset:$s,changeDetail_property:Es,changeDetailProperty:Hs,changeDetailArrow:Os,changeDetailOldValue:Fs,changeDetailNewValue:Us,compareDialogLayer:zs,compareDialog:qs,beforeAfterDrawer:Vs,drawerHeader:Ws,drawerTitle:Ks,drawerCloseBtn:Qs,drawerBody:Ys,pathTabs:Js,pathTab:Xs,pathTabActive:Zs,comparePanel:er,compareHalf:tr,compareLabel:ir,compareImg:ar,comparePlaceholder:sr,compareDetailsPanel:rr,compareDetailsHeader:nr,drawerFooter:or,drawerActionBtn:lr,historyTabWrap:cr,historyWorkspace:dr,historyMainColumn:ur,requestList:hr,emptyHistory:pr,historyError:gr,historyLoading:mr,listHeader:_r,listHeaderTitle:yr,clearBtn:fr,deleteErrBanner:xr};function Sr(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function _e(e){return e==null?"nil":typeof e=="string"?`"${e}"`:typeof e=="object"?JSON.stringify(e):String(e)}function Ge({mutations:e,emptyLabel:i}){const{t:a}=D();return e.length===0?t.jsx("div",{className:c.mutEmpty,children:i??a("uiStudio.history.row.mutationsEmpty","No change details")}):t.jsx(t.Fragment,{children:e.map(o=>t.jsx(jr,{mutation:o},o.mutationId))})}function jr({mutation:e}){return t.jsxs("div",{className:c.mutationRow,children:[t.jsxs("div",{className:c.mutationLine,children:[t.jsx("span",{className:c.mutTs,children:Sr(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(wr,{detail:i},`${i.property}:${i.category}`))}),!e.ok&&e.error&&t.jsx("span",{className:c.mutErr,children:e.error})]})}function wr({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:_e(e.before)}),t.jsx("span",{className:c.changeDetailArrow,children:"→"}),t.jsx("span",{className:c.changeDetailNewValue,children:_e(e.after)})]})}function ye(e,i){return`${q}/api/ui-studio/snapshots/${encodeURIComponent(e)}/image?placeId=${i}`}function vr(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function br(e){if(!e)return null;const i=e.split(/[./]/).filter(o=>o.length>0);if(i.length===0)return null;const a=i.findIndex(o=>o==="StarterGui");return a>=0&&i[a+1]?i[a+1]:i[i.length-1]??null}function J(e,i){if(i.label)return i.label;const a=br(i.affectedPaths[0]);if(a){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}",a).replace("{n}",String(i.mutationCount))}return e("uiStudio.history.row.toolLabel","UI changes ({n})").replace("{n}",String(i.mutationCount))}function X(e,i){return`${i}${e("uiStudio.storage.countSuffix","")}`}function Cr(e,i){if(!i)return null;const a=[i.style_family,i.layout_family,i.device_policy,i.safe_area_policy].filter(o=>typeof o=="string"&&o.length>0);return a.length===0?null:`${e("uiStudio.history.row.qualityPlan","Design direction")}: ${a.join(" · ")}`}function Ir(e,i){if(!i)return null;if(i.source==="unavailable")return e("uiStudio.history.row.designCheckUnavailable","Suggestions: unavailable");if(i.total===0)return e("uiStudio.history.row.designCheckNone","Suggestions: none");const a=`${e("uiStudio.priorityHigh","Priority")} ${X(e,i.priority_high)}`,o=`${e("uiStudio.priorityMedium","Recommended")} ${X(e,i.priority_medium)}`,l=`${e("uiStudio.priorityLow","Optional")} ${X(e,i.priority_low)}`;return`${e("uiStudio.history.row.designCheck","Suggestions")}: ${a} · ${o} · ${l}`}function Me({req:e,placeId:i,onOpenCompare:a,imageUrlOverride:o,sampleMutations:l}){const{t:s}=D(),[n,g]=p.useState(!1),[d,_]=p.useState(null),[m,h]=p.useState(!1),[x,j]=p.useState(null),w=o!=null,C=e.affectedPaths[0]??null,G=e.affectedPaths.length-1,I=C?e.beforeSnapshots[C]??null:null,u=C?e.afterSnapshots[C]??null:null,P=I?w?o:ye(I,i):null,A=u?w?o:ye(u,i):null,S=Cr(s,e.qualityPlanSummary),N=Ir(s,e.postChangeDesignCheckSummary),E=async()=>{if(!n&&d===null)if(w&&l!=null)_(l);else{h(!0),j(null);try{const v=await je(i,e.requestId);_(v.mutations)}catch(v){j(v.message)}finally{h(!1)}}g(v=>!v)};return t.jsxs("div",{className:c.requestRow,children:[t.jsxs("div",{className:c.requestRowMain,children:[t.jsx(y,{text:s("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:v=>a(v.currentTarget),disabled:!C,"aria-label":`${J(s,e)} ${s("uiStudio.history.row.compare","Before / After")}`,type:"button",children:[t.jsx("div",{className:c.thumbSlot,children:P?t.jsx("img",{className:c.thumbImg,src:P,alt:s("uiStudio.compare.before","Before"),loading:"lazy"}):t.jsx(y,{text:s("uiStudio.history.row.noBeforeState.tooltip","No capture saved before this change."),children:t.jsx("span",{className:c.thumbPlaceholder,children:s("uiStudio.history.row.noBeforeState","이전 없음")})})}),t.jsx("span",{className:c.thumbArrow,children:"→"}),t.jsx("div",{className:c.thumbSlot,children:A?t.jsx("img",{className:c.thumbImg,src:A,alt:s("uiStudio.compare.after","After"),loading:"lazy"}):t.jsx(y,{text:s("uiStudio.history.row.noAfterState.tooltip","No capture saved after this change."),children:t.jsx("span",{className:c.thumbPlaceholder,children:s("uiStudio.history.row.noAfterState","이후 없음")})})}),G>0&&t.jsx(y,{text:s("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":`${J(s,e)} ${s("uiStudio.history.row.toggleDetails","Toggle change details")}`,onClick:()=>void E(),children:[t.jsxs("span",{className:c.requestMeta,children:[t.jsx("span",{className:c.requestLabel,children:J(s,e)}),t.jsx("span",{className:c.requestTime,children:vr(e.startedAt)}),t.jsxs("span",{className:c.requestStats,children:[t.jsx(y,{text:s("uiStudio.history.row.affectedPaths.tooltip","Number of UIs affected by this action."),children:t.jsxs("span",{children:[s("uiStudio.history.row.affectedPaths","Paths")," ",e.affectedPaths.length,s("uiStudio.storage.countSuffix","")]})}),t.jsx("span",{className:c.statDot,children:"·"}),t.jsx(y,{text:s("uiStudio.history.row.mutations.tooltip","Number of detailed changes (e.g., property edits)."),children:t.jsxs("span",{children:[s("uiStudio.history.row.mutations","Change details")," ",e.mutationCount,s("uiStudio.storage.countSuffix","")]})}),S&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:c.statDot,children:"·"}),t.jsx(y,{text:s("uiStudio.history.row.qualityPlan.tooltip","Brief design direction used for this change."),children:t.jsx("span",{className:c.summaryPill,children:S})})]}),N&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:c.statDot,children:"·"}),t.jsx(y,{text:s("uiStudio.history.row.designCheck.tooltip","Post-change Design Check suggestion summary."),children:t.jsx("span",{className:c.summaryPill,children:N})})]})]})]}),t.jsx("span",{className:c.requestActions,children:t.jsx(y,{text:s("uiStudio.history.row.toggleDetails.tooltip","Show or hide a per-line breakdown of what changed."),children:t.jsx("span",{className:c.expandHint,children:n?s("uiStudio.history.row.collapseDetails","Hide change details"):s("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:s("uiStudio.history.loading","로딩 중...")}),x&&t.jsx("div",{className:c.mutError,children:x}),d&&t.jsx(Ge,{mutations:d,emptyLabel:s("uiStudio.history.row.mutationsEmpty","No change details")})]})]})}function fe(e,i){return`${q}/api/ui-studio/snapshots/${encodeURIComponent(e)}/image?placeId=${i}`}function Ae({requestId:e,placeId:i,onClose:a,imageUrlOverride:o,sampleDetail:l}){const{t:s}=D(),n=p.useRef(null),g=l!=null,[d,_]=p.useState(g?l:null),[m,h]=p.useState(!g),[x,j]=p.useState(null),[w,C]=p.useState(g&&l.affectedPaths.length>0?l.affectedPaths[0]:null);p.useEffect(()=>{var S;(S=n.current)==null||S.focus()},[]),p.useEffect(()=>{const S=N=>{N.key==="Escape"&&(N.preventDefault(),a())};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[a]),p.useEffect(()=>{if(g)return;let S=!0;return h(!0),j(null),je(i,e).then(N=>{S&&(_(N),N.affectedPaths.length>0&&C(N.affectedPaths[0]))}).catch(N=>{S&&j(N.message)}).finally(()=>{S&&h(!1)}),()=>{S=!1}},[e,i,g]);const G=w&&d?d.beforeSnapshots[w]??null:null,I=w&&d?d.afterSnapshots[w]??null:null,u=G?o??fe(G,i):null,P=I?o??fe(I,i):null,A=s("uiStudio.history.row.compare","전후 비교");return t.jsx("div",{className:c.compareDialogLayer,"data-testid":"history-compare-dialog-layer",onClick:a,role:"presentation",children:t.jsx("section",{ref:n,className:c.compareDialog,role:"dialog","aria-modal":"true","aria-label":A,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:A}),t.jsx("button",{className:c.drawerCloseBtn,onClick:a,type:"button",children:s("uiStudio.history.drawer.close","닫기")})]}),m&&t.jsx("div",{className:c.drawerBody,children:s("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:`${s("uiStudio.compare.path.tooltip","The UI instance path for this screen.")} ${S}`,children:t.jsx("button",{role:"tab","aria-selected":w===S,className:`${c.pathTab} ${w===S?c.pathTabActive:""}`,onClick:()=>C(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:s("uiStudio.compare.before.tooltip","The screen saved just before AI made the change."),children:t.jsx("div",{className:c.compareLabel,children:s("uiStudio.compare.before","Before")})}),u?t.jsx("img",{className:c.compareImg,src:u,alt:s("uiStudio.compare.before","Before")}):t.jsx("div",{className:c.comparePlaceholder,children:s("uiStudio.history.row.noBeforeState","이전 상태 없음")})]}),t.jsxs("div",{className:c.compareHalf,children:[t.jsx(y,{text:s("uiStudio.compare.after.tooltip","The screen saved just after AI made the change."),children:t.jsx("div",{className:c.compareLabel,children:s("uiStudio.compare.after","After")})}),P?t.jsx("img",{className:c.compareImg,src:P,alt:s("uiStudio.compare.after","After")}):t.jsx("div",{className:c.comparePlaceholder,children:s("uiStudio.history.row.noAfterState","이후 상태 없음")})]})]}),t.jsxs("section",{className:c.compareDetailsPanel,children:[t.jsx("div",{className:c.compareDetailsHeader,children:s("uiStudio.history.drawer.changeDetails","Change details")}),t.jsx(Ge,{mutations:d.mutations,emptyLabel:s("uiStudio.history.row.mutationsEmpty","No change details")})]})]}),t.jsx("div",{className:c.drawerFooter,children:t.jsx("button",{className:c.drawerActionBtn,onClick:a,type:"button",children:s("uiStudio.history.drawer.close","닫기")})})]})})})}function z(e){const i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0),a=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999);return{start:i,end:a}}function xe(e,i){const a=e.split("-").map(Number);if(a.length!==3||a.some(n=>Number.isNaN(n)))return;const[o,l,s]=a;return new Date(o,l-1,s,i?23:0,i?59:0,i?59:0,i?999:0).toISOString()}function Nr(e){const i={limit:50};if(e.action!=="all"&&(i.action=e.action),e.datePreset==="custom"){const a=e.from?xe(e.from,!1):void 0,o=e.to?xe(e.to,!0):void 0;a&&(i.from=a),o&&(i.to=o)}else if(e.datePreset!=="all"){const a=new Date;if(e.datePreset==="today"){const{start:o,end:l}=z(a);i.from=o.toISOString(),i.to=l.toISOString()}else if(e.datePreset==="yesterday"){const o=new Date(a);o.setDate(o.getDate()-1);const{start:l,end:s}=z(o);i.from=l.toISOString(),i.to=s.toISOString()}else{const o=e.datePreset==="7d"?6:29,l=new Date(a);l.setDate(l.getDate()-o);const{start:s}=z(l),{end:n}=z(a);i.from=s.toISOString(),i.to=n.toISOString()}}return i}function Re(){return{action:"all",datePreset:"all"}}function Pr(){const{t:e}=D(),{trackEvent:i}=H(),a=ze(e),[o,l]=p.useState(null),s=o?a.requests.find(d=>d.requestId===o)??null:null,n=p.useCallback((d,_)=>{l(d)},[]),g=p.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:Se.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(B,{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:a.requests.map(d=>t.jsx(Me,{req:d,placeId:0,onOpenCompare:_=>n(d.requestId,_),imageUrlOverride:de,sampleMutations:a.mutationsByRequest[d.requestId]},d.requestId))})]}),o&&s&&t.jsx(Ae,{requestId:o,placeId:0,onClose:g,imageUrlOverride:de,sampleDetail:{...s,mutations:a.mutationsByRequest[s.requestId]??[]}})]})]})}function kr({filter:e,onChange:i}){const{t:a}=D(),o=[{value:"all",label:a("uiStudio.history.filter.actionAll","All"),tooltip:a("uiStudio.history.filter.actionAll.tooltip","Show every kind of action.")},{value:"create_tree",label:a("uiStudio.history.filter.actionCreate","Create"),tooltip:a("uiStudio.history.filter.actionCreate.tooltip","Show only actions that created a new UI.")},{value:"update",label:a("uiStudio.history.filter.actionUpdate","Update"),tooltip:a("uiStudio.history.filter.actionUpdate.tooltip","Show only actions that updated an existing UI.")},{value:"delete",label:a("uiStudio.history.filter.actionDelete","Delete"),tooltip:a("uiStudio.history.filter.actionDelete.tooltip","Show only actions that deleted a UI.")}],l=[{value:"all",label:a("uiStudio.history.filter.dateAll","All"),tooltip:a("uiStudio.history.filter.dateAll.tooltip","Show the full history.")},{value:"today",label:a("uiStudio.history.filter.today","Today"),tooltip:a("uiStudio.history.filter.today.tooltip","Show only changes from today.")},{value:"yesterday",label:a("uiStudio.history.filter.yesterday","Yesterday"),tooltip:a("uiStudio.history.filter.yesterday.tooltip","Show only changes from yesterday.")},{value:"7d",label:a("uiStudio.history.filter.last7Days","Last 7 days"),tooltip:a("uiStudio.history.filter.last7Days.tooltip","Show changes from the last 7 days.")},{value:"30d",label:a("uiStudio.history.filter.last30Days","Last 30 days"),tooltip:a("uiStudio.history.filter.last30Days.tooltip","Show changes from the last 30 days.")},{value:"custom",label:a("uiStudio.history.filter.customRange","Custom range"),tooltip:a("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(B,{label:a("uiStudio.history.filter.actions","작업 유형"),tooltip:a("uiStudio.history.filter.actions.tooltip","Filter records by the kind of change AI made.")})}),t.jsx("div",{className:c.segmentGroup,children:o.map(s=>t.jsx(y,{text:s.tooltip,children:t.jsx("button",{className:`${c.segmentBtn} ${e.action===s.value?c.segmentBtnActive:""}`,onClick:()=>i({...e,action:s.value}),"aria-pressed":e.action===s.value,type:"button",children:s.label})},s.value))})]}),t.jsxs("div",{className:c.filterGroup,children:[t.jsx("span",{className:c.filterLabel,children:t.jsx(B,{label:a("uiStudio.history.filter.period","Period"),tooltip:a("uiStudio.history.filter.period.tooltip","Filter records by time range.")})}),t.jsx("div",{className:c.segmentGroup,children:l.map(s=>t.jsx(y,{text:s.tooltip,children:t.jsx("button",{className:`${c.segmentBtn} ${e.datePreset===s.value?c.segmentBtnActive:""}`,onClick:()=>i({...e,datePreset:s.value,from:s.value==="custom"?e.from:void 0,to:s.value==="custom"?e.to:void 0}),"aria-pressed":e.datePreset===s.value,type:"button",children:s.label})},s.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(B,{label:a("uiStudio.history.filter.from","시작일"),tooltip:a("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:s=>i({...e,from:s.target.value||void 0})}),t.jsx("label",{className:c.filterLabel,htmlFor:"ui-history-to-date",children:t.jsx(B,{label:a("uiStudio.history.filter.to","종료일"),tooltip:a("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:s=>i({...e,to:s.target.value||void 0})})]}),t.jsx(y,{text:a("uiStudio.history.filter.reset.tooltip","Reset all filters to defaults."),children:t.jsx("button",{className:c.filterResetBtn,onClick:()=>i(Re()),type:"button",children:a("uiStudio.history.filter.reset","Reset")})})]})}function Tr(){var E;const{t:e}=D(),{trackEvent:i}=H(),a=Ce(1),o=((E=a.data)==null?void 0:E.placeId)??0,[l,s]=p.useState(Re),{data:n,loading:g,error:d,refresh:_}=za(o,Nr(l)),[m,h]=p.useState(null),[x,j]=p.useState(!1),[w,C]=p.useState(!1),[G,I]=p.useState(null),u=async()=>{I(null);try{await qe(o,{all:!0,alsoSnapshots:w}),await _(),j(!1)}catch(v){throw I(v.message),v}},P=(n==null?void 0:n.requests)??[],A=te(a.error)||te(d),S=p.useCallback((v,R)=>{i("dashboard_click_event",{click_target:"ui_studio_compare_before_after",page:"ui-studio",tab:"ui_studio_history"}),h(v)},[i]),N=p.useCallback(()=>{h(null)},[]);return t.jsxs("div",{className:c.historyTabWrap,children:[A?t.jsx(Te,{}):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(kr,{filter:l,onChange:s}),t.jsxs("div",{className:c.listHeader,children:[t.jsx("h2",{className:c.listHeaderTitle,children:t.jsx(B,{label:e("uiStudio.history.title","변경 이력"),tooltip:e("uiStudio.history.title.tooltip","A timeline of every UI change made by AI.")})}),P.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"}),j(!0)},type:"button",children:e("uiStudio.history.clear","Clear")})})]}),g&&t.jsx("div",{className:c.historyLoading,children:e("uiStudio.history.loading","로딩 중...")}),!g&&d&&t.jsxs("div",{className:c.historyError,children:[e("uiStudio.history.error","오류"),": ",d]}),!g&&!d&&P.length===0&&t.jsx("div",{className:c.emptyHistory,children:e("uiStudio.history.empty","아직 변경 이력이 없습니다. AI 에이전트가 manage_ui 로 UI 를 수정하면 자동으로 기록됩니다.")}),!g&&P.length>0&&t.jsx("div",{className:c.requestList,children:P.map(v=>t.jsx(Me,{req:v,placeId:o,onOpenCompare:R=>S(v.requestId,R)},v.requestId))}),G&&t.jsx("div",{className:c.deleteErrBanner,children:G})]}),m&&t.jsx(Ae,{requestId:m,placeId:o,onClose:N})]}),x&&t.jsx(ne,{title:e("uiStudio.history.confirm.clearRequestsTitle","변경 이력 삭제"),message:e("uiStudio.history.confirm.clearRequestsMessage","현재 place의 변경 이력을 삭제합니다. Studio 인스턴스에는 영향을 주지 않습니다."),danger:!0,cascadeOption:{label:e("uiStudio.history.confirm.cascadeOption","연결된 화면 캡처도 함께 삭제"),checked:w,onChange:C},confirmLabel:e("common.delete","삭제"),onConfirm:u,onClose:()=>j(!1)})]})}function Br({tier:e}){return e==="basic"?t.jsx(Pr,{}):t.jsx(Tr,{})}const Dr=["analysis","history"];function $r(){const{t:e}=D(),{trackEvent:i}=H(),{tier:a,loading:o}=Ee(),[l,s]=He(),n=l.get("tab"),g=n&&Dr.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"}),s(h=>{const x=new URLSearchParams(h);return x.set("tab",m),x})},_=[{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(Ve,{items:_,value:g,onChange:d}),o?t.jsx("div",{className:r.emptyState,children:e("uiStudio.loading","Loading...")}):g==="analysis"?t.jsx(Oa,{tier:a}):t.jsx(Br,{tier:a})]})}export{$r as Component};
@@ -0,0 +1 @@
1
+ import{u,j as e,x as w,r as N,y,p as f,L as j}from"./index-IFwX560t.js";const C="_card_f20gt_2",T="_cardUnread_f20gt_15",b="_cardRead_f20gt_20",S="_topRow_f20gt_25",v="_categoryChip_f20gt_32",k="_versionChip_f20gt_45",R="_date_f20gt_57",H="_title_f20gt_65",E="_body_f20gt_74",L="_linkList_f20gt_82",A="_link_f20gt_82",U="_newBadge_f20gt_104",n={card:C,cardUnread:T,cardRead:b,topRow:S,categoryChip:v,versionChip:k,date:R,title:H,body:E,linkList:L,link:A,newBadge:U},B={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function m({announcement:s,isNew:g}){const{locale:r,t:i}=u(),o=g?n.cardUnread:n.cardRead,h=s.title[r]??s.title.en,l=s.body[r]??s.body.en,d=s.links??(s.link?[s.link]:[]),_=c=>typeof c=="string"?c:c[r]??c.en;return e.jsxs("div",{className:`${n.card} ${o}`,children:[e.jsxs("div",{className:n.topRow,children:[e.jsx("span",{className:n.categoryChip,children:i(B[s.category])}),s.version&&e.jsx("span",{className:n.versionChip,children:s.version}),g&&e.jsx("span",{className:n.newBadge,children:i("whatsNew.newBadge","NEW")}),e.jsx("span",{className:n.date,children:s.date})]}),e.jsx("h3",{className:n.title,children:h}),e.jsx("p",{className:n.body,children:l}),d.length>0&&e.jsx("div",{className:n.linkList,children:d.map(c=>{const p=_(c.url),t=_(c.label);return e.jsxs("a",{className:n.link,href:p,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",t]},p)})})]})}const I="_page_19yl3_2",$="_pageHeader_19yl3_10",M="_pageHeaderText_19yl3_17",z="_pageTitle_19yl3_24",W="_pageSubtitle_19yl3_31",O="_settingsIcon_19yl3_38",Y="_section_19yl3_67",G="_sectionTitle_19yl3_73",K="_unreadCount_19yl3_85",P="_empty_19yl3_100",q="_divider_19yl3_108",a={page:I,pageHeader:$,pageHeaderText:M,pageTitle:z,pageSubtitle:W,settingsIcon:O,section:Y,sectionTitle:G,unreadCount:K,empty:P,divider:q};function F(){const{t:s}=u(),{readSet:g,markRead:r}=w(),i=N.useMemo(()=>{const t=[];for(const x of y)g.has(x.id)||t.push(x.id);return t},[]),o=N.useRef(i);o.current=i,N.useEffect(()=>()=>{o.current.length>0&&r(o.current)},[]);const h=N.useMemo(()=>new Set(i),[i]),l=y.filter(t=>h.has(t.id)),d=y.filter(t=>!h.has(t.id)),_=l.length>0,c=d.length>0,p=e.jsxs("div",{className:a.pageHeader,children:[e.jsxs("div",{className:a.pageHeaderText,children:[e.jsx("h1",{className:a.pageTitle,children:s("whatsNew.pageTitle","What's New")}),e.jsx("p",{className:a.pageSubtitle,children:s("whatsNew.pageSubtitle","Stay up to date with MCP changes")})]}),e.jsx(f,{text:s("sidebar.settings","Settings"),children:e.jsx(j,{to:"/settings","aria-label":s("sidebar.settings","Settings"),className:a.settingsIcon,children:"⚙️"})})]});return y.length===0?e.jsxs("div",{className:a.page,children:[p,e.jsx("p",{className:a.empty,children:s("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:a.page,children:[p,_&&e.jsxs("section",{className:a.section,children:[e.jsxs("h2",{className:a.sectionTitle,children:[s("whatsNew.unreadSection","Unread"),e.jsx("span",{className:a.unreadCount,children:l.length})]}),l.map(t=>e.jsx(m,{announcement:t,isNew:!0},`unread-${t.id}`))]}),_&&c&&e.jsx("hr",{className:a.divider}),c&&e.jsxs("section",{className:a.section,children:[e.jsx("h2",{className:a.sectionTitle,children:s("whatsNew.allSection","All Announcements")}),d.map(t=>e.jsx(m,{announcement:t,isNew:!1},`all-${t.id}`))]})]})}export{F as Component};
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Sans:wght@400;500;700&family=JetBrains+Mono:wght@400;500;700&display=swap";._container_6jg7e_2{position:fixed;bottom:16px;right:16px;z-index:2000;display:flex;flex-direction:column-reverse;gap:8px;pointer-events:none}._toast_6jg7e_14{pointer-events:auto;padding:10px 16px;border-radius:var(--radius-sm);font-family:var(--font-label);font-size:13px;color:var(--text-primary);box-shadow:0 4px 12px #0000004d;animation:_slideIn_6jg7e_1 .25s ease-out;max-width:320px}@keyframes _slideIn_6jg7e_1{0%{opacity:0;transform:translate(40px)}to{opacity:1;transform:translate(0)}}._success_6jg7e_39{background:color-mix(in srgb,var(--success) 22%,transparent);border-left:3px solid var(--success)}._info_6jg7e_44{background:color-mix(in srgb,var(--accent) 22%,transparent);border-left:3px solid var(--accent)}._warning_6jg7e_49{background:color-mix(in srgb,var(--warning) 22%,transparent);border-left:3px solid var(--warning)}._error_6jg7e_54{background:var(--error-bg);border-left:3px solid var(--error-border)}._wrapper_x0nim_2{display:inline-flex}._tooltip_x0nim_11{position:fixed;background:var(--bg-card);border:1px solid var(--border);color:var(--text-primary);font-size:12px;padding:4px 8px;border-radius:4px;width:max-content;max-width:min(320px,calc(100vw - 32px));white-space:normal;overflow-wrap:anywhere;text-align:left;pointer-events:none;opacity:0;transition:opacity var(--transition);z-index:1000}._tooltipVisible_x0nim_30{opacity:1}._widget_birep_1{margin:8px 12px 4px;padding:12px;border:1px solid var(--pro-border);border-radius:var(--radius);background:var(--pro-bg-soft);display:flex;flex-direction:column;gap:10px}._header_birep_12{display:flex;align-items:center;gap:8px}._sparkle_birep_18{color:var(--pro-text);flex-shrink:0}._title_birep_23{font-family:var(--font-label);font-size:12px;font-weight:600;color:var(--pro-text);line-height:1.3}._cta_birep_31{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;border-radius:var(--radius-sm);background:var(--pro-badge);color:var(--pro-text-on-badge);font-family:var(--font-label);font-size:12px;font-weight:700;text-decoration:none;transition:filter var(--transition),transform var(--transition)}._cta_birep_31:hover{filter:brightness(1.08);transform:translateY(-1px);text-decoration:none}._collapsed_birep_52{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;margin:8px auto;border-radius:var(--radius-sm);background:var(--pro-bg-soft);color:var(--pro-text);text-decoration:none;transition:filter var(--transition)}._collapsed_birep_52:hover{filter:brightness(1.15);text-decoration:none}._sidebar_1ei54_2{width:var(--sidebar-width);min-width:var(--sidebar-width);height:100%;display:flex;flex-direction:column;background:var(--bg-sidebar);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);border-right:1px solid var(--border);padding:0 0 16px;overflow:visible;transition:width var(--transition),min-width var(--transition)}._brand_1ei54_17{display:flex;align-items:center;gap:10px;min-height:var(--header-height);padding:0 16px;border-bottom:1px solid var(--border);margin-bottom:8px;flex-shrink:0}._brandIcon_1ei54_28{color:var(--accent);flex-shrink:0}._brandText_1ei54_33{font-family:var(--font-label);font-size:14px;font-weight:700;color:var(--text-primary);letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._brandTextPro_1ei54_44{color:var(--pro-text);text-shadow:0 0 18px rgba(212,167,44,.18)}._nav_1ei54_50{display:flex;flex-direction:column;gap:2px}._spacer_1ei54_57{flex:1;min-height:16px}._navLink_1ei54_63{display:flex;align-items:center;gap:12px;padding:10px 16px;color:var(--text-secondary);text-decoration:none;font-size:14px;font-weight:500;border-left:4px solid transparent;transition:color var(--transition),background var(--transition),border-color var(--transition)}._navLink_1ei54_63:hover{color:var(--text-primary);background:var(--accent-dim);text-decoration:none}._navLink_1ei54_63._active_1ei54_84{color:var(--accent);border-left-color:var(--accent);background:var(--accent-dim)}._navLink_1ei54_63._disabled_1ei54_91{color:var(--text-muted);pointer-events:none;cursor:default}._navLink_1ei54_63._disabled_1ei54_91:hover{background:transparent}._icon_1ei54_102{width:20px;height:20px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:currentColor}._label_1ei54_113{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._secondaryDivider_1ei54_120{height:1px;margin:4px 16px;background:var(--border)}._secondaryNav_1ei54_127{display:flex;flex-direction:column;gap:2px}._helpDivider_1ei54_134{height:1px;margin:8px 16px 4px;background:var(--border)}._helpGroupTitle_1ei54_141{padding:4px 16px 6px;font-family:var(--font-label);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted)}._helpNav_1ei54_152{display:flex;flex-direction:column;gap:2px}._externalIcon_1ei54_159{margin-left:auto;display:inline-flex;align-items:center;color:var(--text-muted)}@media(max-width:768px){._sidebar_1ei54_2{width:var(--sidebar-collapsed);min-width:var(--sidebar-collapsed)}._brand_1ei54_17{justify-content:center;padding:0}._brandText_1ei54_33{display:none}._navLink_1ei54_63{justify-content:center;padding:10px 0;gap:0}._label_1ei54_113,._helpGroupTitle_1ei54_141,._externalIcon_1ei54_159{display:none}}._header_4psrj_2{display:flex;flex-direction:column;justify-content:center;gap:4px;height:var(--header-height);padding:8px 24px;border-bottom:1px solid var(--border);background:var(--bg-card);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);flex-shrink:0;overflow:hidden}._row1_4psrj_17{display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0}._projectIdentity_4psrj_25{display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-width:0;flex:1}._folderIcon_4psrj_34{color:var(--accent);flex-shrink:0}._projectName_4psrj_39{margin:0;font-size:15px;font-weight:700;color:var(--text-primary);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:clamp(120px,30vw,360px)}._placeChips_4psrj_51{display:flex;gap:6px;flex-wrap:wrap;min-width:0}._metaActions_4psrj_58{display:flex;align-items:center;gap:8px;flex-shrink:0}._placeChip_4psrj_51{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border:1px solid var(--border);border-radius:var(--radius-pill);background:var(--bg-overlay);color:var(--text-secondary);font-size:12px;font-weight:600;line-height:1.4;cursor:default}._placeChipStatic_4psrj_81,._placeChipMuted_4psrj_82{cursor:default}._placeChipActive_4psrj_86{border-color:var(--border-highlight);color:var(--text-primary);background:var(--accent-dim);box-shadow:0 0 0 1px var(--accent-glow) inset}._placeChipInactive_4psrj_93{border-color:var(--border);color:var(--text-muted);opacity:.85}._placeChipMuted_4psrj_82{border-color:var(--border);color:var(--text-muted)}._placeChipId_4psrj_104{font-family:var(--font-code);font-weight:500;font-size:11px;color:var(--text-muted);padding-left:6px;margin-left:2px;border-left:1px solid var(--border)}._placeChipActive_4psrj_86 ._placeChipId_4psrj_104{color:var(--text-secondary);border-left-color:var(--border-highlight)}._placeDot_4psrj_119{width:7px;height:7px;border-radius:var(--radius-pill);background:var(--success);box-shadow:0 0 6px var(--success)}._placeChipName_4psrj_127{white-space:nowrap;max-width:140px;overflow:hidden;text-overflow:ellipsis}._row2_4psrj_135{display:flex;align-items:center;gap:16px;min-width:0}._pathGroup_4psrj_142{display:flex;align-items:center;gap:10px;min-width:0;flex:1}._projectPath_4psrj_150{font-family:var(--font-code);font-size:12px;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}._changeButton_4psrj_160{display:inline-flex;align-items:center;justify-content:center;height:26px;padding:0 10px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-overlay);color:var(--text-primary);font:inherit;font-size:12px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer;transition:border-color var(--transition),background var(--transition),color var(--transition)}._changeButton_4psrj_160:hover{border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent)}._changeButton_4psrj_160:disabled{cursor:not-allowed;opacity:.52}._iconButton_4psrj_193{position:relative;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-overlay);color:var(--text-primary);text-decoration:none;transition:border-color var(--transition),background var(--transition),color var(--transition)}._iconButton_4psrj_193:hover{border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent);text-decoration:none}._notificationDot_4psrj_218{position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:var(--radius-pill);background:var(--error);box-shadow:0 0 0 2px var(--bg-overlay)}@media(max-width:768px){._header_4psrj_2{padding:10px 16px}._row1_4psrj_17,._projectIdentity_4psrj_25{gap:8px}._row2_4psrj_135{flex-direction:column;align-items:flex-start;gap:8px}._pathGroup_4psrj_142{width:100%}}._bellWrapper_tae21_2{position:relative;display:inline-flex}._unreadDot_tae21_8{position:absolute;top:4px;right:4px;width:8px;height:8px;border-radius:50%;background:var(--error);border:2px solid var(--bg-card);pointer-events:none}._backdrop_1ozbv_1{position:fixed;top:0;right:0;bottom:0;left:0;background:#0c1018b8;display:grid;place-items:center;z-index:1000;padding:24px}._modal_1ozbv_12{width:min(420px,100%);background:var(--bg-overlay);border:1px solid var(--border);border-radius:18px;box-shadow:0 24px 48px #0307126b;padding:24px}._title_1ozbv_23{margin:0 0 12px;color:var(--text-primary);font-size:20px}._message_1ozbv_30{margin:0;color:var(--text-secondary);line-height:1.6}._actions_1ozbv_37{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}._cancelButton_1ozbv_44,._confirmButton_1ozbv_45{border:0;border-radius:var(--radius);padding:10px 14px;font:inherit;cursor:pointer}._cancelButton_1ozbv_44{background:var(--border);border:1px solid transparent;color:var(--text-primary)}._confirmButton_1ozbv_45{background:var(--error-bg);border:1px solid var(--error-border);color:var(--error-text)}._cancelButton_1ozbv_44:disabled,._confirmButton_1ozbv_45:disabled{cursor:not-allowed;opacity:.6}._pathBlock_1ozbv_75{display:grid;gap:6px}._pathLabel_1ozbv_80{font-size:12px;font-weight:700;color:var(--text-secondary)}._pathCode_1ozbv_86{display:block;overflow-wrap:anywhere;padding:10px 12px;border-radius:12px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);font-size:12px;line-height:1.5}._bodyGrid_1ozbv_98{display:grid;gap:14px;margin-top:18px}._warningList_1ozbv_104{margin:0;padding-left:18px;color:var(--text-secondary);line-height:1.6}._errorMessage_1ozbv_111{margin-top:0;color:var(--error-text)}._layout_ya8ln_2{display:flex;height:100%;overflow:hidden}._mainShell_ya8ln_8{flex:1;min-width:0;display:flex;flex-direction:column;overflow:visible}._content_ya8ln_17{flex:1 1 auto;min-height:0;overflow-y:auto;padding:24px}._loading_ya8ln_25{display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-muted);font-size:14px}:root{--bg-primary: #0b0e1a;--bg-secondary: #0f1525;--bg-card: #111827;--bg-sidebar: rgba(11, 14, 26, .95);--bg-overlay: rgba(15, 21, 37, .88);--text-primary: #e2e8f0;--text-secondary: #94a3b8;--text-muted: #475569;--border: #1e293b;--border-highlight: #2563eb;--accent: #3b82f6;--accent-dim: rgba(59, 130, 246, .12);--accent-glow: rgba(59, 130, 246, .25);--pro-badge: #d4a72c;--pro-text: #f3d46b;--pro-text-on-badge: #1a1407;--pro-bg: #3a2d12;--pro-bg-soft: rgba(212, 167, 44, .12);--pro-border: #8f6f1f;--success: #22c55e;--success-bg: rgba(34, 197, 94, .14);--success-border: rgba(34, 197, 94, .5);--success-text: #86efac;--warning: #f59e0b;--warning-bg: rgba(245, 158, 11, .14);--warning-border: rgba(245, 158, 11, .5);--warning-text: #fcd34d;--info: #60a5fa;--info-bg: rgba(96, 165, 250, .14);--info-border: rgba(96, 165, 250, .5);--info-text: #93c5fd;--error: #ef4444;--error-bg: rgba(239, 68, 68, .12);--error-border: rgba(239, 68, 68, .5);--error-text: #f4c1c1;--danger: #d15454;--danger-bg: rgba(209, 84, 84, .12);--danger-border: rgba(209, 84, 84, .5);--danger-text: #f4c1c1;--danger-hover-bg: rgba(209, 84, 84, .2);--diff-add: var(--success);--diff-add-bg: var(--success-bg);--diff-add-text: var(--success-text);--diff-remove: var(--error);--diff-remove-bg: var(--error-bg);--diff-remove-text: var(--error-text);--diff-update: var(--warning);--diff-update-bg: var(--warning-bg);--diff-update-text: var(--warning-text);--diff-rename: var(--info);--diff-rename-bg: var(--info-bg);--diff-rename-text: var(--info-text);--font-code: "JetBrains Mono", "Fira Code", monospace;--font-label: "Inter", "DM Sans", -apple-system, sans-serif;--sidebar-width: 220px;--sidebar-collapsed: 56px;--header-height: 72px;--content-max: 1080px;--content-gap: 16px;--radius: 10px;--radius-sm: 6px;--radius-pill: 999px;--transition: .2s ease}@media(prefers-color-scheme:light){:root{--bg-primary: #f1f5f9;--bg-secondary: #ffffff;--bg-card: #ffffff;--bg-sidebar: rgba(255, 255, 255, .95);--bg-overlay: rgba(255, 255, 255, .95);--text-primary: #0f172a;--text-secondary: #475569;--text-muted: #94a3b8;--border: #e2e8f0;--border-highlight: #3b82f6;--accent: #2563eb;--accent-dim: rgba(37, 99, 235, .08);--accent-glow: rgba(37, 99, 235, .15);--pro-badge: #b07c00;--pro-text: #8a5f00;--pro-text-on-badge: #1a1407;--pro-bg: #fff4d6;--pro-bg-soft: rgba(176, 124, 0, .12);--pro-border: #d9b14d;--success: #16a34a;--success-bg: rgba(22, 163, 74, .1);--success-border: rgba(22, 163, 74, .4);--success-text: #166534;--warning: #d97706;--warning-bg: rgba(217, 119, 6, .1);--warning-border: rgba(217, 119, 6, .4);--warning-text: #92400e;--info: #2563eb;--info-bg: rgba(37, 99, 235, .1);--info-border: rgba(37, 99, 235, .4);--info-text: #1d4ed8;--error: #dc2626;--error-bg: rgba(220, 38, 38, .08);--error-border: rgba(220, 38, 38, .3);--error-text: #b91c1c;--danger: #dc2626;--danger-bg: rgba(220, 38, 38, .08);--danger-border: rgba(220, 38, 38, .4);--danger-text: #b91c1c;--danger-hover-bg: rgba(220, 38, 38, .16)}}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box}html,body{height:100%;font-family:var(--font-label);background:var(--bg-primary);color:var(--text-primary);line-height:1.5;-webkit-font-smoothing:antialiased}#root{height:100%}code,pre,.mono{font-family:var(--font-code)}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}button{font-family:inherit;cursor:pointer}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}