@ttmg/cli 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/dist/index.js +280 -61
  3. package/dist/index.js.map +1 -1
  4. package/dist/package.json +1 -1
  5. package/dist/public/assets/{Card-DvUkoCA3.js → Card-BMss5cuV.js} +1 -1
  6. package/dist/public/assets/{Detail-Cbq9dDUe.js → Detail-Lyas-t6F.js} +1 -1
  7. package/dist/public/assets/Detail-Lyas-t6F.js.br +0 -0
  8. package/dist/public/assets/{MonetizationMode-0taoFj2g.js → MonetizationMode-DI4fy3U7.js} +1 -1
  9. package/dist/public/assets/{MonetizationModeSummary--L4WcmYS.js → MonetizationModeSummary-B6yEB26H.js} +1 -1
  10. package/dist/public/assets/{SectionHeader-DfBBWmpa.js → SectionHeader-3b39hv3n.js} +1 -1
  11. package/dist/public/assets/{Tag-DuP9fCS0.js → Tag-B5gYnANu.js} +1 -1
  12. package/dist/public/assets/{arrow-left-1V5G0Kw7.js → arrow-left-B3swWB64.js} +1 -1
  13. package/dist/public/assets/{baseForm-2J62W6xr.js → baseForm-Dsi8Ia0k.js} +1 -1
  14. package/dist/public/assets/baseForm-Dsi8Ia0k.js.br +0 -0
  15. package/dist/public/assets/{chevron-right-C5K8xBff.js → chevron-right-WZeuFw11.js} +1 -1
  16. package/dist/public/assets/{compass-DZKQ36UU.js → compass-CCsIev11.js} +1 -1
  17. package/dist/public/assets/{index-CZ7VVYfd.js → index-B3-gsm5-.js} +1 -1
  18. package/dist/public/assets/index-B3L1GnMP.js +1 -0
  19. package/dist/public/assets/index-B3L1GnMP.js.br +0 -0
  20. package/dist/public/assets/{index-BaZPp3HP.js → index-BJV8-tz8.js} +1 -1
  21. package/dist/public/assets/{index-cPr70sDS.js → index-BqSAtEgq.js} +1 -1
  22. package/dist/public/assets/{index-CmVUh50W.css → index-ByX5RuFA.css} +1 -1
  23. package/dist/public/assets/{index-WZnCtUAc.js → index-C2NWNiPX.js} +1 -1
  24. package/dist/public/assets/{index-BdDJLxXD.js → index-C9HXjiVu.js} +1 -1
  25. package/dist/public/assets/{index-DqoKSlOn.js → index-C9Un1hFP.js} +1 -1
  26. package/dist/public/assets/{index-Bmw61rl1.css → index-CFd8iglC.css} +1 -1
  27. package/dist/public/assets/index-CFd8iglC.css.br +0 -0
  28. package/dist/public/assets/{index-fS7DhM40.js → index-CV2u_S0E.js} +1 -1
  29. package/dist/public/assets/index-CV2u_S0E.js.br +0 -0
  30. package/dist/public/assets/index-Ci-lqt1V.js +1 -0
  31. package/dist/public/assets/index-Ci-lqt1V.js.br +0 -0
  32. package/dist/public/assets/{index-DYxQAjNc.js → index-Cigxnpav.js} +1 -1
  33. package/dist/public/assets/index-Cigxnpav.js.br +0 -0
  34. package/dist/public/assets/{index-BWWe1lsP.js → index-D0xEiy7C.js} +1 -1
  35. package/dist/public/assets/{index-DNktXE2W.js → index-D1oGAPRa.js} +1 -1
  36. package/dist/public/assets/{index-Br2fR8kJ.js → index-DeL2bgxo.js} +1 -1
  37. package/dist/public/assets/{index-B13yZ-GH.js → index-DjY3Igd6.js} +1 -1
  38. package/dist/public/assets/{index-CcxOfQrE.js → index-DpWpqPKC.js} +1 -1
  39. package/dist/public/assets/index-DpWpqPKC.js.br +0 -0
  40. package/dist/public/assets/{index-CnReCFYA.js → index-DxISN0Xc.js} +5 -5
  41. package/dist/public/assets/index-DxISN0Xc.js.br +0 -0
  42. package/dist/public/assets/{index-CgTtqphq.js → index-HYSh4-Ri.js} +1 -1
  43. package/dist/public/assets/{index-B-k2MmlV.js → index-JNUqDBWt.js} +1 -1
  44. package/dist/public/assets/{index-CwYCdibK.js → index-aqIfJUqW.js} +1 -1
  45. package/dist/public/assets/{index-BttcxiCg.js → index-uquhwGkB.js} +1 -1
  46. package/dist/public/assets/{sparkles-tr6K1Npg.js → sparkles-D2QPhLAu.js} +1 -1
  47. package/dist/public/assets/{zap-CuMRVa_B.js → zap-Cv4X8yRx.js} +1 -1
  48. package/dist/public/index.html +1 -1
  49. package/package.json +1 -1
  50. package/dist/public/assets/Detail-Cbq9dDUe.js.br +0 -0
  51. package/dist/public/assets/baseForm-2J62W6xr.js.br +0 -0
  52. package/dist/public/assets/index-Bmw61rl1.css.br +0 -0
  53. package/dist/public/assets/index-CcxOfQrE.js.br +0 -0
  54. package/dist/public/assets/index-CnReCFYA.js.br +0 -0
  55. package/dist/public/assets/index-DYxQAjNc.js.br +0 -0
  56. package/dist/public/assets/index-YkO-JjYA.js +0 -1
  57. package/dist/public/assets/index-fS7DhM40.js.br +0 -0
  58. package/dist/public/assets/index-qHht7NSU.js +0 -1
  59. package/dist/public/assets/index-qHht7NSU.js.br +0 -0
