@weppy/roblox-mcp 2.8.0 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dashboard/dist/assets/AssetsPage-yddSUaZg.js +51 -0
- package/dashboard/dist/assets/{ChangelogDetailPage-BQu8E3gB.js → ChangelogDetailPage-BiiG5ZpO.js} +1 -1
- package/dashboard/dist/assets/{ChangelogPage-BYIOvsqN.js → ChangelogPage-oIxW8_VE.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-DSKr5eS9.js → ConfirmModal-CpImpY9c.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-OvC9gL_W.js → ConnectionPage-zGBwRnwi.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-BmXlRT3i.js → GameChangeDetail-CghOvUm8.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-CldY9uOT.js → InfoLabel-Cyz7d4Kc.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-Cdw1CYe4.js → OverviewPage-B6ZL_JXU.js} +1 -1
- package/dashboard/dist/assets/PageHeader-CThGgsAt.js +6 -0
- package/dashboard/dist/assets/{PlaytestPage-azdyKqSE.js → PlaytestPage-CQqE8m04.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-BLPo-MfN.js → SettingsPage-DX6vgUTw.js} +1 -1
- package/dashboard/dist/assets/{StatusBadge-DxlagIzF.js → StatusBadge-CkLieULy.js} +1 -1
- package/dashboard/dist/assets/{SyncPage-DtqIcJ5z.js → SyncPage-cfQ-4IDk.js} +1 -1
- package/dashboard/dist/assets/{Tabs-BgJY0tsU.js → Tabs-BhkhdCvF.js} +1 -1
- package/dashboard/dist/assets/{ToolsPage-BEq7XLqc.js → ToolsPage-B004HHzX.js} +1 -1
- package/dashboard/dist/assets/{TooltipText-DazmfUnr.js → TooltipText-H3YSCbob.js} +1 -1
- package/dashboard/dist/assets/{UiStudioPage-BR3NgjBs.js → UiStudioPage-CwURRVO9.js} +2 -2
- package/dashboard/dist/assets/WhatsNewPage-CBUk7WTn.js +1 -0
- package/dashboard/dist/assets/index-CjzKb5lS.css +1 -0
- package/dashboard/dist/assets/index-DG2RrKOl.js +532 -0
- package/dashboard/dist/assets/{sample-requests-Cq6wCxhD.js → sample-requests-D1b5Z8FU.js} +1 -1
- package/dashboard/dist/assets/{useLiveUptime-Dg607eVr.js → useLiveUptime-BHqJirBV.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/index.js +96 -92
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/AssetsPage-B1-IkNLs.js +0 -56
- package/dashboard/dist/assets/PageHeader-ueZvp6K9.js +0 -11
- package/dashboard/dist/assets/WhatsNewPage-BGAIXqWd.js +0 -1
- package/dashboard/dist/assets/index-1ZlHj3-1.js +0 -523
- package/dashboard/dist/assets/index-BdS5zBaA.css +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{q as z,u as Q,i as V,r as p,j as t,X as J,E as Z,C as ee}from"./index-DG2RrKOl.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 te=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ne=z("circle-question-mark",te),a={canDo:{key:"dashboardHelp.section.canDo",fallback:"What you can do here"},needs:{key:"dashboardHelp.section.needs",fallback:"What you need to use it"},currentState:{key:"dashboardHelp.section.currentState",fallback:"Check based on current status"}},oe="https://create.roblox.com/docs/cloud/auth/api-keys",se="https://create.roblox.com/docs/cloud/guides/usage-assets",ae="https://create.roblox.com/docs/cloud/reference/features/assets",re="https://create.roblox.com/docs/reference/engine/classes/DataModel#CreatorId",le="https://create.roblox.com/docs/reference/engine/classes/Player#UserId",ie="https://create.roblox.com/docs/projects/groups",ce="https://create.roblox.com/docs/cloud/reference/features/groups";function y(e,s,o,h){return{id:e,title:{key:`dashboardHelp.${e}.title`,fallback:s},sections:o,links:h}}function l(e,s,o,h){return{heading:e,items:h.map((i,v)=>({key:`dashboardHelp.${s}.${o}.${v+1}`,fallback:i}))}}function r(e,s,o){return{heading:a.currentState,items:[{key:`dashboardHelp.${e}.currentState.${s}`,fallback:o}]}}function _(e,s,o,h,i,v){return y(e,s,[l(a.canDo,e,"canDo",o),l(a.needs,e,"needs",h),l(a.currentState,e,"currentState",i)],v)}function de(e){return e.tier==="basic"?r("assets","basic","Activate Pro before uploading to Roblox."):e.uploadEnabled===!1?r("assets","uploadDisabled","Turn on API Key local upload in Assets settings."):e.hasOpenCloudCredential===!1?r("assets","noCredential","Save and test an Open Cloud API Key."):e.hasDefaultCreator===!1?r("assets","noCreator","Save a default Creator ID or enter Creator details during upload."):r("assets","default","Open an asset detail dialog to start upload or usage scan.")}function ue(e){return e.connectionLevel!==void 0&&e.connectionLevel!=="studioConnected"?r("sync","pluginMissing","Connect WEPPY Plugin in Studio before using live sync details."):e.tier==="basic"?r("sync","basic","Activate Pro to use bidirectional or reverse sync."):r("sync","default","Use the sync log to diagnose stuck or failed sync activity.")}function pe(e,s={}){return e==="openCloudApiKey"?y(e,"Open Cloud API Key help",[l(a.canDo,e,"canDo",["WEPPY uses this key only for Roblox Open Cloud requests."]),l(a.needs,e,"needs",["Create a Roblox API key in Creator Hub. Add Assets under Access Permissions, then enable both Read and Write operations.","Set the key target to the same User or Group that you use as the upload Creator.","The raw key is encrypted on this device. It is not sent to WEPPY servers, and it is not stored in any other external storage, browser storage, telemetry, logs, tool history, or Asset Library metadata."]),s.hasOpenCloudCredential?r(e,"saved","Use Test Connection to confirm the saved key still works."):r(e,"empty","Create an API key in Roblox Creator Hub, paste it here, then save and test it.")],[{label:{key:"dashboardHelp.openCloudApiKey.link.apiKeys",fallback:"Roblox API keys"},href:oe},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsGuide",fallback:"Assets API usage guide"},href:se},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsReference",fallback:"Assets API reference"},href:ae}]):e==="openCloudCreatorId"?y(e,"Creator ID help",[l(a.canDo,e,"canDo",["The default Creator decides which User or Group owns newly uploaded Roblox assets."]),l(a.needs,e,"needs",["For User, sign in to roblox.com, open your profile from your avatar or username, then copy only the number between /users/ and /profile in the browser URL.","For Group, open the Roblox group or community page, then copy only the number after /groups/ or /communities/ in the browser URL.","Paste only the numeric ID in Creator ID. Do not paste the full URL, rbxassetid://, User, or Group text."]),s.hasDefaultCreator?r(e,"saved","Keep this value if new assets should continue using the same owner."):r(e,"empty","Choose User or Group, paste the numeric ID, then save the default Creator.")],[{label:{key:"dashboardHelp.openCloudCreatorId.link.creatorId",fallback:"Creator ID reference"},href:re},{label:{key:"dashboardHelp.openCloudCreatorId.link.userId",fallback:"User ID reference"},href:le},{label:{key:"dashboardHelp.openCloudCreatorId.link.groups",fallback:"Roblox groups"},href:ie},{label:{key:"dashboardHelp.openCloudCreatorId.link.groupsApi",fallback:"Groups Cloud API"},href:ce}]):{overview:y("overview","Overview help",[l(a.canDo,"overview","canDo",["Check MCP server, WEPPY Plugin, AI Agent, Sync, and recent game changes in one place."]),l(a.needs,"overview","needs",["Useful status requires the MCP server. Live Studio status also needs WEPPY Plugin connected to the active place."]),s.connectionLevel==="serverOnly"?r("overview","serverOnly","Open Roblox Studio and start WEPPY Plugin so live place data can appear."):r("overview","default","If the server disconnects, restart MCP or wait for the automatic reconnect.")]),connection:_("connection","Connection help",["Inspect server process details, connected AI agents, Studio plugin clients, and connection log events."],["The MCP server must be reachable. Plugin rows appear after Studio sends heartbeats."],["If Plugin is missing, open Roblox Studio and run WEPPY Plugin. If AI Agent is missing, reconnect the MCP server from your AI tool."]),sync:y("sync","Sync help",[l(a.canDo,"sync","canDo",["Review Studio to local sync status, direction, apply mode, and sync logs."]),l(a.needs,"sync","needs",["Sync needs an active place and connected WEPPY Plugin. Two-way and reverse workflows depend on Pro."]),ue(s)]),assets:y("assets","Assets help",[l(a.canDo,"assets","canDo",["Browse local Asset Library files, switch place/shared scope, filter categories, scan usage, insert RBXM into Studio, and upload local assets to Roblox."]),l(a.needs,"assets","needs",["Upload needs Pro, the Open Cloud upload toggle, a valid API Key, and a Creator. Browse and preview work on Basic."]),de(s)]),changelog:_("changelog","Changelog help",["Review real game-change sessions extracted from AI actions and sync events."],["Entries are scoped to the active place. Basic shows only the latest preview entries."],["If the list is empty, ask the AI Agent to make a game change. Clear only deletes saved history records, not Studio objects."]),playtest:y("playtest","Playtest help",[l(a.canDo,"playtest","canDo",["Review Playtest results and reports saved by the AI Agent."]),l(a.needs,"playtest","needs",["Pro shows real stored reports. Basic shows sample preview data. Live active-place confidence needs WEPPY Plugin connected."]),s.tier==="basic"?r("playtest","basic","Activate Pro to use real Playtest history."):r("playtest","default","Ask the AI Agent to run a Playtest when no report is available.")]),uiStudio:y("uiStudio","UI Studio help",[l(a.canDo,"uiStudio","canDo",["Review AI-created UI analysis, improvement suggestions, captures, and before/after history."]),l(a.needs,"uiStudio","needs",["Pro shows real UI Studio data. Basic shows a bundled sample. New capture/check actions need WEPPY Plugin connected."]),s.tier==="basic"?r("uiStudio","basic","Activate Pro to use live UI Studio previews."):r("uiStudio","default","Ask the AI Agent to capture the UI or recheck improvement suggestions, then copy follow-up requests back to the AI chat.")]),tools:_("tools","Tools help",["Inspect tool history, status classification, fallback/unsupported/warn/error details, and usage statistics."],["History and statistics depend on local recording settings and the active place bucket."],["If no records appear, check Settings > General and confirm history/statistics are enabled. Expand failed rows to inspect input, permission, or connection causes."]),settings:_("settings","Settings help",["Manage License, hot settings, saved data cleanup, server environment display, and language."],["License actions need MCP server connection. Server environment values are read-only here. Asset upload controls live in Assets settings."],["Activate a license for Pro features. Change environment values outside WEPPY Dashboard, then restart MCP. Review delete confirmations before clearing saved data."]),whatsNew:_("whatsNew","What's New help",["Review WEPPY Dashboard, MCP, and Plugin announcements, releases, and change notes."],["Announcements are bundled locally. Unread state is stored in this browser."],["After you visit this page, unread announcements from this visit are marked read when you leave. The top header does not show a duplicate What's New button on this page."])}[e]}const he="_root_rxppj_1",fe="_rootPage_rxppj_7",ye="_rootField_rxppj_11",be="_button_rxppj_15",ge="_panel_rxppj_50",me="_panelField_rxppj_65",ve="_panelPage_rxppj_69",Pe="_panelHeader_rxppj_73",ke="_closeButton_rxppj_91",_e="_sectionStack_rxppj_112",we="_helpSection_rxppj_117",xe="_linkList_rxppj_118",c={root:he,rootPage:fe,rootField:ye,button:be,panel:ge,panelField:me,panelPage:ve,panelHeader:Pe,closeButton:ke,sectionStack:_e,helpSection:we,linkList:xe},b=12,A=8,Ce=120,Ae=360,Ee=340,Y=560;function Ie({topicId:e,state:s,variant:o="page",className:h}){const{t:i}=Q(),{trackEvent:v}=V(),[f,w]=p.useState(!1),[x,D]=p.useState(null),j=p.useId(),O=p.useRef(null),N=p.useRef(null),I=p.useRef(null),g=pe(e,s),R=i(g.title.key,g.title.fallback),C=p.useCallback(()=>{const n=N.current,d=I.current;if(!n||!d||typeof window>"u")return;const u=n.getBoundingClientRect(),m=d.getBoundingClientRect(),P=window.innerWidth,k=window.innerHeight,q=o==="field"?Ee:Ae,M=m.width||Math.min(q,P-b*2),B=m.height||Y;let S=o==="field"?u.left:u.right-M;S=Math.max(b,Math.min(S,P-M-b));const L=k-u.bottom-A-b,W=u.top-A-b,T=L<Math.min(B,220)&&W>L,$=Math.max(Ce,T?W:L),G=Math.min(Y,$),F=Math.min(B,G);let H=T?u.top-A-F:u.bottom+A;H=Math.max(b,Math.min(H,k-F-b)),D({top:Math.round(H),left:Math.round(S),maxHeight:Math.round(G)})},[o]);p.useLayoutEffect(()=>{f?C():D(null)},[f,C]),p.useEffect(()=>{if(!f)return;const n=u=>{var P,k;const m=u.target;m&&!((P=O.current)!=null&&P.contains(m))&&!((k=I.current)!=null&&k.contains(m))&&w(!1)},d=u=>{u.key==="Escape"&&w(!1)};return document.addEventListener("mousedown",n),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",d)}},[f]),p.useEffect(()=>{if(!f)return;const n=()=>C();return window.addEventListener("scroll",n,!0),window.addEventListener("resize",n),()=>{window.removeEventListener("scroll",n,!0),window.removeEventListener("resize",n)}},[f,C]);const K=o==="field"?i("dashboardHelp.fieldButton.ariaLabel","Open field help"):i("dashboardHelp.pageButton.ariaLabel","Open page help"),X=x?{top:x.top,left:x.left,maxHeight:x.maxHeight}:{top:-9999,left:-9999,visibility:"hidden"},U=f?t.jsxs("section",{ref:I,id:j,className:[c.panel,o==="field"?c.panelField:c.panelPage].filter(Boolean).join(" "),style:X,role:"dialog","aria-label":R,"data-panel-placement":"help-portal",children:[t.jsxs("div",{className:c.panelHeader,children:[t.jsx("h2",{children:R}),t.jsx("button",{type:"button",className:c.closeButton,"aria-label":i("common.close","Close"),onClick:()=>w(!1),children:t.jsx(J,{size:15,"aria-hidden":"true"})})]}),t.jsx("div",{className:c.sectionStack,children:g.sections.map(n=>t.jsxs("section",{className:c.helpSection,children:[t.jsx("h3",{children:i(n.heading.key,n.heading.fallback)}),t.jsx("ul",{children:n.items.map(d=>t.jsx("li",{children:i(d.key,d.fallback)},d.key))})]},n.heading.key))}),g.links&&g.links.length>0&&t.jsxs("div",{className:c.linkList,children:[t.jsx("h3",{children:i("dashboardHelp.section.links","Related links")}),g.links.map(n=>t.jsxs("a",{href:n.href,target:"_blank",rel:"noreferrer",children:[i(n.label.key,n.label.fallback),t.jsx(Z,{size:12,"aria-hidden":"true"})]},n.href))]})]}):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:O,className:[c.root,o==="field"?c.rootField:c.rootPage,h??""].filter(Boolean).join(" "),children:t.jsxs("button",{ref:N,type:"button",className:c.button,"aria-label":`${K}: ${R}`,"aria-expanded":f,"aria-controls":j,onClick:()=>{w(n=>{const d=!n;return n||v("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:o}),d})},children:[t.jsx(ne,{size:o==="field"?14:16,"aria-hidden":"true"}),o==="page"&&t.jsx("span",{children:i("dashboardHelp.button","Help")})]})}),U&&typeof document<"u"?ee.createPortal(U,document.body):null]})}const Re="_pageHeader_qym7v_1",Se="_copy_qym7v_9",Le="_titleLine_qym7v_16",He="_actions_qym7v_39",E={pageHeader:Re,copy:Se,titleLine:Le,actions:He};function je({title:e,description:s,badge:o,helpTopicId:h,helpState:i}){return t.jsxs("div",{className:E.pageHeader,children:[t.jsxs("div",{className:E.copy,children:[t.jsxs("div",{className:E.titleLine,children:[t.jsx("h1",{children:e}),o]}),t.jsx("p",{children:s})]}),t.jsx("div",{className:E.actions,children:t.jsx(Ie,{topicId:h,state:i})})]})}export{Ie as D,je as P};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as c,a as f,u as b,j as e,i as M,m as k,n as A,T as H}from"./index-
|
|
1
|
+
import{r as c,a as f,u as b,j as e,i as M,m as k,n as A,T as H}from"./index-DG2RrKOl.js";import{P as D}from"./PageHeader-CThGgsAt.js";import{I}from"./InfoLabel-Cyz7d4Kc.js";import{T as x}from"./TooltipText-H3YSCbob.js";import{C as E}from"./ConfirmModal-CpImpY9c.js";const $=5e3;function U(t){const r=(t==null?void 0:t.enabled)??!0,[p,o]=c.useState([]),[a,n]=c.useState(null),[d,l]=c.useState(r),i=c.useRef(null),h=c.useCallback(async()=>{try{const _=await f.get("/api/dashboard/playtest/history");o(_.entries??[])}catch{}},[]),m=c.useCallback(async()=>{if(!r){l(!1);return}await h(),l(!1)},[r,h]),y=c.useCallback(async()=>{r&&(await f.post("/api/dashboard/playtest/history/clear"),o([]),n(null))},[r]),g=c.useCallback(async _=>{if(r)try{const S=await f.get(`/api/dashboard/playtest/report/${_}`);n(S)}catch{n(null)}},[r]);return c.useEffect(()=>{if(!r){l(!1);return}return m(),i.current=setInterval(m,$),()=>{i.current&&clearInterval(i.current)}},[r,m]),{history:p,selectedReport:a,loading:d,loadReport:g,clearHistory:y}}function O(t){const r="2026-03-27T15:26:00.000Z",p={testScenario:t("playtest.sample.context.why","Spawn into the arena, survive the opener, and verify the HUD responds immediately."),expectedBehavior:t("playtest.sample.context.expected","The player spawns safely, the countdown UI appears within one second, and the first wave starts without errors."),observedBehavior:t("playtest.sample.context.observed","Spawn protection held, the HUD updated on time, and wave one completed with no gameplay regressions.")};return{history:[{timestamp:r,testName:t("playtest.sample.history.name","Sample Arena Smoke Test"),mode:"play",status:"passed",durationMs:4820,contextId:"sample_playtest_preview",contextSummary:p}],report:{markdown:t("playtest.sample.report.markdown",`# Sample Arena Smoke Test
|
|
2
2
|
|
|
3
3
|
- Spawn flow: PASS
|
|
4
4
|
- HUD countdown: PASS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as re,r as l,f as ce,D as de,e as ue,g as ge,h as pe,a as $,u as Q,i as ie,j as e,k as he,l as ye,T as me,A as ve,S as _e}from"./index-1ZlHj3-1.js";import{P as xe}from"./PageHeader-ueZvp6K9.js";import{I as f}from"./InfoLabel-CldY9uOT.js";import{T as u}from"./TooltipText-DazmfUnr.js";import{C as fe}from"./ConfirmModal-DSKr5eS9.js";import{D as ne,f as oe,r as je,s as be,a as le,d as V,S as te,b as Se}from"./sample-requests-Cq6wCxhD.js";function Ne(){const{level:t}=re(),[s,c]=l.useState(null),[S,r]=l.useState(null),[j,i]=l.useState(!1),[m,h]=l.useState(!0),[B,L]=l.useState(!1),[D,b]=l.useState(null),k=t==="disconnected",y=l.useCallback(d=>{d&&r(p=>({...p,...d,maskedKey:d.maskedKey??(p==null?void 0:p.maskedKey),provider:d.provider??(p==null?void 0:p.provider)??"auto"}))},[]),_=l.useCallback(d=>{if(!d){r(null);return}r({...d,provider:d.provider??"auto"})},[]),R=l.useCallback(async()=>{try{return await ce()}catch{return null}},[]);l.useEffect(()=>{let d=!1;async function p(){try{const[v,H]=await Promise.all([$.get("/api/dashboard/settings").catch(()=>null),R()]);if(d)return;v&&c(v),H&&y(H)}catch{}finally{d||h(!1)}}return p(),()=>{d=!0}},[R,y]),l.useEffect(()=>{const d=new de;d.connect();const p=d.on("license",v=>{R().then(H=>{if(H){if((v==null?void 0:v.cleared)===!0){_(H);return}y(H)}})});return()=>{p(),d.disconnect()}},[R,y,_]);const C=l.useCallback((d,p)=>{b(d??p)},[]),w=l.useCallback(async d=>{if(k)return!1;if(!d.trim())return b("License key is required."),!1;L(!0);try{const p=await ue({licenseKey:d.trim()});return y(p.license),C(p.message,p.ok?"License updated.":"License activation failed."),p.ok}catch{return b("License activation failed."),!1}finally{L(!1)}},[C,k,y]),I=l.useCallback(async()=>{if(!k){L(!0);try{const d=await ge();y(d.license),C(d.message,d.ok?"License updated.":"License refresh failed.")}catch{b("License refresh failed.")}finally{L(!1)}}},[C,k,y]),E=l.useCallback(async()=>{if(!k){L(!0);try{const d=await pe();_(d.license),C(d.message,d.ok?"License reset.":"License reset failed.")}catch{b("License reset failed.")}finally{L(!1)}}},[C,k,_]),A=l.useCallback(async(d,p)=>{if(s){c(v=>v&&{...v,hot:{...v.hot,[d]:p}}),i(!0);try{await $.patch("/api/dashboard/settings",{[d]:p})}catch{c(v=>v&&{...v,hot:{...v.hot,[d]:s.hot[d]}})}finally{i(!1)}}},[s]);return{settings:s,license:S,saving:j,licenseControlsDisabled:k,licenseSubmitting:B,licenseMessage:D,activateLicense:w,refreshLicense:I,resetLicense:E,updateHotSetting:A,loading:m}}const Le="_card_1jlvt_4",Ce="_cardEmbedded_1jlvt_14",He="_cardTitle_1jlvt_21",ke="_usageRow_1jlvt_30",Re="_usageTotal_1jlvt_36",we="_usageBreakdown_1jlvt_42",Te="_usageCounts_1jlvt_47",Ee="_divider_1jlvt_53",Ae="_lastRunRow_1jlvt_60",Ie="_lastRunLabel_1jlvt_69",Be="_errorIcon_1jlvt_75",De="_tooltip_1jlvt_83",Pe="_cleanupRow_1jlvt_106",Me="_cleanupLabel_1jlvt_113",$e="_cleanupBtn_1jlvt_120",Ue="_cleanupBtnDanger_1jlvt_143",Oe="_retentionSection_1jlvt_155",ze="_retentionTitle_1jlvt_161",Fe="_retentionFieldset_1jlvt_170",Ge="_proOverlay_1jlvt_185",qe="_radioRow_1jlvt_197",We="_radioLabel_1jlvt_204",Ye="_presetGroup_1jlvt_224",Ke="_presetBtn_1jlvt_232",Ve="_presetBtnActive_1jlvt_249",Qe="_freeInput_1jlvt_256",Xe="_inputError_1jlvt_272",Je="_inputUnit_1jlvt_276",Ze="_cascadeRow_1jlvt_283",et="_retentionActions_1jlvt_302",tt="_saveBtn_1jlvt_308",st="_runNowBtn_1jlvt_330",at="_errorMsg_1jlvt_353",o={card:Le,cardEmbedded:Ce,cardTitle:He,usageRow:ke,usageTotal:Re,usageBreakdown:we,usageCounts:Te,divider:Ee,lastRunRow:Ae,lastRunLabel:Ie,errorIcon:Be,tooltip:De,cleanupRow:Pe,cleanupLabel:Me,cleanupBtn:$e,cleanupBtnDanger:Ue,retentionSection:Oe,retentionTitle:ze,retentionFieldset:Fe,proOverlay:Ge,radioRow:qe,radioLabel:We,presetGroup:Ye,presetBtn:Ke,presetBtnActive:Ve,freeInput:Qe,inputError:Xe,inputUnit:Je,cascadeRow:Ze,retentionActions:et,saveBtn:tt,runNowBtn:st,errorMsg:at};function it(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function se(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function nt(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function F(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function ot({placeId:t,tier:s,currentPolicy:c,onSaved:S}){const{t:r}=Q(),{trackEvent:j}=ie(),[i,m]=l.useState(c),[h,B]=l.useState(()=>[7,14,30,90].includes(c.ageDays??-1)?"":String(c.ageDays??30)),[L,D]=l.useState(()=>[100,500,1e3].includes(c.sizeMb??-1)?"":String(c.sizeMb??500)),[b,k]=l.useState(null),[y,_]=l.useState(!1),[R,C]=l.useState(!1),[w,I]=l.useState(!1),[E,A]=l.useState(null);l.useEffect(()=>{m(c);const g=[7,14,30,90],T=[100,500,1e3];B(g.includes(c.ageDays??-1)?"":String(c.ageDays??30)),D(T.includes(c.sizeMb??-1)?"":String(c.sizeMb??500))},[c]);const d=s==="basic",p=se(i),v=nt(c,i),H=p&&!v&&!R,N=g=>{m(T=>{const z={...T,mode:g};return g==="age"&&(z.ageDays=parseInt(h,10)||30),g==="size"&&(z.sizeMb=parseInt(L,10)||500),z})},x=g=>{B(""),m(T=>({...T,ageDays:g}))},n=g=>{D(""),m(T=>({...T,sizeMb:g}))},P=g=>{B(g);const T=parseInt(g,10);Number.isNaN(T)||m(z=>({...z,ageDays:T}))},M=g=>{D(g);const T=parseInt(g,10);Number.isNaN(T)||m(z=>({...z,sizeMb:T}))},X=async()=>{if(A(null),j("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),it(c,i)){try{const g=await oe(t,{mode:i.mode,ageDays:i.ageDays,sizeMb:i.sizeMb,cascadeSnapshots:i.cascadeSnapshots});k(g.dryRun),_(!0)}catch(g){A(g.message)}return}await K()},K=async()=>{C(!0);try{await be(t,i),_(!1),S()}catch(g){throw A(g.message),g}finally{C(!1)}},J=async()=>{A(null),j("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),I(!0);try{await je(t),S()}catch(g){A(g.message)}finally{I(!1)}},Z=b?`${r("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${b.wouldRemoveRequests}${r("uiStudio.cleanup.policy.confirm.requests","건")} / ${b.wouldRemoveSnapshots}${r("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${F(b.wouldFreeBytes)} ${r("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",O=i.mode==="age"&&!se(i),ee=i.mode==="size"&&!se(i);return e.jsxs("div",{className:o.retentionSection,children:[e.jsx("h3",{className:o.retentionTitle,children:e.jsx(f,{label:r("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:r("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[d&&e.jsx("div",{className:o.proOverlay,title:r("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:o.tooltip,children:r("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:o.retentionFieldset,disabled:d,style:d?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsx("div",{className:o.radioRow,children:e.jsx(u,{text:r("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:o.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:i.mode==="off",onChange:()=>N("off")}),r("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})})}),e.jsxs("div",{children:[e.jsx("div",{className:o.radioRow,children:e.jsx(u,{text:r("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:o.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:i.mode==="age",onChange:()=>N("age")}),r("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})})}),i.mode==="age"&&e.jsxs("div",{className:o.presetGroup,children:[[7,14,30,90].map(g=>e.jsx(u,{text:r("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${i.ageDays===g&&h===""?o.presetBtnActive:""}`,onClick:()=>x(g),children:[g,r("uiStudio.cleanup.policy.daysUnit","일")]})},g)),e.jsx(u,{text:r("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("input",{type:"number",className:`${o.freeInput} ${O?o.inputError:""}`,value:h,min:1,max:365,onChange:g=>P(g.target.value)})}),e.jsxs("span",{className:o.inputUnit,children:["1–365",r("uiStudio.cleanup.policy.daysUnit","일")]})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:o.radioRow,children:e.jsx(u,{text:r("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:o.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:i.mode==="size",onChange:()=>N("size")}),r("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})}),i.mode==="size"&&e.jsxs("div",{className:o.presetGroup,children:[[100,500,1e3].map(g=>e.jsx(u,{text:r("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${i.sizeMb===g&&L===""?o.presetBtnActive:""}`,onClick:()=>n(g),children:[g,r("uiStudio.cleanup.policy.mbUnit","MB")]})},g)),e.jsx(u,{text:r("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("input",{type:"number",className:`${o.freeInput} ${ee?o.inputError:""}`,value:L,min:50,max:1e4,onChange:g=>M(g.target.value)})}),e.jsxs("span",{className:o.inputUnit,children:["50–10000",r("uiStudio.cleanup.policy.mbUnit","MB")]})]})]}),e.jsx(u,{text:r("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:o.cascadeRow,children:[e.jsx("input",{type:"checkbox",checked:i.cascadeSnapshots,onChange:g=>m(T=>({...T,cascadeSnapshots:g.target.checked}))}),r("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:o.retentionActions,children:[e.jsx(u,{text:r("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:o.saveBtn,onClick:()=>void X(),disabled:!H,children:r("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(u,{text:r("uiStudio.cleanup.policy.runNow.tooltip","Run the current rule once now, without waiting for the next scheduled run."),children:e.jsx("button",{type:"button",className:o.runNowBtn,onClick:()=>void J(),disabled:w,children:r("uiStudio.cleanup.policy.runNow","지금 정리")})})]}),E&&e.jsx("div",{className:o.errorMsg,children:E})]})]}),y&&b&&e.jsx(ne,{title:r("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:Z,danger:!0,confirmLabel:r("uiStudio.cleanup.policy.save","정책 저장"),busy:R,onConfirm:K,onClose:()=>_(!1)})]})}function lt({placeId:t,tier:s,onChanged:c,sampleUsage:S,sampleRetention:r,embedded:j=!1}){const{t:i}=Q(),m=s==="basic"&&S!=null&&r!=null,[h,B]=l.useState(m?S:null),[L,D]=l.useState(m?r:null),[b,k]=l.useState(null),[y,_]=l.useState(null),[R,C]=l.useState(null),w=l.useCallback(async()=>{if(!m&&t!=null){k(null);try{const[N,x]=await Promise.all([le(t),oe(t)]);B(N),D(x.policy)}catch(N){k(N.message)}}},[t,m]);l.useEffect(()=>{w()},[w]);const I=l.useCallback(()=>{w(),c==null||c()},[w,c]),E=l.useCallback(async()=>{if(y&&t!=null){C(null);try{y.kind==="keep7"?await V(t,{olderThanDays:7,alsoSnapshots:!0}):y.kind==="keep30"?await V(t,{olderThanDays:30,alsoSnapshots:!0}):await V(t,{all:!0,alsoSnapshots:!0}),_(null),w(),c==null||c()}catch(N){throw C(N.message),N}}},[y,t,w,c]);function A(N){const x=i("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return N.kind==="keep7"?`${i("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${x}`:N.kind==="keep30"?`${i("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${x}`:`${((h==null?void 0:h.requestCount)??0)+((h==null?void 0:h.snapshotCount)??0)}${i("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${x}`}if(t==null&&!m)return null;if(b)return e.jsx("div",{className:`${o.card} ${j?o.cardEmbedded:""}`,children:e.jsx("p",{className:o.errorMsg,children:b})});if(!h||!L)return e.jsx("div",{className:`${o.card} ${j?o.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:i("uiStudio.storage.loading","로딩 중...")})});const d=L.lastRunAt,p=L.lastRunStats,v=d?new Date(d).toLocaleString():null,H=t??0;return e.jsxs("div",{className:`${o.card} ${j?o.cardEmbedded:""}`,children:[e.jsx("h3",{className:o.cardTitle,children:e.jsx(f,{label:i("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:i("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:o.usageRow,children:[e.jsx(u,{text:i("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:o.usageTotal,children:[i("uiStudio.storage.usageLabel","사용 중")," ",F(h.totalBytes)]})}),e.jsxs("div",{className:o.usageBreakdown,children:[e.jsx(u,{text:i("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[i("uiStudio.storage.historyBytes","변경 이력")," ",F(h.historyBytes)]})})," · ",e.jsx(u,{text:i("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[i("uiStudio.storage.snapshotBytes","화면 캡처")," ",F(h.snapshotBytes)]})})]}),e.jsxs("div",{className:o.usageCounts,children:[e.jsx(u,{text:i("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[i("uiStudio.storage.requestCount","변경 기록")," ",h.requestCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(u,{text:i("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[i("uiStudio.storage.mutationCount","변경 상세")," ",h.mutationCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(u,{text:i("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[i("uiStudio.storage.snapshotCount","화면 캡처")," ",h.snapshotCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})]})]}),e.jsx("hr",{className:o.divider}),e.jsx(ot,{placeId:H,tier:s,currentPolicy:L,onSaved:I}),e.jsx("hr",{className:o.divider}),e.jsxs("div",{className:o.lastRunRow,children:[e.jsx("span",{className:o.lastRunLabel,children:e.jsx(f,{label:i("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:i("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),v?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:v}),p&&e.jsxs("span",{children:["· ",i("uiStudio.storage.requestCount","변경 기록")," ",p.removedRequests,i("uiStudio.storage.countSuffix","개")," / ",i("uiStudio.storage.snapshotCount","화면 캡처")," ",p.removedSnapshots,i("uiStudio.storage.countSuffix","개")," / ",F(p.freedBytes)," ",i("uiStudio.storage.lastRunFreed","회수")]}),p&&p.errors>0&&e.jsxs("span",{className:o.errorIcon,title:`${i("uiStudio.storage.lastRunErrors","오류")} ${p.errors}건`,children:["⚠",e.jsxs("span",{className:o.tooltip,children:[i("uiStudio.storage.lastRunErrors","오류")," ",p.errors,i("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:i("uiStudio.storage.lastRunNever","—")})]}),e.jsx("hr",{className:o.divider}),e.jsxs("div",{className:o.cleanupRow,children:[e.jsx("span",{className:o.cleanupLabel,children:e.jsx(f,{label:i("uiStudio.cleanup.label","수동 정리"),tooltip:i("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(u,{text:i("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>_({kind:"keep7"}),disabled:s==="basic",children:i("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(u,{text:i("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>_({kind:"keep30"}),disabled:s==="basic",children:i("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),e.jsx(u,{text:i("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${o.cleanupBtn} ${o.cleanupBtnDanger}`,onClick:()=>_({kind:"all"}),disabled:s==="basic",children:i("uiStudio.cleanup.deleteAll","전체 삭제…")})})]}),R&&e.jsx("div",{className:o.errorMsg,children:R}),y&&e.jsx(ne,{title:i("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:A(y),danger:!0,confirmLabel:i("common.delete","삭제"),onConfirm:E,onClose:()=>{_(null),C(null)}})]})}const rt="_page_199y1_2",ct="_card_199y1_10",dt="_licenseCardTarget_199y1_26",ut="_licenseCardPro_199y1_31",gt="_cardHeader_199y1_42",pt="_cardHeaderActions_199y1_55",ht="_collapseButton_199y1_61",yt="_headerBadge_199y1_83",mt="_headerBadgeLive_199y1_94",vt="_licenseGrid_199y1_100",_t="_statusDot_199y1_118",xt="_statusActive_199y1_127",ft="_statusGrace_199y1_132",jt="_statusInactive_199y1_137",bt="_statusError_199y1_141",St="_proBadge_199y1_146",Nt="_upgradeLink_199y1_160",Lt="_licenseControls_199y1_174",Ct="_licenseControlRow_199y1_183",Ht="_licenseField_199y1_190",kt="_licenseFieldGrow_199y1_196",Rt="_controlLabel_199y1_201",wt="_textInput_199y1_207",Tt="_actionBtn_199y1_223",Et="_licenseMessage_199y1_245",At="_licenseNotice_199y1_252",It="_licenseNoticeInfo_199y1_262",Bt="_licenseNoticeWarning_199y1_268",Dt="_licenseNoticeMuted_199y1_274",Pt="_settingRow_199y1_280",Mt="_settingLabel_199y1_294",$t="_settingControl_199y1_301",Ut="_select_199y1_310",Ot="_numberInput_199y1_328",zt="_toggleSwitch_199y1_346",Ft="_toggleInput_199y1_353",Gt="_toggleTrack_199y1_361",qt="_toggleThumb_199y1_383",Wt="_savedIndicator_199y1_432",Yt="_savedIndicatorHidden_199y1_443",Kt="_dataHistoryIntro_199y1_448",Vt="_dataHistoryList_199y1_456",Qt="_dataHistoryRow_199y1_462",Xt="_dataHistoryDetail_199y1_471",Jt="_uiStudioDataHistoryRow_199y1_476",Zt="_uiStudioDataHistoryDetail_199y1_481",es="_dataHistoryMain_199y1_488",ts="_dataHistoryTitle_199y1_492",ss="_dataHistoryDescription_199y1_498",as="_dataHistoryMetric_199y1_506",is="_dataHistoryActions_199y1_513",ns="_linkButton_199y1_519",os="_dangerButton_199y1_520",ls="_inlineStatus_199y1_556",rs="_coldGrid_199y1_564",cs="_coldHint_199y1_582",ds="_langRow_199y1_591",us="_loading_199y1_604",gs="_unit_199y1_613",a={page:rt,card:ct,licenseCardTarget:dt,licenseCardPro:ut,cardHeader:gt,cardHeaderActions:pt,collapseButton:ht,headerBadge:yt,headerBadgeLive:mt,licenseGrid:vt,statusDot:_t,statusActive:xt,statusGrace:ft,statusInactive:jt,statusError:bt,proBadge:St,upgradeLink:Nt,licenseControls:Lt,licenseControlRow:Ct,licenseField:Ht,licenseFieldGrow:kt,controlLabel:Rt,textInput:wt,actionBtn:Tt,licenseMessage:Et,licenseNotice:At,licenseNoticeInfo:It,licenseNoticeWarning:Bt,licenseNoticeMuted:Dt,settingRow:Pt,settingLabel:Mt,settingControl:$t,select:Ut,numberInput:Ot,toggleSwitch:zt,toggleInput:Ft,toggleTrack:Gt,toggleThumb:qt,savedIndicator:Wt,savedIndicatorHidden:Yt,dataHistoryIntro:Kt,dataHistoryList:Vt,dataHistoryRow:Qt,dataHistoryDetail:Xt,uiStudioDataHistoryRow:Jt,uiStudioDataHistoryDetail:Zt,dataHistoryMain:es,dataHistoryTitle:ts,dataHistoryDescription:ss,dataHistoryMetric:as,dataHistoryActions:is,linkButton:ns,dangerButton:os,inlineStatus:ls,coldGrid:rs,coldHint:cs,langRow:ds,loading:us,unit:gs},ps={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},hs={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function ys(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function U(t){try{return await t}catch{return null}}function W(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function Y(t,s,c,S){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(c,S)}`}function G(t,s,c){const S=c===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):F(c);return`${s} · ${S}`}function q(t,s){var S;const c=(S=t==null?void 0:t[s])==null?void 0:S.bytes;return typeof c=="number"&&Number.isFinite(c)?c:null}function ms(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,F(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function vs({tier:t}){const{t:s}=Q(),[c,S]=l.useState(ps),[r,j]=l.useState(hs),[i,m]=l.useState(t==="basic"?te:null),[h,B]=l.useState(null),[L,D]=l.useState(!0),[b,k]=l.useState(!0),[y,_]=l.useState(null),[R,C]=l.useState(!1),[w,I]=l.useState(null),E=l.useCallback(async()=>{D(!0);const x=await U(he()),n=ys(x);B(n);const[P,M,X,K,J,Z,O]=await Promise.all([U($.get("/api/dashboard/history",{limit:"1",offset:"0"})),U($.get("/api/dashboard/tool-stats")),U($.get("/sync/history",{limit:"1",offset:"0"})),U($.get("/api/dashboard/playtest/history")),U($.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),U($.get("/api/dashboard/connection-log")),U($.get("/api/dashboard/storage-summary"))]),ee=t==="basic"?te:n===null?null:await U(le(n));S({toolsActivity:W(P),toolStats:(M==null?void 0:M.totalCalls)??null,toolSessions:(M==null?void 0:M.totalSessions)??null,syncLog:W(X),playtestReports:W(K),projectChanges:W(J),connectionLog:W(Z)}),j({toolsActivity:q(O,"toolsActivity"),toolStats:q(O,"toolStats"),syncLog:q(O,"syncLog"),playtestReports:q(O,"playtestReports"),projectChanges:q(O,"projectChanges"),connectionLog:q(O,"connectionLog")}),m(ee),D(!1)},[t]);l.useEffect(()=>{E()},[E]);const A=l.useMemo(()=>[{key:"toolsActivity",title:s("settings.dataHistory.toolsActivity.title","Tool activity"),description:s("settings.dataHistory.toolsActivity.description","Saved tool runs shown on the Tools page."),metric:G(s,Y(s,c.toolsActivity,"settings.dataHistory.metric.records","records"),r.toolsActivity),metricTooltip:s("settings.dataHistory.toolsActivity.metric.tooltip","Number of saved tool runs and the disk space they use."),route:"/tools",clearEndpoint:"/api/dashboard/tools/history/clear"},{key:"toolStats",title:s("settings.dataHistory.toolStats.title","Tool usage statistics"),description:s("settings.dataHistory.toolStats.description","Aggregated tool counts and status totals."),metric:G(s,c.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${c.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(c.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,r.toolStats),metricTooltip:s("settings.dataHistory.toolStats.metric.tooltip","Aggregated total runs and session counts."),route:"/tools",clearEndpoint:"/api/dashboard/tools/statistics/clear"},{key:"syncLog",title:s("settings.dataHistory.syncLog.title","Sync log"),description:s("settings.dataHistory.syncLog.description","Saved file sync events for the active place."),metric:G(s,Y(s,c.syncLog,"settings.dataHistory.metric.records","records"),r.syncLog),metricTooltip:s("settings.dataHistory.syncLog.metric.tooltip","Number of saved sync events and the disk space they use."),route:"/sync",clearEndpoint:"/api/dashboard/sync/history/clear"},{key:"playtestReports",title:s("settings.dataHistory.playtest.title","Playtest reports"),description:s("settings.dataHistory.playtest.description","Saved automated playtest reports and logs."),metric:G(s,Y(s,c.playtestReports,"settings.dataHistory.metric.reports","reports"),r.playtestReports),metricTooltip:s("settings.dataHistory.playtestReports.metric.tooltip","Number of saved playtest reports and the disk space they use."),route:"/playtest",clearEndpoint:"/api/dashboard/playtest/history/clear"},{key:"projectChanges",title:s("settings.dataHistory.projectChanges.title","Project change summary"),description:s("settings.dataHistory.projectChanges.description","Saved summaries of project changes."),metric:G(s,Y(s,c.projectChanges,"settings.dataHistory.metric.records","records"),r.projectChanges),metricTooltip:s("settings.dataHistory.projectChanges.metric.tooltip","Number of saved project change summaries and the disk space they use."),route:"/changelog",clearEndpoint:"/api/dashboard/changelog/clear"},{key:"connectionLog",title:s("settings.dataHistory.connectionLog.title","Connection log"),description:s("settings.dataHistory.connectionLog.description","Saved MCP and Studio connection events."),metric:G(s,Y(s,c.connectionLog,"settings.dataHistory.metric.records","records"),r.connectionLog),metricTooltip:s("settings.dataHistory.connectionLog.metric.tooltip","Number of saved connection events and the disk space they use."),route:"/connection",clearEndpoint:"/api/dashboard/connection-log/clear"}],[c,r,s]),d=async()=>{if(y){C(!0),I(null);try{if(y.kind==="uiStudio"){if(t!=="pro"||h===null)throw new Error("UI Studio place is unavailable");await V(h,{all:!0,alsoSnapshots:!0}),I(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else await $.post(y.row.clearEndpoint),I(s("settings.dataHistory.clear.success","Saved data cleared."));_(null),await E()}catch{I(y.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{C(!1)}}},p=t==="pro"?h:0,v=t==="pro"&&h!==null,H=(y==null?void 0:y.kind)==="uiStudio",N=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(f,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:a.cardHeaderActions,children:[e.jsx(u,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:a.headerBadge,children:L?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(u,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:a.collapseButton,type:"button","aria-expanded":b,"aria-controls":"settings-data-history-body","aria-label":b?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",N):s("settings.dataHistory.expand","Expand {title}").replace("{title}",N),onClick:()=>k(x=>!x),children:b?"▾":"▸"})})]})]}),b&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:a.dataHistoryIntro,children:s("settings.dataHistory.intro","Review saved dashboard data, open the related page, or clear stored records from one place.")}),e.jsxs("div",{className:a.dataHistoryList,children:[A.map(x=>e.jsxs("div",{className:a.dataHistoryRow,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:x.title}),e.jsx("div",{className:a.dataHistoryDescription,children:x.description})]}),e.jsx(u,{text:x.metricTooltip,children:e.jsx("div",{className:a.dataHistoryMetric,children:x.metric})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(u,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:`#${x.route}`,children:s("settings.dataHistory.open","Open")})}),e.jsx(u,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",onClick:()=>_({kind:"row",row:x}),children:s("common.clear","Clear")})})]})]},x.key)),e.jsxs("div",{className:`${a.dataHistoryRow} ${a.uiStudioDataHistoryRow}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:a.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(u,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:a.dataHistoryMetric,children:ms(s,i)})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(u,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(u,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",disabled:!v,onClick:()=>_({kind:"uiStudio"}),children:s("common.clear","Clear")})})]})]}),e.jsx("div",{className:`${a.dataHistoryDetail} ${a.uiStudioDataHistoryDetail}`,children:e.jsx(lt,{placeId:p,tier:t,onChanged:E,embedded:!0,...t==="basic"?{sampleUsage:te,sampleRetention:Se}:{}})})]}),w&&e.jsx("p",{className:a.inlineStatus,children:w})]})]}),e.jsx(fe,{open:y!==null,title:H?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:H?s("settings.dataHistory.uiStudio.clear.message","This deletes saved UI Studio change records and screenshots only. Roblox Studio instances and project objects are not changed."):s("settings.dataHistory.clear.message","This deletes saved dashboard records only. Roblox Studio instances and project objects are not changed."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:s("common.clear","Clear"),loading:R,onCancel:()=>!R&&_(null),onConfirm:()=>void d()})]})}const _s={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"},xs=["debug","info","warn","error"];function fs(t){return t==="active"?a.statusActive:t==="grace"?a.statusGrace:t==="invalid"||t==="revoked"?a.statusError:a.statusInactive}function js(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:a.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:a.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:a.licenseNoticeMuted}}function ae({checked:t,onChange:s,testId:c,ariaLabel:S}){return e.jsxs("label",{className:a.toggleSwitch,"data-testid":c,children:[e.jsx("input",{type:"checkbox",className:a.toggleInput,checked:t,"aria-label":S,onChange:r=>s(r.target.checked)}),e.jsx("span",{className:a.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:a.toggleThumb})})]})}function ks(){const{t,selectedLocale:s,setLocale:c}=Q(),{trackEvent:S}=ie(),{search:r}=ye(),{settings:j,license:i,licenseControlsDisabled:m,licenseSubmitting:h,licenseMessage:B,activateLicense:L,refreshLicense:D,resetLicense:b,updateHotSetting:k,loading:y}=Ne(),[_,R]=l.useState(null),[C,w]=l.useState(""),I=i?js(i,t):null,E=(i==null?void 0:i.tier)==="pro",A=(i==null?void 0:i.tier)==="pro"?i.maskedKey:void 0,d=i!=null&&i.provider&&i.provider!=="auto"?i.provider:void 0,p=(i==null?void 0:i.tier)==="pro"?"pro":"basic",v=l.useRef(null),H=l.useRef(null),N=l.useMemo(()=>new URLSearchParams(r).get("section")==="license",[r]),x=l.useCallback(async(n,P)=>{await k(n,P),R(n),setTimeout(()=>R(M=>M===n?null:M),2e3)},[k]);return l.useEffect(()=>{var P;if(!N||y)return;const n=v.current;if((P=n==null?void 0:n.scrollIntoView)==null||P.call(n,{block:"start",behavior:"smooth"}),H.current&&!H.current.disabled){H.current.focus();return}n==null||n.focus()},[y,m,h,N]),y?e.jsx("div",{className:a.page,children:e.jsx("div",{className:a.loading,children:t("common.loading")})}):e.jsxs("div",{className:a.page,children:[e.jsx(xe,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, live settings, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:p}}),e.jsxs("div",{id:"settings-license",ref:v,tabIndex:-1,"data-testid":"settings-license-card",className:[a.card,N?a.licenseCardTarget:"",(i==null?void 0:i.tier)==="pro"?a.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(f,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(u,{text:m?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${a.headerBadge} ${m?"":a.headerBadgeLive}`,children:m?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[i?e.jsxs(e.Fragment,{children:[(()=>{const n=I;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.licenseGrid,children:[e.jsx("dt",{children:e.jsx(f,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${a.statusDot} ${fs(i.status)}`}),e.jsx(u,{text:(n==null?void 0:n.tooltip)??t(`settings.license.${i.status}.tooltip`,"Current license activation state."),children:(n==null?void 0:n.label)??t(`settings.license.${i.status}`,i.status)})]}),e.jsx("dt",{children:e.jsx(f,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:i.tier==="pro"?a.proBadge:"",children:e.jsx(u,{text:t(`tier.${i.tier}.tooltip`,"Available feature set for the connected license."),children:i.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),A&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(f,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(u,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:A})})]}),d&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(f,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(u,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:d})})]})]}),(n==null?void 0:n.detail)&&e.jsx("p",{className:`${a.licenseNotice} ${n.detailTone}`,children:i.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):n.detail}),i.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${a.licenseNotice} ${a.licenseNoticeMuted}`,children:n==null?void 0:n.detail})]})})(),i.tier==="basic"&&e.jsx(u,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:a.upgradeLink,href:me.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>S("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:a.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:a.licenseControls,children:[e.jsxs("div",{className:a.licenseControlRow,children:[e.jsx(u,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:m||h||!E,onClick:()=>{D()},children:h?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(u,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:m||h||!E,onClick:()=>{b()},children:h?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:a.licenseControlRow,children:[e.jsxs("label",{className:`${a.licenseField} ${a.licenseFieldGrow}`,children:[e.jsx("span",{className:a.controlLabel,children:e.jsx(f,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:H,"aria-label":t("settings.license.keyInput","License Key"),className:a.textInput,type:"text",value:C,disabled:m||h,onChange:n=>w(n.target.value)})]}),e.jsx(u,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:m||h,onClick:()=>{(async()=>await L(C)&&w(""))()},children:h?t("common.loading"):t("settings.license.activate","Activate License")})})]}),B&&e.jsx("p",{className:a.licenseMessage,children:B})]})]})]}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(f,{label:t("settings.general.title","General Settings"),tooltip:t("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(u,{text:t("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${a.headerBadge} ${a.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),j?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.logLevel","Log Level"),tooltip:t("settings.general.logLevel.tooltip","Sets how much detail WEPPY Dashboard writes to its logs.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("select",{className:a.select,value:j.hot.LOG_LEVEL,onChange:n=>x("LOG_LEVEL",n.target.value),children:xs.map(n=>e.jsx("option",{value:n,children:n},n))}),_==="LOG_LEVEL"&&e.jsx("span",{className:a.savedIndicator,children:t("settings.general.applied")})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.localHistory","Tool History Recording"),tooltip:t("settings.general.localHistory.tooltip","Stores local tool execution history for the WEPPY Dashboard history views.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("span",{className:`${a.savedIndicator} ${_==="ENABLE_LOCAL_HISTORY"?"":a.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(ae,{checked:j.hot.ENABLE_LOCAL_HISTORY,ariaLabel:t("settings.general.localHistory","Tool History Recording"),testId:"settings-toggle-enable-local-history",onChange:n=>x("ENABLE_LOCAL_HISTORY",n)})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.localStatistics","Tool Statistics Collection"),tooltip:t("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WEPPY Dashboard reporting.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("span",{className:`${a.savedIndicator} ${_==="ENABLE_LOCAL_STATISTICS"?"":a.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(ae,{checked:j.hot.ENABLE_LOCAL_STATISTICS,ariaLabel:t("settings.general.localStatistics","Tool Statistics Collection"),testId:"settings-toggle-enable-local-statistics",onChange:n=>x("ENABLE_LOCAL_STATISTICS",n)})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.contextCapture","Context Capture"),tooltip:t("settings.general.contextCapture.tooltip","When enabled, WEPPY Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("span",{className:`${a.savedIndicator} ${_==="ENABLE_CONTEXT_CAPTURE"?"":a.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(ae,{checked:j.hot.ENABLE_CONTEXT_CAPTURE,ariaLabel:t("settings.general.contextCapture","Context Capture"),testId:"settings-toggle-enable-context-capture",onChange:n=>x("ENABLE_CONTEXT_CAPTURE",n)})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.requestTimeout","Action Timeout"),tooltip:t("settings.general.requestTimeout.tooltip","Maximum time WEPPY Dashboard waits for an action before it fails.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("input",{type:"number",className:a.numberInput,value:j.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:n=>{const P=parseInt(n.target.value,10);isNaN(P)||x("REQUEST_TIMEOUT",P)}}),e.jsx(u,{text:t("settings.general.requestTimeout.unit.tooltip","Action timeout is measured in milliseconds."),children:e.jsx("span",{className:a.unit,children:t("settings.general.requestTimeout.unit","ms")})}),_==="REQUEST_TIMEOUT"&&e.jsx("span",{className:a.savedIndicator,children:t("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:a.loading,children:t("settings.unavailable")})]}),e.jsx(vs,{tier:p}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(f,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(u,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:a.headerBadge,children:t("settings.readOnly","Read-only")})})]}),j?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.coldGrid,children:[e.jsx("dt",{children:e.jsx(f,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:j.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(f,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:j.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(f,{label:"DASHBOARD_AUTO_OPEN",tooltip:t("settings.cold.dashboardAutoOpen.tooltip","Controls whether WEPPY Dashboard opens automatically in the browser when the server starts.")})}),e.jsx("dd",{children:e.jsx(u,{text:t("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WEPPY Dashboard in a browser."),children:String(j.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:a.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:a.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:a.card,children:[e.jsx("div",{className:a.cardHeader,children:e.jsx(f,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WEPPY Dashboard interface text is localized.")})}),e.jsxs("div",{className:a.langRow,children:[e.jsx("label",{children:e.jsx(f,{label:t("settings.language.dashboard","WEPPY Dashboard Language"),tooltip:t("settings.language.dashboard.tooltip","Overrides the WEPPY Dashboard language or follows the system language when set to Auto.")})}),e.jsx(u,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:a.select,value:s,onChange:n=>c(n.target.value),children:[e.jsx("option",{value:ve,children:t("settings.language.auto","Auto")}),_e.map(n=>e.jsx("option",{value:n,children:_s[n]??n},n))]})})]})]})]})}export{ks as Component};
|
|
1
|
+
import{d as re,r as l,f as ce,D as de,e as ue,g as ge,h as pe,a as $,u as Q,i as ie,j as e,k as he,l as ye,T as me,A as ve,S as _e}from"./index-DG2RrKOl.js";import{P as xe}from"./PageHeader-CThGgsAt.js";import{I as f}from"./InfoLabel-Cyz7d4Kc.js";import{T as u}from"./TooltipText-H3YSCbob.js";import{C as fe}from"./ConfirmModal-CpImpY9c.js";import{D as ne,f as oe,r as je,s as be,a as le,d as V,S as te,b as Se}from"./sample-requests-D1b5Z8FU.js";function Ne(){const{level:t}=re(),[s,c]=l.useState(null),[S,r]=l.useState(null),[j,i]=l.useState(!1),[m,h]=l.useState(!0),[B,L]=l.useState(!1),[D,b]=l.useState(null),k=t==="disconnected",y=l.useCallback(d=>{d&&r(p=>({...p,...d,maskedKey:d.maskedKey??(p==null?void 0:p.maskedKey),provider:d.provider??(p==null?void 0:p.provider)??"auto"}))},[]),_=l.useCallback(d=>{if(!d){r(null);return}r({...d,provider:d.provider??"auto"})},[]),R=l.useCallback(async()=>{try{return await ce()}catch{return null}},[]);l.useEffect(()=>{let d=!1;async function p(){try{const[v,H]=await Promise.all([$.get("/api/dashboard/settings").catch(()=>null),R()]);if(d)return;v&&c(v),H&&y(H)}catch{}finally{d||h(!1)}}return p(),()=>{d=!0}},[R,y]),l.useEffect(()=>{const d=new de;d.connect();const p=d.on("license",v=>{R().then(H=>{if(H){if((v==null?void 0:v.cleared)===!0){_(H);return}y(H)}})});return()=>{p(),d.disconnect()}},[R,y,_]);const C=l.useCallback((d,p)=>{b(d??p)},[]),w=l.useCallback(async d=>{if(k)return!1;if(!d.trim())return b("License key is required."),!1;L(!0);try{const p=await ue({licenseKey:d.trim()});return y(p.license),C(p.message,p.ok?"License updated.":"License activation failed."),p.ok}catch{return b("License activation failed."),!1}finally{L(!1)}},[C,k,y]),I=l.useCallback(async()=>{if(!k){L(!0);try{const d=await ge();y(d.license),C(d.message,d.ok?"License updated.":"License refresh failed.")}catch{b("License refresh failed.")}finally{L(!1)}}},[C,k,y]),E=l.useCallback(async()=>{if(!k){L(!0);try{const d=await pe();_(d.license),C(d.message,d.ok?"License reset.":"License reset failed.")}catch{b("License reset failed.")}finally{L(!1)}}},[C,k,_]),A=l.useCallback(async(d,p)=>{if(s){c(v=>v&&{...v,hot:{...v.hot,[d]:p}}),i(!0);try{await $.patch("/api/dashboard/settings",{[d]:p})}catch{c(v=>v&&{...v,hot:{...v.hot,[d]:s.hot[d]}})}finally{i(!1)}}},[s]);return{settings:s,license:S,saving:j,licenseControlsDisabled:k,licenseSubmitting:B,licenseMessage:D,activateLicense:w,refreshLicense:I,resetLicense:E,updateHotSetting:A,loading:m}}const Le="_card_1jlvt_4",Ce="_cardEmbedded_1jlvt_14",He="_cardTitle_1jlvt_21",ke="_usageRow_1jlvt_30",Re="_usageTotal_1jlvt_36",we="_usageBreakdown_1jlvt_42",Te="_usageCounts_1jlvt_47",Ee="_divider_1jlvt_53",Ae="_lastRunRow_1jlvt_60",Ie="_lastRunLabel_1jlvt_69",Be="_errorIcon_1jlvt_75",De="_tooltip_1jlvt_83",Pe="_cleanupRow_1jlvt_106",Me="_cleanupLabel_1jlvt_113",$e="_cleanupBtn_1jlvt_120",Ue="_cleanupBtnDanger_1jlvt_143",Oe="_retentionSection_1jlvt_155",ze="_retentionTitle_1jlvt_161",Fe="_retentionFieldset_1jlvt_170",Ge="_proOverlay_1jlvt_185",qe="_radioRow_1jlvt_197",We="_radioLabel_1jlvt_204",Ye="_presetGroup_1jlvt_224",Ke="_presetBtn_1jlvt_232",Ve="_presetBtnActive_1jlvt_249",Qe="_freeInput_1jlvt_256",Xe="_inputError_1jlvt_272",Je="_inputUnit_1jlvt_276",Ze="_cascadeRow_1jlvt_283",et="_retentionActions_1jlvt_302",tt="_saveBtn_1jlvt_308",st="_runNowBtn_1jlvt_330",at="_errorMsg_1jlvt_353",o={card:Le,cardEmbedded:Ce,cardTitle:He,usageRow:ke,usageTotal:Re,usageBreakdown:we,usageCounts:Te,divider:Ee,lastRunRow:Ae,lastRunLabel:Ie,errorIcon:Be,tooltip:De,cleanupRow:Pe,cleanupLabel:Me,cleanupBtn:$e,cleanupBtnDanger:Ue,retentionSection:Oe,retentionTitle:ze,retentionFieldset:Fe,proOverlay:Ge,radioRow:qe,radioLabel:We,presetGroup:Ye,presetBtn:Ke,presetBtnActive:Ve,freeInput:Qe,inputError:Xe,inputUnit:Je,cascadeRow:Ze,retentionActions:et,saveBtn:tt,runNowBtn:st,errorMsg:at};function it(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function se(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function nt(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function F(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function ot({placeId:t,tier:s,currentPolicy:c,onSaved:S}){const{t:r}=Q(),{trackEvent:j}=ie(),[i,m]=l.useState(c),[h,B]=l.useState(()=>[7,14,30,90].includes(c.ageDays??-1)?"":String(c.ageDays??30)),[L,D]=l.useState(()=>[100,500,1e3].includes(c.sizeMb??-1)?"":String(c.sizeMb??500)),[b,k]=l.useState(null),[y,_]=l.useState(!1),[R,C]=l.useState(!1),[w,I]=l.useState(!1),[E,A]=l.useState(null);l.useEffect(()=>{m(c);const g=[7,14,30,90],T=[100,500,1e3];B(g.includes(c.ageDays??-1)?"":String(c.ageDays??30)),D(T.includes(c.sizeMb??-1)?"":String(c.sizeMb??500))},[c]);const d=s==="basic",p=se(i),v=nt(c,i),H=p&&!v&&!R,N=g=>{m(T=>{const z={...T,mode:g};return g==="age"&&(z.ageDays=parseInt(h,10)||30),g==="size"&&(z.sizeMb=parseInt(L,10)||500),z})},x=g=>{B(""),m(T=>({...T,ageDays:g}))},n=g=>{D(""),m(T=>({...T,sizeMb:g}))},P=g=>{B(g);const T=parseInt(g,10);Number.isNaN(T)||m(z=>({...z,ageDays:T}))},M=g=>{D(g);const T=parseInt(g,10);Number.isNaN(T)||m(z=>({...z,sizeMb:T}))},X=async()=>{if(A(null),j("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),it(c,i)){try{const g=await oe(t,{mode:i.mode,ageDays:i.ageDays,sizeMb:i.sizeMb,cascadeSnapshots:i.cascadeSnapshots});k(g.dryRun),_(!0)}catch(g){A(g.message)}return}await K()},K=async()=>{C(!0);try{await be(t,i),_(!1),S()}catch(g){throw A(g.message),g}finally{C(!1)}},J=async()=>{A(null),j("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),I(!0);try{await je(t),S()}catch(g){A(g.message)}finally{I(!1)}},Z=b?`${r("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${b.wouldRemoveRequests}${r("uiStudio.cleanup.policy.confirm.requests","건")} / ${b.wouldRemoveSnapshots}${r("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${F(b.wouldFreeBytes)} ${r("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",O=i.mode==="age"&&!se(i),ee=i.mode==="size"&&!se(i);return e.jsxs("div",{className:o.retentionSection,children:[e.jsx("h3",{className:o.retentionTitle,children:e.jsx(f,{label:r("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:r("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[d&&e.jsx("div",{className:o.proOverlay,title:r("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:o.tooltip,children:r("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:o.retentionFieldset,disabled:d,style:d?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsx("div",{className:o.radioRow,children:e.jsx(u,{text:r("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:o.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:i.mode==="off",onChange:()=>N("off")}),r("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})})}),e.jsxs("div",{children:[e.jsx("div",{className:o.radioRow,children:e.jsx(u,{text:r("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:o.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:i.mode==="age",onChange:()=>N("age")}),r("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})})}),i.mode==="age"&&e.jsxs("div",{className:o.presetGroup,children:[[7,14,30,90].map(g=>e.jsx(u,{text:r("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${i.ageDays===g&&h===""?o.presetBtnActive:""}`,onClick:()=>x(g),children:[g,r("uiStudio.cleanup.policy.daysUnit","일")]})},g)),e.jsx(u,{text:r("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("input",{type:"number",className:`${o.freeInput} ${O?o.inputError:""}`,value:h,min:1,max:365,onChange:g=>P(g.target.value)})}),e.jsxs("span",{className:o.inputUnit,children:["1–365",r("uiStudio.cleanup.policy.daysUnit","일")]})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:o.radioRow,children:e.jsx(u,{text:r("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:o.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:i.mode==="size",onChange:()=>N("size")}),r("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})}),i.mode==="size"&&e.jsxs("div",{className:o.presetGroup,children:[[100,500,1e3].map(g=>e.jsx(u,{text:r("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${i.sizeMb===g&&L===""?o.presetBtnActive:""}`,onClick:()=>n(g),children:[g,r("uiStudio.cleanup.policy.mbUnit","MB")]})},g)),e.jsx(u,{text:r("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("input",{type:"number",className:`${o.freeInput} ${ee?o.inputError:""}`,value:L,min:50,max:1e4,onChange:g=>M(g.target.value)})}),e.jsxs("span",{className:o.inputUnit,children:["50–10000",r("uiStudio.cleanup.policy.mbUnit","MB")]})]})]}),e.jsx(u,{text:r("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:o.cascadeRow,children:[e.jsx("input",{type:"checkbox",checked:i.cascadeSnapshots,onChange:g=>m(T=>({...T,cascadeSnapshots:g.target.checked}))}),r("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:o.retentionActions,children:[e.jsx(u,{text:r("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:o.saveBtn,onClick:()=>void X(),disabled:!H,children:r("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(u,{text:r("uiStudio.cleanup.policy.runNow.tooltip","Run the current rule once now, without waiting for the next scheduled run."),children:e.jsx("button",{type:"button",className:o.runNowBtn,onClick:()=>void J(),disabled:w,children:r("uiStudio.cleanup.policy.runNow","지금 정리")})})]}),E&&e.jsx("div",{className:o.errorMsg,children:E})]})]}),y&&b&&e.jsx(ne,{title:r("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:Z,danger:!0,confirmLabel:r("uiStudio.cleanup.policy.save","정책 저장"),busy:R,onConfirm:K,onClose:()=>_(!1)})]})}function lt({placeId:t,tier:s,onChanged:c,sampleUsage:S,sampleRetention:r,embedded:j=!1}){const{t:i}=Q(),m=s==="basic"&&S!=null&&r!=null,[h,B]=l.useState(m?S:null),[L,D]=l.useState(m?r:null),[b,k]=l.useState(null),[y,_]=l.useState(null),[R,C]=l.useState(null),w=l.useCallback(async()=>{if(!m&&t!=null){k(null);try{const[N,x]=await Promise.all([le(t),oe(t)]);B(N),D(x.policy)}catch(N){k(N.message)}}},[t,m]);l.useEffect(()=>{w()},[w]);const I=l.useCallback(()=>{w(),c==null||c()},[w,c]),E=l.useCallback(async()=>{if(y&&t!=null){C(null);try{y.kind==="keep7"?await V(t,{olderThanDays:7,alsoSnapshots:!0}):y.kind==="keep30"?await V(t,{olderThanDays:30,alsoSnapshots:!0}):await V(t,{all:!0,alsoSnapshots:!0}),_(null),w(),c==null||c()}catch(N){throw C(N.message),N}}},[y,t,w,c]);function A(N){const x=i("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return N.kind==="keep7"?`${i("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${x}`:N.kind==="keep30"?`${i("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${x}`:`${((h==null?void 0:h.requestCount)??0)+((h==null?void 0:h.snapshotCount)??0)}${i("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${x}`}if(t==null&&!m)return null;if(b)return e.jsx("div",{className:`${o.card} ${j?o.cardEmbedded:""}`,children:e.jsx("p",{className:o.errorMsg,children:b})});if(!h||!L)return e.jsx("div",{className:`${o.card} ${j?o.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:i("uiStudio.storage.loading","로딩 중...")})});const d=L.lastRunAt,p=L.lastRunStats,v=d?new Date(d).toLocaleString():null,H=t??0;return e.jsxs("div",{className:`${o.card} ${j?o.cardEmbedded:""}`,children:[e.jsx("h3",{className:o.cardTitle,children:e.jsx(f,{label:i("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:i("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:o.usageRow,children:[e.jsx(u,{text:i("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:o.usageTotal,children:[i("uiStudio.storage.usageLabel","사용 중")," ",F(h.totalBytes)]})}),e.jsxs("div",{className:o.usageBreakdown,children:[e.jsx(u,{text:i("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[i("uiStudio.storage.historyBytes","변경 이력")," ",F(h.historyBytes)]})})," · ",e.jsx(u,{text:i("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[i("uiStudio.storage.snapshotBytes","화면 캡처")," ",F(h.snapshotBytes)]})})]}),e.jsxs("div",{className:o.usageCounts,children:[e.jsx(u,{text:i("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[i("uiStudio.storage.requestCount","변경 기록")," ",h.requestCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(u,{text:i("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[i("uiStudio.storage.mutationCount","변경 상세")," ",h.mutationCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(u,{text:i("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[i("uiStudio.storage.snapshotCount","화면 캡처")," ",h.snapshotCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})]})]}),e.jsx("hr",{className:o.divider}),e.jsx(ot,{placeId:H,tier:s,currentPolicy:L,onSaved:I}),e.jsx("hr",{className:o.divider}),e.jsxs("div",{className:o.lastRunRow,children:[e.jsx("span",{className:o.lastRunLabel,children:e.jsx(f,{label:i("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:i("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),v?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:v}),p&&e.jsxs("span",{children:["· ",i("uiStudio.storage.requestCount","변경 기록")," ",p.removedRequests,i("uiStudio.storage.countSuffix","개")," / ",i("uiStudio.storage.snapshotCount","화면 캡처")," ",p.removedSnapshots,i("uiStudio.storage.countSuffix","개")," / ",F(p.freedBytes)," ",i("uiStudio.storage.lastRunFreed","회수")]}),p&&p.errors>0&&e.jsxs("span",{className:o.errorIcon,title:`${i("uiStudio.storage.lastRunErrors","오류")} ${p.errors}건`,children:["⚠",e.jsxs("span",{className:o.tooltip,children:[i("uiStudio.storage.lastRunErrors","오류")," ",p.errors,i("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:i("uiStudio.storage.lastRunNever","—")})]}),e.jsx("hr",{className:o.divider}),e.jsxs("div",{className:o.cleanupRow,children:[e.jsx("span",{className:o.cleanupLabel,children:e.jsx(f,{label:i("uiStudio.cleanup.label","수동 정리"),tooltip:i("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(u,{text:i("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>_({kind:"keep7"}),disabled:s==="basic",children:i("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(u,{text:i("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>_({kind:"keep30"}),disabled:s==="basic",children:i("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),e.jsx(u,{text:i("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${o.cleanupBtn} ${o.cleanupBtnDanger}`,onClick:()=>_({kind:"all"}),disabled:s==="basic",children:i("uiStudio.cleanup.deleteAll","전체 삭제…")})})]}),R&&e.jsx("div",{className:o.errorMsg,children:R}),y&&e.jsx(ne,{title:i("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:A(y),danger:!0,confirmLabel:i("common.delete","삭제"),onConfirm:E,onClose:()=>{_(null),C(null)}})]})}const rt="_page_199y1_2",ct="_card_199y1_10",dt="_licenseCardTarget_199y1_26",ut="_licenseCardPro_199y1_31",gt="_cardHeader_199y1_42",pt="_cardHeaderActions_199y1_55",ht="_collapseButton_199y1_61",yt="_headerBadge_199y1_83",mt="_headerBadgeLive_199y1_94",vt="_licenseGrid_199y1_100",_t="_statusDot_199y1_118",xt="_statusActive_199y1_127",ft="_statusGrace_199y1_132",jt="_statusInactive_199y1_137",bt="_statusError_199y1_141",St="_proBadge_199y1_146",Nt="_upgradeLink_199y1_160",Lt="_licenseControls_199y1_174",Ct="_licenseControlRow_199y1_183",Ht="_licenseField_199y1_190",kt="_licenseFieldGrow_199y1_196",Rt="_controlLabel_199y1_201",wt="_textInput_199y1_207",Tt="_actionBtn_199y1_223",Et="_licenseMessage_199y1_245",At="_licenseNotice_199y1_252",It="_licenseNoticeInfo_199y1_262",Bt="_licenseNoticeWarning_199y1_268",Dt="_licenseNoticeMuted_199y1_274",Pt="_settingRow_199y1_280",Mt="_settingLabel_199y1_294",$t="_settingControl_199y1_301",Ut="_select_199y1_310",Ot="_numberInput_199y1_328",zt="_toggleSwitch_199y1_346",Ft="_toggleInput_199y1_353",Gt="_toggleTrack_199y1_361",qt="_toggleThumb_199y1_383",Wt="_savedIndicator_199y1_432",Yt="_savedIndicatorHidden_199y1_443",Kt="_dataHistoryIntro_199y1_448",Vt="_dataHistoryList_199y1_456",Qt="_dataHistoryRow_199y1_462",Xt="_dataHistoryDetail_199y1_471",Jt="_uiStudioDataHistoryRow_199y1_476",Zt="_uiStudioDataHistoryDetail_199y1_481",es="_dataHistoryMain_199y1_488",ts="_dataHistoryTitle_199y1_492",ss="_dataHistoryDescription_199y1_498",as="_dataHistoryMetric_199y1_506",is="_dataHistoryActions_199y1_513",ns="_linkButton_199y1_519",os="_dangerButton_199y1_520",ls="_inlineStatus_199y1_556",rs="_coldGrid_199y1_564",cs="_coldHint_199y1_582",ds="_langRow_199y1_591",us="_loading_199y1_604",gs="_unit_199y1_613",a={page:rt,card:ct,licenseCardTarget:dt,licenseCardPro:ut,cardHeader:gt,cardHeaderActions:pt,collapseButton:ht,headerBadge:yt,headerBadgeLive:mt,licenseGrid:vt,statusDot:_t,statusActive:xt,statusGrace:ft,statusInactive:jt,statusError:bt,proBadge:St,upgradeLink:Nt,licenseControls:Lt,licenseControlRow:Ct,licenseField:Ht,licenseFieldGrow:kt,controlLabel:Rt,textInput:wt,actionBtn:Tt,licenseMessage:Et,licenseNotice:At,licenseNoticeInfo:It,licenseNoticeWarning:Bt,licenseNoticeMuted:Dt,settingRow:Pt,settingLabel:Mt,settingControl:$t,select:Ut,numberInput:Ot,toggleSwitch:zt,toggleInput:Ft,toggleTrack:Gt,toggleThumb:qt,savedIndicator:Wt,savedIndicatorHidden:Yt,dataHistoryIntro:Kt,dataHistoryList:Vt,dataHistoryRow:Qt,dataHistoryDetail:Xt,uiStudioDataHistoryRow:Jt,uiStudioDataHistoryDetail:Zt,dataHistoryMain:es,dataHistoryTitle:ts,dataHistoryDescription:ss,dataHistoryMetric:as,dataHistoryActions:is,linkButton:ns,dangerButton:os,inlineStatus:ls,coldGrid:rs,coldHint:cs,langRow:ds,loading:us,unit:gs},ps={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},hs={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function ys(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function U(t){try{return await t}catch{return null}}function W(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function Y(t,s,c,S){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(c,S)}`}function G(t,s,c){const S=c===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):F(c);return`${s} · ${S}`}function q(t,s){var S;const c=(S=t==null?void 0:t[s])==null?void 0:S.bytes;return typeof c=="number"&&Number.isFinite(c)?c:null}function ms(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,F(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function vs({tier:t}){const{t:s}=Q(),[c,S]=l.useState(ps),[r,j]=l.useState(hs),[i,m]=l.useState(t==="basic"?te:null),[h,B]=l.useState(null),[L,D]=l.useState(!0),[b,k]=l.useState(!0),[y,_]=l.useState(null),[R,C]=l.useState(!1),[w,I]=l.useState(null),E=l.useCallback(async()=>{D(!0);const x=await U(he()),n=ys(x);B(n);const[P,M,X,K,J,Z,O]=await Promise.all([U($.get("/api/dashboard/history",{limit:"1",offset:"0"})),U($.get("/api/dashboard/tool-stats")),U($.get("/sync/history",{limit:"1",offset:"0"})),U($.get("/api/dashboard/playtest/history")),U($.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),U($.get("/api/dashboard/connection-log")),U($.get("/api/dashboard/storage-summary"))]),ee=t==="basic"?te:n===null?null:await U(le(n));S({toolsActivity:W(P),toolStats:(M==null?void 0:M.totalCalls)??null,toolSessions:(M==null?void 0:M.totalSessions)??null,syncLog:W(X),playtestReports:W(K),projectChanges:W(J),connectionLog:W(Z)}),j({toolsActivity:q(O,"toolsActivity"),toolStats:q(O,"toolStats"),syncLog:q(O,"syncLog"),playtestReports:q(O,"playtestReports"),projectChanges:q(O,"projectChanges"),connectionLog:q(O,"connectionLog")}),m(ee),D(!1)},[t]);l.useEffect(()=>{E()},[E]);const A=l.useMemo(()=>[{key:"toolsActivity",title:s("settings.dataHistory.toolsActivity.title","Tool activity"),description:s("settings.dataHistory.toolsActivity.description","Saved tool runs shown on the Tools page."),metric:G(s,Y(s,c.toolsActivity,"settings.dataHistory.metric.records","records"),r.toolsActivity),metricTooltip:s("settings.dataHistory.toolsActivity.metric.tooltip","Number of saved tool runs and the disk space they use."),route:"/tools",clearEndpoint:"/api/dashboard/tools/history/clear"},{key:"toolStats",title:s("settings.dataHistory.toolStats.title","Tool usage statistics"),description:s("settings.dataHistory.toolStats.description","Aggregated tool counts and status totals."),metric:G(s,c.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${c.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(c.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,r.toolStats),metricTooltip:s("settings.dataHistory.toolStats.metric.tooltip","Aggregated total runs and session counts."),route:"/tools",clearEndpoint:"/api/dashboard/tools/statistics/clear"},{key:"syncLog",title:s("settings.dataHistory.syncLog.title","Sync log"),description:s("settings.dataHistory.syncLog.description","Saved file sync events for the active place."),metric:G(s,Y(s,c.syncLog,"settings.dataHistory.metric.records","records"),r.syncLog),metricTooltip:s("settings.dataHistory.syncLog.metric.tooltip","Number of saved sync events and the disk space they use."),route:"/sync",clearEndpoint:"/api/dashboard/sync/history/clear"},{key:"playtestReports",title:s("settings.dataHistory.playtest.title","Playtest reports"),description:s("settings.dataHistory.playtest.description","Saved automated playtest reports and logs."),metric:G(s,Y(s,c.playtestReports,"settings.dataHistory.metric.reports","reports"),r.playtestReports),metricTooltip:s("settings.dataHistory.playtestReports.metric.tooltip","Number of saved playtest reports and the disk space they use."),route:"/playtest",clearEndpoint:"/api/dashboard/playtest/history/clear"},{key:"projectChanges",title:s("settings.dataHistory.projectChanges.title","Project change summary"),description:s("settings.dataHistory.projectChanges.description","Saved summaries of project changes."),metric:G(s,Y(s,c.projectChanges,"settings.dataHistory.metric.records","records"),r.projectChanges),metricTooltip:s("settings.dataHistory.projectChanges.metric.tooltip","Number of saved project change summaries and the disk space they use."),route:"/changelog",clearEndpoint:"/api/dashboard/changelog/clear"},{key:"connectionLog",title:s("settings.dataHistory.connectionLog.title","Connection log"),description:s("settings.dataHistory.connectionLog.description","Saved MCP and Studio connection events."),metric:G(s,Y(s,c.connectionLog,"settings.dataHistory.metric.records","records"),r.connectionLog),metricTooltip:s("settings.dataHistory.connectionLog.metric.tooltip","Number of saved connection events and the disk space they use."),route:"/connection",clearEndpoint:"/api/dashboard/connection-log/clear"}],[c,r,s]),d=async()=>{if(y){C(!0),I(null);try{if(y.kind==="uiStudio"){if(t!=="pro"||h===null)throw new Error("UI Studio place is unavailable");await V(h,{all:!0,alsoSnapshots:!0}),I(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else await $.post(y.row.clearEndpoint),I(s("settings.dataHistory.clear.success","Saved data cleared."));_(null),await E()}catch{I(y.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{C(!1)}}},p=t==="pro"?h:0,v=t==="pro"&&h!==null,H=(y==null?void 0:y.kind)==="uiStudio",N=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(f,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:a.cardHeaderActions,children:[e.jsx(u,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:a.headerBadge,children:L?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(u,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:a.collapseButton,type:"button","aria-expanded":b,"aria-controls":"settings-data-history-body","aria-label":b?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",N):s("settings.dataHistory.expand","Expand {title}").replace("{title}",N),onClick:()=>k(x=>!x),children:b?"▾":"▸"})})]})]}),b&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:a.dataHistoryIntro,children:s("settings.dataHistory.intro","Review saved dashboard data, open the related page, or clear stored records from one place.")}),e.jsxs("div",{className:a.dataHistoryList,children:[A.map(x=>e.jsxs("div",{className:a.dataHistoryRow,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:x.title}),e.jsx("div",{className:a.dataHistoryDescription,children:x.description})]}),e.jsx(u,{text:x.metricTooltip,children:e.jsx("div",{className:a.dataHistoryMetric,children:x.metric})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(u,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:`#${x.route}`,children:s("settings.dataHistory.open","Open")})}),e.jsx(u,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",onClick:()=>_({kind:"row",row:x}),children:s("common.clear","Clear")})})]})]},x.key)),e.jsxs("div",{className:`${a.dataHistoryRow} ${a.uiStudioDataHistoryRow}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:a.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(u,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:a.dataHistoryMetric,children:ms(s,i)})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(u,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(u,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",disabled:!v,onClick:()=>_({kind:"uiStudio"}),children:s("common.clear","Clear")})})]})]}),e.jsx("div",{className:`${a.dataHistoryDetail} ${a.uiStudioDataHistoryDetail}`,children:e.jsx(lt,{placeId:p,tier:t,onChanged:E,embedded:!0,...t==="basic"?{sampleUsage:te,sampleRetention:Se}:{}})})]}),w&&e.jsx("p",{className:a.inlineStatus,children:w})]})]}),e.jsx(fe,{open:y!==null,title:H?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:H?s("settings.dataHistory.uiStudio.clear.message","This deletes saved UI Studio change records and screenshots only. Roblox Studio instances and project objects are not changed."):s("settings.dataHistory.clear.message","This deletes saved dashboard records only. Roblox Studio instances and project objects are not changed."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:s("common.clear","Clear"),loading:R,onCancel:()=>!R&&_(null),onConfirm:()=>void d()})]})}const _s={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"},xs=["debug","info","warn","error"];function fs(t){return t==="active"?a.statusActive:t==="grace"?a.statusGrace:t==="invalid"||t==="revoked"?a.statusError:a.statusInactive}function js(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:a.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:a.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:a.licenseNoticeMuted}}function ae({checked:t,onChange:s,testId:c,ariaLabel:S}){return e.jsxs("label",{className:a.toggleSwitch,"data-testid":c,children:[e.jsx("input",{type:"checkbox",className:a.toggleInput,checked:t,"aria-label":S,onChange:r=>s(r.target.checked)}),e.jsx("span",{className:a.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:a.toggleThumb})})]})}function ks(){const{t,selectedLocale:s,setLocale:c}=Q(),{trackEvent:S}=ie(),{search:r}=ye(),{settings:j,license:i,licenseControlsDisabled:m,licenseSubmitting:h,licenseMessage:B,activateLicense:L,refreshLicense:D,resetLicense:b,updateHotSetting:k,loading:y}=Ne(),[_,R]=l.useState(null),[C,w]=l.useState(""),I=i?js(i,t):null,E=(i==null?void 0:i.tier)==="pro",A=(i==null?void 0:i.tier)==="pro"?i.maskedKey:void 0,d=i!=null&&i.provider&&i.provider!=="auto"?i.provider:void 0,p=(i==null?void 0:i.tier)==="pro"?"pro":"basic",v=l.useRef(null),H=l.useRef(null),N=l.useMemo(()=>new URLSearchParams(r).get("section")==="license",[r]),x=l.useCallback(async(n,P)=>{await k(n,P),R(n),setTimeout(()=>R(M=>M===n?null:M),2e3)},[k]);return l.useEffect(()=>{var P;if(!N||y)return;const n=v.current;if((P=n==null?void 0:n.scrollIntoView)==null||P.call(n,{block:"start",behavior:"smooth"}),H.current&&!H.current.disabled){H.current.focus();return}n==null||n.focus()},[y,m,h,N]),y?e.jsx("div",{className:a.page,children:e.jsx("div",{className:a.loading,children:t("common.loading")})}):e.jsxs("div",{className:a.page,children:[e.jsx(xe,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, live settings, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:p}}),e.jsxs("div",{id:"settings-license",ref:v,tabIndex:-1,"data-testid":"settings-license-card",className:[a.card,N?a.licenseCardTarget:"",(i==null?void 0:i.tier)==="pro"?a.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(f,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(u,{text:m?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${a.headerBadge} ${m?"":a.headerBadgeLive}`,children:m?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[i?e.jsxs(e.Fragment,{children:[(()=>{const n=I;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.licenseGrid,children:[e.jsx("dt",{children:e.jsx(f,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${a.statusDot} ${fs(i.status)}`}),e.jsx(u,{text:(n==null?void 0:n.tooltip)??t(`settings.license.${i.status}.tooltip`,"Current license activation state."),children:(n==null?void 0:n.label)??t(`settings.license.${i.status}`,i.status)})]}),e.jsx("dt",{children:e.jsx(f,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:i.tier==="pro"?a.proBadge:"",children:e.jsx(u,{text:t(`tier.${i.tier}.tooltip`,"Available feature set for the connected license."),children:i.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),A&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(f,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(u,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:A})})]}),d&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(f,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(u,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:d})})]})]}),(n==null?void 0:n.detail)&&e.jsx("p",{className:`${a.licenseNotice} ${n.detailTone}`,children:i.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):n.detail}),i.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${a.licenseNotice} ${a.licenseNoticeMuted}`,children:n==null?void 0:n.detail})]})})(),i.tier==="basic"&&e.jsx(u,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:a.upgradeLink,href:me.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>S("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:a.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:a.licenseControls,children:[e.jsxs("div",{className:a.licenseControlRow,children:[e.jsx(u,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:m||h||!E,onClick:()=>{D()},children:h?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(u,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:m||h||!E,onClick:()=>{b()},children:h?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:a.licenseControlRow,children:[e.jsxs("label",{className:`${a.licenseField} ${a.licenseFieldGrow}`,children:[e.jsx("span",{className:a.controlLabel,children:e.jsx(f,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:H,"aria-label":t("settings.license.keyInput","License Key"),className:a.textInput,type:"text",value:C,disabled:m||h,onChange:n=>w(n.target.value)})]}),e.jsx(u,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:m||h,onClick:()=>{(async()=>await L(C)&&w(""))()},children:h?t("common.loading"):t("settings.license.activate","Activate License")})})]}),B&&e.jsx("p",{className:a.licenseMessage,children:B})]})]})]}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(f,{label:t("settings.general.title","General Settings"),tooltip:t("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(u,{text:t("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${a.headerBadge} ${a.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),j?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.logLevel","Log Level"),tooltip:t("settings.general.logLevel.tooltip","Sets how much detail WEPPY Dashboard writes to its logs.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("select",{className:a.select,value:j.hot.LOG_LEVEL,onChange:n=>x("LOG_LEVEL",n.target.value),children:xs.map(n=>e.jsx("option",{value:n,children:n},n))}),_==="LOG_LEVEL"&&e.jsx("span",{className:a.savedIndicator,children:t("settings.general.applied")})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.localHistory","Tool History Recording"),tooltip:t("settings.general.localHistory.tooltip","Stores local tool execution history for the WEPPY Dashboard history views.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("span",{className:`${a.savedIndicator} ${_==="ENABLE_LOCAL_HISTORY"?"":a.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(ae,{checked:j.hot.ENABLE_LOCAL_HISTORY,ariaLabel:t("settings.general.localHistory","Tool History Recording"),testId:"settings-toggle-enable-local-history",onChange:n=>x("ENABLE_LOCAL_HISTORY",n)})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.localStatistics","Tool Statistics Collection"),tooltip:t("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WEPPY Dashboard reporting.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("span",{className:`${a.savedIndicator} ${_==="ENABLE_LOCAL_STATISTICS"?"":a.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(ae,{checked:j.hot.ENABLE_LOCAL_STATISTICS,ariaLabel:t("settings.general.localStatistics","Tool Statistics Collection"),testId:"settings-toggle-enable-local-statistics",onChange:n=>x("ENABLE_LOCAL_STATISTICS",n)})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.contextCapture","Context Capture"),tooltip:t("settings.general.contextCapture.tooltip","When enabled, WEPPY Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("span",{className:`${a.savedIndicator} ${_==="ENABLE_CONTEXT_CAPTURE"?"":a.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(ae,{checked:j.hot.ENABLE_CONTEXT_CAPTURE,ariaLabel:t("settings.general.contextCapture","Context Capture"),testId:"settings-toggle-enable-context-capture",onChange:n=>x("ENABLE_CONTEXT_CAPTURE",n)})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(f,{label:t("settings.general.requestTimeout","Action Timeout"),tooltip:t("settings.general.requestTimeout.tooltip","Maximum time WEPPY Dashboard waits for an action before it fails.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("input",{type:"number",className:a.numberInput,value:j.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:n=>{const P=parseInt(n.target.value,10);isNaN(P)||x("REQUEST_TIMEOUT",P)}}),e.jsx(u,{text:t("settings.general.requestTimeout.unit.tooltip","Action timeout is measured in milliseconds."),children:e.jsx("span",{className:a.unit,children:t("settings.general.requestTimeout.unit","ms")})}),_==="REQUEST_TIMEOUT"&&e.jsx("span",{className:a.savedIndicator,children:t("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:a.loading,children:t("settings.unavailable")})]}),e.jsx(vs,{tier:p}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(f,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(u,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:a.headerBadge,children:t("settings.readOnly","Read-only")})})]}),j?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.coldGrid,children:[e.jsx("dt",{children:e.jsx(f,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:j.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(f,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:j.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(f,{label:"DASHBOARD_AUTO_OPEN",tooltip:t("settings.cold.dashboardAutoOpen.tooltip","Controls whether WEPPY Dashboard opens automatically in the browser when the server starts.")})}),e.jsx("dd",{children:e.jsx(u,{text:t("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WEPPY Dashboard in a browser."),children:String(j.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:a.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:a.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:a.card,children:[e.jsx("div",{className:a.cardHeader,children:e.jsx(f,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WEPPY Dashboard interface text is localized.")})}),e.jsxs("div",{className:a.langRow,children:[e.jsx("label",{children:e.jsx(f,{label:t("settings.language.dashboard","WEPPY Dashboard Language"),tooltip:t("settings.language.dashboard.tooltip","Overrides the WEPPY Dashboard language or follows the system language when set to Auto.")})}),e.jsx(u,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:a.select,value:s,onChange:n=>c(n.target.value),children:[e.jsx("option",{value:ve,children:t("settings.language.auto","Auto")}),_e.map(n=>e.jsx("option",{value:n,children:_s[n]??n},n))]})})]})]})]})}export{ks as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o,j as s}from"./index-
|
|
1
|
+
import{u as o,j as s}from"./index-DG2RrKOl.js";const e="_badge_1ucqq_2",c="_dot_1ucqq_12",a="_online_1ucqq_20",l="_offline_1ucqq_25",_="_idle_1ucqq_30",u="_syncing_1ucqq_34",d="_initializing_1ucqq_35",n={badge:e,dot:c,online:a,offline:l,idle:_,syncing:u,initializing:d},g={online:"status.online",offline:"status.offline",idle:"status.idle",syncing:"status.syncing",initializing:"status.initializing"};function f({status:i}){const{t}=o();return s.jsxs("span",{className:n.badge,children:[s.jsx("span",{className:`${n.dot} ${n[i]}`}),t(g[i])]})}export{f as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as c,a as I,D as R,i as S,l as k,o as $,j as t,u as E,d as A,m as D,n as O,p as B,T as H}from"./index-
|
|
1
|
+
import{r as c,a as I,D as R,i as S,l as k,o as $,j as t,u as E,d as A,m as D,n as O,p as B,T as H}from"./index-DG2RrKOl.js";import{P as M}from"./PageHeader-CThGgsAt.js";import{I as _}from"./InfoLabel-Cyz7d4Kc.js";import{T as b}from"./TooltipText-H3YSCbob.js";import{C as F}from"./ConfirmModal-CpImpY9c.js";import{S as U}from"./StatusBadge-CkLieULy.js";const W=5e3;function q(){const[e,i]=c.useState(null),[u,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,P]=await Promise.all([I.get("/sync/status"),I.get("/api/dashboard/place-summary")]);i(T);const a=(r=P.places)==null?void 0:r.find(j=>j.isActive);w((a==null?void 0:a.placeDirName)??null)}catch{}},[]),f=c.useCallback(async()=>{try{const r=await I.get("/sync/history",{limit:"30"});d(r.entries??[])}catch{d([])}},[]),x=c.useCallback(async()=>{await Promise.all([l(),f()]),o(!1)},[l,f]),N=c.useCallback(()=>{x()},[x]),n=c.useCallback(async()=>{await I.post("/api/dashboard/sync/history/clear"),d([]),l()},[l]);return c.useEffect(()=>(x(),g.current=setInterval(x,W),()=>{g.current&&clearInterval(g.current)}),[x]),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:e,history:u,loading:p,activePlaceDirName:y,refresh:N,clearHistory:n}}const G="_actions_1j3p3_60",z="_btn_1j3p3_68",V="_btnPrimary_1j3p3_99",Y="_panel_1j3p3_109",J="_panelIcon_1j3p3_116",Q="_panelTitle_1j3p3_122",X="_panelDesc_1j3p3_131",Z="_benefitList_1j3p3_139",K="_benefitItem_1j3p3_148",h={actions:G,btn:z,btnPrimary:V,panel:Y,panelIcon:J,panelTitle:Q,panelDesc:X,benefitList:Z,benefitItem:K};function ee({icon:e,title:i,description:u,benefits:d,upgradeLabel:p,upgradeHref:o}){const{trackEvent:y}=S(),{pathname:w,search:m}=k(),g=$(w,m);return t.jsxs("div",{className:h.panel,children:[e&&t.jsx("div",{className:h.panelIcon,children:e}),t.jsx("div",{className:h.panelTitle,children:i}),t.jsx("div",{className:h.panelDesc,children:u}),t.jsx("ul",{className:h.benefitList,children:d.map(l=>t.jsx("li",{className:h.benefitItem,children:l},l))}),t.jsx("div",{className:h.actions,children:t.jsx("a",{className:`${h.btn} ${h.btnPrimary}`,href:o,target:"_blank",rel:"noreferrer",onClick:()=>y("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...g}),children:p})})]})}const te="_page_siyu4_2",se="_card_siyu4_10",ne="_cardHeader_siyu4_17",ie="_clearButton_siyu4_29",ae="_statusRow_siyu4_39",ce="_metaItem_siyu4_46",oe="_statusGrid_siyu4_52",le="_table_siyu4_71",re="_directionRail_siyu4_99",de="_endpointLabel_siyu4_105",pe="_optionRail_siyu4_109",ye="_directionOption_siyu4_115",ue="_directionOptionActive_siyu4_129",_e="_directionOptionInactive_siyu4_133",he="_direction_forward_siyu4_139",me="_direction_bidirectional_siyu4_143",ge="_direction_reverse_siyu4_147",fe="_lockBadge_siyu4_152",xe="_proBadge_siyu4_160",be="_forwardBadge_siyu4_174",je="_logContainer_siyu4_187",ve="_logEntry_siyu4_194",we="_logTime_siyu4_206",Te="_logType_siyu4_212",Ne="_logTypeWrite_siyu4_221",Ie="_logTypeUpdate_siyu4_225",Pe="_logTypeDelete_siyu4_229",Ce="_logTypeIdle_siyu4_233",Le="_logPath_siyu4_237",Se="_logEmpty_siyu4_244",Re="_overlay_siyu4_251",ke="_overlayTitle_siyu4_261",$e="_overlayMessage_siyu4_268",Ee="_checklist_siyu4_274",Ae="_checkItem_siyu4_284",De="_upgradePanel_siyu4_300",Oe="_upgradePanelHeader_siyu4_307",Be="_benefitList_siyu4_315",He="_benefitItem_siyu4_324",Me="_upgradeActions_siyu4_339",Fe="_btn_siyu4_344",Ue="_btnPrimary_siyu4_361",We="_disabled_siyu4_372",s={page:te,card:se,cardHeader:ne,clearButton:ie,statusRow:ae,metaItem:ce,statusGrid:oe,table:le,directionRail:re,endpointLabel:de,optionRail:pe,directionOption:ye,directionOptionActive:ue,directionOptionInactive:_e,direction_forward:he,direction_bidirectional:me,direction_reverse:ge,lockBadge:fe,proBadge:xe,forwardBadge:be,logContainer:je,logEntry:ve,logTime:we,logType:Te,logTypeWrite:Ne,logTypeUpdate:Ie,logTypeDelete:Pe,logTypeIdle:Ce,logPath:Le,logEmpty:Se,overlay:Re,overlayTitle:ke,overlayMessage:$e,checklist:Ee,checkItem:Ae,upgradePanel:De,upgradePanelHeader:Oe,benefitList:Be,benefitItem:He,upgradeActions:Me,btn:Fe,btnPrimary:Ue,disabled:We},qe=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function Ge(e){const i=new Date(e);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function ze(e){switch(e){case"write":return s.logTypeWrite;case"update":return s.logTypeUpdate;case"delete":return s.logTypeDelete;default:return s.logTypeIdle}}function Ve(e){switch(e){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function Ye(e,i,u,d){const p=e(`sync.directions.cat.${i}`,i.charAt(0).toUpperCase()+i.slice(1)),o=e("sync.directions.endpoint.local","Local"),y=e("sync.directions.endpoint.studio","Studio");switch(u){case"forward":return[`${p}: ${o} <- ${y}`,e("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
|
|
2
2
|
`);case"bidirectional":return[`${p}: ${o} <-> ${y}`,e("sync.directions.tooltip.bidirectional.body","Two-way sync between Local and Studio"),d?e("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
3
3
|
`);case"reverse":return[`${p}: ${o} -> ${y}`,e("sync.directions.tooltip.reverse.body","Push local file changes to Studio"),d?e("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
4
4
|
`);default:return p}}const Je=["scripts","values","containers","data","services"];function Qe(e,i){return i==="manual"?e("sync.directions.mode.manual","Manual"):i==="auto"?e("sync.directions.mode.auto","Auto"):"-"}function Xe(e,i){return i==="manual"?e("sync.directions.mode.manual.tooltip","Applies sync changes only when you trigger them manually."):i==="auto"?e("sync.directions.mode.auto.tooltip","Applies sync changes automatically when updates arrive."):""}function Ze(e,i){switch(i){case"write":return e("sync.log.type.write","WRITE");case"update":return e("sync.log.type.update","UPDATE");case"delete":return e("sync.log.type.delete","DELETE");default:return e("sync.log.type.idle","IDLE")}}function Ke(e,i){switch(i){case"write":return e("sync.log.type.write.tooltip","A new sync output was written to disk.");case"update":return e("sync.log.type.update.tooltip","An existing synced file or instance was updated.");case"delete":return e("sync.log.type.delete.tooltip","A synced file or instance was removed.");default:return e("sync.log.type.idle.tooltip","A sync event was recorded without a file mutation.")}}function ct(){const{t:e}=E(),{trackEvent:i}=S(),{level:u}=A(),{tier:d,loading:p}=D(),o=q(),{show:y}=O(),[w,m]=c.useState(!1),[g,l]=c.useState(!1),f=!p&&d==="basic",x=u==="disconnected"||u==="serverOnly",N=t.jsx(M,{title:e("page.sync.title","Sync"),description:e("page.sync.description","Monitor Studio to local sync status, direction, apply mode, and recent sync logs."),helpTopicId:"sync",helpState:{connectionLevel:u,tier:d}});if(x)return t.jsxs("div",{className:s.page,children:[N,t.jsx("div",{className:s.card,children:t.jsxs("div",{className:s.overlay,children:[t.jsx("div",{className:s.overlayTitle,children:e("sync.overlay.title","Roblox Studio plugin required")}),t.jsx("div",{className:s.overlayMessage,children:e("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{className:s.checkItem,children:e("sync.overlay.check1","Is Roblox Studio running?")}),t.jsx("li",{className:s.checkItem,children:e("sync.overlay.check2","Is the WEPPY Plugin installed?")})]})]})})]});const n=o.status,r=o.history,T=Ve(n==null?void 0:n.state),P=async()=>{l(!0);try{await o.clearHistory(),y(e("toast.clearSuccess","Cleared successfully"),"success"),m(!1)}catch{y(e("toast.clearFailed","Failed to clear data"),"error")}finally{l(!1)}};return t.jsxs("div",{className:s.page,children:[N,t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx(b,{text:e("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:e("sync.status.title","Sync Status")}),f&&t.jsx(b,{text:e("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:t.jsx("span",{className:s.forwardBadge,children:e("sync.status.forwardOnly","Forward Only")})})]}),t.jsxs("div",{className:s.statusRow,children:[t.jsx(U,{status:T}),(n==null?void 0:n.placeName)&&t.jsxs("span",{className:s.metaItem,children:[t.jsx(_,{label:e("sync.status.place","Place"),tooltip:e("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",n.placeName,n.placeId?` (${n.placeId})`:""]})]}),t.jsxs("dl",{className:s.statusGrid,children:[(n==null?void 0:n.syncRoot)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.path","Path"),tooltip:e("sync.status.path.tooltip","Local filesystem root currently used for sync output.")})}),t.jsx("dd",{children:n.syncRoot})]}),o.activePlaceDirName&&(n==null?void 0:n.syncRoot)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.placePath","Place Path"),tooltip:e("sync.status.placePath.tooltip","Active place directory where explorer files are synced.")})}),t.jsx("dd",{children:`${n.syncRoot}/${o.activePlaceDirName}/explorer`})]}),(n==null?void 0:n.instanceCount)!=null&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.instances","Instances"),tooltip:e("sync.status.instances.tooltip","Total synced Roblox instances tracked in the local mirror.")})}),t.jsx("dd",{children:n.instanceCount})]}),(n==null?void 0:n.scriptCount)!=null&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.scripts","Scripts"),tooltip:e("sync.status.scripts.tooltip","Total synced script files currently indexed for this place.")})}),t.jsx("dd",{children:n.scriptCount})]}),(n==null?void 0:n.state)==="syncing"&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.state","State"),tooltip:e("sync.status.state.tooltip","Current runtime sync state reported by the server.")})}),t.jsx("dd",{children:e("status.syncing","Syncing")})]})]})]}),(n==null?void 0:n.directions)&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:t.jsx(b,{text:e("sync.directions.title.tooltip","Per-category sync direction and apply behavior between Local and Studio."),children:e("sync.directions.title","Sync Directions")})}),t.jsxs("table",{className:s.table,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:t.jsx(_,{label:e("sync.directions.type","Type"),tooltip:e("sync.directions.type.tooltip","Sync category affected by this rule.")})}),t.jsx("th",{children:t.jsx(_,{label:e("sync.directions.direction","Direction"),tooltip:e("sync.directions.direction.tooltip","Whether each category syncs from Studio, to Studio, or both ways.")})}),t.jsx("th",{children:t.jsx(_,{label:e("sync.directions.applyMode","Apply Mode"),tooltip:e("sync.directions.applyMode.tooltip","How incoming sync changes are applied for this category.")})})]})}),t.jsx("tbody",{children:Je.map(a=>{var L;const j=n.directions[a],C=(L=n.applyModes)==null?void 0:L[a];return t.jsxs("tr",{children:[t.jsx("td",{children:e(`sync.directions.cat.${a}`,a.charAt(0).toUpperCase()+a.slice(1))}),t.jsx("td",{children:t.jsxs("div",{className:s.directionRail,"aria-label":`${a}-direction-rail`,children:[t.jsx(b,{text:e("sync.directions.endpoint.local.tooltip","Local files on disk are always shown on the left side of the direction rail."),children:t.jsx("span",{className:s.endpointLabel,children:e("sync.directions.endpoint.local","Local")})}),t.jsx("span",{className:s.optionRail,children:qe.map(v=>t.jsx(B,{text:Ye(e,a,v.key,f),children:t.jsx("span",{className:`${s.directionOption} ${j===v.key?s.directionOptionActive:s.directionOptionInactive} ${s[`direction_${v.key}`]??""}`,"data-active":j===v.key?"true":"false",children:v.symbol})},v.key))}),t.jsx(b,{text:e("sync.directions.endpoint.studio.tooltip","Roblox Studio is always shown on the right side of the direction rail."),children:t.jsx("span",{className:s.endpointLabel,children:e("sync.directions.endpoint.studio","Studio")})})]})}),t.jsx("td",{children:t.jsx(b,{text:Xe(e,C),children:Qe(e,C)})})]},a)})})]})]}),t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx("span",{children:e("sync.log.title","Sync Log")}),t.jsx("button",{className:s.clearButton,onClick:()=>{i("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),m(!0)},children:e("common.clear","Clear")})]}),t.jsx("div",{className:s.logContainer,children:r.length===0?t.jsx("div",{className:s.logEmpty,children:e("sync.log.empty","No sync events yet")}):r.map((a,j)=>t.jsxs("div",{className:s.logEntry,children:[t.jsx("span",{className:s.logTime,children:Ge(a.timestamp)}),t.jsx(b,{text:Ke(e,a.type),children:t.jsx("span",{className:`${s.logType} ${ze(a.type)}`,children:Ze(e,a.type)})}),t.jsxs("span",{className:s.logPath,children:[a.path,a.details?` — ${a.details}`:""]})]},j))})]}),f&&t.jsx(ee,{title:e("sync.upgrade.title","Explore Full Sync with Pro"),description:e("tier.banner.save","Save AI tokens with Pro!"),benefits:[e("sync.upgrade.benefit1","Bidirectional sync — edit files, auto-apply to Studio"),e("sync.upgrade.benefit2","Reverse sync — push file changes back to Studio"),e("sync.upgrade.benefit3","Full sync history and detailed change log")],upgradeLabel:e("sync.upgrade.buy","View Pro"),upgradeHref:H.sync}),t.jsx(F,{open:w,title:e("sync.clear.title","Clear sync log?"),message:e("sync.clear.message","This permanently removes the stored sync log for the current place."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:g,onCancel:()=>!g&&m(!1),onConfirm:P})]})}export{ct as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-DG2RrKOl.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 at,u as lt,i as rt,n as it}from"./index-1ZlHj3-1.js";import{P as nt}from"./PageHeader-ueZvp6K9.js";import{T as M}from"./TooltipText-DazmfUnr.js";import{C as ct}from"./ConfirmModal-DSKr5eS9.js";import{T as dt}from"./Tabs-BgJY0tsU.js";const ut="_wrapper_hzgda_2",pt="_table_hzgda_7",xt="_sortable_hzgda_32",ht="_sortArrow_hzgda_41",mt="_clickable_hzgda_52",bt="_empty_hzgda_57",_t="_expandedRow_hzgda_65",ft="_expandedCell_hzgda_74",T={wrapper:ut,table:pt,sortable:xt,sortArrow:ht,clickable:mt,empty:bt,expandedRow:_t,expandedCell:ft};function gt({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 Ct(s){return{...s,sequenceNumber:typeof s.sequenceNumber=="number"?s.sequenceNumber:void 0,executionTimeMs:typeof s.executionTimeMs=="number"?s.executionTimeMs:void 0}}const yt=50;function jt(){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,R]=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(yt),offset:String(d)};N&&(O.tool=N);const A=await D.get("/api/dashboard/history",O);y(A.entries.map(Ct)),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 at;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:R,setHistoryToolFilter:g,refresh:q,clearHistory:z,clearStatistics:F}}const vt="_page_16x6v_2",kt="_card_16x6v_12",Tt="_cardToolbar_16x6v_19",wt="_sectionTitle_16x6v_27",Nt="_dangerButton_16x6v_33",St="_proBadge_16x6v_52",Mt="_statusOk_16x6v_67",Bt="_statusFallback_16x6v_76",Et="_statusUnsupported_16x6v_85",Lt="_statusWarning_16x6v_94",At="_statusError_16x6v_103",Pt="_tierBasic_16x6v_113",Rt="_tierPro_16x6v_117",Ht="_tierMixed_16x6v_122",Ft="_filterRow_16x6v_133",Ot="_filterLabel_16x6v_140",It="_filterSelect_16x6v_149",$t="_expandedRow_16x6v_160",Dt="_expandedSection_16x6v_165",Wt="_detailList_16x6v_175",qt="_detailItem_16x6v_181",zt="_detailLabel_16x6v_187",Ut="_detailValue_16x6v_192",Vt="_pre_16x6v_197",Kt="_pagination_16x6v_214",Gt="_pageInfo_16x6v_222",Jt="_btn_16x6v_228",Zt="_tierDistribution_16x6v_251",Qt="_tierBarWrap_16x6v_255",Xt="_tierBarBasic_16x6v_263",Yt="_tierBarPro_16x6v_268",ts="_tierLabels_16x6v_273",ss="_statsTableWrap_16x6v_282",es="_statsTable_16x6v_282",os="_sortableHeader_16x6v_313",as="_sortArrow_16x6v_318",ls="_statsToolRow_16x6v_322",rs="_statsActionRow_16x6v_330",is="_expandButton_16x6v_334",ns="_expandIcon_16x6v_346",cs="_actionLabel_16x6v_351",ds="_emptyStats_16x6v_358",us="_summaryLine_16x6v_364",o={page:vt,card:kt,cardToolbar:Tt,sectionTitle:wt,dangerButton:Nt,proBadge:St,statusOk:Mt,statusFallback:Bt,statusUnsupported:Et,statusWarning:Lt,statusError:At,tierBasic:Pt,tierPro:Rt,tierMixed:Ht,filterRow:Ft,filterLabel:Ot,filterSelect:It,expandedRow:$t,expandedSection:Dt,detailList:Wt,detailItem:qt,detailLabel:zt,detailValue:Ut,pre:Vt,pagination:Kt,pageInfo:Gt,btn:Jt,tierDistribution:Zt,tierBarWrap:Qt,tierBarBasic:Xt,tierBarPro:Yt,tierLabels:ts,statsTableWrap:ss,statsTable:es,sortableHeader:os,sortArrow:as,statsToolRow:ls,statsActionRow:rs,expandButton:is,expandIcon:ns,actionLabel:cs,emptyStats:ds,summaryLine:us},U=50;function ps(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 P(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 xs(s,l){const _=Z(s,l);return _?`${s}.${_}`:s}function J(s){return typeof s=="string"&&s.length>0?s:void 0}function hs(s){if(!Array.isArray(s))return;const l=s.filter(_=>typeof _=="string"&&_.length>0);return l.length>0?l:void 0}function ms(s){const l=s.result??{};return{requestedCommand:s.requestedCommand??J(l.requestedCommand),executedCommand:s.executedCommand??J(l.executedCommand),alternatives:s.alternatives??hs(l.alternatives)}}function bs(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:o.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:o.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:o.statusWarning};case"error":return{label:l("tools.badge.err","FAILED"),tooltip:l("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:l("tools.status.ok","OK"),tooltip:l("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function j(s,l){return e.jsxs("div",{className:o.detailItem,children:[e.jsx("span",{className:o.detailLabel,children:s}),e.jsx("span",{className:o.detailValue,children:l})]})}function vs(){const{t:s}=lt(),{trackEvent:l,trackPageView:_}=rt(),r=jt(),{show:v}=it(),[y,B]=n.useState("history"),[E,L]=n.useState(null),[w,u]=n.useState(null),[f,x]=n.useState(null),[R,h]=n.useState(!1),[g,H]=n.useState("totalCalls"),[m,C]=n.useState("desc"),q=n.useCallback(t=>{H(a=>a===t?(C(i=>i==="asc"?"desc":"asc"),t):(C("desc"),t))},[]),z=n.useMemo(()=>{var a;const t=new Set;return Object.keys(((a=r.statistics)==null?void 0:a.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(a=>{var G;const i=Object.entries(a.commands??{}).map(([p,c])=>({toolName:a.tool,commandName:c.command??p,label:Z(a.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),ot=new Set(i.map(p=>p.tier)).size>1?"mixed":((G=i[0])==null?void 0:G.tier)??a.tier;return{toolName:a.tool,tier:ot,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,a,i,b)=>e.jsx(M,{text:s(i,b),children:s(t,a)}),[s]),N=n.useMemo(()=>[...F].sort((a,i)=>{const b=a[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=>ps(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:[xs(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:o.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 a=bs(t,s);return e.jsx(M,{text:a.tooltip,children:e.jsx("span",{className:a.className,children:a.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"?o.tierPro:o.tierBasic,children:P(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"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:P(s,t.tier)})})}],[s,d]),S=n.useMemo(()=>{if(!r.statistics)return null;const t=r.statistics.tierSummary.basic.totalCalls,a=r.statistics.tierSummary.pro.totalCalls,i=t+a;if(i===0)return null;const b=Math.round(t/i*100),k=100-b;return{basic:t,pro:a,basicPct:b,proPct:k}},[r.statistics]),V=n.useCallback(t=>{u(a=>a===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 a=t==="history"?"tools_history":"tools_statistics";l("dashboard_click_event",{click_target:t==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:a}),_({page:"tools",tab:a}),B(t)},[l,_]),Y=n.useCallback(t=>{const a=ms(t);return e.jsxs("div",{className:o.expandedRow,children:[e.jsxs("div",{className:o.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:o.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&e.jsxs("div",{className:o.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:o.pre,children:JSON.stringify(t.result,null,2)})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="warning"||t.status==="error")&&e.jsx("div",{className:o.expandedSection,children:e.jsxs("div",{className:o.detailList,children:[t.status==="fallback"&&(a==null?void 0:a.requestedCommand)&&j(s("tools.detail.requestedCommand","Requested Command"),a.requestedCommand),t.status==="fallback"&&(a==null?void 0:a.executedCommand)&&j(s("tools.detail.executedCommand","Executed Command"),a.executedCommand),t.status==="fallback"&&(a==null?void 0:a.alternatives)&&j(s("tools.detail.alternatives","Alternatives"),a.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:o.page,children:[e.jsx(nt,{title:s("page.tools.title","Tools"),description:s("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),e.jsx(dt,{items:tt,value:y,onChange:X}),y==="history"&&e.jsxs("div",{className:o.card,children:[e.jsxs("div",{className:o.cardToolbar,children:[e.jsx("div",{className:o.sectionTitle,children:s("tools.tab.history","History")}),e.jsx("button",{className:o.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:o.filterRow,children:e.jsxs("label",{className:o.filterLabel,children:[s("tools.filter.tool","Tool"),":",e.jsxs("select",{className:o.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(gt,{columns:O,data:r.history,rowKey:t=>t.id,onRowClick:t=>L(a=>a===t.id?null:t.id),emptyMessage:s("tools.empty.history","No history entries"),expandedKey:E,renderExpandedRow:Y}),e.jsxs("div",{className:o.pagination,children:[e.jsx("button",{className:o.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:o.pageInfo,children:[r.historyOffset+1,"–",Math.min(r.historyOffset+U,r.historyTotal)," / ",r.historyTotal]}),e.jsx("button",{className:o.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:o.card,children:[e.jsxs("div",{className:o.cardToolbar,children:[e.jsx("div",{className:o.sectionTitle,children:s("tools.tab.statistics","Statistics")}),e.jsx("button",{className:o.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:o.tierDistribution,children:[e.jsxs("div",{className:o.tierBarWrap,children:[e.jsx("div",{className:o.tierBarBasic,style:{width:`${S.basicPct}%`}}),e.jsx("div",{className:o.tierBarPro,style:{width:`${S.proPct}%`}})]}),e.jsxs("div",{className:o.tierLabels,children:[e.jsxs("span",{children:[P(s,"basic")," ",S.basicPct,"% (",S.basic,")"]}),e.jsxs("span",{children:[P(s,"pro")," ",S.proPct,"% (",S.pro,")"]})]})]}),e.jsx("div",{className:o.statsTableWrap,children:e.jsxs("table",{className:o.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?o.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:o.sortArrow,children:m==="asc"?"▴":"▾"})]},t.key))})}),e.jsx("tbody",{children:N.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:A.length,className:o.emptyStats,children:s("tools.empty.stats","No tool statistics")})}):N.map(t=>{const a=w===t.toolName;return e.jsxs(n.Fragment,{children:[e.jsxs("tr",{className:o.statsToolRow,onClick:()=>V(t.toolName),children:[e.jsx("td",{children:e.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":a,"aria-label":`${t.toolName} ${a?s("common.collapse","Collapse"):s("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),V(t.toolName)},children:[e.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:a?"▾":"▸"}),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"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:P(s,t.tier)})})})]}),a&&t.commands.map(i=>e.jsxs("tr",{className:o.statsActionRow,children:[e.jsx("td",{children:e.jsx("span",{className:o.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"?o.tierPro:o.tierBasic,children:P(s,i.tier)})})]},`${t.toolName}:${i.commandName}`))]},t.toolName)})})]})}),r.statistics&&e.jsxs("div",{className:o.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(ct,{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:R,onCancel:()=>!R&&x(null),onConfirm:Q})]})}export{vs as Component};
|
|
1
|
+
import{j as e,r as n,a as D,D as at,u as lt,i as rt,n as it}from"./index-DG2RrKOl.js";import{P as nt}from"./PageHeader-CThGgsAt.js";import{T as M}from"./TooltipText-H3YSCbob.js";import{C as ct}from"./ConfirmModal-CpImpY9c.js";import{T as dt}from"./Tabs-BhkhdCvF.js";const ut="_wrapper_hzgda_2",pt="_table_hzgda_7",xt="_sortable_hzgda_32",ht="_sortArrow_hzgda_41",mt="_clickable_hzgda_52",bt="_empty_hzgda_57",_t="_expandedRow_hzgda_65",ft="_expandedCell_hzgda_74",T={wrapper:ut,table:pt,sortable:xt,sortArrow:ht,clickable:mt,empty:bt,expandedRow:_t,expandedCell:ft};function gt({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 Ct(s){return{...s,sequenceNumber:typeof s.sequenceNumber=="number"?s.sequenceNumber:void 0,executionTimeMs:typeof s.executionTimeMs=="number"?s.executionTimeMs:void 0}}const yt=50;function jt(){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,R]=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(yt),offset:String(d)};N&&(O.tool=N);const A=await D.get("/api/dashboard/history",O);y(A.entries.map(Ct)),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 at;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:R,setHistoryToolFilter:g,refresh:q,clearHistory:z,clearStatistics:F}}const vt="_page_16x6v_2",kt="_card_16x6v_12",Tt="_cardToolbar_16x6v_19",wt="_sectionTitle_16x6v_27",Nt="_dangerButton_16x6v_33",St="_proBadge_16x6v_52",Mt="_statusOk_16x6v_67",Bt="_statusFallback_16x6v_76",Et="_statusUnsupported_16x6v_85",Lt="_statusWarning_16x6v_94",At="_statusError_16x6v_103",Pt="_tierBasic_16x6v_113",Rt="_tierPro_16x6v_117",Ht="_tierMixed_16x6v_122",Ft="_filterRow_16x6v_133",Ot="_filterLabel_16x6v_140",It="_filterSelect_16x6v_149",$t="_expandedRow_16x6v_160",Dt="_expandedSection_16x6v_165",Wt="_detailList_16x6v_175",qt="_detailItem_16x6v_181",zt="_detailLabel_16x6v_187",Ut="_detailValue_16x6v_192",Vt="_pre_16x6v_197",Kt="_pagination_16x6v_214",Gt="_pageInfo_16x6v_222",Jt="_btn_16x6v_228",Zt="_tierDistribution_16x6v_251",Qt="_tierBarWrap_16x6v_255",Xt="_tierBarBasic_16x6v_263",Yt="_tierBarPro_16x6v_268",ts="_tierLabels_16x6v_273",ss="_statsTableWrap_16x6v_282",es="_statsTable_16x6v_282",os="_sortableHeader_16x6v_313",as="_sortArrow_16x6v_318",ls="_statsToolRow_16x6v_322",rs="_statsActionRow_16x6v_330",is="_expandButton_16x6v_334",ns="_expandIcon_16x6v_346",cs="_actionLabel_16x6v_351",ds="_emptyStats_16x6v_358",us="_summaryLine_16x6v_364",o={page:vt,card:kt,cardToolbar:Tt,sectionTitle:wt,dangerButton:Nt,proBadge:St,statusOk:Mt,statusFallback:Bt,statusUnsupported:Et,statusWarning:Lt,statusError:At,tierBasic:Pt,tierPro:Rt,tierMixed:Ht,filterRow:Ft,filterLabel:Ot,filterSelect:It,expandedRow:$t,expandedSection:Dt,detailList:Wt,detailItem:qt,detailLabel:zt,detailValue:Ut,pre:Vt,pagination:Kt,pageInfo:Gt,btn:Jt,tierDistribution:Zt,tierBarWrap:Qt,tierBarBasic:Xt,tierBarPro:Yt,tierLabels:ts,statsTableWrap:ss,statsTable:es,sortableHeader:os,sortArrow:as,statsToolRow:ls,statsActionRow:rs,expandButton:is,expandIcon:ns,actionLabel:cs,emptyStats:ds,summaryLine:us},U=50;function ps(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 P(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 xs(s,l){const _=Z(s,l);return _?`${s}.${_}`:s}function J(s){return typeof s=="string"&&s.length>0?s:void 0}function hs(s){if(!Array.isArray(s))return;const l=s.filter(_=>typeof _=="string"&&_.length>0);return l.length>0?l:void 0}function ms(s){const l=s.result??{};return{requestedCommand:s.requestedCommand??J(l.requestedCommand),executedCommand:s.executedCommand??J(l.executedCommand),alternatives:s.alternatives??hs(l.alternatives)}}function bs(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:o.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:o.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:o.statusWarning};case"error":return{label:l("tools.badge.err","FAILED"),tooltip:l("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:l("tools.status.ok","OK"),tooltip:l("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function j(s,l){return e.jsxs("div",{className:o.detailItem,children:[e.jsx("span",{className:o.detailLabel,children:s}),e.jsx("span",{className:o.detailValue,children:l})]})}function vs(){const{t:s}=lt(),{trackEvent:l,trackPageView:_}=rt(),r=jt(),{show:v}=it(),[y,B]=n.useState("history"),[E,L]=n.useState(null),[w,u]=n.useState(null),[f,x]=n.useState(null),[R,h]=n.useState(!1),[g,H]=n.useState("totalCalls"),[m,C]=n.useState("desc"),q=n.useCallback(t=>{H(a=>a===t?(C(i=>i==="asc"?"desc":"asc"),t):(C("desc"),t))},[]),z=n.useMemo(()=>{var a;const t=new Set;return Object.keys(((a=r.statistics)==null?void 0:a.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(a=>{var G;const i=Object.entries(a.commands??{}).map(([p,c])=>({toolName:a.tool,commandName:c.command??p,label:Z(a.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),ot=new Set(i.map(p=>p.tier)).size>1?"mixed":((G=i[0])==null?void 0:G.tier)??a.tier;return{toolName:a.tool,tier:ot,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,a,i,b)=>e.jsx(M,{text:s(i,b),children:s(t,a)}),[s]),N=n.useMemo(()=>[...F].sort((a,i)=>{const b=a[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=>ps(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:[xs(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:o.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 a=bs(t,s);return e.jsx(M,{text:a.tooltip,children:e.jsx("span",{className:a.className,children:a.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"?o.tierPro:o.tierBasic,children:P(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"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:P(s,t.tier)})})}],[s,d]),S=n.useMemo(()=>{if(!r.statistics)return null;const t=r.statistics.tierSummary.basic.totalCalls,a=r.statistics.tierSummary.pro.totalCalls,i=t+a;if(i===0)return null;const b=Math.round(t/i*100),k=100-b;return{basic:t,pro:a,basicPct:b,proPct:k}},[r.statistics]),V=n.useCallback(t=>{u(a=>a===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 a=t==="history"?"tools_history":"tools_statistics";l("dashboard_click_event",{click_target:t==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:a}),_({page:"tools",tab:a}),B(t)},[l,_]),Y=n.useCallback(t=>{const a=ms(t);return e.jsxs("div",{className:o.expandedRow,children:[e.jsxs("div",{className:o.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:o.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&e.jsxs("div",{className:o.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:o.pre,children:JSON.stringify(t.result,null,2)})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="warning"||t.status==="error")&&e.jsx("div",{className:o.expandedSection,children:e.jsxs("div",{className:o.detailList,children:[t.status==="fallback"&&(a==null?void 0:a.requestedCommand)&&j(s("tools.detail.requestedCommand","Requested Command"),a.requestedCommand),t.status==="fallback"&&(a==null?void 0:a.executedCommand)&&j(s("tools.detail.executedCommand","Executed Command"),a.executedCommand),t.status==="fallback"&&(a==null?void 0:a.alternatives)&&j(s("tools.detail.alternatives","Alternatives"),a.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:o.page,children:[e.jsx(nt,{title:s("page.tools.title","Tools"),description:s("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),e.jsx(dt,{items:tt,value:y,onChange:X}),y==="history"&&e.jsxs("div",{className:o.card,children:[e.jsxs("div",{className:o.cardToolbar,children:[e.jsx("div",{className:o.sectionTitle,children:s("tools.tab.history","History")}),e.jsx("button",{className:o.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:o.filterRow,children:e.jsxs("label",{className:o.filterLabel,children:[s("tools.filter.tool","Tool"),":",e.jsxs("select",{className:o.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(gt,{columns:O,data:r.history,rowKey:t=>t.id,onRowClick:t=>L(a=>a===t.id?null:t.id),emptyMessage:s("tools.empty.history","No history entries"),expandedKey:E,renderExpandedRow:Y}),e.jsxs("div",{className:o.pagination,children:[e.jsx("button",{className:o.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:o.pageInfo,children:[r.historyOffset+1,"–",Math.min(r.historyOffset+U,r.historyTotal)," / ",r.historyTotal]}),e.jsx("button",{className:o.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:o.card,children:[e.jsxs("div",{className:o.cardToolbar,children:[e.jsx("div",{className:o.sectionTitle,children:s("tools.tab.statistics","Statistics")}),e.jsx("button",{className:o.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:o.tierDistribution,children:[e.jsxs("div",{className:o.tierBarWrap,children:[e.jsx("div",{className:o.tierBarBasic,style:{width:`${S.basicPct}%`}}),e.jsx("div",{className:o.tierBarPro,style:{width:`${S.proPct}%`}})]}),e.jsxs("div",{className:o.tierLabels,children:[e.jsxs("span",{children:[P(s,"basic")," ",S.basicPct,"% (",S.basic,")"]}),e.jsxs("span",{children:[P(s,"pro")," ",S.proPct,"% (",S.pro,")"]})]})]}),e.jsx("div",{className:o.statsTableWrap,children:e.jsxs("table",{className:o.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?o.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:o.sortArrow,children:m==="asc"?"▴":"▾"})]},t.key))})}),e.jsx("tbody",{children:N.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:A.length,className:o.emptyStats,children:s("tools.empty.stats","No tool statistics")})}):N.map(t=>{const a=w===t.toolName;return e.jsxs(n.Fragment,{children:[e.jsxs("tr",{className:o.statsToolRow,onClick:()=>V(t.toolName),children:[e.jsx("td",{children:e.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":a,"aria-label":`${t.toolName} ${a?s("common.collapse","Collapse"):s("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),V(t.toolName)},children:[e.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:a?"▾":"▸"}),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"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:P(s,t.tier)})})})]}),a&&t.commands.map(i=>e.jsxs("tr",{className:o.statsActionRow,children:[e.jsx("td",{children:e.jsx("span",{className:o.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"?o.tierPro:o.tierBasic,children:P(s,i.tier)})})]},`${t.toolName}:${i.commandName}`))]},t.toolName)})})]})}),r.statistics&&e.jsxs("div",{className:o.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(ct,{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:R,onCancel:()=>!R&&x(null),onConfirm:Q})]})}export{vs as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p,p as r}from"./index-
|
|
1
|
+
import{j as p,p as r}from"./index-DG2RrKOl.js";function i({text:o,children:t}){return p.jsx(r,{text:o,children:t})}export{i as T};
|