@@ -1 +1 @@
1
- import{u as t,j as e,B as b,T as s,i,b as d}from"./index-CnReCFYA.js";const u="https://bytedance.larkoffice.com/wiki/PeIawT4M4ia9R8kYyLMcjwHknOg",n=[{titleKey:"basicDebugGuide.available.scan.title",descKey:"basicDebugGuide.available.scan.desc"},{titleKey:"basicDebugGuide.available.launch.title",descKey:"basicDebugGuide.available.launch.desc"},{titleKey:"basicDebugGuide.available.preview.title",descKey:"basicDebugGuide.available.preview.desc"},{titleKey:"basicDebugGuide.available.network.title",descKey:"basicDebugGuide.available.network.desc"},{titleKey:"basicDebugGuide.available.manual.title",descKey:"basicDebugGuide.available.manual.desc"}],g=[{titleKey:"basicDebugGuide.locked.project.title",descKey:"basicDebugGuide.locked.project.desc"},{titleKey:"basicDebugGuide.locked.upload.title",descKey:"basicDebugGuide.locked.upload.desc"},{titleKey:"basicDebugGuide.locked.platform.title",descKey:"basicDebugGuide.locked.platform.desc"}],r=["basicDebugGuide.step1","basicDebugGuide.step2","basicDebugGuide.step3","basicDebugGuide.step4"],x=()=>{const l=t();return e.jsxs("div",{className:"basic-debug-guide-page",children:[e.jsx(b,{className:"basic-debug-guide-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"info",description:e.jsxs("div",{className:"basic-debug-guide-banner-copy",children:[e.jsx(s.Text,{strong:!0,children:i("basicDebugGuide.bannerTitle")}),e.jsx(s.Text,{children:i("basicDebugGuide.bannerDesc")})]})}),e.jsxs("section",{className:"basic-debug-guide-hero",children:[e.jsxs("div",{className:"basic-debug-guide-hero-copy",children:[e.jsx(s.Title,{heading:3,children:i("basicDebugGuide.title")}),e.jsx(s.Paragraph,{className:"basic-debug-guide-hero-desc",children:i("basicDebugGuide.desc")})]}),e.jsxs("div",{className:"basic-debug-guide-actions",children:[e.jsx(d,{theme:"solid",type:"primary",onClick:()=>l("/"),children:i("basicDebugGuide.actionScan")}),e.jsx(d,{theme:"light",onClick:()=>l("/network_diagnostics"),children:i("basicDebugGuide.actionNetwork")}),e.jsx(d,{theme:"borderless",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:i("basicDebugGuide.actionProxy")})]})]}),e.jsxs("section",{className:"basic-debug-guide-section",children:[e.jsxs("div",{className:"basic-debug-guide-section-head",children:[e.jsx(s.Text,{strong:!0,children:i("basicDebugGuide.availableTitle")}),e.jsx(s.Text,{className:"basic-debug-guide-section-desc",children:i("basicDebugGuide.availableDesc")})]}),e.jsx("div",{className:"basic-debug-guide-list",children:n.map((c,a)=>e.jsxs("div",{className:"basic-debug-guide-item",children:[e.jsx("span",{className:"basic-debug-guide-item-index",children:a+1}),e.jsxs("div",{className:"basic-debug-guide-item-copy",children:[e.jsx(s.Text,{strong:!0,children:i(c.titleKey)}),e.jsx(s.Text,{children:i(c.descKey)})]})]},c.titleKey))})]}),e.jsxs("section",{className:"basic-debug-guide-section",children:[e.jsxs("div",{className:"basic-debug-guide-section-head",children:[e.jsx(s.Text,{strong:!0,children:i("basicDebugGuide.lockedTitle")}),e.jsx(s.Text,{className:"basic-debug-guide-section-desc",children:i("basicDebugGuide.lockedDesc")})]}),e.jsx("div",{className:"basic-debug-guide-list",children:g.map((c,a)=>e.jsxs("div",{className:"basic-debug-guide-item basic-debug-guide-item-muted",children:[e.jsx("span",{className:"basic-debug-guide-item-index",children:a+1}),e.jsxs("div",{className:"basic-debug-guide-item-copy",children:[e.jsx(s.Text,{strong:!0,children:i(c.titleKey)}),e.jsx(s.Text,{children:i(c.descKey)})]})]},c.titleKey))})]}),e.jsxs("section",{className:"basic-debug-guide-section",children:[e.jsxs("div",{className:"basic-debug-guide-section-head",children:[e.jsx(s.Text,{strong:!0,children:i("basicDebugGuide.stepsTitle")}),e.jsx(s.Text,{className:"basic-debug-guide-section-desc",children:i("basicDebugGuide.stepsDesc")})]}),e.jsx("div",{className:"basic-debug-guide-steps",children:r.map((c,a)=>e.jsxs("div",{className:"basic-debug-guide-step",children:[e.jsx("span",{className:"basic-debug-guide-step-index",children:a+1}),e.jsx(s.Text,{children:i(c)})]},c))}),e.jsxs("div",{className:"basic-debug-guide-command-list",children:[e.jsxs("div",{className:"basic-debug-guide-command-item",children:[e.jsx(s.Text,{type:"tertiary",children:i("basicDebugGuide.commandProxy")}),e.jsx("code",{children:"ttmg config set proxy http://127.0.0.1:7890"}),e.jsx(s.Text,{type:"tertiary",children:i("basicDebugGuide.commandProxyHint")})]}),e.jsxs("div",{className:"basic-debug-guide-command-item",children:[e.jsx(s.Text,{type:"tertiary",children:i("basicDebugGuide.commandLogin")}),e.jsx("code",{children:"ttmg login"})]}),e.jsxs("div",{className:"basic-debug-guide-command-item",children:[e.jsx(s.Text,{type:"tertiary",children:i("basicDebugGuide.commandDev")}),e.jsx("code",{children:"ttmg dev"})]})]})]})]})};export{x as BasicDebugGuide};
1
+ import{u as t,j as e,B as b,T as s,i,b as d}from"./index-DxISN0Xc.js";const u="https://bytedance.larkoffice.com/wiki/PeIawT4M4ia9R8kYyLMcjwHknOg",n=[{titleKey:"basicDebugGuide.available.scan.title",descKey:"basicDebugGuide.available.scan.desc"},{titleKey:"basicDebugGuide.available.launch.title",descKey:"basicDebugGuide.available.launch.desc"},{titleKey:"basicDebugGuide.available.preview.title",descKey:"basicDebugGuide.available.preview.desc"},{titleKey:"basicDebugGuide.available.network.title",descKey:"basicDebugGuide.available.network.desc"},{titleKey:"basicDebugGuide.available.manual.title",descKey:"basicDebugGuide.available.manual.desc"}],g=[{titleKey:"basicDebugGuide.locked.project.title",descKey:"basicDebugGuide.locked.project.desc"},{titleKey:"basicDebugGuide.locked.upload.title",descKey:"basicDebugGuide.locked.upload.desc"},{titleKey:"basicDebugGuide.locked.platform.title",descKey:"basicDebugGuide.locked.platform.desc"}],r=["basicDebugGuide.step1","basicDebugGuide.step2","basicDebugGuide.step3","basicDebugGuide.step4"],x=()=>{const l=t();return e.jsxs("div",{className:"basic-debug-guide-page",children:[e.jsx(b,{className:"basic-debug-guide-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"info",description:e.jsxs("div",{className:"basic-debug-guide-banner-copy",children:[e.jsx(s.Text,{strong:!0,children:i("basicDebugGuide.bannerTitle")}),e.jsx(s.Text,{children:i("basicDebugGuide.bannerDesc")})]})}),e.jsxs("section",{className:"basic-debug-guide-hero",children:[e.jsxs("div",{className:"basic-debug-guide-hero-copy",children:[e.jsx(s.Title,{heading:3,children:i("basicDebugGuide.title")}),e.jsx(s.Paragraph,{className:"basic-debug-guide-hero-desc",children:i("basicDebugGuide.desc")})]}),e.jsxs("div",{className:"basic-debug-guide-actions",children:[e.jsx(d,{theme:"solid",type:"primary",onClick:()=>l("/"),children:i("basicDebugGuide.actionScan")}),e.jsx(d,{theme:"light",onClick:()=>l("/network_diagnostics"),children:i("basicDebugGuide.actionNetwork")}),e.jsx(d,{theme:"borderless",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:i("basicDebugGuide.actionProxy")})]})]}),e.jsxs("section",{className:"basic-debug-guide-section",children:[e.jsxs("div",{className:"basic-debug-guide-section-head",children:[e.jsx(s.Text,{strong:!0,children:i("basicDebugGuide.availableTitle")}),e.jsx(s.Text,{className:"basic-debug-guide-section-desc",children:i("basicDebugGuide.availableDesc")})]}),e.jsx("div",{className:"basic-debug-guide-list",children:n.map((c,a)=>e.jsxs("div",{className:"basic-debug-guide-item",children:[e.jsx("span",{className:"basic-debug-guide-item-index",children:a+1}),e.jsxs("div",{className:"basic-debug-guide-item-copy",children:[e.jsx(s.Text,{strong:!0,children:i(c.titleKey)}),e.jsx(s.Text,{children:i(c.descKey)})]})]},c.titleKey))})]}),e.jsxs("section",{className:"basic-debug-guide-section",children:[e.jsxs("div",{className:"basic-debug-guide-section-head",children:[e.jsx(s.Text,{strong:!0,children:i("basicDebugGuide.lockedTitle")}),e.jsx(s.Text,{className:"basic-debug-guide-section-desc",children:i("basicDebugGuide.lockedDesc")})]}),e.jsx("div",{className:"basic-debug-guide-list",children:g.map((c,a)=>e.jsxs("div",{className:"basic-debug-guide-item basic-debug-guide-item-muted",children:[e.jsx("span",{className:"basic-debug-guide-item-index",children:a+1}),e.jsxs("div",{className:"basic-debug-guide-item-copy",children:[e.jsx(s.Text,{strong:!0,children:i(c.titleKey)}),e.jsx(s.Text,{children:i(c.descKey)})]})]},c.titleKey))})]}),e.jsxs("section",{className:"basic-debug-guide-section",children:[e.jsxs("div",{className:"basic-debug-guide-section-head",children:[e.jsx(s.Text,{strong:!0,children:i("basicDebugGuide.stepsTitle")}),e.jsx(s.Text,{className:"basic-debug-guide-section-desc",children:i("basicDebugGuide.stepsDesc")})]}),e.jsx("div",{className:"basic-debug-guide-steps",children:r.map((c,a)=>e.jsxs("div",{className:"basic-debug-guide-step",children:[e.jsx("span",{className:"basic-debug-guide-step-index",children:a+1}),e.jsx(s.Text,{children:i(c)})]},c))}),e.jsxs("div",{className:"basic-debug-guide-command-list",children:[e.jsxs("div",{className:"basic-debug-guide-command-item",children:[e.jsx(s.Text,{type:"tertiary",children:i("basicDebugGuide.commandProxy")}),e.jsx("code",{children:"ttmg config set proxy http://127.0.0.1:7890"}),e.jsx(s.Text,{type:"tertiary",children:i("basicDebugGuide.commandProxyHint")})]}),e.jsxs("div",{className:"basic-debug-guide-command-item",children:[e.jsx(s.Text,{type:"tertiary",children:i("basicDebugGuide.commandLogin")}),e.jsx("code",{children:"ttmg login"})]}),e.jsxs("div",{className:"basic-debug-guide-command-item",children:[e.jsx(s.Text,{type:"tertiary",children:i("basicDebugGuide.commandDev")}),e.jsx("code",{children:"ttmg dev"})]})]})]})]})};export{x as BasicDebugGuide};
@@ -1 +1 @@
1
- import{c as i,u as d,a5 as h,r as p,j as e,i as a}from"./index-CnReCFYA.js";import{C as l}from"./compass-DZKQ36UU.js";import{Z as u}from"./zap-CuMRVa_B.js";const y=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],m=i("cloud-upload",y);const x=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],_=i("layout-dashboard",x);const k=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],g=i("qr-code",k),v=[{itemKey:"scan_qrcode",text:a("scanQRCode2Debug"),icon:g,path:"/"},{itemKey:"project_overview",text:a("projectInfo"),icon:_,path:"/project_overview"},{itemKey:"integration_assistant",text:a("integrationAssistant"),icon:l,path:"/integration_assistant"},{itemKey:"performance",text:a("performance.menu.title"),icon:u,path:"/performance"},{itemKey:"upload_publish",text:a("codePreCheck"),icon:m,path:"/upload_publish"}],w=()=>{const s=d(),r=h(),n=p.useMemo(()=>{const t=r.pathname;return t==="/"||["/basic_debug_guide","/network_diagnostics","/manual_connect","/launch_mode","/debug_setting"].includes(t)?"scan_qrcode":t.startsWith("/integration_assistant")?"integration_assistant":t==="/performance"||t==="/wasm_split"?"performance":t==="/project_overview"||t==="/project_detail"?"project_overview":t==="/upload_publish"||t==="/version_upload"||t==="/precheck_code"?"upload_publish":""},[r.pathname]);return e.jsx("nav",{className:"tt-sidebar","aria-label":"primary",children:e.jsx("ul",{className:"tt-sidebar-list",children:v.map(t=>{const c=t.icon,o=t.itemKey===n;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:o?"tt-sidebar-item tt-sidebar-item-active":"tt-sidebar-item",onClick:()=>s(t.path),"aria-current":o?"page":void 0,children:[e.jsx("span",{className:"tt-sidebar-item-icon","aria-hidden":"true",children:e.jsx(c,{size:16,strokeWidth:1.75})}),e.jsx("span",{className:"tt-sidebar-item-text",children:t.text})]})},t.itemKey)})})})};export{w as Sidebar};
1
+ import{c as i,u as d,a6 as h,r as p,j as e,i as a}from"./index-DxISN0Xc.js";import{C as l}from"./compass-CCsIev11.js";import{Z as u}from"./zap-Cv4X8yRx.js";const y=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],m=i("cloud-upload",y);const x=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],_=i("layout-dashboard",x);const k=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],g=i("qr-code",k),v=[{itemKey:"scan_qrcode",text:a("scanQRCode2Debug"),icon:g,path:"/"},{itemKey:"project_overview",text:a("projectInfo"),icon:_,path:"/project_overview"},{itemKey:"integration_assistant",text:a("integrationAssistant"),icon:l,path:"/integration_assistant"},{itemKey:"performance",text:a("performance.menu.title"),icon:u,path:"/performance"},{itemKey:"upload_publish",text:a("codePreCheck"),icon:m,path:"/upload_publish"}],w=()=>{const s=d(),r=h(),n=p.useMemo(()=>{const t=r.pathname;return t==="/"||["/basic_debug_guide","/network_diagnostics","/manual_connect","/launch_mode","/debug_setting"].includes(t)?"scan_qrcode":t.startsWith("/integration_assistant")?"integration_assistant":t==="/performance"||t==="/wasm_split"?"performance":t==="/project_overview"||t==="/project_detail"?"project_overview":t==="/upload_publish"||t==="/version_upload"||t==="/precheck_code"?"upload_publish":""},[r.pathname]);return e.jsx("nav",{className:"tt-sidebar","aria-label":"primary",children:e.jsx("ul",{className:"tt-sidebar-list",children:v.map(t=>{const c=t.icon,o=t.itemKey===n;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:o?"tt-sidebar-item tt-sidebar-item-active":"tt-sidebar-item",onClick:()=>s(t.path),"aria-current":o?"page":void 0,children:[e.jsx("span",{className:"tt-sidebar-item-icon","aria-hidden":"true",children:e.jsx(c,{size:16,strokeWidth:1.75})}),e.jsx("span",{className:"tt-sidebar-item-text",children:t.text})]})},t.itemKey)})})})};export{w as Sidebar};
@@ -1 +1 @@
1
- import{c as h,e as N,d as M,r as s,H as v,j as e,f as b,P as L,i as o,B as S,T as z,J as C}from"./index-CnReCFYA.js";import{S as E}from"./SectionHeader-DfBBWmpa.js";import{C as f}from"./Card-DvUkoCA3.js";import{T as x}from"./Tag-DuP9fCS0.js";import{S as I}from"./sparkles-tr6K1Npg.js";const T=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],_=h("bug",T);const q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],w=h("external-link",q);const H=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],B=h("wrench",H);function V(){return N({url:"/game/changelog",method:"GET"})}const A=[{key:"feature",icon:I,titleI18n:"changelogFeature",tone:"success"},{key:"optimize",icon:B,titleI18n:"changelogOptimize",tone:"warn"},{key:"bugfix",icon:_,titleI18n:"changelogBugfix",tone:"error"}],D=()=>{const{state:{devToolVersion:r}}=M(),d=C,[p,u]=s.useState([]),[j,l]=s.useState(!0),[c,m]=s.useState("");return s.useEffect(()=>{r&&v(r)},[r]),s.useEffect(()=>{let a=!1;return(async()=>{l(!0),m("");const n=await V();if(!a){if(n?.error||n?.code!==0||!n?.data){u([]),m(typeof n?.error=="object"&&n.error?.errorMsg||"Failed to load changelog."),l(!1);return}u(n.data.items||[]),l(!1)}})(),()=>{a=!0}},[]),j?e.jsx("div",{className:"change-log-container change-log-loading",children:e.jsx(b,{size:"large"})}):e.jsxs("div",{className:"change-log-container",children:[e.jsx(L,{title:o("changelog"),subtitle:o("changelogTip")}),c?e.jsx(S,{fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:c}):null,!c&&p.length===0?e.jsx(f,{padding:"lg",children:e.jsx(z.Paragraph,{className:"change-log-empty",children:"No changelog entries yet."})}):null,p.map(a=>e.jsxs(f,{padding:"md",className:"change-log-item",children:[e.jsxs("div",{className:"change-log-item-head",children:[e.jsx("h2",{className:"change-log-version",children:a.title}),e.jsxs(x,{tone:"neutral",size:"sm",children:["iOS ",a.target.iOS," · Android ",a.target.Android]})]}),A.map(({key:i,icon:n,titleI18n:k,tone:y})=>{const g=a.changes?.[i]||[];return g.length?e.jsxs("section",{className:"change-log-section",children:[e.jsx(E,{icon:n,title:e.jsxs("span",{className:"change-log-section-title",children:[e.jsx("span",{children:o(k)}),e.jsx(x,{tone:y,size:"sm",children:g.length})]})}),e.jsx("ul",{className:"change-log-changes",children:g.map(t=>e.jsxs("li",{className:"change-log-change",children:[e.jsx("span",{className:"change-log-change-bullet","aria-hidden":!0}),e.jsxs("span",{className:"change-log-change-body",children:[t.desc[d],t?.link?e.jsxs("a",{className:"change-log-change-link",href:t.link,target:"_blank",rel:"noopener noreferrer",children:[o("changelogLink"),e.jsx(w,{size:12,strokeWidth:2})]}):null]})]},t.desc[d]))})]},i):null})]},a.title))]})};export{D as ChangeLog};
1
+ import{c as h,e as N,d as M,r as s,H as v,j as e,f as b,P as L,i as o,B as S,T as z,J as C}from"./index-DxISN0Xc.js";import{S as E}from"./SectionHeader-3b39hv3n.js";import{C as f}from"./Card-BMss5cuV.js";import{T as x}from"./Tag-B5gYnANu.js";import{S as I}from"./sparkles-D2QPhLAu.js";const T=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],_=h("bug",T);const q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],w=h("external-link",q);const H=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],B=h("wrench",H);function V(){return N({url:"/game/changelog",method:"GET"})}const A=[{key:"feature",icon:I,titleI18n:"changelogFeature",tone:"success"},{key:"optimize",icon:B,titleI18n:"changelogOptimize",tone:"warn"},{key:"bugfix",icon:_,titleI18n:"changelogBugfix",tone:"error"}],D=()=>{const{state:{devToolVersion:r}}=M(),d=C,[p,u]=s.useState([]),[j,l]=s.useState(!0),[c,m]=s.useState("");return s.useEffect(()=>{r&&v(r)},[r]),s.useEffect(()=>{let a=!1;return(async()=>{l(!0),m("");const n=await V();if(!a){if(n?.error||n?.code!==0||!n?.data){u([]),m(typeof n?.error=="object"&&n.error?.errorMsg||"Failed to load changelog."),l(!1);return}u(n.data.items||[]),l(!1)}})(),()=>{a=!0}},[]),j?e.jsx("div",{className:"change-log-container change-log-loading",children:e.jsx(b,{size:"large"})}):e.jsxs("div",{className:"change-log-container",children:[e.jsx(L,{title:o("changelog"),subtitle:o("changelogTip")}),c?e.jsx(S,{fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:c}):null,!c&&p.length===0?e.jsx(f,{padding:"lg",children:e.jsx(z.Paragraph,{className:"change-log-empty",children:"No changelog entries yet."})}):null,p.map(a=>e.jsxs(f,{padding:"md",className:"change-log-item",children:[e.jsxs("div",{className:"change-log-item-head",children:[e.jsx("h2",{className:"change-log-version",children:a.title}),e.jsxs(x,{tone:"neutral",size:"sm",children:["iOS ",a.target.iOS," · Android ",a.target.Android]})]}),A.map(({key:i,icon:n,titleI18n:k,tone:y})=>{const g=a.changes?.[i]||[];return g.length?e.jsxs("section",{className:"change-log-section",children:[e.jsx(E,{icon:n,title:e.jsxs("span",{className:"change-log-section-title",children:[e.jsx("span",{children:o(k)}),e.jsx(x,{tone:y,size:"sm",children:g.length})]})}),e.jsx("ul",{className:"change-log-changes",children:g.map(t=>e.jsxs("li",{className:"change-log-change",children:[e.jsx("span",{className:"change-log-change-bullet","aria-hidden":!0}),e.jsxs("span",{className:"change-log-change-body",children:[t.desc[d],t?.link?e.jsxs("a",{className:"change-log-change-link",href:t.link,target:"_blank",rel:"noopener noreferrer",children:[o("changelogLink"),e.jsx(w,{size:12,strokeWidth:2})]}):null]})]},t.desc[d]))})]},i):null})]},a.title))]})};export{D as ChangeLog};
@@ -1 +1 @@
1
- import{r as s,j as e,S as b,T as k}from"./index-CnReCFYA.js";import{C as g}from"./index-CcxOfQrE.js";const S=c=>{const{open:C,onClose:u}=c,[t,n]=s.useState(!0),[o,l]=s.useState(!1),[r,d]=s.useState(!1),[x,m]=s.useState(!1),i=[{label:"是否开启域名校验",description:"开启后,客户端将校验所有请求的域名是否合法,建议开发环境关闭以便调试。",checked:t,onChange:n},{label:"是否开启 IAA Mock",description:"启用后,广告相关接口将返回模拟数据,方便开发和测试广告逻辑。",checked:o,onChange:l},{label:"是否开启 IAP Mock",description:"启用后,内购相关流程将使用模拟支付,避免真实扣费。",checked:r,onChange:d}];return e.jsx("div",{children:e.jsx(b,{vertical:!0,align:"start",spacing:"loose",children:i.map((a,h)=>e.jsxs("div",{children:[e.jsx(g,{checked:a.checked,onChange:p=>a.onChange(p.target.checked),children:a.label}),e.jsx(k.Text,{type:"tertiary",style:{display:"block",marginTop:4},children:a.description})]},h))})})};export{S as DebugSetting};
1
+ import{r as s,j as e,S as b,T as k}from"./index-DxISN0Xc.js";import{C as g}from"./index-DpWpqPKC.js";const S=c=>{const{open:C,onClose:u}=c,[t,n]=s.useState(!0),[o,l]=s.useState(!1),[r,d]=s.useState(!1),[x,m]=s.useState(!1),i=[{label:"是否开启域名校验",description:"开启后,客户端将校验所有请求的域名是否合法,建议开发环境关闭以便调试。",checked:t,onChange:n},{label:"是否开启 IAA Mock",description:"启用后,广告相关接口将返回模拟数据,方便开发和测试广告逻辑。",checked:o,onChange:l},{label:"是否开启 IAP Mock",description:"启用后,内购相关流程将使用模拟支付,避免真实扣费。",checked:r,onChange:d}];return e.jsx("div",{children:e.jsx(b,{vertical:!0,align:"start",spacing:"loose",children:i.map((a,h)=>e.jsxs("div",{children:[e.jsx(g,{checked:a.checked,onChange:p=>a.onChange(p.target.checked),children:a.label}),e.jsx(k.Text,{type:"tertiary",style:{display:"block",marginTop:4},children:a.description})]},h))})})};export{S as DebugSetting};
@@ -1 +1 @@
1
- import{c as a}from"./index-CnReCFYA.js";const e=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],l=a("sparkles",e);export{l as S};
1
+ import{c as a}from"./index-DxISN0Xc.js";const e=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],l=a("sparkles",e);export{l as S};
@@ -1 +1 @@
1
- import{c as a}from"./index-CnReCFYA.js";const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e=a("zap",o);export{e as Z};
1
+ import{c as a}from"./index-DxISN0Xc.js";const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e=a("zap",o);export{e as Z};
@@ -12,7 +12,7 @@
12
12
  rel="stylesheet"
13
13
  />
14
14
  <title>TikTok Mini Games DevTool</title>
15
- <script type="module" crossorigin src="/assets/index-CnReCFYA.js"></script>
15
+ <script type="module" crossorigin src="/assets/index-DxISN0Xc.js"></script>
16
16
  <link rel="stylesheet" crossorigin href="/assets/index-ROKxx4f7.css">
17
17
  </head>
18
18
  <!--
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttmg/cli",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "description": "TikTok Mini Game Command Line Tool",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- import{k as I,l as q,m as R,_ as k,n as D,o as T,R as r,b as x,I as A,p as U,L as z,q as M,s as X,C as Q,t as o,v as Z,w as j,x as G,i as s,u as H,d as J,r as y,N as w,j as m,B as K,y as W}from"./index-CnReCFYA.js";import{F as P}from"./baseForm-2J62W6xr.js";import"./index-CcxOfQrE.js";const B={PREFIX:`${I}-popconfirm`,POPOVER:`${I}-popconfirm-popover`},Y={DEFAULT_Z_INDEX:1030};class ee extends q{init(){}destroy(){}handleCancel(e){const t=this._adapter.notifyCancel(e);R(t)?(this._adapter.updateCancelLoading(!0),t.then(n=>{this.handleVisibleChange(!1),this._adapter.updateCancelLoading(!1)},n=>{this._adapter.updateCancelLoading(!1)})):this.handleVisibleChange(!1)}handleConfirm(e){const t=this._adapter.notifyConfirm(e);R(t)?(this._adapter.updateConfirmLoading(!0),t.then(n=>{this._adapter.updateConfirmLoading(!1),this.handleVisibleChange(!1)},n=>{this._adapter.updateConfirmLoading(!1)})):this.handleVisibleChange(!1)}handleClickOutSide(e){this._adapter.notifyClickOutSide(e)}handleVisibleChange(e){this._isControlledComponent("visible")||this._adapter.setVisible(e),e?this.handleFocusOperateButton():this._adapter.focusPrevFocusElement(),this._adapter.notifyVisibleChange(e)}handleFocusOperateButton(){const{cancelButtonProps:e,okButtonProps:t}=this._adapter.getProps();k(e,"autoFocus")&&!k(e,"disabled")?this._adapter.focusCancelButton():k(t,"autoFocus")&&!k(t,"disabled")&&this._adapter.focusOkButton()}}var te=function(u,e){var t={};for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&e.indexOf(n)<0&&(t[n]=u[n]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(u);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(u,n[i])&&(t[n[i]]=u[n[i]]);return t};class O extends D{constructor(e){super(e),this.handleCancel=t=>this.foundation.handleCancel(t&&t.nativeEvent),this.handleConfirm=t=>this.foundation.handleConfirm(t&&t.nativeEvent),this.handleVisibleChange=t=>this.foundation.handleVisibleChange(t),this.handleClickOutSide=t=>this.foundation.handleClickOutSide(t),this.stopImmediatePropagation=t=>t&&t.nativeEvent&&t.nativeEvent.stopImmediatePropagation(),this.renderConfirmPopCard=t=>{let{initialFocusRef:n}=t;const{content:i,title:g,className:p,style:f,cancelType:b,icon:h,prefixCls:l,showCloseIcon:v}=this.props,{direction:_}=this.context,S=T(l,p,{[`${l}-rtl`]:_==="rtl"}),E=g!==null&&typeof g<"u",F=!(i===null||typeof i>"u"),V=r.isValidElement(h),N=T({[`${l}-body`]:!0,[`${l}-body-withIcon`]:V});return r.createElement("div",{className:S,onClick:this.stopImmediatePropagation,style:f},r.createElement("div",{className:`${l}-inner`},r.createElement("div",{className:`${l}-header`},V?r.createElement("i",{className:`${l}-header-icon`,"x-semi-prop":"icon"},h):null,r.createElement("div",{className:`${l}-header-body`},E?r.createElement("div",{className:`${l}-header-title`,"x-semi-prop":"title"},g):null),v?r.createElement(x,{className:`${l}-btn-close`,icon:r.createElement(A,null),size:"small",theme:"borderless",type:b,onClick:this.handleCancel}):null),F?r.createElement("div",{className:N,"x-semi-prop":"content"},U(i)?i({initialFocusRef:n}):i):null,r.createElement("div",{className:`${l}-footer`,ref:this.footerRef},this.renderControls())))},this.state={cancelLoading:!1,confirmLoading:!1,visible:e.defaultVisible||!1},this.foundation=new ee(this.adapter),this.footerRef=r.createRef(),this.popoverRef=r.createRef()}static getDerivedStateFromProps(e,t){const n={},{hasOwnProperty:i}=Object.prototype;return i.call(e,"visible")&&(n.visible=e.visible),n}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:e=>this.setState({visible:e}),updateConfirmLoading:e=>this.setState({confirmLoading:e}),updateCancelLoading:e=>this.setState({cancelLoading:e}),notifyConfirm:e=>this.props.onConfirm(e),notifyCancel:e=>this.props.onCancel(e),notifyVisibleChange:e=>this.props.onVisibleChange(e),notifyClickOutSide:e=>this.props.onClickOutSide(e),focusCancelButton:()=>{var e,t;const n=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=cancel]");n?.focus({preventScroll:!0})},focusOkButton:()=>{var e,t;const n=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=ok]");n?.focus({preventScroll:!0})},focusPrevFocusElement:()=>{var e;(e=this.popoverRef.current)===null||e===void 0||e.focusTrigger()}})}renderControls(){const{okText:e,cancelText:t,okType:n,cancelType:i,cancelButtonProps:g,okButtonProps:p}=this.props,{cancelLoading:f,confirmLoading:b}=this.state;return r.createElement(z,{componentName:"Popconfirm"},(h,l)=>r.createElement(r.Fragment,null,r.createElement(x,Object.assign({"data-type":"cancel",type:i,onClick:this.handleCancel,loading:f},M(g,"autoFocus")),t||k(h,"cancel")),r.createElement(x,Object.assign({"data-type":"ok",type:n,theme:"solid",onClick:this.handleConfirm,loading:b},M(p,"autoFocus")),e||k(h,"confirm"))))}render(){const{direction:e}=this.context,t=e==="rtl"?"bottomRight":"bottomLeft",n=this.props,{className:i,prefixCls:g,disabled:p,children:f,style:b,position:h=t}=n,l=te(n,["className","prefixCls","disabled","children","style","position"]);if(p)return f;const{visible:v}=this.state,_={onVisibleChange:this.handleVisibleChange,className:B.POPOVER,onClickOutSide:this.handleClickOutSide};return this.isControlled("visible")&&(_.trigger="custom"),r.createElement(X,Object.assign({ref:this.popoverRef},l,{content:S=>{let{initialFocusRef:E}=S;return this.renderConfirmPopCard({initialFocusRef:E})},visible:v,position:h},_),f)}}O.contextType=Q;O.propTypes={motion:o.oneOfType([o.bool,o.func,o.object]),disabled:o.bool,content:o.oneOfType([o.node,o.func]),title:o.any,prefixCls:o.string,className:o.string,style:o.object,icon:o.node,okText:o.string,okType:o.string,cancelText:o.string,cancelType:o.string,onCancel:o.func,onConfirm:o.func,onClickOutSide:o.func,onVisibleChange:o.func,visible:o.bool,defaultVisible:o.bool,okButtonProps:o.object,cancelButtonProps:o.object,stopPropagation:o.oneOfType([o.bool,o.string]),showCloseIcon:o.bool,zIndex:o.number,trigger:o.string,position:o.string};O.__SemiComponentName__="Popconfirm";O.defaultProps=Z(O.__SemiComponentName__,{stopPropagation:!0,trigger:"click",onVisibleChange:j,disabled:!1,icon:r.createElement(G,{size:"extra-large"}),okType:"primary",cancelType:"tertiary",prefixCls:B.PREFIX,zIndex:Y.DEFAULT_Z_INDEX,showCloseIcon:!0,onCancel:j,onConfirm:j,onClickOutSide:j});const ne=[{label:s("scene_scan_qrcode"),value:"scan_qrcode"},{label:s("scene_search"),value:"search"},{label:s("scene_fyf_promotion_direct_feed_play"),value:"fyf_promotion_direct_feed_play"},{label:s("scene_anchor"),value:"anchor"},{label:s("scene_center"),value:"center"},{label:s("scene_ad"),value:"ads"},{label:s("scene_shortcut"),value:"desktop_shortcut"},{label:s("scene_sharing"),value:"dm_sharing"},{label:s("scene_link"),value:"minis_link"}],ie=()=>{const u=H(),{state:{launchOptions:e,selectedLaunchOption:t,packages:n},setLaunchOptions:i,setSelectedLaunchOption:g}=J(),p=y.useRef(null),f=t||w,[b,h]=y.useState(f),[l,v]=y.useState(f.id),_=n.map(a=>{if(a.type==="main")return{label:s("gameMainPackage"),value:a.name};if(a.type==="independent")return{label:`${s("independentPackage")}: ${a.name}`,value:a.name}}).filter(Boolean),S=y.useCallback(a=>{const c={...b,...a};c.pkgType==="main"&&c.independentPkg!==void 0&&(c.independentPkg=void 0,p.current&&p.current.setValues({independentPkg:void 0})),h(c)},[b]),E=y.useCallback(()=>{if(!p.current)return;const a=p.current.getValues();a.pkgType==="main"&&(a.independentPkg=void 0);const c=e.findIndex(C=>C.name===a.name&&C.id!=="created"&&C.id!=="normal");let d;c!==-1?(d=[...e],d[c]=a):(a.id=Date.now().toString(),d=[...e.slice(0,-1),a,...e.slice(-1)]),i(d),h(a),g(a),u("/")},[e,u,i,g]),F=y.useCallback(a=>{const c=e.find(d=>d.id===a);if(c){v(a);const d={...c};a==="created"?d.name="":a==="normal"&&(d.name=s("normalLaunchMode")),h(d),p.current?.setValues(d)}},[e]),V=y.useCallback(()=>{const a=l;if(["normal","created"].includes(a))return;const c=e.filter(L=>L.id!==a);i(c);const d=c.find(L=>L.id==="normal")||c.find(L=>L.id==="created")||c[0]||w,C={...d,...d.id==="created"?{name:""}:{},...d.id==="normal"?{name:s("normalLaunchMode")}:{}};g(C),v(C.id),h(C),p.current?.setValues(C)},[e,l,i,g]),N=y.useCallback(()=>{h(f),p.current?.setValues(f),u("/")},[f,u]),$=e.find(a=>a.id===l);return m.jsxs("div",{children:[m.jsx(K,{style:{marginBottom:32},fullMode:!1,icon:null,closeIcon:null,description:s("launchModeDesc"),type:"info"}),m.jsxs(P,{initValues:b,onValueChange:S,getFormApi:a=>p.current=a,style:{padding:20,border:"1px solid var(--tt-border)",borderRadius:8},onSubmit:E,children:[m.jsx(P.Select,{placeholder:s("selectLaunchMode"),rules:[{required:!0,message:s("selectLaunchMode")}],field:"id",label:s("selectLaunchMode"),optionList:e.map(a=>({label:a.name,value:a.id})),onChange:F,style:{width:"100%"},value:l}),m.jsx(P.Input,{required:!0,placeholder:s("launchModeName"),field:"name",label:s("launchModeName"),rules:[{required:!0,message:s("notEmpty")}],style:{width:"100%"},trigger:"blur"}),m.jsx(P.Select,{field:"pkgName",label:s("selectLaunchPkg"),placeholder:s("selectLaunchPkg"),rules:[{required:!0,message:s("notEmpty")}],optionList:_,style:{width:"100%"}}),m.jsx(P.Select,{field:"scene",label:s("selectScene"),rules:[{required:!0,message:s("notEmpty")}],placeholder:s("selectScene"),optionList:ne,style:{width:"100%"},filter:!0}),m.jsx(P.Input,{field:"queries",label:s("launchQueries"),placeholder:s("launchQueriesDesc"),trigger:"blur",rules:[{validator:(a,c)=>{const{isValid:d,message:C}=W(c);return d?Promise.resolve():Promise.reject(C)}}],style:{width:"100%"}}),m.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:20},children:[["created","normal"].includes(l)?m.jsx(x,{style:{marginRight:12},onClick:N,children:s("cancel")}):m.jsx(O,{title:s("deleteLaunchModeConfirm",{name:$?.name??""}),onConfirm:V,position:"bottomRight",children:m.jsx(x,{type:"danger",style:{marginRight:12},children:s("delete")})}),m.jsx(x,{htmlType:"submit",type:"primary",children:s("saveAndUse")})]})]})]})};export{ie as LaunchMode};
@@ -1 +0,0 @@
1
- import{k as ae,o as I,R as m,x as ie,z as oe,U as ce,t as u,V as qe,r as w,W as de,l as Fe,X as Xe,n as Me,Y as He,Z as Ge,I as Ue,F as Ve,C as Ke,v as Qe,w as ne,$ as re,a0 as ve,a1 as Ze,c as K,e as $,j as e,i as r,b as N,a as Ye,d as We,f as A,Q as Je,a2 as et,a3 as Z,a4 as q,u as tt,P as te}from"./index-CnReCFYA.js";import{S as Se}from"./SectionHeader-DfBBWmpa.js";import{C as Q}from"./Card-DvUkoCA3.js";import{T as st}from"./Tag-DuP9fCS0.js";import{a as at,R as nt,F as Ce}from"./baseForm-2J62W6xr.js";/* empty css */import{A as se}from"./arrow-left-1V5G0Kw7.js";import{S as rt}from"./sparkles-tr6K1Npg.js";import"./index-CcxOfQrE.js";const X={PREFIX:`${ae}-steps`,ITEM:`${ae}-steps-item`};var U;(function(n){n.small="large",n.default="extra-large"})(U||(U={}));const pe=n=>{const{prefixCls:s,className:t,size:a,title:l,description:i,status:c,style:d,active:o,done:p,icon:h,stepNumber:x,onClick:S,onChange:C,onKeyDown:b}=n,g=()=>{let v,E;if("icon"in n)m.isValidElement(h)&&(v=h);else if("status"in n)switch(c){case"error":v=m.createElement(ce,{size:U[a]});break;case"wait":v=m.createElement("span",{className:`${s}-number-icon`},x);break;case"process":v=m.createElement("span",{className:`${s}-number-icon`},x),E=!0;break;case"finish":v=m.createElement(oe,{size:U[a]});break;case"warning":v=m.createElement(ie,{size:U[a]});break;default:v=null;break}const F=I({[`${s}-icon`]:!0,[`${s}-custom-icon`]:"icon"in n,[`${s}-icon-process`]:E});return v?m.createElement("span",{className:F},v):null},y=I(s,`${s}-${c}`,{[`${s}-active`]:o,[`${s}-done`]:p,[`${s}-hover`]:C||n.onClick,[`${s}-clickable`]:C||S,[`${s}-${c}-hover`]:C||n.onClick},t),f=v=>{S?.(v),C?.()},j=v=>{v.key==="Enter"&&(b?.(v),C?.())};return m.createElement("div",{role:n.role,"aria-label":n["aria-label"],tabIndex:0,"aria-current":"step",className:y,style:d,onClick:v=>f(v),onKeyDown:j},m.createElement("div",{className:`${s}-container`},m.createElement("div",{className:`${s}-left`},g()),m.createElement("div",{className:`${s}-content`},m.createElement("div",{className:`${s}-title`},m.createElement("div",{className:`${s}-title-text`},l)),i&&m.createElement("div",{className:`${s}-description`},i))))};pe.propTypes={prefixCls:u.string,description:u.node,icon:u.node,status:u.oneOf(["wait","process","finish","error","warning"]),title:u.node,className:u.string,style:u.object,onClick:u.func,active:u.bool,done:u.bool};pe.defaultProps={prefixCls:X.ITEM,active:!1,done:!1,status:"wait",className:""};const me=n=>{const{prefixCls:s,className:t,title:a,description:l,status:i,style:c,onClick:d,icon:o,onChange:p,stepNumber:h,onKeyDown:x}=n,S=()=>{let g,y;if("icon"in n)g=o;else if("status"in n)switch(i){case"error":g=m.createElement(ce,{size:"extra-large"});break;case"wait":g=h;break;case"process":g=h,y=!0;break;case"finish":g=m.createElement(oe,{size:"extra-large"});break;case"warning":g=m.createElement(ie,{size:"extra-large"});break;default:g=null;break}const f=I({[`${s}-left`]:!0,[`${s}-icon`]:"icon"in n,[`${s}-plain`]:!("icon"in n),[`${s}-icon-process`]:y,[`${s}-hover`]:p||d});return g?m.createElement("div",{className:f},g):null},C=g=>{d?.(g),p?.()},b=g=>{g.key==="Enter"&&(x?.(g),p?.())};return m.createElement("div",{role:n.role,"aria-label":n["aria-label"],"aria-current":"step",tabIndex:0,className:I({[s]:!0,[`${s}-${i}`]:!!i,[`${s}-${i}-hover`]:!!i&&(p||d),[`${s}-${i}-active`]:!!i&&(p||d),[`${s}-clickable`]:p||d},t),style:c,onClick:g=>{C(g)},onKeyDown:b},S(),m.createElement("div",{className:`${s}-content`},m.createElement("div",{className:`${s}-title`,title:typeof a=="string"?a:null},m.createElement("span",{className:`${s}-title-text`},a)),m.createElement("div",{className:`${s}-description`,title:typeof l=="string"?l:null},l)))};me.propTypes={prefixCls:u.string,description:u.node,icon:u.node,status:u.oneOf(["wait","process","finish","error","warning"]),title:u.node,className:u.string,style:u.object,onClick:u.func};me.defaultProps={prefixCls:X.ITEM,status:"wait",className:""};const ue=n=>{const{prefixCls:s,className:t,title:a,style:l,active:i,index:c,total:d,onClick:o,onKeyDown:p,onChange:h}=n,x=I(s,{[`${s}-active`]:i},t),S=b=>{o?.(b),h?.()},C=b=>{b.key==="Enter"&&(p?.(b),h?.())};return m.createElement("div",{role:n.role,"aria-label":n["aria-label"],"aria-current":"step",tabIndex:0,className:x,style:l,onClick:b=>S(b),onKeyDown:C},m.createElement("div",{className:`${s}-container`},m.createElement("div",{className:`${s}-content`},m.createElement("div",{className:`${s}-title`},a)),c!==d-1&&m.createElement("div",{className:`${s}-icon`},m.createElement(qe,{size:"small"}))))};ue.propTypes={prefixCls:u.string,title:u.node,className:u.string,style:u.object,onClick:u.func,active:u.bool};ue.defaultProps={prefixCls:X.ITEM,active:!1,className:""};const ze=m.createContext(null),lt=n=>{const{type:s}=w.useContext(ze);return(()=>{switch(s){case"fill":return m.createElement(me,Object.assign({},n));case"basic":return m.createElement(pe,Object.assign({},n));case"nav":return m.createElement(ue,Object.assign({},n));default:return null}})()};var it=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};const he=n=>{const{current:s,status:t,children:a,prefixCls:l,initial:i,direction:c,className:d,style:o,onChange:p}=n,h=it(n,["current","status","children","prefixCls","initial","direction","className","style","onChange"]),x=w.useMemo(()=>{const C=w.Children.toArray(a).filter(y=>w.isValidElement(y)),b=c==="vertical"?null:{width:`${100/C.length}%`};return w.Children.map(C,(y,f)=>{if(!y)return null;const j=i+f,v=Object.assign({stepNumber:`${j+1}`,direction:c},y.props);return t==="error"&&f===s-1&&(v.className=`${l}-next-error`),y.props.status||(j===s?v.status=t:j<s?v.status="finish":v.status="wait"),v.onChange=p?()=>{f!==s&&p(f+i)}:void 0,m.createElement(at,{style:b},w.cloneElement(y,Object.assign({},v)))})},[a,i,l,c,t,s,p]),S=I(d,{[l]:!0,[`${l}-${c}`]:!0});return m.createElement("div",Object.assign({className:S,style:o,"aria-label":n["aria-label"]},de(h)),m.createElement(nt,{type:"flex",justify:"start"},x))};he.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,direction:u.oneOf(["horizontal","vertical"]),status:u.oneOf(["wait","process","finish","error","warning"])};he.defaultProps={prefixCls:X.PREFIX,current:0,direction:"horizontal",initial:0,status:"process"};var ot=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};const fe=n=>{const{size:s,current:t,status:a,children:l,prefixCls:i,initial:c,direction:d,className:o,style:p,hasLine:h,onChange:x}=n,S=ot(n,["size","current","status","children","prefixCls","initial","direction","className","style","hasLine","onChange"]),C=w.useMemo(()=>{const g=w.Children.toArray(l).filter(f=>w.isValidElement(f));return w.Children.map(g,(f,j)=>{if(!f)return null;const v=c+j,E=Object.assign({stepNumber:`${v+1}`,size:s},f.props);return a==="error"&&j===t-1&&(E.className=`${i}-next-error`),f.props.status||(v===t?E.status=a:v<t?E.status="finish":E.status="wait"),E.active=v===t,E.done=v<t,E.onChange=x?()=>{j!==t&&x(j+c)}:void 0,w.cloneElement(f,Object.assign({},E))})},[l,c,i,d,a,t,s,x]),b=I(o,{[`${i}-basic`]:!0,[`${i}-${d}`]:!0,[`${i}-${s}`]:s!=="default",[`${i}-hasline`]:h});return m.createElement("div",Object.assign({"aria-label":n["aria-label"],className:b,style:p},de(S)),C)};fe.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,direction:u.oneOf(["horizontal","vertical"]),status:u.oneOf(["wait","process","finish","error","warning"]),hasLine:u.bool};fe.defaultProps={prefixCls:X.PREFIX,current:0,direction:"horizontal",size:"",initial:0,hasLine:!0,status:"process"};var ct=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};const ge=n=>{const{size:s,current:t,initial:a,children:l,prefixCls:i,className:c,style:d,onChange:o}=n,p=ct(n,["size","current","initial","children","prefixCls","className","style","onChange"]),h=w.useMemo(()=>{const S=w.Children.toArray(l).filter(g=>w.isValidElement(g)),C=S.length;return w.Children.map(S,(g,y)=>{if(!g)return null;const f=Object.assign({index:y,total:C},g.props);return f.active=y===t,f.onChange=o?()=>{y!==t&&o(y+a)}:void 0,w.cloneElement(g,Object.assign({},f))})},[l,i,t,s,a,o]),x=I(c,{[`${i}-nav`]:!0,[`${i}-${s}`]:s!=="default"});return m.createElement("div",Object.assign({"aria-label":n["aria-label"],className:x,style:d},de(p)),h)};ge.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,size:u.oneOf(["small","default"])};ge.defaultProps={prefixCls:X.PREFIX,current:0,direction:"horizontal",size:"default",initial:0,status:"process"};var dt=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};class D extends w.Component{renderComponent(){const s=this.props,{type:t}=s,a=dt(s,["type"]);switch(t){case"fill":return m.createElement(he,Object.assign({},a));case"basic":return m.createElement(fe,Object.assign({},a));case"nav":return m.createElement(ge,Object.assign({},a));default:return null}}render(){const{type:s}=this.props;return m.createElement(ze.Provider,{value:{type:s}},this.renderComponent())}}D.Step=lt;D.propTypes={onChange:u.func,type:u.oneOf(["fill","basic","nav"]),size:u.oneOf(["small","default"])};D.defaultProps={type:"fill",size:"default"};class we extends Fe{constructor(s){super(Object.assign(Object.assign({},we.defaultAdapter),s)),this.handleMouseInSideChange=t=>{this._adapter.handleMouseInSideChange(t)},this.getInputWrapperRect=()=>this._adapter.getInputWrapperRect()}hasToast(s){return this._adapter.getState("list").map(a=>{let{id:l}=a;return l}).includes(s)}addToast(s){const t=this._adapter.getState("list");t.push(s),this._adapter.updateToast(t,[],[])}updateToast(s,t){let a=this._adapter.getState("list");a=a.map(i=>i.id===s?Object.assign(Object.assign({},i),t):i);const l=a.filter(i=>i.id===s);this._adapter.updateToast(a,[],l)}removeToast(s){let t=this._adapter.getState("list");const a=[];t=t.filter(l=>l.id===s?(a.push(l),!1):!0),this._adapter.updateToast(t,a,[])}destroyAll(){const s=this._adapter.getState("list");s.length>0&&this._adapter.updateToast([],s,[])}}const ke=`${ae}-toast`,B={PREFIX:ke,WRAPPER:`${ke}-wrapper`},V={types:["warning","success","info","error","default"],themes:["normal","light"],directions:["ltr","rtl"]},pt={duration:3};class xe extends Fe{constructor(s){super(Object.assign(Object.assign({},xe.defaultAdapter),s)),this._timer=null,this._id=null}init(){this.startCloseTimer_(),this._id=this._adapter.getProp("id")}destroy(){this.clearCloseTimer_()}startCloseTimer_(){const s=this._adapter.getProp("duration");s&&Xe(s)&&(this._timer=setTimeout(()=>{this.close()},s*1e3))}close(s){s&&s.stopPropagation(),this._adapter.notifyWrapperToRemove(this._id),this._adapter.notifyClose()}clearCloseTimer_(){this._timer&&(clearTimeout(this._timer),this._timer=null)}restartCloseTimer(){this.clearCloseTimer_(),this.startCloseTimer_()}}const R=B.PREFIX;let L=class extends Me{constructor(s){super(s),this.toastEle=m.createRef(),this.clearCloseTimer=()=>{this.foundation.clearCloseTimer_()},this.startCloseTimer=()=>{this.foundation.startCloseTimer_()},this.restartCloseTimer=()=>{this.foundation.restartCloseTimer()},this.state={},this.foundation=new xe(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyWrapperToRemove:s=>{this.props.close(s)},notifyClose:()=>{this.props.onClose()}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}close(s){this.foundation.close(s)}renderIcon(){const{type:s,icon:t}=this.props,l={warning:m.createElement(ie,null),success:m.createElement(oe,null),info:m.createElement(Ve,null),error:m.createElement(ce,null)}[s],i="large",c=I(`${R}-icon`,`${R}-icon-${s}`);return t?He(t)?m.cloneElement(t,{size:i,className:`${R}-icon`}):t:s&&l?m.cloneElement(l,{size:i,className:c}):null}render(){const{content:s,type:t,theme:a,showClose:l,textMaxWidth:i,className:c,style:d}=this.props,o=this.props.direction||this.context.direction,p=I(R,c,{[`${R}-${t}`]:!0,[`${R}-${a}`]:a==="light",[`${R}-rtl`]:o==="rtl"}),h={};h.maxWidth=i;const x="borderless",S="small",C=this.props.positionInList?this.props.positionInList.length-this.props.positionInList.index-1:0,b=m.createElement("div",{ref:this.toastEle,role:"alert","aria-label":`${t||"default"} type`,className:p,style:Object.assign(Object.assign({},d),{transform:`translate3d(0,0,${C*-10}px)`}),onMouseEnter:this.clearCloseTimer,onMouseLeave:this.startCloseTimer,onAnimationStart:this.props.onAnimationStart,onAnimationEnd:this.props.onAnimationEnd},m.createElement("div",{className:`${R}-content`},this.renderIcon(),m.createElement("span",{className:`${R}-content-text`,style:h,"x-semi-prop":"content"},s),l&&m.createElement("div",{className:`${R}-close-button`},m.createElement(Ge,{onClick:g=>this.close(g),type:"tertiary",icon:m.createElement(Ue,{"x-semi-prop":"icon"}),theme:x,size:S}))));if(this.props.stack){const g=this.props.stackExpanded&&this.toastEle.current&&getComputedStyle(this.toastEle.current).height||0;return m.createElement("div",{className:`${R}-zero-height-wrapper`,style:{height:g}},b)}else return b}};L.contextType=Ke;L.propTypes={onClose:u.func,content:u.node,close:u.func,duration:u.number,theme:u.oneOf(V.themes),type:u.oneOf(V.types),textMaxWidth:u.oneOfType([u.string,u.number]),style:u.object,className:u.string,showClose:u.bool,stack:u.bool,stackExpanded:u.bool,icon:u.node,direction:u.oneOf(V.directions)};L.__SemiComponentName__="Toast";L.defaultProps=Qe(L.__SemiComponentName__,{onClose:ne,content:"",close:ne,duration:pt.duration,textMaxWidth:450,showClose:!0,stack:!1,stackExpanded:!1,theme:"normal"});var mt=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};const ut=(n,s)=>{var{afterClose:t}=n,a=mt(n,["afterClose"]);const[l,i]=w.useState(!0),c=()=>{i(!1)};return m.useImperativeHandle(s,()=>({close:()=>{i(!1)}})),w.useEffect(()=>{l||t(a.id)},[l]),l?m.createElement(L,Object.assign({},a,{close:c})):null},ht=m.forwardRef(ut),G={motion:!0,zIndex:1010,duration:3};function ft(){const[n,s]=m.useState([]);function t(a,l){return s(i=>[{element:a,config:l},...i]),i=>{s(c=>c.filter(d=>{let{config:o}=d;return o.id!==i}))}}return[n,t]}function gt(){const[n,s]=ft(),t=w.useRef(new Map),a=i=>{const c=re("semi_toast_"),d=Object.assign(Object.assign({},i),{id:c});let o;const p=m.createElement(ht,Object.assign({},d,{key:c,afterClose:h=>o(h),ref:h=>{var x;t.current.set(c,{close:(x=h?.close)!==null&&x!==void 0?x:ne})}}));return o=s(p,Object.assign({},d)),c},l=i=>{var c;const{close:d}=(c=t.current.get(i))!==null&&c!==void 0?c:{};d?.()};return[{success:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"success"})),info:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"info"})),error:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"error"})),warning:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"warning"})),open:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"default"})),close:i=>l(i)},m.createElement(m.Fragment,null,Array.isArray(n)&&n.length?m.createElement(m.Fragment,null,n.map(i=>i.element)):null)]}const wt=()=>{var n;return n=class k extends Me{constructor(t){super(t),this.stack=!1,this.innerWrapperRef=m.createRef(),this.handleMouseEnter=a=>{this.stack&&this.foundation.handleMouseInSideChange(!0)},this.handleMouseLeave=a=>{var l;this.stack&&!((l=this.foundation.getInputWrapperRect())===null||l===void 0)&&l.height&&this.foundation.handleMouseInSideChange(!1)},this.state={list:[],removedItems:[],updatedItems:[],mouseInSide:!1},this.foundation=new we(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateToast:(t,a,l)=>{this.setState({list:t,removedItems:a,updatedItems:l})},handleMouseInSideChange:t=>{this.setState({mouseInSide:t})},getInputWrapperRect:()=>{var t;return(t=this.innerWrapperRef.current)===null||t===void 0?void 0:t.getBoundingClientRect()}})}static create(t){var a;const l=(a=t.id)!==null&&a!==void 0?a:re("toast");if(k.ref){const i=document.querySelector(`#${this.wrapperId}`);["top","left","bottom","right"].map(c=>{c in t&&(i.style[c]=typeof t[c]=="number"?`${t[c]}px`:t[c])}),!!t.stack!==k.ref.stack&&(k.ref.stack=!!t.stack),k.ref.has(l)?k.ref.update(l,Object.assign(Object.assign({},t),{id:l})):k.ref.add(Object.assign(Object.assign({},t),{id:l}))}else{const i=document.createElement("div");this.wrapperId||(this.wrapperId=re("toast-wrapper").slice(0,26)),i.className=B.WRAPPER,i.id=this.wrapperId,i.style.zIndex=String(typeof t.zIndex=="number"?t.zIndex:k.defaultOpts.zIndex),["top","left","bottom","right"].map(c=>{if(c in k.defaultOpts||c in t){const d=t[c]?t[c]:k.defaultOpts[c];i.style[c]=typeof d=="number"?`${d}px`:d}}),k.defaultOpts.getPopupContainer?k.defaultOpts.getPopupContainer().appendChild(i):document.body.appendChild(i),ve.render(m.createElement(k,{ref:c=>k.ref=c}),i,()=>{k.ref.add(Object.assign(Object.assign({},t),{id:l})),k.ref.stack=!!t.stack})}return l}static close(t){k.ref&&k.ref.remove(t)}static destroyAll(){if(k.ref){k.ref.destroyAll();const t=document.querySelector(`#${this.wrapperId}`);ve.unmountComponentAtNode(t),t&&t.parentNode.removeChild(t),k.ref=null,this.wrapperId=null}}static getWrapperId(){return this.wrapperId}static info(t){return typeof t=="string"&&(t={content:t}),this.create(Object.assign(Object.assign(Object.assign({},k.defaultOpts),t),{type:"info"}))}static warning(t){return typeof t=="string"&&(t={content:t}),this.create(Object.assign(Object.assign(Object.assign({},k.defaultOpts),t),{type:"warning"}))}static error(t){return typeof t=="string"&&(t={content:t}),this.create(Object.assign(Object.assign(Object.assign({},k.defaultOpts),t),{type:"error"}))}static success(t){return typeof t=="string"&&(t={content:t}),this.create(Object.assign(Object.assign(Object.assign({},k.defaultOpts),t),{type:"success"}))}static config(t){["top","left","bottom","right"].forEach(a=>{a in t&&(k.defaultOpts[a]=t[a])}),typeof t.theme=="string"&&V.themes.includes(t.theme)&&(k.defaultOpts.theme=t.theme),typeof t.zIndex=="number"&&(k.defaultOpts.zIndex=t.zIndex),typeof t.duration=="number"&&(k.defaultOpts.duration=t.duration),typeof t.getPopupContainer=="function"&&(k.defaultOpts.getPopupContainer=t.getPopupContainer)}has(t){return this.foundation.hasToast(t)}add(t){return this.foundation.addToast(t)}update(t,a){return this.foundation.updateToast(t,a)}remove(t){return this.foundation.removeToast(t)}destroyAll(){return this.foundation.destroyAll()}render(){let{list:t}=this.state;const{removedItems:a,updatedItems:l}=this.state;t=Array.from(new Set([...t,...a]));const i=l.map(d=>{let{id:o}=d;return o}),c=d=>{var o;!((o=d?.foundation)===null||o===void 0)&&o._id&&i.includes(d.foundation._id)&&d.foundation.restartCloseTimer()};return m.createElement(m.Fragment,null,m.createElement("div",{className:I({[`${B.PREFIX}-innerWrapper`]:!0,[`${B.PREFIX}-innerWrapper-hover`]:this.state.mouseInSide}),ref:this.innerWrapperRef,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},t.map((d,o)=>{const p=a.find(h=>h.id===d.id)!==void 0;return m.createElement(Ze,{key:d.id,motion:d.motion,animationState:p?"leave":"enter",startClassName:p?`${B.PREFIX}-animation-hide`:`${B.PREFIX}-animation-show`},h=>{let{animationClassName:x,animationEventsNeedBind:S,isAnimating:C}=h;return p&&!C?null:m.createElement(L,Object.assign({},d,{stack:this.stack,stackExpanded:this.state.mouseInSide,positionInList:{length:t.length,index:o},className:I({[d.className]:!!d.className,[x]:!0})},S,{style:Object.assign({},d.style),close:b=>this.remove(b),ref:c}))})})))}},n.defaultOpts={motion:!0,zIndex:1010,content:""},n.propTypes={content:u.node,duration:u.number,onClose:u.func,icon:u.node,direction:u.oneOf(V.directions),stack:u.bool},n.defaultProps={},n};class xt{static create(s){const t=wt();return t.useToast=gt,s&&t.config(s),t}}const le=xt.create();const bt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jt=K("check",bt);const yt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ne=K("circle-alert",yt);const vt=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],St=K("cloud",vt);const Ct=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],kt=K("cpu",Ct);const Nt=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],_t=K("workflow",Nt),M={Idle:0,WasmPreparing:1,WasmPrepared:2,WasmSplitIssued:3,WasmSplitting:4,WasmSplitDone:5,WasmReadyToPrepare:6,WasmSplitPreparing:7,WasmPreparedSuccess:8,WasmCollecting:9,WasmUploadFail:-1,WasmDownloadFail:-2,WasmFileNotExist:-3,WasmSplitFail:-4,WasmSplitUpdateDBFail:-5,WasmSplitPrepareFail:-6,WasmPrepareFailed:-1};function _e({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-split-config",method:"GET",data:{codeMd5:n,clientKey:s}})}function Et(n){const{codePath:s,codeMd5:t,clientKey:a,desc:l}=n;return $({url:"/game/wasm-prepare",method:"POST",data:{codePath:s,clientKey:a,codeMd5:t,desc:l}})}function Ot({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-prepare-result",method:"POST",data:{codeMd5:n,clientKey:s}})}function $t(n,s){const t=s?.intervalMs,a=s?.maxAttempts,l=s?.signal||new AbortController().signal;let i=0;return new Promise((c,d)=>{if(l?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const o=()=>{clearTimeout(p),d(new DOMException("Polling aborted","AbortError"))};l?.addEventListener("abort",o,{once:!0});let p;const h=async()=>{i+=1;try{const x=await Ot(n),{status:S}=x.data;if(S===M.WasmPreparedSuccess||S===M.WasmSplitDone){c(x);return}if(S<0){c(x);return}if(i>=a){d(new Error(`Polling timeout after ${a} attempts`));return}p=window.setTimeout(h,t)}catch(x){if(i>=a){d(x);return}p=window.setTimeout(h,t)}};h()})}function Pt({codeMd5:n,clientKey:s,codePath:t}){return $({url:"/game/wasm-prepare-download",method:"POST",data:{codeMd5:n,clientKey:s,codePath:t}})}function Ee(n){const{codeMd5:s,clientKey:t,archive:a}=n;return $({url:"/game/wasm-split",method:"POST",data:{codeMd5:s,clientKey:t,archive:a??!1}})}function Tt({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-split-result",method:"POST",data:{codeMd5:n,clientKey:s}})}function It(n,s){const t=s?.intervalMs,a=s?.maxAttempts,l=s?.signal||new AbortController().signal;let i=0;return new Promise((c,d)=>{if(l?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const o=()=>{clearTimeout(p),d(new DOMException("Polling aborted","AbortError"))};l?.addEventListener("abort",o,{once:!0});let p;const h=async()=>{i+=1;try{const x=await Tt(n),{status:S}=x.data;if(S!==M.WasmSplitDone){if(i>=a){d(new Error(`Polling timeout after ${a} attempts`));return}p=window.setTimeout(h,t);return}c(x)}catch(x){if(i>=a){d(x);return}p=window.setTimeout(h,t)}};h()})}function Rt({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-split-download-result",method:"POST",data:{clientKey:s,codeMd5:n}})}function Oe(n){return $({url:"/game/wasm-split-download",method:"POST",data:n})}function De(n){const{codeMd5:s,clientKey:t,codePath:a}=n;return $({url:"/game/wasm-split-reset",method:"POST",data:{codeMd5:s,clientKey:t,codePath:a}})}function Ft({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-taskinfo",method:"GET",data:{codeMd5:n,clientKey:s}})}function Mt({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-collect-start",method:"POST",data:{codeMd5:n,clientKey:s}})}function Wt({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-set-collect",method:"POST",data:{codeMd5:n,clientKey:s}})}function $e(n){return $({url:"/game/wasm-collect-funcids",method:"GET",data:n})}function zt(n){return $({url:"/game/wasm-collect-info",method:"GET",data:n})}function Pe(n){return $({url:"/game/pipeline-mode",method:"POST",data:{mode:n}})}const Dt=({onSubmit:n,onCancel:s,onChange:t})=>e.jsxs(Ce,{style:{width:"100%"},onChange:t,onSubmit:n,children:[e.jsx(Ce.TextArea,{rules:[{required:!0,message:r("inputSplitDesc")}],label:r("splitDesc"),placeholder:r("inputSplitDesc"),field:"desc"}),e.jsxs("div",{className:"wasm-prepare-form-button-container",children:[e.jsx(N,{type:"primary",htmlType:"submit",style:{marginRight:12},children:r("startPrepare")}),e.jsx(N,{type:"tertiary",onClick:s,children:r("cancel")})]})]}),O={init:"init",start:"start",processing:M.WasmPreparing,processingReady:M.WasmReadyToPrepare,success:M.WasmPreparedSuccess,failed:M.WasmPrepareFailed,splitDone:M.WasmSplitDone},At=({codePath:n,codeMd5:s,clientKey:t,onCancel:a,onNext:l,onHide:i})=>{const[c,d]=w.useState(""),[o,p]=w.useState({code:0,data:{status:O.init}}),h=w.useRef(null),x=w.useMemo(()=>o?.data?.status,[o?.data?.status]),S=()=>{h.current?.abort(),a(),De({codeMd5:s,clientKey:t,codePath:n}).then(f=>{f.code===0&&p({...o,data:{...o?.data,status:O.init}})})},C=async()=>{h.current=new AbortController,p({code:0,data:{status:O.start}}),Et({codePath:n,codeMd5:s,clientKey:t,desc:c}).then(f=>{f.code===0||f?.error?.code===10024||f?.error?.code===10028?(p({...f,data:{...f?.data,status:O.processing}}),b()):p({...o,error:f?.error||{code:-1,message:"Internal server error, please try again later..."},data:{...o?.data,status:O.failed}})})},b=()=>{$t({codeMd5:s,clientKey:t},{intervalMs:2e3,maxAttempts:240,signal:h.current?.signal}).then(f=>{f.code===0?Pt({codeMd5:s,clientKey:t,codePath:n}).then(j=>{j.code===0?l():p({...o,error:{code:-1,message:j?.error?.message||"Download prepared wasm failed"},data:{...o?.data,status:O.failed}})}).catch(j=>{p({...o,error:{code:-1,message:j?.message||"Download prepared wasm failed"},data:{...o?.data,status:O.failed}})}):p({...o,data:{...o?.data,status:O.failed}})}).catch(f=>{f?.name!=="AbortError"&&p(j=>({...j,error:{code:-1,message:f?.message||"Polling failed"},data:{...j?.data,status:O.failed}}))})},g=f=>{d(f?.values?.desc)};let y=null;switch(x){case O.init:y=e.jsx(Dt,{onSubmit:C,onCancel:a,onChange:g});break;case O.start:y=e.jsxs("div",{className:"wasm-prepare-processing-content",children:[e.jsx("div",{className:"wasm-prepare-processing-spinner",role:"status","aria-label":r("startingPrepare")}),e.jsx("div",{className:"wasm-prepare-processing-text",children:r("startingPrepare")}),e.jsxs("div",{className:"wasm-prepare-processing-cancel",children:[e.jsx(N,{type:"tertiary",onClick:a,children:r("cancelPrepare")}),e.jsx(N,{type:"primary",onClick:()=>i(),children:r("backgroundRun")})]})]});break;case O.processing:case O.processingReady:y=e.jsxs("div",{className:"wasm-prepare-processing-content",children:[e.jsx("div",{className:"wasm-prepare-processing-spinner",role:"status","aria-label":r("preparingSplit")}),e.jsx("div",{className:"wasm-prepare-processing-text",children:r("preparingSplit")}),e.jsx("div",{className:"wasm-prepare-processing-warning",children:r("warningDuringPreparing")}),e.jsxs("div",{className:"wasm-prepare-processing-cancel",children:[e.jsx(N,{type:"tertiary",onClick:()=>{S()},children:r("cancelPrepare")}),e.jsx(N,{type:"primary",onClick:()=>i(),children:r("backgroundRun")})]})]});break;case O.success:case O.splitDone:break;case O.failed:const f=o?.error?.message||"Unknown error";y=e.jsxs("div",{className:"wasm-prepare-failed-content",children:[e.jsx("div",{className:"wasm-prepare-failed-text",children:r("preparingSplitFailed")}),o?.data?.status===O.failed&&e.jsx("div",{className:"wasm-prepare-failed-warning",children:f}),e.jsx(N,{type:"tertiary",style:{marginTop:12},onClick:C,children:r("retryPrepare")})]});break;default:y=null}return e.jsx("div",{className:"wasm-prepare-content-container",children:y})},Lt=({data:n})=>{const s={...n||{}},t=[{label:"Client key",value:"app_id"},{label:r("wasmSize"),value:"wasm_size",render:a=>`${(a/1024/1024).toFixed(2)} MB`},{label:r("totalFuncCount"),value:"total_wasm_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:r("collectedFuncCount"),value:"collected_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:"Wasm md5",value:"wasm_md5"}];return e.jsx("div",{className:"wasm-collect-status",children:t.map(a=>e.jsxs("div",{className:"wasm-collect-status-item",children:[e.jsx(Ye,{size:"small",className:"wasm-collect-status-item-label",children:a.label}),e.jsx("span",{className:"wasm-collect-status-item-value",children:a.render?.(s[a.value])||s[a.value]})]},a.value))})},Bt=({onNext:n,onCancel:s,codeMd5:t,clientKey:a,onHide:l,pipelineMode:i="local"})=>{const c=i==="remote",{state:{devSchema:d}}=We(),[o,p]=w.useState("startCollect"),[h,x]=w.useState(),[S,C]=w.useState(),[b,g]=w.useState(0),y=w.useRef(null),f=w.useRef(!1),j=w.useRef(!1),v=.08,E=w.useMemo(()=>{if(!S)return!1;const T=S?.total_wasm_func_count;return T?b/T>=v:!1},[S,b]);w.useEffect(()=>{if(o!=="collecting"){y.current&&(window.clearInterval(y.current),y.current=null);return}if(y.current)return;const T=P=>{g(P.data?.collected_func_count||0);const W=P.data?.collect_state;W==="closed"&&!f.current?(f.current=!0,le.warning({content:r("collect.sessionClosed"),duration:5})):W==="open"&&(f.current=!1)};return $e({codeMd5:t,clientKey:a}).then(T).catch(console.error),y.current=window.setInterval(()=>{$e({codeMd5:t,clientKey:a}).then(T).catch(P=>{console.error(P)})},2e3),()=>{y.current&&(window.clearInterval(y.current),y.current=null)}},[o,t,a]);const F=async()=>{if(o!=="collecting")try{if(p("startCollect"),(await Mt({codeMd5:t,clientKey:a})).code!==0){p("willCollect");return}Wt({codeMd5:t,clientKey:a}).catch(console.error),p("collecting"),Ft({codeMd5:t,clientKey:a}).then(P=>{x(P.data)}).catch(console.error),zt({codeMd5:t,clientKey:a}).then(P=>{C(P.data||{})}).catch(console.error)}catch(T){console.error(T),le.error({content:r("collect.startFailed"),duration:4}),p("willCollect")}};w.useEffect(()=>{j.current||(j.current=!0,F())},[]);const H=()=>{y.current&&(window.clearInterval(y.current),y.current=null),p("willCollect"),n()};return e.jsxs("div",{className:"wasm-collect-content-container",children:[o!=="willCollect"&&(h?e.jsx(Lt,{data:{...h||{},total_wasm_func_count:S?.total_wasm_func_count,collected_func_count:b}}):e.jsxs("div",{className:"wasm-collect-status-loading",children:[e.jsx(A,{size:"middle"}),e.jsx("span",{className:"wasm-collect-status-loading-text",children:r("startingCollect")})]})),e.jsx("div",{className:"collect-qrcode-container",children:e.jsx(Je,{value:d})}),e.jsx("div",{className:"collect-qrcode-desc",children:r("collectDesc")}),e.jsxs("div",{className:"collect-qrcode-button-container",children:[o==="willCollect"&&e.jsxs(e.Fragment,{children:[e.jsx(N,{type:"primary",onClick:F,children:r("startCollect")}),e.jsx(N,{type:"tertiary",onClick:s,children:r("cancelSplit")})]}),o!=="willCollect"&&e.jsxs(e.Fragment,{children:[c&&(E?e.jsx(N,{type:"primary",onClick:H,children:r("startSplit")}):e.jsx(et,{content:r("cannotSplitTip"),children:e.jsx(N,{type:"primary",disabled:!0,children:r("startSplit")})})),e.jsx(N,{type:"tertiary",onClick:l,children:r("backgroundRun")}),e.jsx(N,{type:"tertiary",onClick:s,children:r("cancelSplit")})]})]})]})},Te=({onCancel:n,onRetry:s,onHide:t,forcedStatus:a,forcedErrorMsg:l})=>{const[i,c]=w.useState(""),[d,o]=w.useState("");w.useEffect(()=>{const b=g=>{c(g.status),o(g.errorMsg||"")};return Z.on("unitySplitStatus",b),()=>{Z.off("unitySplitStatus",b)}},[]);const p="wasm-split-downloading-content",h="wasm-split-downloading-text",x=a||i,S=l||d;let C=null;switch(x){case"start_download_android_main_wasm":case"download_android_main_wasm_done":case"start_compress_android_main_wasm":case"compress_android_main_wasm_done":case"start_download_android_sub_wasm_code":case"download_android_sub_wasm_code_done":case"start_compress_android_sub_wasm_code":case"compress_android_sub_wasm_code_done":case"start_download_ios_main_wasm":case"download_ios_main_wasm_done":case"start_compress_ios_main_wasm":case"compress_ios_main_wasm_done":case"start_download_ios_range_json":case"download_ios_range_json_done":case"start_download_ios_js_data_br":case"download_ios_js_data_br_done":case"start_compress_ios_sub_wasm_code":case"compress_ios_sub_wasm_code_done":case"start_write_splited_wasm_br":case"write_splited_wasm_done":case"start_update_wasm_split_config":case"update_wasm_split_config_done":C=e.jsxs("div",{className:p,children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:h,children:r(x)}),e.jsxs(q,{children:[e.jsx(N,{type:"danger",onClick:n,children:r("cancelSplit")}),e.jsx(N,{onClick:t,children:r("backgroundRun")})]})]});break;case"wasm_split_failed":C=e.jsxs("div",{className:p,children:[e.jsx("div",{className:h,children:r("downloadSplitResultFailed")}),S?e.jsx("div",{className:h,children:S}):null,e.jsxs(q,{children:[e.jsx(N,{type:"primary",onClick:s,children:r("retryDownloadSplitResult")}),e.jsx(N,{type:"danger",onClick:n,children:r("cancelSplit")}),e.jsx(N,{onClick:t,children:r("backgroundRun")})]})]});break;default:C=e.jsxs("div",{className:p,children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:h,children:r("processing")})]})}return C},qt=({onCancel:n,onHide:s,codeMd5:t,clientKey:a,archive:l,pipelineMode:i="local"})=>{const c=i==="local",[d,o]=w.useState("spliting"),[p,h]=w.useState(""),[x,S]=w.useState(),C=()=>{o("spliting"),h(""),Ee({codeMd5:t,clientKey:a,archive:l}).then(j=>{if(j.code===0){const v=j.data?.func_count;return o("writing"),Oe({}).then(E=>{E.code===0?(o("success"),typeof v=="number"&&v>0&&le.success({content:r("wasmSplit.splitDoneToast",{count:String(v)}),duration:3})):(h(E?.error?.errorMsg||E?.msg||r("splitFailed")),o("writeFailed"))})}else h(j?.error?.message||j?.msg||r("splitFailed")),o("splitFailed")}).catch(j=>{h(j?.message||r("splitFailed")),o("splitFailed")})},b=()=>{o("spliting"),h(""),Ee({codeMd5:t,clientKey:a,archive:l}).then(j=>{if(j.code===0)return o("remotePolling"),It({codeMd5:t,clientKey:a},{intervalMs:1e3,maxAttempts:1e3}).then(()=>(o("remoteFetchingResult"),Rt({clientKey:a,codeMd5:t}).then(v=>{v.code===0?(S(v.data),o("remoteReadyToDownload")):(h(r("getSplitResultFailed")),o("splitFailed"))})));h(j?.error?.message||j?.msg||r("splitFailed")),o("splitFailed")}).catch(j=>{h(j?.message||r("splitFailed")),o("splitFailed")})},g=()=>{o("remoteDownloading"),h(""),Oe(x?.result).then(j=>{j.code===0?o("success"):(h(j?.error?.errorMsg||j?.msg||r("downloadSplitResultFailed")),o("remoteDownloadFailed"))}).catch(j=>{h(j?.message||r("downloadSplitResultFailed")),o("remoteDownloadFailed")})},y=c?C:b;w.useEffect(()=>{y()},[]);let f=null;switch(d){case"spliting":f=e.jsxs("div",{className:"wasm-split-processing",children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:"wasm-split-processing-content",children:r("splittingDesc")}),e.jsx("div",{className:"wasm-split-processing-cancel",children:e.jsxs(q,{children:[e.jsx(N,{onClick:()=>n(),type:"danger",children:r("cancelSplit")}),e.jsx(N,{onClick:()=>s(),children:r("backgroundRun")})]})})]});break;case"writing":f=e.jsxs("div",{className:"wasm-split-processing",children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:"wasm-split-processing-content",children:r("writingSplitResult")||"正在写入分包产物..."})]});break;case"splitFailed":case"writeFailed":f=e.jsxs("div",{className:"wasm-split-failed",children:[e.jsx("div",{className:"wasm-split-failed-content",children:p||r("splitFailed")}),e.jsx("div",{className:"wasm-split-failed-retry",children:e.jsxs(q,{children:[e.jsx(N,{type:"primary",onClick:()=>y(),children:r("retry")||"重试"}),e.jsx(N,{type:"tertiary",onClick:()=>n(),children:r("cancelSplit")})]})})]});break;case"remotePolling":case"remoteFetchingResult":f=e.jsxs("div",{className:"wasm-split-processing",children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:"wasm-split-processing-content",children:d==="remotePolling"?r("splittingDesc"):r("getSplitResult")||"获取分包结果..."}),e.jsx("div",{className:"wasm-split-processing-cancel",children:e.jsxs(q,{children:[e.jsx(N,{onClick:()=>n(),type:"danger",children:r("cancelSplit")}),e.jsx(N,{onClick:()=>s(),children:r("backgroundRun")})]})})]});break;case"remoteReadyToDownload":f=e.jsxs("div",{className:"wasm-split-success",children:[e.jsx("div",{className:"wasm-split-success-content",children:r("splitSuccess")||"分包成功"}),e.jsx("div",{className:"wasm-split-success-download",children:e.jsx(N,{type:"primary",onClick:g,children:r("downloadSplitResult")||"下载分包产物"})})]});break;case"remoteDownloading":f=e.jsx(Te,{onCancel:n,onRetry:g,onHide:s});break;case"remoteDownloadFailed":f=e.jsx(Te,{onCancel:n,onRetry:g,onHide:s,forcedStatus:"wasm_split_failed",forcedErrorMsg:p});break;case"success":f=e.jsxs("div",{className:"wasm-split-success",children:[e.jsx("div",{className:"wasm-split-success-content",children:r("downloadSplitResultSuccess")}),e.jsx("div",{className:"wasm-split-success-tip",children:r("downloadSplitResultTip")})]});break;default:f=null}return e.jsx("div",{className:"wasm-split-content-container",children:f})},z={prepare:{number:0,title:r("splitPrepare"),description:r("splitPrepare.desc")},collect:{number:1,title:r("splitCollect"),description:r("splitCollect.desc")},split:{number:2,title:r("splitCode"),description:r("splitCode.desc")},rollback:{number:3,title:r("rollback"),description:""}},Xt=({stage:n})=>e.jsxs(D,{type:"basic",current:z[n].number,className:"tt-wasm-steps",children:[e.jsx(D.Step,{title:z.prepare.title,description:z.prepare.description}),e.jsx(D.Step,{title:z.collect.title,description:z.collect.description}),e.jsx(D.Step,{title:z.split.title,description:z.split.description})]}),Ht=({onCancel:n,errorType:s,onHide:t})=>e.jsxs("div",{className:"wasm-code-split-error",children:[s==="noWasmCode"&&e.jsxs("div",{className:"wasm-code-split-error-container",children:[e.jsx("div",{className:"wasm-code-split-error-title",children:r("noWasmCode")}),e.jsx("div",{className:"wasm-code-split-error-desc",children:r("noWasmCodeDesc")})]}),s==="hasSplited"&&e.jsxs("div",{className:"wasm-code-split-error-container",children:[e.jsx("div",{className:"wasm-code-split-error-title",children:r("hasSplitedTitle")}),e.jsx("div",{className:"wasm-code-split-error-desc",children:r("hasSplitedDesc")}),e.jsxs(q,{children:[e.jsx(N,{onClick:n,children:r("cancelSplit")}),e.jsx(N,{onClick:t,children:r("backgroundRun")})]})]}),s==="noSplitConfig"&&e.jsxs("div",{className:"wasm-code-split-error-container",children:[e.jsx("div",{className:"wasm-code-split-error-title",children:r("noSplitConfigTitle")}),e.jsx("div",{className:"wasm-code-split-error-desc",children:r("noSplitConfigDesc")})]})]}),Ie=()=>e.jsxs("div",{className:"split-loading",children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:"split-loading-text",children:r("wasmSplit.initializingEnv")})]}),Gt=({codeMd5:n,clientKey:s,codePath:t,onHide:a,onReset:l})=>{const[i,c]=w.useState("rollbacking"),d=()=>{c("rollbacking"),De({codeMd5:n,clientKey:s,codePath:t}).then(h=>{h.code===0?(c("rollbackSuccess"),l()):c("rollbackFailed")})};w.useEffect(()=>{d()},[]);let o="",p=null;switch(i){case"rollbacking":o=r("rollback.rollbacking"),p=e.jsx(N,{onClick:()=>{c("rollbackFailed")},children:r("rollback.backgroundRun")});break;case"rollbackSuccess":o=r("rollback.success"),p=e.jsx(N,{onClick:()=>{a()},children:r("rollback.close")});break;case"rollbackFailed":o=r("rollback.failed"),p=e.jsx(N,{onClick:()=>{d()},children:r("rollback.retry")});break}return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"wasm-split-rollback-container",children:[e.jsx("div",{className:"wasm-split-rollback-text",children:o}),p]})})},Ut=()=>{const[n,s]=w.useState({kind:"idle"}),t=w.useRef(null);if(w.useEffect(()=>{const d=()=>{t.current!==null&&(window.clearTimeout(t.current),t.current=null)},o=({status:p,msg:h,progress:x})=>{switch(p){case"start":d(),s({kind:"uploading",progress:0});break;case"process":d(),s({kind:"uploading",progress:Math.max(0,Math.min(1,x??0))});break;case"success":d(),s({kind:"success"}),t.current=window.setTimeout(()=>{s({kind:"idle"}),t.current=null},2500);break;case"restart":d(),s({kind:"restart"});break;case"error":d(),s({kind:"error",msg:h});break}};return Z.on("uploadGame",o),()=>{Z.off("uploadGame",o),d()}},[]),n.kind==="idle")return null;let a="",l="",i="0%",c="uploading";switch(n.kind){case"uploading":{const d=Math.round(n.progress*100);a=r("uploadStart"),l=`${d}%`,i=`${d}%`,c="uploading";break}case"success":a=r("uploadSuccess"),l="100%",i="100%",c="success";break;case"restart":a=r("uploadStart"),l="",i="0%",c="uploading";break;case"error":a=r("uploadError"),n.msg&&(a=`${a}: ${n.msg}`),l="",i="100%",c="error";break}return e.jsxs("div",{className:`tt-wasm-upload-progress tt-wasm-upload-progress--${c}`,role:"status","aria-live":"polite",title:a,children:[e.jsxs("div",{className:"tt-wasm-upload-progress-meta",children:[e.jsx("span",{className:"tt-wasm-upload-progress-label",children:a}),l&&e.jsx("span",{className:"tt-wasm-upload-progress-percent",children:l})]}),e.jsx("div",{className:"tt-wasm-upload-progress-track",children:e.jsx("div",{className:"tt-wasm-upload-progress-fill",style:{width:i}})})]})};function Vt({enableWasmCollect:n,enableWasmSplit:s}){return typeof n=="boolean"&&(typeof s=="string"||s===!1)?n:!1}function Kt({enableWasmSplit:n,hasWasmCode:s}){return n===!0?{errorType:"hasSplited",hasError:!0}:s?{hasError:!1}:{errorType:"noWasmCode",hasError:!0}}const Qt={loading:"neutral",prepare:"accent",collect:"accent",split:"success",rollback:"warn",error:"error"},Zt=n=>({label:r(`wasmSplit.stage.${n}`),tone:Qt[n]}),Yt=n=>{const s=a=>r(`wasmSplit.help.${n}.${a}`),t={loading:["line1"],prepare:["line1","line2"],collect:["line1","line2"],split:["line1","line2"],rollback:["line1"],error:["line1"]};return{title:s("title"),lines:t[n].map(s)}},Re=({active:n,recommended:s,icon:t,title:a,description:l,onSelect:i})=>e.jsxs("button",{type:"button",className:`tt-wasm-mode-card${n?" tt-wasm-mode-card-active":""}`,onClick:i,"aria-pressed":n,children:[e.jsx("span",{className:"tt-wasm-mode-card-icon",children:t}),e.jsxs("span",{className:"tt-wasm-mode-card-body",children:[e.jsxs("span",{className:"tt-wasm-mode-card-title-row",children:[e.jsx("span",{className:"tt-wasm-mode-card-title",children:a}),s&&e.jsx("span",{className:"tt-wasm-mode-card-badge",children:r("wasmSplit.recommended")})]}),e.jsx("span",{className:"tt-wasm-mode-card-desc",children:l})]}),n&&e.jsx("span",{className:"tt-wasm-mode-card-check","aria-hidden":"true",children:e.jsx(jt,{size:14,strokeWidth:2.5})})]}),cs=()=>{const n=tt(),{state:{engine:s,packages:t,gameDetail:a}}=We(),l=t?.find(_=>_.name==="wasmcode"),i=l?.root||"",c=l?.md5||"",d=l?.size,o=a?.client_key||"",p=a?.name?.trim()||"",x=(_=>typeof _!="number"||_<=0?"":_<1024?`${_} B`:_<1024*1024?`${(_/1024).toFixed(1)} KB`:`${(_/1024/1024).toFixed(2)} MB`)(d),[S,C]=w.useState(""),[b,g]=w.useState("loading"),[y,f]=w.useState(null),[j,v]=w.useState("local"),E=_=>{v(_),Pe(_)},F=a===null,H=!F&&(!c||!o);w.useEffect(()=>{F||H||(g("loading"),_e({codeMd5:c,clientKey:o}).then(_=>{if(_.code===0){const{errorType:J,hasError:ee}=Kt({enableWasmSplit:_.data.enableWasmSplit,hasWasmCode:!!i});ee?(C(J),g("error")):Vt(_.data)?g("collect"):g("prepare"),f(_.data),Pe("local")}else C("noSplitConfig"),g("error")}))},[c,o,i,F,H]);const T=()=>{g("rollback")},P=()=>{n("/")},W=()=>{n("/")},be=(_,J,ee,Be)=>e.jsxs("div",{className:"tt-wasm-split-shell tt-wasm-split-page",children:[e.jsxs("div",{className:"tt-wasm-split-hero-strip",children:[e.jsxs("button",{type:"button",className:"tt-wasm-split-back",onClick:W,children:[e.jsx(se,{size:14,strokeWidth:2}),e.jsx("span",{children:r("back")})]}),e.jsx(te,{title:r("wasmSplit")})]}),e.jsxs(Q,{padding:"lg",className:"tt-wasm-split-empty-card",children:[e.jsx("div",{className:"tt-wasm-split-empty-icon","aria-hidden":"true",children:e.jsx(Ne,{size:24,strokeWidth:1.75})}),e.jsx("h2",{className:"tt-wasm-split-empty-title",children:_}),e.jsx("p",{className:"tt-wasm-split-empty",children:J}),e.jsx("div",{className:"tt-wasm-split-empty-actions",children:e.jsx("button",{type:"button",className:"tt-wasm-split-empty-cta",onClick:()=>n(Be),children:ee})})]})]});if(F)return e.jsxs("div",{className:"tt-wasm-split-shell tt-wasm-split-page",children:[e.jsxs("div",{className:"tt-wasm-split-hero-strip",children:[e.jsxs("button",{type:"button",className:"tt-wasm-split-back",onClick:W,children:[e.jsx(se,{size:14,strokeWidth:2}),e.jsx("span",{children:r("back")})]}),e.jsx(te,{title:r("wasmSplit")})]}),e.jsx(Q,{padding:"lg",children:e.jsx(Ie,{})})]});if(s&&s!=="unity")return be(r("wasmSplit.empty.unityOnly.title"),r("wasmSplit.empty.unityOnly.desc"),r("wasmSplit.empty.backHome"),"/");if(H)return be(r("wasmSplit.empty.needDevice.title"),r("wasmSplit.empty.needDevice.desc"),r("wasmSplit.empty.connectDevice"),"/");const Y=Zt(b),je=Yt(b),Ae=b==="prepare",Le=b==="collect"||b==="split",ye=b!=="error"&&b!=="loading";return e.jsxs("div",{className:"tt-wasm-split-shell tt-wasm-split-page",children:[e.jsxs("div",{className:"tt-wasm-split-hero-strip",children:[e.jsxs("button",{type:"button",className:"tt-wasm-split-back",onClick:W,children:[e.jsx(se,{size:14,strokeWidth:2}),e.jsx("span",{children:r("back")})]}),e.jsx(te,{title:r("wasmSplit"),subtitle:r("wasmSplit.subtitle"),action:e.jsx(st,{tone:Y.tone,withDot:!0,variant:"solid",children:Y.label})})]}),Ae&&e.jsxs("section",{className:"tt-wasm-split-section",children:[e.jsx(Se,{icon:_t,eyebrow:"STEP 0",title:r("wasmSplit.strategy.title"),subtitle:r("wasmSplit.strategy.subtitle")}),e.jsxs("div",{className:"tt-wasm-mode-grid",children:[e.jsx(Re,{active:j==="local",recommended:!0,icon:e.jsx(kt,{size:18,strokeWidth:2}),title:r("wasmSplit.mode.local.title"),description:r("wasmSplit.mode.local.desc"),onSelect:()=>E("local")}),e.jsx(Re,{active:j==="remote",icon:e.jsx(St,{size:18,strokeWidth:2}),title:r("wasmSplit.mode.remote.title"),description:r("wasmSplit.mode.remote.desc"),onSelect:()=>E("remote")})]})]}),e.jsxs("div",{className:"tt-wasm-split-grid",children:[e.jsx("aside",{className:"tt-wasm-split-helper",children:e.jsx(Q,{padding:"lg",className:"tt-wasm-split-helper-card",children:e.jsxs("div",{className:"tt-wasm-split-helper-grid",children:[e.jsxs("div",{className:"tt-wasm-split-helper-main",children:[e.jsx(Se,{icon:b==="error"?Ne:rt,title:je.title}),e.jsx("ul",{className:"tt-wasm-split-helper-list",children:je.lines.map(_=>e.jsx("li",{children:_},_))})]}),e.jsxs("div",{className:"tt-wasm-split-helper-meta",children:[e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.stage")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value",children:Y.label})]}),e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.mode")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value",children:j==="local"?r("wasmSplit.mode.local.title"):r("wasmSplit.mode.remote.title")})]}),e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.engine")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value",children:"Unity"})]}),p&&e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.game")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value tt-wasm-split-helper-meta-truncate",title:p,children:p})]}),x&&e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.wasmSize")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value",children:x})]}),c&&e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.wasmMd5")}),e.jsxs("span",{className:"tt-wasm-split-helper-meta-value tt-wasm-split-helper-meta-mono",title:c,children:[c.slice(0,8),"…",c.slice(-4)]})]})]})]})})}),e.jsxs(Q,{padding:"lg",className:"tt-wasm-split-workflow-card",children:[Le&&e.jsxs("div",{className:"tt-wasm-status-row tt-wasm-status-row-inset",children:[e.jsxs("div",{className:"tt-pipeline-mode-chip",children:[e.jsx("span",{className:"tt-pipeline-mode-dot"}),r("wasmSplit.currentMode"),e.jsx("strong",{children:j==="local"?r("wasmSplit.mode.local.title"):r("wasmSplit.mode.remote.title")})]}),e.jsx(Ut,{})]}),b==="loading"&&e.jsx(Ie,{}),b==="error"&&e.jsx(Ht,{errorType:S,onCancel:T,onHide:P}),ye&&e.jsx("div",{className:"tt-wasm-split-steps-wrap",children:e.jsx(Xt,{stage:b})}),ye&&e.jsxs("div",{className:"tt-wasm-split-stage",children:[b==="prepare"&&e.jsx(At,{codeMd5:c,codePath:i,clientKey:o,onCancel:W,onNext:()=>g("collect"),onHide:P}),b==="collect"&&e.jsx(Bt,{codeMd5:c,clientKey:o,pipelineMode:j,onCancel:T,onHide:P,onNext:()=>{_e({codeMd5:c,clientKey:o}).then(_=>{_.code===0&&f(_.data),g("split")})}}),b==="split"&&e.jsx(qt,{codeMd5:c,clientKey:o,archive:y?.enableArchiveMode===!0,pipelineMode:j,onCancel:T,onHide:P}),b==="rollback"&&e.jsx(Gt,{codeMd5:c,clientKey:o,codePath:i,onHide:P,onReset:()=>g("prepare")})]})]})]})]})};export{cs as WasmCodeSplit};