@forsion/unit 2.13.3 → 2.13.4

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 (199) hide show
  1. package/main.mjs +25 -3
  2. package/package.json +1 -1
  3. package/release.json +5 -5
  4. package/web/assets/ArtificialView-DLh75dAI.js +1 -0
  5. package/web/assets/AutomationBuilder-DNWWGnFr.js +1 -0
  6. package/web/assets/CalendarConfigView-G7je7k9-.js +1 -0
  7. package/web/assets/{CalendarView-D55PA1vn.js → CalendarView-B2MtaOJk.js} +1 -1
  8. package/web/assets/{CapabilityMenu-BVrokPpT.js → CapabilityMenu-DJaZ_Cyt.js} +1 -1
  9. package/web/assets/{CheckboxInput-BuJ3HPm_.js → CheckboxInput-FYXLaZke.js} +1 -1
  10. package/web/assets/{Chrome-amTcZNE4.js → Chrome-CFonajM4.js} +1 -1
  11. package/web/assets/{CodeView-DRVh13k9.js → CodeView-GZ0BAgoW.js} +3 -3
  12. package/web/assets/DashboardGridView-Xgw4wa0_.js +17 -0
  13. package/web/assets/{EventCard-DUrn2krw.js → EventCard-_39F_I5M.js} +1 -1
  14. package/web/assets/ExcalidrawCanvas-rXujil36.js +1 -0
  15. package/web/assets/{FloatingToc-B1d4-5EL.js → FloatingToc-DNqAkkI0.js} +1 -1
  16. package/web/assets/GitCloneDialog-Bj9G3o-n.css +1 -0
  17. package/web/assets/GitCloneDialog-CQx-O4j1.js +1 -0
  18. package/web/assets/HomepageView-DcWmTPQO.css +1 -0
  19. package/web/assets/HomepageView-MYEk3RCs.js +3 -0
  20. package/web/assets/{ImageStudioPanels-B2PTq6Yb.js → ImageStudioPanels-4wnb2XF4.js} +2 -2
  21. package/web/assets/ImageStudioView-qrmW8pfx.js +1 -0
  22. package/web/assets/InlineAiPanel-B3kd1ob2.js +1 -0
  23. package/web/assets/InlineAiPanel-DZZijfif.css +1 -0
  24. package/web/assets/InlineFiles-Clnqh9jD.js +1 -0
  25. package/web/assets/MarkdownBlock-DQTuoen3.css +1 -0
  26. package/web/assets/MarkdownBlock-DT_wsaja.js +58 -0
  27. package/web/assets/ModelPill-JaIH3ffZ.js +2 -0
  28. package/web/assets/MuseLibraryView-16p1zsxz.css +1 -0
  29. package/web/assets/MuseLibraryView-DOJVVeU6.js +2 -0
  30. package/web/assets/{MuseView-CDDwV6SR.js → MuseView-uxTmjVQa.js} +2 -2
  31. package/web/assets/{PageHistoryPanel-BbdXpjJM.js → PageHistoryPanel-Bn4-XmdK.js} +2 -2
  32. package/web/assets/{PdfAnnotator-CW0wPWRB.js → PdfAnnotator-Cq8cklTz.js} +1 -1
  33. package/web/assets/PenRow-COOYAaxx.js +1 -0
  34. package/web/assets/ProductView-DPTveulg.js +1 -0
  35. package/web/assets/RightPanel-BJUacrsf.js +4 -0
  36. package/web/assets/RightPanel-D0zk1g3I.css +1 -0
  37. package/web/assets/{SketchCard-BcXCdBAs.js → SketchCard-B_UU5sxV.js} +3 -3
  38. package/web/assets/{StudioGuestSurface-ZJFKnNYF.js → StudioGuestSurface-yBa4QKfX.js} +1 -1
  39. package/web/assets/TargetHealthNotice-BLzDB-Xl.css +1 -0
  40. package/web/assets/TargetHealthNotice-CgkdTdhB.js +47 -0
  41. package/web/assets/{TodoListView-DuRdVFgB.js → TodoListView-CricdCfW.js} +1 -1
  42. package/web/assets/{Tooltip-DtDUL18W.js → Tooltip-o8ZqIb3L.js} +1 -1
  43. package/web/assets/UnifiedPage-BWAyqj65.js +69 -0
  44. package/web/assets/ViewSelectionBar-35x8TiLA.js +2 -0
  45. package/web/assets/appStore-CI1_L5OS.js +3357 -0
  46. package/web/assets/appStore-DQc2marq.css +1 -0
  47. package/web/assets/{arrow-up-right-R4P9Mmxz.js → arrow-up-right-BDsMFoNQ.js} +1 -1
  48. package/web/assets/{astryxBridge-CT2wZJXs.js → astryxBridge-CH_c5xjo.js} +3 -3
  49. package/web/assets/automationListSource-CB6AWkL_.js +1 -0
  50. package/web/assets/{boardSurface-Ce0_vf9f.js → boardSurface-CLvEUjbF.js} +1 -1
  51. package/web/assets/{book-open-CcXCToyx.js → book-open-BLzEdGfu.js} +1 -1
  52. package/web/assets/{calendarNavStore-tQJRVpum.js → calendarNavStore-BHUNxDx8.js} +1 -1
  53. package/web/assets/{canvasPrefs-CSuX9aLF.js → canvasPrefs-CvE7mgyq.js} +1 -1
  54. package/web/assets/{chatBoxSurface-IG6Vu4Dz.js → chatBoxSurface-CuuHLzs5.js} +1 -1
  55. package/web/assets/{circle-question-mark-O8AhUz35.js → circle-question-mark-BM4ZRxQS.js} +1 -1
  56. package/web/assets/{circle-x-AV2ZWulM.js → circle-x-DTcNGZDT.js} +1 -1
  57. package/web/assets/{client-BqhpYbYL.js → client-CaivGZFR.js} +5 -5
  58. package/web/assets/{code-xml-DdR58F83.js → code-xml-AE3mT4T5.js} +1 -1
  59. package/web/assets/{codeStudioStore-Dq5i8nbE.js → codeStudioStore-DhyMazGT.js} +1 -1
  60. package/web/assets/codingNavigation-B0kVsy4x.js +53 -0
  61. package/web/assets/codingNavigation-DHCidM4N.css +1 -0
  62. package/web/assets/{create-BgJN5qsj.js → create-1JI2I47p.js} +2 -2
  63. package/web/assets/dashboardSurface-CIE5HybN.js +1 -0
  64. package/web/assets/{deskCapture-BD2qD6NI.js → deskCapture-COW7aG5Y.js} +1 -1
  65. package/web/assets/{diff2html-OoRdHZ_O.js → diff2html-Daje9Kkm.js} +1 -1
  66. package/web/assets/{docx-preview-B43XC8Cn.js → docx-preview-CABR7n30.js} +1 -1
  67. package/web/assets/emoji-DZ9CA_3l.css +1 -0
  68. package/web/assets/emoji-DphwSxPx.js +1 -0
  69. package/web/assets/{floatingTocSurface-BM2SYE_u.js → floatingTocSurface-BOm2QYBK.js} +1 -1
  70. package/web/assets/{foldActions-BcyvNVBs.js → foldActions-DNbJPlPl.js} +1 -1
  71. package/web/assets/{folder-CCZqnwRc.js → folder-DotgUhYD.js} +1 -1
  72. package/web/assets/{folder-plus-BJKT1Pqg.js → folder-plus-aJgL9NeP.js} +1 -1
  73. package/web/assets/gestures-dqncPOwo.js +1 -0
  74. package/web/assets/git-branch-CwR2qic6.js +1 -0
  75. package/web/assets/{hand-DRu7IJdU.js → hand-XNkzNiW2.js} +1 -1
  76. package/web/assets/{hard-drive-CXNJUCXw.js → hard-drive-CfWKRoAE.js} +1 -1
  77. package/web/assets/i18n-CykmULlm.css +1 -0
  78. package/web/assets/{i18n.generated-DvY59Zq3.js → i18n.generated-BwynSSMk.js} +3 -3
  79. package/web/assets/{imageStudio-Axwmd4GW.js → imageStudio-CWgLpC_d.js} +2 -2
  80. package/web/assets/{index-C65u4fXd.js → index-B65ULikK.js} +1 -1
  81. package/web/assets/{index-DDMXVG0h.js → index-BGfvNj7R.js} +1 -1
  82. package/web/assets/{index-BGEkZBs2.js → index-BIIeiIap.js} +1 -1
  83. package/web/assets/{index-BYUntVIZ.js → index-BOzsniE1.js} +89 -89
  84. package/web/assets/{index-BO2XJc36.js → index-BfrjVzia.js} +1 -1
  85. package/web/assets/{index-mB0EQkyZ.js → index-Bi9UtjVz.js} +1 -1
  86. package/web/assets/{index-pJh7JN7_.js → index-C1uilc9i.js} +1 -1
  87. package/web/assets/{index-DY0M_dpd.js → index-C3Dc3Ivz.js} +1 -1
  88. package/web/assets/{index-D3CYvMpl.js → index-CJF_Ld1Y.js} +1 -1
  89. package/web/assets/{index-BFTY79aq.js → index-CMARP4oV.js} +1 -1
  90. package/web/assets/{index-taRxNsbp.js → index-C_RsQVNm.js} +1 -1
  91. package/web/assets/{index-Dlkq7gkE.js → index-ChyxZMm8.js} +1 -1
  92. package/web/assets/{index-DcbZwhpE.js → index-CoKcOaZg.js} +1 -1
  93. package/web/assets/{index-Uq4J2aoW.js → index-CuviSCbk.js} +1 -1
  94. package/web/assets/{index-HqmJW2np.js → index-Cw43kua8.js} +1 -1
  95. package/web/assets/{index-WbVt2P8R.js → index-D1fu6XQN.js} +1 -1
  96. package/web/assets/{index-D78izbLA.js → index-DG-hXb63.js} +1 -1
  97. package/web/assets/index-DjnTfJpN.js +1 -0
  98. package/web/assets/{index-LxlyPm0_.js → index-Dtw0abst.js} +1 -1
  99. package/web/assets/{index-D102FOuM.js → index-O05r2Ty6.js} +1 -1
  100. package/web/assets/{index-C_Ohi-I3.js → index-W3ErfZiX.js} +1 -1
  101. package/web/assets/{index-B1rE_NwA.js → index-Yc56b3XX.js} +1 -1
  102. package/web/assets/{index-CkMhazev.js → index-d4jCdYJH.js} +1 -1
  103. package/web/assets/{index-CobUnTcv.js → index-gt5JBIFf.js} +1 -1
  104. package/web/assets/{index-XyjIhkPw.js → index-siHtlYTM.js} +1 -1
  105. package/web/assets/{invitePage-BW0BH8Ac.js → invitePage-Bgveo6Hj.js} +1 -1
  106. package/web/assets/{ipc-D7yENkjV.js → ipc-B6hkgxQL.js} +1 -1
  107. package/web/assets/{jszip.min-UE5d5vPJ.js → jszip.min-eU-k-vEy.js} +1 -1
  108. package/web/assets/{layout-grid-Hs3eDA07.js → layout-grid-CraV7nhh.js} +1 -1
  109. package/web/assets/linkFollow-BpvDWzUx.js +8 -0
  110. package/web/assets/{list-tree-DmuRb-p9.js → list-tree-cLJw-jYQ.js} +1 -1
  111. package/web/assets/{listFold-CKxjyY5_.js → listFold-M8s5JYEC.js} +1 -1
  112. package/web/assets/{lock-kffGfeHt.js → lock-DBkXXwaI.js} +1 -1
  113. package/web/assets/lock-open-C-9-AWct.js +1 -0
  114. package/web/assets/{log-out-B5gEP0tF.js → log-out-C8bDXj9P.js} +1 -1
  115. package/web/assets/main-CMk6twzA.js +20 -0
  116. package/web/assets/markdownEditorSurface-DgQ0TUWH.js +3 -0
  117. package/web/assets/{message-square-plus-DxBPIhPS.js → message-square-plus-8pfimvem.js} +1 -1
  118. package/web/assets/{messages-4w1Khzm1.js → messages-CKtabOqy.js} +1 -1
  119. package/web/assets/minus-CfA9fAN3.js +1 -0
  120. package/web/assets/mobileEntry-NcMcK0LV.js +13 -0
  121. package/web/assets/{nativeDownload-Udrv_tmU.js → nativeDownload-CNtwSCy0.js} +1 -1
  122. package/web/assets/pageChrome-BR4cfIaA.js +1 -0
  123. package/web/assets/{pageChrome-eO9pb2fH.css → pageChrome-BbUhILy0.css} +1 -1
  124. package/web/assets/{pageTree-CIXFRCLk.js → pageTree-BYYPgZm_.js} +4 -4
  125. package/web/assets/{pen-tool-D_Y9We9x.js → pen-tool-C5ftHCnm.js} +1 -1
  126. package/web/assets/{pencil-DGiTRzW1.js → pencil-ehhM9_9k.js} +1 -1
  127. package/web/assets/phoneList-B6gwUJZF.js +9 -0
  128. package/web/assets/phoneList-iRdfiKA8.css +1 -0
  129. package/web/assets/pluginChat-DTTWWiUS.js +2 -0
  130. package/web/assets/{redo-2-QgiKEg9T.js → redo-2-DCEAgQlN.js} +1 -1
  131. package/web/assets/{rotate-ccw-BLoH5er1.js → rotate-ccw-DdkrbRAB.js} +1 -1
  132. package/web/assets/selectionActions-BQD2kox1.js +2 -0
  133. package/web/assets/selectionBarSurface-CzUZmJDJ.js +1 -0
  134. package/web/assets/server-Ddu9f1k3.js +1 -0
  135. package/web/assets/sharePage-CNrm2xTC.js +2 -0
  136. package/web/assets/{shareViewer-BzuSyJv_.js → shareViewer-BiMqIBxP.js} +2 -2
  137. package/web/assets/{star-BmywYD3u.js → star-Dxv7XANS.js} +1 -1
  138. package/web/assets/tableSurface-Bly1iCXc.js +1 -0
  139. package/web/assets/{terminal-BlmA_Z1C.js → terminal-CAmmC9cV.js} +1 -1
  140. package/web/assets/{terminalView-SAxITnRW.js → terminalView-lbcBgG0c.js} +1 -1
  141. package/web/assets/theme-CUWFlazV.css +1 -0
  142. package/web/assets/{type-DmIL6FB-.js → type-Dz6rnTvG.js} +1 -1
  143. package/web/assets/{undo-2-yMeXc8Wi.js → undo-2-B7izWNb_.js} +1 -1
  144. package/web/assets/{unitAccount-BPYRAa3m.js → unitAccount-DGwGsmC3.js} +1 -1
  145. package/web/assets/{unitBridge-BNVzai6X.js → unitBridge-CE2yAvm0.js} +1 -1
  146. package/web/assets/{unitCloudTransport-iFweA1xk.js → unitCloudTransport-BGFwkaDM.js} +1 -1
  147. package/web/assets/{unitOwnerAccess-Bggl7bDP.js → unitOwnerAccess-D4nKS6Gg.js} +1 -1
  148. package/web/assets/{unitShim-BP2nBO_k.js → unitShim-2_2hhGxS.js} +3 -3
  149. package/web/assets/{upload-D20PZHXc.js → upload-DqpRRAhG.js} +1 -1
  150. package/web/assets/userSpaces-VFu4s05v.js +1 -0
  151. package/web/assets/viewportLock-3AOdDmwi.js +631 -0
  152. package/web/assets/viewportLock-djvL8fUQ.css +1 -0
  153. package/web/assets/{zoom-in-_TgFOpyv.js → zoom-in-Bf-eKTnH.js} +1 -1
  154. package/web/index.html +2 -2
  155. package/web/assets/ArtificialView-DS97zlMg.js +0 -1
  156. package/web/assets/AutomationBuilder-BsJc8wuC.js +0 -1
  157. package/web/assets/CalendarConfigView-BN8mraSo.js +0 -1
  158. package/web/assets/DashboardGridView-DlFyYfUh.js +0 -17
  159. package/web/assets/ExcalidrawCanvas-TpbzBF-J.js +0 -1
  160. package/web/assets/HomepageView-DnQ_5Obe.css +0 -1
  161. package/web/assets/HomepageView-nzKfbHM-.js +0 -1
  162. package/web/assets/ImageStudioView-Cawr6pGW.js +0 -1
  163. package/web/assets/InlineFiles-DKPH5JHz.js +0 -1
  164. package/web/assets/MarkdownBlock--__nPQGh.css +0 -1
  165. package/web/assets/MarkdownBlock-BHpDy2qQ.js +0 -58
  166. package/web/assets/ModelPill-ChzAM3z1.js +0 -2
  167. package/web/assets/MuseLibraryView-DLuQ_jyV.js +0 -2
  168. package/web/assets/PenRow-BY-MZLDQ.js +0 -1
  169. package/web/assets/ProductView-0ieVL3rY.js +0 -1
  170. package/web/assets/RightPanel-BRexwQ3W.js +0 -4
  171. package/web/assets/RunLocationPicker-BrDfOu8-.css +0 -1
  172. package/web/assets/RunLocationPicker-CadYiE7C.js +0 -43
  173. package/web/assets/UnifiedPage-D7JTfABH.js +0 -68
  174. package/web/assets/appStore-ClD7vq5L.css +0 -1
  175. package/web/assets/appStore-affnJoin.js +0 -3292
  176. package/web/assets/automationListSource-JVBMsMbC.js +0 -1
  177. package/web/assets/codingNavigation-CxdCK78-.js +0 -53
  178. package/web/assets/codingNavigation-_tOR0ell.css +0 -1
  179. package/web/assets/dashboardSurface-BY-AFB-r.js +0 -1
  180. package/web/assets/emoji-BPdA62d7.js +0 -1
  181. package/web/assets/gestures-BwPbZDkU.js +0 -1
  182. package/web/assets/i18n-BMo19xaR.css +0 -1
  183. package/web/assets/index-Y2kzYlZq.js +0 -1
  184. package/web/assets/linkFollow-Msu1XH9v.js +0 -8
  185. package/web/assets/main-DIyFlyfK.js +0 -20
  186. package/web/assets/markdownEditorSurface-Cx2rqFAY.js +0 -3
  187. package/web/assets/minus-CfoZ4oxr.js +0 -1
  188. package/web/assets/mobileEntry-B8JwR53-.js +0 -13
  189. package/web/assets/pageChrome-D-9npbUE.js +0 -1
  190. package/web/assets/phoneList-BQfCJwKF.css +0 -1
  191. package/web/assets/phoneList-DHUia6HT.js +0 -9
  192. package/web/assets/pluginChat-BXuJiMYi.js +0 -2
  193. package/web/assets/sharePage-DYYN5usb.js +0 -2
  194. package/web/assets/tableSurface-21LDYY_G.js +0 -1
  195. package/web/assets/theme-Dgqst5S9.css +0 -1
  196. package/web/assets/userSpaces-CrLrKklx.js +0 -1
  197. package/web/assets/viewportLock-DO1lzA2N.css +0 -1
  198. package/web/assets/viewportLock-tlT6H_Hc.js +0 -629
  199. package/web/assets/workflow-Bd6xBHiT.js +0 -1
@@ -1 +0,0 @@
1
- import{u as U,d as i,j as t,t as K,r as xe,cs as Ge,ct as We}from"./index-BYUntVIZ.js";import{H as Je,p as Qe,c as et,d as tt,s as at,f as ot,h as ke,n as nt,u as rt,C as ue,r as st,i as lt,E as ct,M as N,j as it,k as dt}from"./PenRow-BY-MZLDQ.js";import{G as ut,a3 as ht,fw as pt,bm as He,kT as De,cP as Fe,d$ as mt,s7 as he,s8 as Le,s9 as pe,sa as ft,sb as xt,sc as bt,ej as ze,bq as me,sd as gt,se as fe}from"./appStore-affnJoin.js";import{F as vt,T as yt}from"./type-DmIL6FB-.js";import{P as wt}from"./pencil-DGiTRzW1.js";import{M as Be}from"./minus-CfoZ4oxr.js";import{H as jt}from"./hand-DRu7IJdU.js";import{L as St}from"./lock-kffGfeHt.js";import"./client-BqhpYbYL.js";import"./pen-tool-D_Y9We9x.js";import"./nativeDownload-Udrv_tmU.js";import"./ipc-D7yENkjV.js";const Et=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]],Oe=ut("diamond",Et),oe=["left","mid","right"],M={left:["lock","hand"],mid:["selection","shape","line","freedraw","highlighter","text","eraser"],right:["frame","laser"]},Nt=[...M.left,...M.mid,...M.right],se="amx.boardToolbar",X=new Set;let C=null;const kt=e=>e<9?String(e+1):e===9?"0":null;function $e(e){const a=new Set,d={left:[],mid:[],right:[]},n=e??{};for(const s of oe)for(const o of Array.isArray(n[s])?n[s]:[])typeof o!="string"||!Nt.includes(o)||a.has(o)||(a.add(o),d[s].push(o));for(const s of oe)for(const o of M[s])a.has(o)||d[s].push(o);return d}const q=()=>{if(C)return C;try{const e=localStorage.getItem(se);if(e)return C=$e(JSON.parse(e))}catch{}return C=M},Lt=e=>{C=$e(e);try{localStorage.setItem(se,JSON.stringify(C))}catch{}for(const a of X)a()},zt=()=>{C=M;try{localStorage.removeItem(se)}catch{}for(const e of X)e()},Rt=e=>oe.every(a=>e[a].length===M[a].length&&e[a].every((d,n)=>d===M[a][n])),_e=e=>(X.add(e),()=>X.delete(e));function Ct(e,a,d,n){const s={left:[...e.left],mid:[...e.mid],right:[...e.right]};for(const o of oe){const r=s[o].indexOf(a);r>=0&&s[o].splice(r,1)}return s[d].splice(Math.max(0,Math.min(n,s[d].length)),0,a),s}typeof window<"u"&&window.addEventListener("storage",e=>{if(e.key===se){C=null;for(const a of X)a()}});xe({"boardtoolbar.shapeRectangle":{zh:"矩形",en:"Rectangle"},"boardtoolbar.shapeDiamond":{zh:"菱形",en:"Diamond"},"boardtoolbar.shapeEllipse":{zh:"椭圆",en:"Ellipse"},"boardtoolbar.lineArrow":{zh:"箭头",en:"Arrow"},"boardtoolbar.lineSegment":{zh:"线段",en:"Line"},"boardtoolbar.toolLock":{zh:"保持工具选中",en:"Keep tool selected"},"boardtoolbar.toolHand":{zh:"抓手",en:"Hand"},"boardtoolbar.toolSelection":{zh:"选择",en:"Selection"},"boardtoolbar.toolShape":{zh:"形状",en:"Shape"},"boardtoolbar.toolLine":{zh:"线",en:"Line"},"boardtoolbar.toolFreedraw":{zh:"画笔",en:"Draw"},"boardtoolbar.toolHighlighter":{zh:"荧光笔",en:"Highlighter"},"boardtoolbar.toolText":{zh:"文字",en:"Text"},"boardtoolbar.toolEraser":{zh:"橡皮",en:"Eraser"},"boardtoolbar.toolFrame":{zh:"画框",en:"Frame"},"boardtoolbar.toolLaser":{zh:"激光笔",en:"Laser pointer"}});const ne=["rectangle","diamond","ellipse"],re=["arrow","line"],Mt=()=>({shape:"rectangle",line:"arrow"}),Pt={rectangle:Fe,diamond:Oe,ellipse:De},At={arrow:He,line:Be},Re={get rectangle(){return K("boardtoolbar.shapeRectangle")},get diamond(){return K("boardtoolbar.shapeDiamond")},get ellipse(){return K("boardtoolbar.shapeEllipse")}},Ce={get arrow(){return K("boardtoolbar.lineArrow")},get line(){return K("boardtoolbar.lineSegment")}},It={lock:"boardtoolbar.toolLock",hand:"boardtoolbar.toolHand",selection:"boardtoolbar.toolSelection",shape:"boardtoolbar.toolShape",line:"boardtoolbar.toolLine",freedraw:"boardtoolbar.toolFreedraw",highlighter:"boardtoolbar.toolHighlighter",text:"boardtoolbar.toolText",eraser:"boardtoolbar.toolEraser",frame:"boardtoolbar.toolFrame",laser:"boardtoolbar.toolLaser"};function Ye(e,a,d){const n=a.getAppState();switch(e){case"lock":a.setActiveTool({...n.activeTool,locked:!n.activeTool.locked});return;case"shape":a.setActiveTool({type:d.group.current.shape});return;case"line":a.setActiveTool({type:d.group.current.line});return;case"freedraw":et(a,d.pen),a.setActiveTool({type:"freedraw"});return;case"highlighter":Qe(a,d.pen,"highlighter");return;default:a.setActiveTool({type:e})}}function Tt(e,a){switch(e){case"lock":return St;case"hand":return jt;case"selection":return mt;case"shape":return Pt[a.shape];case"line":return At[a.line];case"freedraw":return wt;case"highlighter":return Je;case"text":return yt;case"eraser":return pt;case"frame":return vt;case"laser":return ht}}function Ht(e,a,d){const n=a.tool;switch(e){case"lock":return a.locked;case"shape":return ne.includes(n);case"line":return re.includes(n);case"freedraw":return n==="freedraw"&&d.active!=="highlighter";case"highlighter":return n==="freedraw"&&d.active==="highlighter";default:return n===e}}const Me=["left","mid","right"];function Dt({api:e,ui:a,refs:d}){const{t:n}=U(),s=i.useSyncExternalStore(_e,q,q),[o,r]=i.useState(null),m=i.useRef(null),b=i.useRef(null),u=o?.layout??s;if(!e)return null;const le=d.group.current,P=d.pen.current,Z=(f,x)=>{const g=b.current;if(!g)return null;let y=null,B=1/0;for(const v of Me){const R=g.querySelector(`[data-seg="${v}"]`);if(!R)continue;const j=R.getBoundingClientRect();if(f>=j.left&&f<=j.right){y=v;break}const J=f<j.left?j.left-f:f-j.right;J<B&&(B=J,y=v)}if(!y)return null;const L=[...g.querySelectorAll(`[data-seg="${y}"] [data-tool]`)];let E=L.length;for(let v=0;v<L.length;v++){const R=L[v].getBoundingClientRect();if(f<R.left+R.width/2){E=v;break}}const z=L.findIndex(v=>v.dataset.tool===x);return z>=0&&z<E&&E--,{seg:y,index:E}},G=(f,x)=>{f.button===0&&(m.current={x:f.clientX,y:f.clientY,id:x,moved:!1},f.currentTarget.setPointerCapture(f.pointerId))},W=f=>{const x=m.current;if(!x||!x.moved&&Math.hypot(f.clientX-x.x,f.clientY-x.y)<5)return;x.moved=!0;const g=Z(f.clientX,x.id);g&&r({id:x.id,layout:Ct(s,x.id,g.seg,g.index)})},A=i.useRef(0),V=f=>{const x=m.current;m.current=null,f.currentTarget.releasePointerCapture?.(f.pointerId),A.current=x?.moved?Date.now():0,x?.moved&&o&&Lt(o.layout),r(null)},F=f=>{if(Date.now()-A.current<400){A.current=0;return}Ye(f,e,d)};return t.jsx("div",{className:"amx-toolbar",ref:b,"data-dragging":o?"":void 0,children:Me.map((f,x)=>t.jsxs("div",{className:"amx-toolbar-seg","data-seg":f,children:[x>0&&t.jsx("span",{className:"amx-toolbar-sep","aria-hidden":!0}),u[f].map((g,y)=>{const B=Tt(g,le),L=Ht(g,a,P),E=f==="mid"?kt(y):null,z=n(It[g]);return t.jsxs("button",{type:"button","data-tool":g,"data-on":L||void 0,"data-drag":o?.id===g||void 0,className:"amx-tool",title:E?`${z} — ${E}`:z,"aria-label":z,"aria-pressed":L,onPointerDown:v=>G(v,g),onPointerMove:W,onPointerUp:V,onClick:()=>F(g),onPointerCancel:()=>{m.current=null,A.current=0,r(null)},children:[t.jsx(B,{size:17}),E&&t.jsx("span",{className:"amx-tool-key",children:E})]},g)})]},f))})}xe({"panelextras.secPen":{zh:"笔",en:"Pen"},"panelextras.secStroke":{zh:"笔触",en:"Stroke"},"panelextras.capRound":{zh:"圆头",en:"Round cap"},"panelextras.capButt":{zh:"方头",en:"Flat cap"},"panelextras.secShape":{zh:"形状",en:"Shape"},"panelextras.secLine":{zh:"线",en:"Line"}});const Ft={rectangle:Fe,diamond:Oe,ellipse:De},Bt={arrow:He,line:Be};function te({title:e,children:a}){return t.jsxs("fieldset",{className:"amx-panelsec",children:[t.jsx("legend",{children:e}),a]})}function Ot({api:e,ui:a,pen:d,group:n}){const{t:s}=U();if(!e)return null;const o=a.tool;if(o==="freedraw"){const r=d.current.active==="highlighter";return t.jsxs(t.Fragment,{children:[t.jsx(te,{title:s("panelextras.secPen"),children:t.jsx(tt,{api:e,ui:a,state:d})}),r&&t.jsx(te,{title:s("panelextras.secStroke"),children:t.jsx("div",{className:"amx-panelrow buttonList",children:[!1,!0].map(m=>{const b=a.capRound===m,u=s(m?"panelextras.capRound":"panelextras.capButt");return t.jsx("label",{className:b?"active":"",title:u,"data-on":b||void 0,onClick:()=>at(e,m),children:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18","aria-label":u,children:t.jsx("line",{x1:"4",y1:"9",x2:"14",y2:"9",stroke:"currentColor",strokeWidth:"7",strokeLinecap:m?"round":"butt"})})},String(m))})})})]})}return ne.includes(o)?t.jsx(te,{title:s("panelextras.secShape"),children:t.jsx("div",{className:"amx-panelrow buttonList",children:ne.map(r=>{const m=Ft[r],b=o===r;return t.jsx("label",{className:b?"active":"",title:Re[r],"data-on":b||void 0,onClick:()=>{n.current.shape=r,e.setActiveTool({type:r})},children:t.jsx(m,{size:16,"aria-label":Re[r]})},r)})})}):re.includes(o)?t.jsx(te,{title:s("panelextras.secLine"),children:t.jsx("div",{className:"amx-panelrow buttonList",children:re.map(r=>{const m=Bt[r],b=o===r;return t.jsx("label",{className:b?"active":"",title:Ce[r],"data-on":b||void 0,onClick:()=>{n.current.line=r,e.setActiveTool({type:r})},children:t.jsx(m,{size:16,"aria-label":Ce[r]})},r)})})}):null}const $t=()=>({tool:"selection",locked:!1,snapshot:null,capRound:null}),_t=(e,a)=>e.tool===a.tool&&e.locked===a.locked&&e.snapshot===a.snapshot&&e.capRound===a.capRound;xe({"excalicanvas.addPage":{zh:"+ 新建页面",en:"+ New page"},"excalicanvas.delBlankPage":{zh:"删掉这张空白页",en:"Delete this blank page"},"excalicanvas.modeFull":{zh:"常规",en:"Standard"},"excalicanvas.modeCompact":{zh:"紧凑",en:"Compact"},"excalicanvas.paper":{zh:"纸张",en:"Paper"},"excalicanvas.paperNone":{zh:"无限",en:"Infinite"},"excalicanvas.portrait":{zh:"纵向",en:"Portrait"},"excalicanvas.landscape":{zh:"横向",en:"Landscape"},"excalicanvas.flow":{zh:"页面排布",en:"Page layout"},"excalicanvas.flowV":{zh:"上下",en:"Top to bottom"},"excalicanvas.flowH":{zh:"左右",en:"Left to right"},"excalicanvas.grid":{zh:"网格",en:"Grid"},"excalicanvas.gridH":{zh:"横线",en:"Horizontal"},"excalicanvas.gridV":{zh:"竖线",en:"Vertical"},"excalicanvas.opacity":{zh:"淡浓",en:"Opacity"},"excalicanvas.uiMode":{zh:"属性面板",en:"Properties panel"},"excalicanvas.allBoards":{zh:"所有白板",en:"All boards"},"excalicanvas.toolbar":{zh:"工具栏",en:"Toolbar"},"excalicanvas.resetOrder":{zh:"恢复默认顺序",en:"Reset to default order"}});const ae=4,Yt="linear-gradient(90deg, var(--amx-grid-line) 0 1px, transparent 1px)",Ut="linear-gradient(180deg, var(--amx-grid-line) 0 1px, transparent 1px)",Pe=(e,a,d)=>Math.min(Math.max(e,a),d),Ae=(e,a)=>(e%a+a)%a;function Ie(e,a,d){const[n,s]=i.useState(null);return i.useEffect(()=>{if(!e)return;let o=null;const r=()=>{const b=e.querySelector(a);if(!b){o&&(o.remove(),o=null,s(null));return}if(o&&o.parentElement===b)return;o?.remove();const u=document.createElement("div");u.className=d,b.insertBefore(u,b.firstChild),o=u,s(u)};r();const m=new MutationObserver(r);return m.observe(e,{childList:!0,subtree:!0}),()=>{m.disconnect(),o?.remove(),s(null)}},[e,a,d]),n}function Vt(e){i.useEffect(()=>{const a=new Map,d=o=>{o.classList.contains("amx-board-portal")||o.classList.add("amx-board-portal"),o.style.zoom!==e&&(o.style.zoom=e)},n=o=>{if(!(o instanceof HTMLElement)||!o.classList.contains("excalidraw")||o.closest(".amx-boardhost")||(d(o),a.has(o)))return;const r=new MutationObserver(()=>d(o));r.observe(o,{attributes:!0,attributeFilter:["class","style"]}),a.set(o,r)};for(const o of[...document.body.children])n(o);const s=new MutationObserver(o=>{for(const r of o){for(const m of r.addedNodes)n(m);for(const m of r.removedNodes)m instanceof HTMLElement&&a.has(m)&&(a.get(m)?.disconnect(),a.delete(m))}});return s.observe(document.body,{childList:!0}),()=>{s.disconnect();for(const o of a.values())o.disconnect()}},[e])}function ia({initialData:e,theme:a,langCode:d,settings:n,onSettings:s,onSceneChange:o,registerApplier:r,viewMode:m=!1}){const{t:b}=U(),[u,le]=i.useState(null),P=i.useRef(null),Z=i.useRef([]),G=i.useRef(null),W=i.useRef(null),A=i.useRef(null),V=i.useRef(!1),[F,f]=i.useState(null),[x,g]=i.useState(null),y=i.useMemo(()=>he(n)?Le(n,x):{min:0,max:0},[n,x]),B=i.useMemo(()=>Array.from({length:y.max-y.min+1},(c,l)=>y.min+l),[y]),L=i.useMemo(()=>Le({...n,pageFirst:0,pageLast:0},x),[n,x]),E=i.useSyncExternalStore(ot,ke,ke),z=i.useRef(nt()),v=i.useRef(Mt()),R=i.useMemo(()=>({pen:z,group:v}),[]),[j,J]=i.useState($t),[Ue,Ve]=i.useState(""),[be,ge]=i.useState(null),ve=Ie(be,".App-toolbar","amx-toolbar-slot"),ye=Ie(be,".Island > .selected-shape-actions, .Island > .compact-shape-actions, .Island.compact-shape-actions","amx-panel-slot");Vt(Ue),rt(u,j.tool,j.snapshot,z),i.useEffect(()=>{ne.includes(j.tool)&&(v.current.shape=j.tool),re.includes(j.tool)&&(v.current.line=j.tool)},[j.tool]),i.useEffect(()=>{if(!u)return;const c=l=>{if(l.metaKey||l.ctrlKey||l.altKey||!/^[0-9]$/.test(l.key))return;const h=P.current?.querySelector(".excalidraw"),p=l.target;if(!h||!p||!h.contains(p)||p.isContentEditable||p.tagName==="INPUT"||p.tagName==="TEXTAREA")return;const S=q().mid[l.key==="0"?9:Number(l.key)-1];S&&(l.preventDefault(),l.stopImmediatePropagation(),Ye(S,u,R))};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[u,R]),i.useEffect(()=>{u?.setDesktopUIMode(E)},[u,E]),i.useEffect(()=>{if(!(!u||!r))return r(c=>{const l=u.getSceneElementsIncludingDeleted(),h=Ge(l,c.elements??[]);if(We(h,l))return;u.updateScene({elements:st(h,null),captureUpdate:ue.NEVER});const p=Object.values(c.files??{});p.length&&u.addFiles(p)})},[u,r]),i.useEffect(()=>{const c=u&&P.current?.querySelector(".excalidraw");if(!c)return;const l=document.createElement("div");return l.style.display="contents",c.insertBefore(l,c.firstChild),f(l),ge(c),()=>{l.remove(),f(null),ge(null)}},[u]);const O=i.useCallback(c=>{const l=G.current,h=Z.current.filter(w=>!!w);if(!l||!h.length)return;const p=c.zoom.value,S=he(n),I=n.gridV*p,Q=n.gridH*p,ee=[],ie=[],de=[],Ke=S||I<ae?0:Ae(c.scrollX*p,I),Xe=S||Q<ae?0:Ae(c.scrollY*p,Q);I>=ae&&(ee.push(Yt),ie.push(`${I}px 100%`),de.push(`${Ke}px 0px`)),Q>=ae&&(ee.push(Ut),ie.push(`100% ${Q}px`),de.push(`0px ${Xe}px`));for(const w of h)w.style.backgroundImage=ee.join(", "),w.style.backgroundSize=ie.join(", "),w.style.backgroundPosition=de.join(", "),w.style.opacity=n.gridOpacity>=100?"":String(n.gridOpacity/100),w.style.display=ee.length||S?"":"none";if(!S){Object.assign(h[0].style,{left:"0px",top:"0px",width:"100%",height:"100%"}),l.style.display="none";return}const je=(w,k,T)=>{if(!w)return;const H=(k.x+c.scrollX)*p,Y=(k.y+c.scrollY)*p,D=22,qe=n.flow==="h"?T?H+k.w*p+D:H-D:H+k.w*p/2,Ze=n.flow==="h"?Y+k.h*p/2:T?Y+k.h*p+D:Y-D;w.style.left=`${qe}px`,w.style.top=`${Ze}px`},Se=[];for(let w=0;w<h.length;w++){const k=pe(n,y.min+w);if(!k)continue;const T=(k.x+c.scrollX)*p,H=(k.y+c.scrollY)*p,Y=k.w*p,D=k.h*p;Object.assign(h[w].style,{left:`${T}px`,top:`${H}px`,width:`${Y}px`,height:`${D}px`}),Se.push(`M${T.toFixed(1)} ${H.toFixed(1)}H${(T+Y).toFixed(1)}V${(H+D).toFixed(1)}H${T.toFixed(1)}Z`)}const Ee=pe(n,y.min),Ne=pe(n,y.max);Ee&&je(W.current,Ee,!1),Ne&&je(A.current,Ne,!0),l.style.display="",l.style.clipPath=`path(evenodd,"M0 0H${l.offsetWidth}V${l.offsetHeight}H0Z ${Se.join(" ")}")`},[n,y]),$=i.useCallback(c=>{if(!u||V.current)return c;const l=u.getAppState();if(l.cursorButton==="down")return c;const h=ft(n,{scrollX:c.scrollX,scrollY:c.scrollY,zoom:c.zoom.value,width:l.width,height:l.height},x);if(!h)return c;V.current=!0;try{u.updateScene({appState:{scrollX:h.scrollX,scrollY:h.scrollY,zoom:{value:h.zoom}},captureUpdate:ue.NEVER})}finally{V.current=!1}return{scrollX:h.scrollX,scrollY:h.scrollY,zoom:{value:h.zoom}}},[u,n,x]),ce=i.useCallback(c=>{const l=xt(c);g(h=>h&&l&&h.minX===l.minX&&h.minY===l.minY&&h.maxX===l.maxX&&h.maxY===l.maxY?h:l)},[]),we=i.useRef(n.flow);i.useEffect(()=>{const c=we.current,l=n.flow;if(we.current=l,c===l||!u||!n.paper)return;const h=u.getSceneElements();h.length&&u.updateScene({elements:h.map(p=>{const S=bt(n,c,l,p.x,p.y);return S.x===p.x&&S.y===p.y?p:lt(p,{x:S.x,y:S.y})}),captureUpdate:ue.IMMEDIATELY})},[u,n]),i.useEffect(()=>{!u||!F||(ce(u.getSceneElements()),O($(u.getAppState())))},[u,F,O,$,ce]);const _=i.useCallback(()=>{const c=P.current;if(!c)return;const l=c.parentElement?.currentCSSZoom??1,h=Math.abs(l-1)>1e-6?String(1/l):"";c.style.zoom!==h&&(c.style.zoom=h),Ve(p=>p===h?p:h)},[]);return i.useEffect(()=>(_(),window.addEventListener(ze,_),()=>window.removeEventListener(ze,_)),[_]),i.useEffect(()=>{const c=P.current;if(!c||!u||typeof ResizeObserver>"u")return;const l=new ResizeObserver(()=>{_(),O($(u.getAppState()))});return l.observe(c),()=>l.disconnect()},[u,O,$,_]),t.jsxs("div",{className:"amx-boardhost",ref:P,children:[t.jsx(ct,{onExcalidrawAPI:le,initialData:e,theme:a,langCode:d,viewModeEnabled:m,onScrollChange:(c,l,h)=>O($({scrollX:c,scrollY:l,zoom:h})),onChange:(c,l,h)=>{ce(c),O($(l));const p=l.currentStrokeOptions,S={tool:l.activeTool.type,locked:!!l.activeTool.locked,snapshot:l.resetCustomPen??null,capRound:p?!!p.options?.start?.cap:null};J(I=>_t(I,S)?I:S),o(dt(c,l,h,"local"))},children:t.jsxs(N,{children:[t.jsx(N.DefaultItems.LoadScene,{}),t.jsx(N.DefaultItems.SaveToActiveFile,{}),t.jsx(N.DefaultItems.Export,{}),t.jsx(N.DefaultItems.SaveAsImage,{}),t.jsx(N.DefaultItems.SearchMenu,{}),t.jsx(N.DefaultItems.Help,{}),t.jsx(N.DefaultItems.ClearCanvas,{}),t.jsx(N.Separator,{}),t.jsx(N.DefaultItems.ToggleTheme,{allowSystemTheme:!1}),t.jsx(N.DefaultItems.ChangeCanvasBackground,{}),t.jsx(N.Separator,{}),t.jsx(N.ItemCustom,{children:t.jsx(qt,{settings:n,onSettings:s,uiMode:E,onUiMode:it})})]})}),ve&&me.createPortal(t.jsx(Dt,{api:u,ui:j,refs:R}),ve),ye&&me.createPortal(t.jsx(Ot,{api:u,ui:j,pen:z,group:v}),ye),F&&me.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"amx-matte",ref:G,onWheel:Kt}),B.map((c,l)=>t.jsx("div",{className:"amx-grid","data-page":c,ref:h=>{Z.current[l]=h}},c)),!!he(n)&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"amx-pageadd","data-end":"before","data-flow":n.flow,ref:W,children:[t.jsx("button",{onClick:()=>s({pageFirst:n.pageFirst-1}),children:b("excalicanvas.addPage")}),n.pageFirst<L.min&&t.jsx("button",{className:"amx-pageadd-del",title:b("excalicanvas.delBlankPage"),onClick:()=>s({pageFirst:n.pageFirst+1}),children:"−"})]}),t.jsxs("div",{className:"amx-pageadd","data-end":"after","data-flow":n.flow,ref:A,children:[t.jsx("button",{onClick:()=>s({pageLast:n.pageLast+1}),children:b("excalicanvas.addPage")}),n.pageLast>L.max&&t.jsx("button",{className:"amx-pageadd-del",title:b("excalicanvas.delBlankPage"),onClick:()=>s({pageLast:n.pageLast-1}),children:"−"})]})]})]}),F)]})}function Kt(e){const a=e.currentTarget.closest(".excalidraw")?.querySelector("canvas.excalidraw__canvas.interactive");a&&(e.preventDefault(),a.dispatchEvent(new WheelEvent("wheel",{deltaX:e.deltaX,deltaY:e.deltaY,deltaMode:e.deltaMode,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,bubbles:!0,cancelable:!0})))}const Xt=[{id:"full",labelKey:"excalicanvas.modeFull"},{id:"compact",labelKey:"excalicanvas.modeCompact"}];function qt({settings:e,onSettings:a,uiMode:d,onUiMode:n}){const{t:s}=U(),o=a;return t.jsxs("div",{className:"amx-bs",children:[t.jsx("div",{className:"amx-bs-h",children:s("excalicanvas.paper")}),t.jsxs("div",{className:"amx-bs-row",children:[t.jsx("button",{className:"amx-bs-chip","data-on":!e.paper||void 0,onClick:()=>o({paper:null}),children:s("excalicanvas.paperNone")}),gt.map(r=>t.jsx("button",{className:"amx-bs-chip","data-on":e.paper===r||void 0,onClick:()=>o({paper:r}),children:r},r))]}),e.paper&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"amx-bs-row",children:[t.jsx("button",{className:"amx-bs-chip","data-on":!e.landscape||void 0,onClick:()=>o({landscape:!1}),children:s("excalicanvas.portrait")}),t.jsx("button",{className:"amx-bs-chip","data-on":e.landscape||void 0,onClick:()=>o({landscape:!0}),children:s("excalicanvas.landscape")})]}),t.jsx("div",{className:"amx-bs-h",children:s("excalicanvas.flow")}),t.jsxs("div",{className:"amx-bs-row",children:[t.jsx("button",{className:"amx-bs-chip","data-on":e.flow==="v"||void 0,onClick:()=>o({flow:"v"}),children:s("excalicanvas.flowV")}),t.jsx("button",{className:"amx-bs-chip","data-on":e.flow==="h"||void 0,onClick:()=>o({flow:"h"}),children:s("excalicanvas.flowH")})]})]}),t.jsx("div",{className:"amx-bs-h",children:s("excalicanvas.grid")}),t.jsx(Te,{label:s("excalicanvas.gridH"),value:e.gridH,onChange:r=>o({gridH:r})}),t.jsx(Te,{label:s("excalicanvas.gridV"),value:e.gridV,onChange:r=>o({gridV:r})}),t.jsx(Gt,{value:e.gridOpacity,disabled:e.gridH<=0&&e.gridV<=0,onCommit:r=>o({gridOpacity:r})}),t.jsxs("div",{className:"amx-bs-h",children:[s("excalicanvas.uiMode")," ",t.jsx("span",{className:"amx-bs-note",children:s("excalicanvas.allBoards")})]}),t.jsx("div",{className:"amx-bs-row",children:Xt.map(r=>t.jsx("button",{className:"amx-bs-chip","data-on":d===r.id||void 0,onClick:()=>n(r.id),children:s(r.labelKey)},r.id))}),t.jsx(Zt,{})]})}function Zt(){const{t:e}=U(),a=i.useSyncExternalStore(_e,q,q);return Rt(a)?null:t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"amx-bs-h",children:[e("excalicanvas.toolbar")," ",t.jsx("span",{className:"amx-bs-note",children:e("excalicanvas.allBoards")})]}),t.jsx("div",{className:"amx-bs-row",children:t.jsx("button",{className:"amx-bs-chip",onClick:()=>zt(),children:e("excalicanvas.resetOrder")})})]})}function Gt({value:e,disabled:a,onCommit:d}){const{t:n}=U(),[s,o]=i.useState(e);return i.useEffect(()=>o(e),[e]),t.jsxs("label",{className:"amx-bs-check",children:[t.jsx("span",{className:"amx-bs-lbl",children:n("excalicanvas.opacity")}),t.jsx("input",{className:"amx-bs-range",type:"range",min:10,max:100,step:5,disabled:a,value:s,onChange:r=>{const m=Number(r.target.value);o(m);for(const b of r.currentTarget.closest(".excalidraw")?.querySelectorAll(".amx-grid")??[])b.style.opacity=m>=100?"":String(m/100)},onPointerUp:()=>d(s),onKeyUp:()=>d(s)}),t.jsxs("span",{className:"amx-bs-note",children:[s,"%"]})]})}function Te({label:e,value:a,onChange:d}){const[n,s]=i.useState(String(a||fe));i.useEffect(()=>{a>0&&s(String(a))},[a]);const o=()=>{const r=Math.round(Number(n)),m=Number.isFinite(r)&&r>0?Pe(r,4,400):fe;s(String(m)),a>0&&m!==a&&d(m)};return t.jsxs("label",{className:"amx-bs-check",children:[t.jsx("input",{type:"checkbox",checked:a>0,onChange:r=>d(r.target.checked?Pe(Math.round(Number(n))||fe,4,400):0)}),t.jsx("span",{className:"amx-bs-lbl",children:e}),t.jsx("input",{className:"amx-bs-num",type:"number",min:4,max:400,disabled:a<=0,value:n,onChange:r=>s(r.target.value),onBlur:o,onKeyDown:r=>{r.key==="Enter"&&o()}}),t.jsx("span",{className:"amx-bs-note",children:"px"})]})}export{ia as default};
@@ -1 +0,0 @@
1
- @font-face{font-family:Dancing Script;font-style:normal;font-weight:600;font-display:swap;src:url(./DancingScript-Bold-latin-CWNX0RqN.woff2) format("woff2")}.hp-root{position:relative;box-sizing:border-box;height:100%;overflow:clip;display:flex;--hp-padding-block: clamp(24px, 5vh, 48px);padding:calc(var(--hp-chrome-top, 0px) + var(--hp-padding-block)) 24px calc(var(--hp-chrome-bottom, 0px) + var(--hp-padding-block));isolation:isolate;background:var(--bg);--hp-glass-tint: color-mix(in srgb, var(--bg-card) 46%, transparent);--hp-glass-thick-tint: color-mix(in srgb, var(--bg-card) 58%, transparent);--hp-glass-sheen: var(--gl-sheen, linear-gradient(145deg, color-mix(in srgb, var(--bg-card) 20%, transparent), transparent 48%, color-mix(in srgb, var(--accent-ink) 4%, transparent)));--hp-glass-filter: var(--gl-blur-float, blur(40px) saturate(160%))}.hp-wallpaper,.hp-wallpaper-art,.hp-wallpaper-edge,.hp-wallpaper-tone,.hp-glow{position:absolute;inset:0;pointer-events:none}.hp-wallpaper{z-index:-5;background-position:center;background-size:cover;transform:scale(1.001);transition:transform .52s var(--ease-spring),filter .42s var(--ease-out)}.hp-root:not([data-wallpaper=true]) .hp-wallpaper{background:radial-gradient(ellipse 72% 58% at 12% 4%,color-mix(in srgb,var(--accent-ink) 11%,transparent),transparent 72%),radial-gradient(ellipse 62% 68% at 92% 92%,color-mix(in srgb,var(--accent-ink) 7%,var(--bg-card)),transparent 76%),linear-gradient(145deg,color-mix(in srgb,var(--bg) 94%,var(--accent-ink) 6%),var(--bg) 48%,color-mix(in srgb,var(--bg) 96%,var(--bg-card) 4%))}.hp-wallpaper-art{z-index:-4;overflow:hidden;opacity:.78;transition:opacity var(--duration-slow) var(--ease-out),transform .52s var(--ease-spring),filter .42s var(--ease-out)}.hp-wallpaper-art:before,.hp-wallpaper-art:after,.hp-theme-preview:before,.hp-theme-preview:after{content:"";position:absolute;pointer-events:none}.hp-root[data-wallpaper=true] .hp-wallpaper-art{opacity:0}.hp-root[data-theme-preset=rings] .hp-wallpaper-art,.hp-theme-preview[data-preset=rings]{background:radial-gradient(circle at 76% 27%,color-mix(in srgb,var(--accent-ink) 13%,transparent) 0 7%,transparent 7.4%),repeating-radial-gradient(circle at 76% 27%,transparent 0 54px,color-mix(in srgb,var(--accent-ink) 16%,transparent) 55px 56px,transparent 57px 94px)}.hp-root[data-theme-preset=rings] .hp-wallpaper-art{-webkit-mask-image:linear-gradient(115deg,transparent 8%,#000 48%,transparent 94%);mask-image:linear-gradient(115deg,transparent 8%,#000 48%,transparent 94%)}.hp-root[data-theme-preset=rings] .hp-wallpaper-art:before,.hp-theme-preview[data-preset=rings]:before{width:54%;height:70%;right:-9%;top:-16%;border:1px solid color-mix(in srgb,var(--accent-ink) 28%,transparent);border-radius:50%;transform:rotate(-24deg)}.hp-root[data-theme-preset=topography] .hp-wallpaper-art,.hp-theme-preview[data-preset=topography]{background:repeating-radial-gradient(ellipse at 9% 92%,transparent 0 34px,color-mix(in srgb,var(--accent-ink) 15%,transparent) 35px 36px,transparent 37px 66px)}.hp-root[data-theme-preset=topography] .hp-wallpaper-art{-webkit-mask-image:linear-gradient(35deg,#000 2%,rgba(0,0,0,.78) 48%,transparent 88%);mask-image:linear-gradient(35deg,#000 2%,rgba(0,0,0,.78) 48%,transparent 88%)}.hp-root[data-theme-preset=topography] .hp-wallpaper-art:after,.hp-theme-preview[data-preset=topography]:after{width:46%;height:38%;left:3%;bottom:5%;border:1px solid color-mix(in srgb,var(--accent-ink) 26%,transparent);border-radius:48% 58% 44% 62%;transform:rotate(-9deg)}.hp-root[data-theme-preset=weave] .hp-wallpaper-art,.hp-theme-preview[data-preset=weave]{background:repeating-linear-gradient(31deg,transparent 0 47px,color-mix(in srgb,var(--accent-ink) 12%,transparent) 48px 49px,transparent 50px 96px),repeating-linear-gradient(-31deg,transparent 0 63px,color-mix(in srgb,var(--border) 52%,transparent) 64px 65px,transparent 66px 128px)}.hp-root[data-theme-preset=weave] .hp-wallpaper-art{-webkit-mask-image:radial-gradient(ellipse 68% 72% at 50% 48%,#000 8%,rgba(0,0,0,.74) 58%,transparent 100%);mask-image:radial-gradient(ellipse 68% 72% at 50% 48%,#000 8%,rgba(0,0,0,.74) 58%,transparent 100%)}.hp-root[data-theme-preset=hack2gate] .hp-wallpaper,.hp-theme-preview[data-preset=hack2gate]{background-image:url(./hack2gate-light-DRKq9tyS.jpg)}html.dark .hp-root[data-theme-preset=hack2gate] .hp-wallpaper,html.dark .hp-theme-preview[data-preset=hack2gate]{background-image:url(./hack2gate-dark-Dx2RtDRI.jpg)}.hp-theme-preview[data-preset=hack2gate]{background-size:cover;background-position:center}.hp-wallpaper-edge{z-index:-3;opacity:.46;background:linear-gradient(to right,color-mix(in srgb,var(--bg) 92%,transparent),transparent 18%,transparent 82%,color-mix(in srgb,var(--bg) 92%,transparent)),linear-gradient(to bottom,color-mix(in srgb,var(--bg) 82%,transparent),transparent 20%,transparent 72%,color-mix(in srgb,var(--bg) 94%,transparent));mask-image:radial-gradient(ellipse 74% 76% at center,transparent 39%,rgba(0,0,0,.58) 74%,#000 100%);-webkit-mask-image:radial-gradient(ellipse 74% 76% at center,transparent 39%,rgba(0,0,0,.58) 74%,#000 100%);backdrop-filter:blur(14px) saturate(118%);-webkit-backdrop-filter:blur(14px) saturate(118%);transition:opacity var(--duration-slow) var(--ease-out)}.hp-root[data-wallpaper=true] .hp-wallpaper-edge{opacity:1;backdrop-filter:blur(24px) saturate(128%);-webkit-backdrop-filter:blur(24px) saturate(128%)}.hp-root[data-wallpaper=true][data-vignette=false] .hp-wallpaper-edge{opacity:.64}.hp-wallpaper-tone{z-index:-2;opacity:0;background:var(--hp-center-scrim, linear-gradient(transparent, transparent)),linear-gradient(to bottom,color-mix(in srgb,var(--bg) 24%,transparent),transparent 34%),linear-gradient(to right,color-mix(in srgb,var(--bg) 24%,transparent),transparent 15%,transparent 85%,color-mix(in srgb,var(--bg) 24%,transparent)),radial-gradient(ellipse at center,transparent 36%,color-mix(in srgb,var(--bg) 64%,transparent) 100%);transition:opacity var(--duration-slow) var(--ease-out)}.hp-root[data-wallpaper=true] .hp-wallpaper-tone{opacity:1}.hp-root[data-wallpaper=true][data-vignette=false] .hp-wallpaper-tone{opacity:.36}.hp-root[data-vignette=true]{--hp-center-scrim: radial-gradient(ellipse 46% 40% at 50% 56%, color-mix(in srgb, var(--bg) 40%, transparent), transparent 78%)}.hp-glow{z-index:-1;background:var(--glow, none)}.hp-root[data-focus-blur=true].hp-composer-focused .hp-wallpaper,.hp-root[data-focus-blur=true].hp-composer-focused .hp-wallpaper-art,.hp-root[data-focus-blur=true].hp-layer-focused .hp-wallpaper,.hp-root[data-focus-blur=true].hp-layer-focused .hp-wallpaper-art,.hp-root[data-focus-blur=true].hp-secondary-open .hp-wallpaper{filter:blur(8px) brightness(.86);transform:scale(1.045)}.hp-root[data-focus-blur=true].hp-secondary-open .hp-wallpaper{filter:blur(15px) brightness(.8) saturate(.9);transform:scale(1.065)}.hp-root[data-focus-blur=true].hp-secondary-open .hp-wallpaper-art{filter:blur(8px) brightness(.82) saturate(.9);transform:scale(1.045)}.hp-wallpaper-button{position:absolute;z-index:5;top:calc(var(--hp-chrome-top, 0px) + 16px);right:16px;width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--bg-card);color:var(--text-muted);box-shadow:var(--icon-shadow);cursor:pointer;transition:color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-spring)}.hp-wallpaper-button:hover,.hp-wallpaper-button.on{color:var(--text);background:var(--bg-hover);transform:scale(1.05)}.hp-root .hp-wallpaper-button{background:color-mix(in srgb,var(--bg-card) 64%,transparent);backdrop-filter:blur(22px) saturate(145%);-webkit-backdrop-filter:blur(22px) saturate(145%)}.hp-wallpaper-file{display:none}.hp-wallpaper-credit{position:absolute;z-index:2;right:18px;bottom:12px;max-width:min(420px,54%);overflow:hidden;color:var(--text-light);font-size:var(--ui-font-caption, 11px);line-height:1.3;opacity:.58;text-overflow:ellipsis;white-space:nowrap}.hp-stack{position:relative;width:min(840px,100%);margin:auto;display:flex;flex-direction:column;align-items:center;gap:22px;transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.hp-title,.hp-composer,.hp-spaces{transition:opacity .32s var(--ease-out),transform .36s var(--ease-spring)}.hp-composer-focused .hp-title{opacity:.58;transform:translateY(-5px) scale(.985)}.hp-composer-focused .hp-composer{transform:translateY(-2px) scale(1.012)}.hp-composer-focused .hp-spaces{opacity:.74;transform:translateY(5px) scale(.988)}.hp-layer-focused .hp-stack{opacity:.18;transform:scale(.965)}.hp-secondary-open .hp-stack{opacity:0;transform:scale(.955);pointer-events:none}.hp-stack.leaving{opacity:0;transform:scale(.985)}@keyframes hp-rise{0%{transform:translateY(10px)}to{transform:none}}.hp-title,.hp-composer,.hp-spaces{animation:hp-rise var(--duration-slow) var(--ease-out) backwards}.hp-composer{animation-delay:60ms}.hp-spaces{animation-delay:.12s}.hp-title{text-align:center;-webkit-user-select:none;user-select:none}.hp-brand{margin-bottom:3px;color:var(--text);opacity:.38;font-family:Dancing Script,Snell Roundhand,Segoe Script,cursive;font-size:clamp(30px,4vw,42px);font-weight:700;line-height:1.2}.hp-clock{color:var(--text);font-size:clamp(48px,6vw,58px);font-weight:300;font-variant-numeric:tabular-nums;letter-spacing:-.035em;line-height:1}.hp-date{margin-top:9px;color:var(--text-muted);font-size:var(--ui-font-meta, 12px)}.hp-greet{margin-top:3px;color:var(--text-light);font-size:var(--ui-font-body, 13px)}.hp-root[data-wallpaper=true] .hp-brand{opacity:.62}.hp-root[data-wallpaper=true] .hp-date,.hp-root[data-wallpaper=true] .hp-greet{color:var(--text);opacity:.7}.hp-composer{width:100%}.hp-projectbar{display:flex;align-items:center;padding:0 4px 6px}.hp-composer .t2c-inner{width:100%;max-width:none;padding:0}.hp-composer .t2c-card{box-shadow:var(--card-shadow)}.hp-spaces{box-sizing:border-box;width:100%;padding:10px;border:var(--border-width) solid transparent;border-radius:var(--radius-lg);background:transparent}.hp-root .hp-composer .t2c-card{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;isolation:isolate}.hp-root .hp-composer .t2c-card:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--hp-glass-sheen),var(--hp-glass-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter)}.hp-root[data-wallpaper=true] .hp-spaces{border-color:transparent;background:var(--hp-glass-sheen),var(--hp-glass-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter)}.hp-root .hp-composer .t2c-card.dragover{border-color:var(--accent-ink)}html[data-glass=off] .hp-root .hp-composer .t2c-card:before,html[data-glass=off] .hp-root[data-wallpaper=true] .hp-spaces,html[data-glass=off] .hp-root .hp-organizer-panel:before,html[data-glass=off] .hp-root .hp-folder-panel:before,html[data-glass=off] .hp-root .hp-organizer-grid .hp-tile-icon,html[data-glass=off] .hp-root .hp-organizer-new>span,html[data-glass=off] .hp-root .hp-wallpaper-button,html[data-glass=off] .hp-root .hp-wallpaper-edge,html[data-glass=off] .hp-root .hp-folder-head,html[data-glass=off] .hp-root .hp-organizer-head,html[data-glass=off] .hp-root .hp-wallpaper-sheet{background:var(--bg-card);backdrop-filter:none;-webkit-backdrop-filter:none}.hp-root .hp-composer .engine-picker-hint,.hp-root .hp-composer .agent-select-team{position:relative;isolation:isolate;padding:2px 10px;border-radius:var(--radius-pill)}.hp-root .hp-composer .project-pill{position:relative;isolation:isolate}.hp-root .hp-composer .engine-picker-hint:before,.hp-root .hp-composer .agent-select-team:before,.hp-root .hp-composer .project-pill:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:color-mix(in srgb,var(--bg-card) 64%,transparent);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter)}html[data-glass=off] .hp-root .hp-composer .engine-picker-hint:before,html[data-glass=off] .hp-root .hp-composer .agent-select-team:before,html[data-glass=off] .hp-root .hp-composer .project-pill:before{background:var(--bg-card);backdrop-filter:none;-webkit-backdrop-filter:none}.hp-root .hp-composer .engine-picker-hint.is-default{display:none}.hp-space-row{width:100%;min-width:0;display:flex;align-items:stretch;gap:5px}.hp-pinned-zone{box-sizing:border-box;flex:0 1 auto;width:max-content;min-width:170px;max-width:min(42%,350px);display:flex;align-items:flex-start;gap:4px;padding:2px;overflow-x:auto;overscroll-behavior-x:contain;border:var(--border-width) solid transparent;border-radius:var(--radius-md);transition:background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out)}.hp-pinned-zone[data-over=true]{border-color:color-mix(in srgb,var(--accent-ink) 50%,transparent);background:color-mix(in srgb,var(--accent-light) 68%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent-ink) 12%,transparent)}.hp-space-divider{flex:0 0 1px;align-self:stretch;min-height:54px;margin:10px 5px;border-radius:var(--radius-pill, 999px);background:color-mix(in srgb,var(--border-strong) 68%,transparent)}.hp-space-main{flex:1 1 0;min-width:0;display:flex;overflow-x:auto;overscroll-behavior-x:contain}.hp-pinned-zone .hp-tile,.hp-space-main .hp-tile{flex:0 0 82px}.hp-pinned-action{cursor:pointer;touch-action:auto}.hp-pinned-action:active{cursor:pointer}.hp-dock{display:flex;flex-wrap:nowrap;align-items:flex-start;justify-content:flex-start;gap:4px}.hp-tile{position:relative;box-sizing:border-box;width:82px;min-height:78px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:8px 5px 7px;border:var(--border-width) solid transparent;border-radius:var(--radius-md);background:transparent;color:var(--text-muted);box-shadow:none;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;transition:transform var(--duration-fast) var(--ease-spring),color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out),opacity var(--duration-fast) var(--ease-out)}.hp-tile:hover{color:var(--text);background:var(--bg-hover);transform:translateY(-2px)}.hp-tile:active{cursor:grabbing;transform:scale(.97)}.hp-tile.dragging{opacity:.16;cursor:grabbing}.hp-tile-icon{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-md);background:var(--overlay-light, color-mix(in srgb, var(--text) 7%, transparent));color:var(--text-light);transition:transform var(--duration-fast) var(--ease-spring),background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.hp-tile:hover .hp-tile-icon{background:var(--overlay-medium, var(--bg-hover));color:var(--text)}.hp-tile-name{width:100%;overflow:hidden;color:inherit;font-size:var(--ui-font-caption, 11px);line-height:1.2;text-align:center;text-overflow:ellipsis;white-space:nowrap}.hp-tile[data-over]{border-color:var(--accent);box-shadow:0 0 0 .5px var(--accent)}.hp-folder[data-over] .hp-tile-icon{transform:scale(1.12);background:color-mix(in srgb,var(--accent) 16%,var(--overlay-light))}.hp-fpreview{display:grid;grid-template-columns:repeat(2,12px);grid-auto-rows:12px;place-content:center;gap:2px;background:var(--overlay-medium, var(--bg-hover))}.hp-fmini{display:inline-flex;align-items:center;justify-content:center;opacity:.82}.hp-folder.on{color:var(--text);background:var(--bg-hover)}.hp-folder-count,.hp-more-count{position:absolute;top:5px;right:6px;min-width:17px;height:17px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px;border-radius:var(--radius-pill, 999px);background:var(--bg-card);color:var(--text-faint);font-size:var(--ui-font-caption, 11px);font-variant-numeric:tabular-nums}.hp-more{cursor:pointer}.hp-more-count{color:var(--accent-ink)}.hp-drag-overlay{pointer-events:none;cursor:grabbing;background:var(--bg-card);border-color:var(--accent);box-shadow:var(--card-shadow);opacity:.96;transform:rotate(1deg) scale(1.04)}.hp-spaces-empty{padding:20px 12px 22px;color:var(--text-faint);font-size:var(--ui-font-meta, 12px);text-align:center}@keyframes hp-stage-in{0%{opacity:0}to{opacity:1}}@keyframes hp-folder-open{0%{transform:translate(var(--hp-folder-dx),var(--hp-folder-dy)) scale(.24)}to{transform:none}}.hp-folder-stage,.hp-organizer-stage,.hp-wallpaper-stage{position:absolute;z-index:20;inset:0;display:grid;place-items:center;padding:calc(var(--hp-chrome-top, 0px) + 24px) 24px calc(var(--hp-chrome-bottom, 0px) + 24px)}.hp-folder-stage:before,.hp-organizer-stage:before,.hp-wallpaper-stage:before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:color-mix(in srgb,var(--overlay-scrim) 72%,transparent);animation:hp-stage-in var(--duration-fast) var(--ease-out) both}.hp-folder-stage:before,.hp-organizer-stage:before{background:color-mix(in srgb,var(--overlay-scrim) 36%,transparent)}.hp-organizer-stage{z-index:20;overflow:auto}.hp-folder-panel,.hp-organizer-panel{position:relative;isolation:isolate;border-radius:var(--radius-chat-surface);box-shadow:var(--card-shadow)}.hp-root .hp-folder-panel:before,.hp-root .hp-organizer-panel:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--hp-glass-sheen),var(--hp-glass-thick-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter)}.hp-folder-panel{box-sizing:border-box;width:min(680px,100%);min-height:min(330px,calc(100% - 16px));max-height:min(620px,calc(100% - 16px));overflow:hidden;display:flex;flex-direction:column;padding:18px;border:0;background:transparent;transform-origin:center;animation:hp-folder-open .36s var(--ease-spring) backwards}.hp-root .hp-wallpaper-sheet{border-color:color-mix(in srgb,var(--border) 76%,transparent);background:color-mix(in srgb,var(--bg-card) 70%,transparent);backdrop-filter:blur(34px) saturate(155%);-webkit-backdrop-filter:blur(34px) saturate(155%)}.hp-folder-head{flex:none;width:min(480px,calc(100% - 24px));margin-inline:auto;padding:6px 7px 6px 9px;border:var(--border-width) solid color-mix(in srgb,var(--border) 76%,transparent);border-radius:var(--radius-pill, 999px);background:color-mix(in srgb,var(--bg-card) 58%,transparent);backdrop-filter:blur(28px) saturate(150%);-webkit-backdrop-filter:blur(28px) saturate(150%)}.hp-folder-head,.hp-wallpaper-head{display:flex;align-items:center;justify-content:space-between;gap:18px}.hp-folder-head>button,.hp-wallpaper-head>button{width:30px;height:30px;flex:none;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:transparent;color:var(--text-muted);cursor:pointer}.hp-folder-head>button:hover,.hp-wallpaper-head>button:hover{color:var(--text);background:var(--bg-hover)}.hp-folder-identity{min-width:0;display:flex;align-items:center;gap:12px}.hp-folder-identity>span:last-child{min-width:0;display:flex;flex-direction:column}.hp-folder-identity strong{overflow:hidden;color:var(--text);font-size:var(--ui-font-heading, 14px);text-overflow:ellipsis;white-space:nowrap}.hp-folder-identity small{color:var(--text-faint);font-size:var(--ui-font-caption, 11px)}.hp-folder-hero{width:44px;height:44px;flex:none;display:inline-flex;align-items:center;justify-content:center}.hp-folder-hero>.hp-tile-icon{width:44px;height:44px}.hp-folder-hero>.hp-tile-name,.hp-folder-hero>.hp-folder-count{display:none}.hp-folder-grid{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-wrap:wrap;align-content:safe center;align-items:center;justify-content:center;gap:18px;padding:26px 4px 20px}.hp-folder-app{width:96px;min-width:0;min-height:104px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:10px 7px;border:var(--border-width) solid transparent;border-radius:var(--radius-md);background:transparent;color:var(--text-light);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:grab;touch-action:none;transition:color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-spring),opacity var(--duration-fast) var(--ease-out)}.hp-folder-app:hover{color:var(--text);background:var(--bg-hover);transform:translateY(-3px)}.hp-folder-app:active{cursor:grabbing}.hp-folder-app.dragging{opacity:.18}.hp-folder-app>span:last-child{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hp-folder-app-icon{width:48px;height:48px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-md);background:var(--overlay-light)}.hp-folder-empty{margin:auto;max-width:270px;color:var(--text-faint);font-size:var(--ui-font-meta, 12px);line-height:1.6;text-align:center}.hp-folder-panel footer{flex:none;padding-top:12px;color:var(--text-ghost);font-size:var(--ui-font-caption, 11px);text-align:center}.hp-organizer-panel{box-sizing:border-box;width:min(590px,100%);max-height:calc(100% - 8px);overflow:hidden;display:flex;flex-direction:column;align-items:stretch;padding:8px 10px 7px;animation:hp-rise .36s var(--ease-spring) backwards}.hp-organizer-head{min-height:42px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:14px;width:min(440px,calc(100% - 24px));margin:0 auto 9px;padding:5px 7px 5px 8px;border:var(--border-width) solid color-mix(in srgb,var(--border) 76%,transparent);border-radius:var(--radius-pill, 999px);background:color-mix(in srgb,var(--bg-card) 58%,transparent);backdrop-filter:blur(28px) saturate(150%);-webkit-backdrop-filter:blur(28px) saturate(150%)}.hp-organizer-head>div{min-width:0;display:flex;align-items:center;gap:9px}.hp-organizer-head>div>span:nth-child(2){min-width:0;display:flex;flex-direction:column}.hp-organizer-head strong{color:var(--text);font-size:var(--ui-font-meta, 12px);line-height:1.3}.hp-organizer-head small{color:var(--text-faint);font-size:var(--ui-font-caption, 11px)}.hp-organizer-mark{width:30px;height:30px;flex:none;display:grid;place-items:center;border-radius:50%;background:var(--overlay-light);color:var(--text-light)}.hp-organizer-head>button{width:30px;height:30px;flex:none;display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:var(--text-muted);cursor:pointer}.hp-organizer-head>button:hover{color:var(--text);background:var(--bg-hover)}.hp-organizer-grid{box-sizing:border-box;display:grid;grid-template-columns:repeat(6,78px);grid-auto-rows:78px;align-content:start;justify-content:center;justify-items:center;gap:6px 8px;min-height:0;max-height:414px;overflow-y:auto;overscroll-behavior:contain;padding:5px 8px;scroll-padding-block:5px}.hp-organizer-grid .hp-tile,.hp-organizer-new{width:78px;min-height:78px;padding:5px 3px;gap:5px}.hp-organizer-grid .hp-tile{color:var(--text-light)}.hp-organizer-grid .hp-tile-icon,.hp-organizer-new>span{width:40px;height:40px;background:color-mix(in srgb,var(--bg-card) 54%,transparent);backdrop-filter:blur(18px) saturate(135%);-webkit-backdrop-filter:blur(18px) saturate(135%);box-shadow:var(--icon-shadow)}.hp-organizer-grid .hp-tile:hover{color:var(--text)}.hp-organizer-new{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:5px 3px;border:var(--border-width) solid transparent;border-radius:var(--radius-md);background:transparent;color:var(--text-muted);font:inherit;cursor:pointer;transition:color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-spring)}.hp-organizer-new>span{display:grid;place-items:center;border-radius:var(--radius-md);box-shadow:none}.hp-organizer-new small{max-width:100%;overflow:hidden;font-size:var(--ui-font-caption, 11px);text-overflow:ellipsis;white-space:nowrap}.hp-organizer-new:hover{color:var(--text);background:var(--bg-hover);transform:translateY(-2px)}.hp-organizer-grid .hp-tile-name,.hp-organizer-new small{font-size:var(--ui-font-caption, 11px)}.hp-organizer-panel>footer{flex:none;padding-top:7px;color:var(--text-ghost);font-size:var(--ui-font-caption, 11px);text-align:center}.hp-wallpaper-stage{z-index:30;justify-items:end}.hp-wallpaper-sheet{box-sizing:border-box;width:min(420px,100%);max-height:100%;overflow:auto;padding:18px;border:var(--border-width) solid var(--border);border-radius:calc(var(--radius-lg) + 4px);background:var(--bg-card);box-shadow:var(--card-shadow);animation:hp-rise var(--duration-slow) var(--ease-out) both}.hp-wallpaper-head>div{min-width:0;display:flex;flex-direction:column}.hp-wallpaper-head strong{color:var(--text);font-size:var(--ui-font-heading, 14px)}.hp-wallpaper-head span{color:var(--text-faint);font-size:var(--ui-font-caption, 11px);line-height:1.4}.hp-wallpaper-sources{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;margin-top:17px;padding:3px;border:var(--border-width) solid var(--border);border-radius:var(--radius-md);background:var(--overlay-subtle)}.hp-wallpaper-sources button{min-width:0;height:30px;display:inline-flex;align-items:center;justify-content:center;gap:4px;border:0;border-radius:calc(var(--radius-md) - 3px);background:transparent;color:var(--text-muted);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:pointer}.hp-wallpaper-sources button:hover{color:var(--text)}.hp-wallpaper-sources button.on{background:var(--bg-card);color:var(--text);box-shadow:var(--btn-shadow)}.hp-wallpaper-loading,.hp-wallpaper-error{min-height:126px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:20px;color:var(--text-faint);font-size:var(--ui-font-caption, 11px);line-height:1.5;text-align:center}.hp-wallpaper-error{min-height:48px;color:var(--danger)}.hp-theme-presets{padding-top:13px}.hp-theme-presets>p{margin:0 1px 9px;color:var(--text-faint);font-size:var(--ui-font-caption, 11px);line-height:1.45}.hp-theme-presets>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.hp-theme-presets button{position:relative;min-width:0;display:grid;grid-template-rows:auto 22px;overflow:hidden;padding:0;border:var(--border-width) solid transparent;border-radius:var(--radius-sm);background:var(--overlay-subtle);color:var(--text-muted);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:pointer;transition:transform var(--duration-fast) var(--ease-spring),border-color var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.hp-theme-presets button:hover{color:var(--text);transform:translateY(-2px)}.hp-theme-presets button.on{border-color:color-mix(in srgb,var(--accent-ink) 72%,var(--border));color:var(--text)}.hp-theme-presets button>span:nth-child(2){align-self:center;padding-inline:7px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.hp-theme-presets button>i{position:absolute;top:6px;right:6px;width:18px;height:18px;display:grid;place-items:center;border-radius:50%;background:var(--action-fill);color:var(--on-action);font-style:normal}.hp-theme-preview{position:relative;min-height:76px;overflow:hidden;background-color:color-mix(in srgb,var(--bg) 94%,var(--accent-ink) 6%)}.hp-wallpaper-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 1px 9px}.hp-wallpaper-switch,.hp-wallpaper-refresh{display:inline-flex;align-items:center;gap:7px;border:0;background:transparent;color:var(--text-muted);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:pointer}.hp-wallpaper-switch>span{position:relative;width:27px;height:16px;border-radius:var(--radius-pill, 999px);background:var(--overlay-strong)}.hp-wallpaper-switch>span:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:var(--bg-card);transition:transform var(--duration-fast) var(--ease-spring)}.hp-wallpaper-switch.on>span{background:var(--action-fill)}.hp-wallpaper-switch.on>span:after{transform:translate(11px)}.hp-wallpaper-refresh:hover{color:var(--text)}.hp-wallpaper-refresh:disabled{opacity:.45;cursor:wait}.hp-wallpaper-refresh:disabled svg{animation:hp-spin .85s linear infinite}@keyframes hp-spin{to{transform:rotate(1turn)}}.hp-wallpaper-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}.hp-wallpaper-grid button{position:relative;aspect-ratio:5 / 3;overflow:hidden;padding:0;border:var(--border-width) solid transparent;border-radius:var(--radius-sm);background:var(--overlay-light);cursor:pointer;transition:transform var(--duration-fast) var(--ease-spring),border-color var(--duration-fast) var(--ease-out)}.hp-wallpaper-grid button:hover{transform:translateY(-2px)}.hp-wallpaper-grid button.on{border-color:var(--accent-ink)}.hp-wallpaper-grid img{width:100%;height:100%;display:block;object-fit:cover}.hp-wallpaper-grid button>span{position:absolute;right:5px;bottom:5px;width:19px;height:19px;display:grid;place-items:center;border-radius:50%;background:var(--action-fill);color:var(--on-action)}.hp-wallpaper-custom{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;padding:14px 1px 6px}.hp-wallpaper-custom-preview{grid-column:1 / -1;aspect-ratio:16 / 7;border-radius:var(--radius-md);background-color:var(--overlay-light);background-position:center;background-size:cover}.hp-wallpaper-custom>div:nth-child(2){min-width:0;display:flex;flex-direction:column}.hp-wallpaper-custom strong{color:var(--text);font-size:var(--ui-font-caption, 11px)}.hp-wallpaper-custom span{color:var(--text-faint);font-size:var(--ui-font-caption, 11px)}.hp-wallpaper-custom button{min-height:29px;display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:0 8px;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:transparent;color:var(--text-muted);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:pointer}.hp-wallpaper-custom button:hover{color:var(--text);background:var(--bg-hover)}.hp-wallpaper-options{margin-top:14px;padding-top:8px;border-top:var(--border-width) solid var(--border)}.hp-wallpaper-options>button{width:100%;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:7px 3px;border:0;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer}.hp-wallpaper-options>button>span{min-width:0;display:flex;flex-direction:column}.hp-wallpaper-options strong{font-size:var(--ui-font-caption, 11px)}.hp-wallpaper-options small{color:var(--text-faint);font-size:var(--ui-font-caption, 11px);font-weight:400}.hp-wallpaper-options i{position:relative;width:27px;height:16px;flex:none;border-radius:var(--radius-pill, 999px);background:var(--overlay-strong)}.hp-wallpaper-options i:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:var(--bg-card);transition:transform var(--duration-fast) var(--ease-spring)}.hp-wallpaper-options button.on i{background:var(--action-fill)}.hp-wallpaper-options button.on i:after{transform:translate(11px)}@media(max-width:620px){.hp-root{padding-inline:12px;--hp-padding-block: 24px}.hp-wallpaper-button{top:calc(var(--hp-chrome-top, 0px) + 10px);right:10px}.hp-stack{gap:18px}.hp-clock{font-size:46px}.hp-brand{font-size:30px}.hp-dock{gap:2px}.hp-tile{width:70px;min-height:74px}.hp-pinned-zone{min-width:146px;max-width:48%;gap:2px}.hp-pinned-zone .hp-tile,.hp-space-main .hp-tile{flex-basis:70px}.hp-space-divider{margin-inline:3px}.hp-composer .t2c-card{padding-inline:11px}.hp-folder-stage,.hp-organizer-stage,.hp-wallpaper-stage{padding:calc(var(--hp-chrome-top, 0px) + 10px) 10px calc(var(--hp-chrome-bottom, 0px) + 10px)}.hp-organizer-panel{width:min(390px,100%);padding-inline:2px}.hp-organizer-grid{grid-template-columns:repeat(4,72px);grid-auto-rows:76px;gap:4px 6px}.hp-organizer-grid .hp-tile,.hp-organizer-new{width:72px;min-height:76px}.hp-folder-panel{min-height:300px;padding:14px}.hp-folder-grid{gap:5px}.hp-folder-app{width:82px;min-height:92px}.hp-wallpaper-sheet{width:100%;padding:15px}.hp-wallpaper-credit{display:none}}@media(max-width:390px){.hp-organizer-panel{width:min(300px,100%)}.hp-organizer-grid{grid-template-columns:repeat(3,72px)}.hp-theme-presets>div{grid-template-columns:1fr}}@media(max-height:700px){.hp-root{--hp-padding-block: 20px}.hp-stack{gap:16px}.hp-brand{font-size:28px}.hp-clock{font-size:44px}.hp-date{margin-top:6px}}@media(max-height:520px){.hp-root{--hp-padding-block: 12px}.hp-stack{gap:10px}.hp-brand{display:none}.hp-clock{font-size:32px}.hp-date{margin-top:3px;font-size:var(--ui-font-caption, 11px)}.hp-greet{display:none}}@media(prefers-reduced-motion:reduce){.hp-title,.hp-composer,.hp-spaces,.hp-folder-panel,.hp-folder-stage,.hp-folder-stage:before,.hp-organizer-panel,.hp-organizer-stage,.hp-organizer-stage:before,.hp-wallpaper-sheet,.hp-wallpaper-stage,.hp-wallpaper-stage:before{animation:none}.hp-stack,.hp-wallpaper,.hp-wallpaper-art,.hp-tile,.hp-tile-icon,.hp-folder-app{transition-duration:.01ms!important}.hp-root[data-focus-blur=true].hp-composer-focused .hp-wallpaper,.hp-root[data-focus-blur=true].hp-composer-focused .hp-wallpaper-art,.hp-root[data-focus-blur=true].hp-layer-focused .hp-wallpaper,.hp-root[data-focus-blur=true].hp-layer-focused .hp-wallpaper-art,.hp-root[data-focus-blur=true].hp-secondary-open .hp-wallpaper{filter:none;transform:none}.hp-tile:hover,.hp-tile:active,.hp-folder-app:hover,.hp-drag-overlay{transform:none}}.hp-still .hp-title,.hp-still .hp-composer,.hp-still .hp-spaces,.hp-still .hp-folder-panel,.hp-still .hp-folder-stage,.hp-still .hp-folder-stage:before,.hp-still .hp-organizer-panel,.hp-still .hp-organizer-stage,.hp-still .hp-organizer-stage:before,.hp-still .hp-wallpaper-sheet,.hp-still .hp-wallpaper-stage,.hp-still .hp-wallpaper-stage:before{animation:none}.hp-still[data-focus-blur=true].hp-composer-focused .hp-wallpaper,.hp-still[data-focus-blur=true].hp-composer-focused .hp-wallpaper-art,.hp-still[data-focus-blur=true].hp-layer-focused .hp-wallpaper,.hp-still[data-focus-blur=true].hp-layer-focused .hp-wallpaper-art,.hp-still[data-focus-blur=true].hp-secondary-open .hp-wallpaper{filter:none;transform:none}.hp-still .hp-tile,.hp-still .hp-tile-icon,.hp-still .hp-folder-app{transition-duration:.01ms!important}.hp-root.hp-phone{--hp-dp: calc(1px / var(--uiz, 1));--hp-padding-block: calc(18 * var(--hp-dp));padding-inline:calc(18 * var(--hp-dp))}.hp-phone .hp-stack{align-items:stretch;height:100%;margin:0;gap:calc(14 * var(--hp-dp))}.hp-phone .hp-title{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:calc(6 * var(--hp-dp));text-align:left;margin-bottom:auto}.hp-phone .hp-brand{flex:0 0 100%;order:1;margin:0 0 calc(4 * var(--hp-dp));font-size:var(--ui-font-title, 16px)}.hp-phone .hp-greet{flex:0 0 100%;order:2;margin:0;color:var(--text);font-size:var(--ui-font-display, 20px);font-weight:600;line-height:1.25}.hp-phone .hp-date{order:3;margin-top:calc(6 * var(--hp-dp));font-size:var(--ui-font-body, 13px)}.hp-phone .hp-clock{order:4;font-size:var(--ui-font-body, 13px);font-weight:400;letter-spacing:0;line-height:inherit;color:var(--text-muted)}.hp-phone .hp-clock:before{content:"·";margin-right:calc(6 * var(--hp-dp))}.hp-root.hp-phone[data-wallpaper=true] .hp-greet{opacity:1}.hp-root.hp-phone[data-wallpaper=true] .hp-clock{color:var(--text);opacity:.7}.hp-phone .hp-cards{order:2;display:grid;grid-template-columns:1fr 1fr;gap:calc(12 * var(--hp-dp))}.hp-phone .hp-card{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;align-content:space-between;column-gap:calc(10 * var(--hp-dp));row-gap:calc(8 * var(--hp-dp));min-height:calc(104 * var(--hp-dp));padding:calc(16 * var(--hp-dp));border:0;border-radius:var(--radius-lg, 16px);background:var(--hp-glass-sheen),var(--hp-glass-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter);box-shadow:var(--card-shadow);color:var(--text);font-family:var(--font-ui);text-align:left}.hp-phone .hp-card:active{transform:scale(.98)}.hp-phone .hp-card-icon{display:inline-flex;align-self:center;color:var(--text-muted)}.hp-phone .hp-card-icon>svg{width:calc(24 * var(--hp-dp));height:calc(24 * var(--hp-dp))}.hp-phone .hp-card-name{align-self:center;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ui-font-heading, 14px);font-weight:600}.hp-phone .hp-card-status{grid-column:1 / -1;min-width:0;min-height:1.3em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ui-font-caption, 11px);line-height:1.3;color:var(--text-muted)}.hp-phone .hp-pill{order:3;display:flex;align-items:center;gap:calc(12 * var(--hp-dp));height:calc(54 * var(--hp-dp));padding:0 calc(8 * var(--hp-dp)) 0 calc(20 * var(--hp-dp));border:0;border-radius:var(--radius-pill, 999px);background:var(--hp-glass-sheen),var(--hp-glass-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter);box-shadow:var(--card-shadow);color:var(--text-muted);font-family:var(--font-ui);font-size:var(--ui-font-body, 13px);text-align:left}.hp-phone .hp-pill-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hp-phone .hp-pill-text[data-draft]{color:var(--text)}.hp-phone .hp-pill-mic{align-self:stretch;display:grid;place-items:center;width:calc(44 * var(--hp-dp));margin-inline:calc(-8 * var(--hp-dp))}.hp-phone .hp-pill-mic>svg{width:calc(20 * var(--hp-dp));height:calc(20 * var(--hp-dp))}.hp-phone .hp-pill-send{display:grid;place-items:center;width:calc(38 * var(--hp-dp));height:calc(38 * var(--hp-dp));border-radius:50%;background:var(--accent);color:var(--on-accent, #fff)}.hp-phone .hp-pill-send>svg{width:calc(18 * var(--hp-dp));height:calc(18 * var(--hp-dp))}.hp-phone .hp-composer{order:3}.hp-root.hp-phone:not(.hp-composer-focused) .hp-composer{display:none}.hp-root.hp-phone.hp-composer-focused .hp-pill,.hp-root.hp-phone.hp-composer-focused .hp-cards{display:none}.hp-root.hp-phone.hp-composer-focused .hp-composer{transform:none}.hp-root.hp-phone.hp-composer-focused .hp-title{opacity:1;transform:none}
@@ -1 +0,0 @@
1
- import{u as en,d as g,j as e,r as Dn}from"./index-BYUntVIZ.js";import{G as nn,l as An,a6 as ve,m as ne,fO as On,kx as Ue,ky as In,kz as Wn,kA as zn,Z as Tn,cQ as Rn,bI as Ln,fS as me,kB as ge,kC as fe,kD as Ve,aF as xe,aK as je,aP as _n,kE as sn,ai as Fn,aj as $n,b as Bn,u as F,aT as tn,hA as Hn,kF as Un,kG as Vn,kH as qn,ia as Gn,kI as Kn,ib as Jn,kJ as Yn,bq as Zn,ap as O,kK as Xn,kL as Qn,kM as on,kN as Ce,a5 as es,fV as qe,am as Ge,e2 as ns,dY as ss,ab as we,q as Ke,fC as ts,cW as os,fq as as,kO as rs,an as Je,al as is,kP as ls,a$ as cs,af as ds}from"./appStore-affnJoin.js";import"./client-BqhpYbYL.js";import{a as ps,d as us}from"./phoneList-DHUia6HT.js";import{a5 as hs,a6 as ms,a7 as gs,C as fs,H as xs}from"./RunLocationPicker-CadYiE7C.js";import{U as js}from"./upload-D20PZHXc.js";import{F as ws}from"./folder-plus-BJKT1Pqg.js";import{L as bs}from"./log-out-B5gEP0tF.js";import{P as vs}from"./pencil-DGiTRzW1.js";import"./nativeDownload-Udrv_tmU.js";import"./ipc-D7yENkjV.js";import"./codeStudioStore-Dq5i8nbE.js";import"./RightPanel-BRexwQ3W.js";import"./book-open-CcXCToyx.js";import"./folder-CCZqnwRc.js";import"./ModelPill-ChzAM3z1.js";import"./create-BgJN5qsj.js";import"./approvalText-Cy2UAUAQ.js";import"./message-square-plus-DxBPIhPS.js";import"./hand-DRu7IJdU.js";import"./pageChrome-D-9npbUE.js";import"./emoji-BPdA62d7.js";const Cs=[["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ss=nn("folder-minus",Cs);const ks=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],Ye=nn("grid-2x2",ks),an="forsion.homepage.wallpaper.v1",ys=32*1024*1024,rn={source:"theme",themePreset:"rings",bingDaily:!0,focusBlur:!0,vignette:!0,bing:null},z=t=>typeof t=="string"?t:"";function Ze(t){const s=z(t);try{const i=new URL(s);return i.protocol==="https:"&&(i.hostname==="www.bing.com"||i.hostname.endsWith(".bing.com"))?i.toString():""}catch{return""}}function Se(t){if(!t||typeof t!="object")return null;const s=t,i=Ze(s.url);if(!i)return null;const d=Ze(s.thumbnailUrl)||i,l=z(s.startDate);return{id:z(s.id)||l||i,url:i,thumbnailUrl:d,title:z(s.title),copyright:z(s.copyright),startDate:l}}function Ns(t){if(!t||typeof t!="object")return{...rn};const s=t,i=s.source==="bing"||s.source==="custom"?s.source:"theme",d=s.themePreset==="topography"||s.themePreset==="weave"||s.themePreset==="hack2gate"?s.themePreset:"rings";return{source:i,themePreset:d,bingDaily:s.bingDaily!==!1,focusBlur:s.focusBlur!==!1,vignette:s.vignette!==!1,bing:Se(s.bing)}}function Ms(){try{return Ns(JSON.parse(localStorage.getItem(an)||"null"))}catch{return{...rn}}}function Ps(t){try{localStorage.setItem(an,JSON.stringify(t))}catch{}}function Es(t){return(Array.isArray(t)?t:t&&typeof t=="object"&&Array.isArray(t.images)?t.images:[]).flatMap(i=>{if(!i||typeof i!="object")return[];const d=i,l=z(d.urlbase),o=z(d.url),c=l?`https://www.bing.com${l}_UHD.jpg`:o.startsWith("/")?`https://www.bing.com${o}`:o,x=l?`https://www.bing.com${l}_400x240.jpg`:c,u=Se({id:z(d.startdate)||l||c,url:c,thumbnailUrl:x,title:d.title,copyright:d.copyright,startDate:d.startdate});return u?[u]:[]})}async function Ds(t){if(window.tangu?.wallpaperListBing){const i=await window.tangu.wallpaperListBing(t==="zh"?"zh-CN":"en-US",8);if(!i.ok)throw new Error(i.error||"Bing wallpaper unavailable");return i.items.map(Se).filter(d=>!!d)}const s=await fetch(`/api/wallpaper/daily?mkt=${t==="zh"?"zh-CN":"en-US"}&n=8&idx=0`);if(!s.ok)throw new Error(`HTTP ${s.status}`);return Es(await s.json())}const As="forsion-homepage",se="wallpaper",ke="custom";function Os(){return new Promise((t,s)=>{const i=indexedDB.open(As,1);i.onupgradeneeded=()=>{i.result.objectStoreNames.contains(se)||i.result.createObjectStore(se)},i.onsuccess=()=>t(i.result),i.onerror=()=>s(i.error||new Error("IndexedDB unavailable"))})}async function ye(t,s){const i=await Os();try{return await new Promise((d,l)=>{const o=i.transaction(se,t),c=s(o.objectStore(se));let x;c.onsuccess=()=>{x=c.result},c.onerror=()=>l(c.error||o.error||new Error("Wallpaper storage failed")),o.oncomplete=()=>d(x),o.onerror=()=>l(o.error||new Error("Wallpaper storage failed")),o.onabort=()=>l(o.error||new Error("Wallpaper storage aborted"))})}finally{i.close()}}async function Is(){const t=await ye("readonly",s=>s.get(ke));return t instanceof Blob&&t.type.startsWith("image/")?t:null}async function Ws(t){if(!t.type.startsWith("image/"))throw new Error("NOT_IMAGE");if(t.size>ys)throw new Error("TOO_LARGE");await ye("readwrite",s=>s.put(t,ke))}async function zs(){await ye("readwrite",t=>t.delete(ke))}const te="home",Ts=140,Rs=6,ln="forsion.homepage.pinned-spaces.v1",be="homepage:pinned-spaces",V="homepage:pinned:",Ls=["rb-market","rb-achievements"],_s=["rings","topography","weave","hack2gate"],Xe=t=>{const s=Xn(t);return s.length?s:sn(t)};function Fs({onDispatch:t,onStartCall:s,onInputModeChange:i}){const d=Bn(a=>a.vaultRoot),l=ve(a=>a.activeSpaceId),o=F(tn(a=>({cfg:a.cfg,desktopConfig:a.desktopConfig,desktopMode:a.desktopMode,homeDir:a.homeDir,defaultWsDir:a.defaultWsDir,modelsResp:a.modelsResp,newChatWs:a.newChatWs,newChatCfg:a.newChatCfg,newChatModel:a.newChatModel,sessionMode:a.sessionMode,setSessionMode:a.setSessionMode,engines:a.engines,engineCaps:a.engineCaps,agentDefs:a.agentDefs,defaultAgentSlug:a.defaultAgentSlug,skillsList:a.skillsList,connState:a.connState,voiceOnByAgent:a.voiceOnByAgent,ensureEngineCaps:a.ensureEngineCaps,refreshVoiceMode:a.refreshVoiceMode,setSessionModel:a.setSessionModel,setNewChatCfg:a.setNewChatCfg,setSessionThinking:a.setSessionThinking,setDefaultModel:a.setDefaultModel,setModelContextWindow:a.setModelContextWindow,setVoiceMode:a.setVoiceMode,setExecConfig:a.setExecConfig,openSettings:a.openSettings,setNewChatWs:a.setNewChatWs,addLocalWorkspace:a.addLocalWorkspace,addCloudProject:a.addCloudProject,workspaces:a.workspaces,sessions:a.sessions,archivedSessions:a.archivedSessions,cloudProjects:a.cloudProjects,channelWorkspaces:a.channelWorkspaces,tr:a.tr})));Hn();const c=Un(o),x=g.useMemo(()=>o.workspaces(),[o.workspaces,o.sessions,o.archivedSessions,o.cloudProjects,o.channelWorkspaces,o.defaultWsDir,o.homeDir,o.tr,d]),u=Vn(o.sessionMode,c),m=u==="chat"||c.kind==="cloud"||c.kind==="rootless",f=g.useMemo(()=>qn(Gn(Kn({execMode:m?"sandbox":"host",...Jn(o.desktopConfig,!m,u),cwd:m?void 0:c.path||void 0,...o.newChatCfg},u),d)),[m,u,o.desktopConfig,o.newChatCfg,c.path,d]),S=Yn(o)||"",I=o.modelsResp?.models?o.modelsResp.models.filter(a=>(a.modelType||"llm")==="llm"&&(!m||a.source==="forsion")):null,v=f.agentSlug||o.defaultAgentSlug,N=v?!!o.voiceOnByAgent[v]:!1;return g.useEffect(()=>{o.ensureEngineCaps(f.engineId||void 0)},[f.engineId,o.ensureEngineCaps]),g.useEffect(()=>{v&&o.refreshVoiceMode(v)},[v,o.refreshVoiceMode]),e.jsxs("div",{className:"hp-composer",onClick:a=>a.stopPropagation(),onPointerDownCapture:()=>i(!0),onPointerDown:a=>a.stopPropagation(),onFocusCapture:()=>i(!0),onBlurCapture:a=>{a.relatedTarget instanceof Node&&!a.currentTarget.contains(a.relatedTarget)&&i(!1)},onKeyDownCapture:a=>{a.key==="Escape"&&a.target.matches?.(".t2c-ta")&&(a.target.blur(),i(!1))},children:[e.jsx("div",{className:"newchat-pickers",children:e.jsx(hs,{sessionId:null,cfg:f})}),e.jsxs("div",{className:"hp-projectbar",children:[e.jsx(ms,{}),e.jsx(gs,{workspaces:x,value:c.key,onChange:o.setNewChatWs,onAddProject:window.tangu?.pickDirectory?()=>{o.addLocalWorkspace()}:void 0,onAddCloudProject:a=>{o.addCloudProject(a)}})]}),e.jsx(fs,{sessionId:null,liveOwner:l==="home",prepareLiveSession:s,autoFocus:!1,disabled:o.connState!=="ok",running:!1,execConfig:f,models:I,modelsResponse:o.modelsResp,modelId:S,onModelChange:a=>o.setSessionModel(a,null),engines:o.engines,engineId:f.engineId,engineModels:f.engineId?o.engineCaps[f.engineId]?.models??[]:void 0,engineModelId:f.engineModelId,onEngineModelChange:a=>o.setNewChatCfg(w=>({...w,engineModelId:a||void 0})),engineCommands:f.engineId?o.engineCaps[f.engineId]?.commands??[]:void 0,thinkingLevel:f.thinkingLevel,ultra:f.ultra,onThinkingChange:(a,w)=>o.setSessionThinking(a,null,void 0,w),defaultModelIds:{backgroundModelId:o.desktopConfig?.backgroundModelId||"",imageModelId:o.cfg.imageModelId||"",visionModelId:o.cfg.visionModelId||""},onDefaultModelChange:o.setDefaultModel,onContextWindowChange:(a,w)=>{o.setModelContextWindow(a,w)},maxIterations:f.maxIterations,onMaxIterationsChange:a=>o.setNewChatCfg(w=>({...w,maxIterations:a})),verifyCommand:f.verifyCommand,onVerifyCommandChange:a=>o.setNewChatCfg(w=>({...w,verifyCommand:a||void 0})),planMode:f.planMode,onPlanModeChange:a=>o.setNewChatCfg(w=>({...w,planMode:a})),preset:f.preset,onPresetChange:a=>o.setSessionMode(a),voiceMode:N,onVoiceModeChange:v?a=>{o.setVoiceMode(v,a)}:void 0,groupChat:f.groupChat,groupAgents:f.groupAgents,groupTempAgents:f.groupTempAgents,onGroupChange:a=>o.setNewChatCfg(w=>({...w,...a})),skills:o.skillsList,agents:o.agentDefs,currentAgentSlug:v,onOpenSettings:()=>o.openSettings("skills"),onExecConfigChange:a=>o.setExecConfig(a,null),onSend:(a,w,q,T,k)=>t(a,w,q,T,k),onStop:()=>{},autoRefFromMain:!1})]})}function $({tile:t}){return t.kind==="space"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hp-tile-icon",children:t.space.icon&&e.jsx(t.space.icon,{size:21})}),e.jsx("span",{className:"hp-tile-name",children:O(t.space.name)})]}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"hp-tile-icon hp-fpreview",children:[t.members.slice(0,4).map(s=>e.jsx("span",{className:"hp-fmini",children:s.icon&&e.jsx(s.icon,{size:11})},s.id)),t.members.length===0&&e.jsx(es,{size:19})]}),e.jsx("span",{className:"hp-tile-name",children:t.folder.name}),e.jsx("span",{className:"hp-folder-count",children:t.members.length})]})}function $s(){try{const t=JSON.parse(localStorage.getItem(ln)||"[]");return Array.isArray(t)?[...new Set(t.filter(s=>typeof s=="string"&&s!==te))]:[]}catch{return[]}}function Bs({item:t}){const s=t.icon,i=t.tooltip?O(t.tooltip):"";return e.jsxs("button",{type:"button",className:"hp-tile hp-pinned-action","data-fixed-id":t.id,draggable:!1,"aria-label":i||void 0,title:i,onClick:t.onClick,children:[e.jsx("span",{className:"hp-tile-icon",children:s&&e.jsx(s,{size:21})}),e.jsx("span",{className:"hp-tile-name",children:i})]})}function Hs({space:t,onLaunch:s}){const i=`${V}${t.id}`,{attributes:d,listeners:l,setNodeRef:o,transform:c,isDragging:x}=ls({id:i}),u={kind:"space",id:`space:${t.id}`,space:t};return e.jsx("button",{ref:o,type:"button",className:`hp-tile hp-pinned-space${x?" dragging":""}`,"data-space-id":t.id,style:{transform:Ce.Transform.toString(c)},"aria-label":O(t.name),title:O(t.name),...d,...l,onClick:()=>{x||s(t.id)},children:e.jsx($,{tile:u})})}function Us({actions:t,spaces:s,onLaunch:i,labelText:d}){const{isOver:l,setNodeRef:o}=Qn({id:be});return e.jsxs("div",{ref:o,className:"hp-pinned-zone","data-over":l||void 0,"aria-label":d,children:[t.map(c=>e.jsx(Bs,{item:c},c.id)),s.map(c=>e.jsx(Hs,{space:c,onLaunch:i},c.id))]})}function Qe({tile:t,over:s,open:i,onOpen:d,onLaunch:l,onMenu:o}){const{attributes:c,listeners:x,setNodeRef:u,transform:m,transition:f,isDragging:S}=on({id:t.id}),I=t.kind==="space"?O(t.space.name):t.folder.name,v={transform:Ce.Transform.toString(m),transition:f?`${f}, color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out)`:void 0};return e.jsx("button",{ref:u,type:"button",style:v,className:`hp-tile${t.kind==="folder"?" hp-folder":""}${S?" dragging":""}${i?" on":""}`,"data-id":t.id,"data-over":s||void 0,"aria-label":I,title:I,...c,...x,onClick:N=>{S||(t.kind==="folder"?(N.stopPropagation(),d(N,t.id)):l(t.space.id))},onContextMenu:t.kind==="folder"?N=>o(N,t.id):void 0,children:e.jsx($,{tile:t})})}function Vs({member:t,onLaunch:s,onMenu:i}){const d=`space:${t.id}`,{attributes:l,listeners:o,setNodeRef:c,transform:x,transition:u,isDragging:m}=on({id:d});return e.jsxs("button",{ref:c,type:"button",className:`hp-folder-app${m?" dragging":""}`,style:{transform:Ce.Transform.toString(x),transition:u},"data-id":d,title:O(t.name),...l,...o,onClick:()=>{m||s(t.id)},onContextMenu:f=>i(f,d),children:[e.jsx("span",{className:"hp-folder-app-icon",children:t.icon&&e.jsx(t.icon,{size:24})}),e.jsx("span",{children:O(t.name)})]})}function qs(t){const s=()=>{const l=new Date;return{time:ss(l),date:ns(l,{locale:t}),hour:l.getHours()}},[i,d]=g.useState(s);return g.useEffect(()=>{const l=()=>d(c=>{const x=s();return x.time===c.time&&x.date===c.date?c:x});l();const o=setInterval(l,1e3);return()=>clearInterval(o)},[t]),i}function Gs(){const[t,s]=g.useState("");return g.useEffect(()=>{let i=!0;const d=()=>{window.tangu?.authStatus?.().then(o=>{i&&s(o?.loggedIn&&(o.nickname||o.username)||"")}).catch(()=>{})};d();const l=window.tangu?.onAuthChanged?.(d);return()=>{i=!1,l?.()}},[]),t}function Ks(){const t=ve(u=>u.spaces),s=ne(u=>u.order),d=ne(u=>u.folders).filter(u=>u.zone==="top"),l=u=>t.find(m=>`space:${m.id}`===u),o=new Set(d.flatMap(u=>u.items)),c=$n([...t.map(u=>`space:${u.id}`),...d.map(u=>u.id)],s).filter(u=>!o.has(u)),x=[];for(const u of c){if(u===`space:${te}`)continue;const m=d.find(S=>S.id===u);if(m){x.push({kind:"folder",id:u,folder:m,members:m.items.map(l).filter(S=>!!S)});continue}const f=l(u);f&&x.push({kind:"space",id:u,space:f})}return{tiles:x,topIds:c,order:s}}Dn({"home.folderMenu.renameTitle":{zh:"重命名收纳夹",en:"Rename folder"},"home.folderMenu.rename":{zh:"重命名",en:"Rename"},"home.folderMenu.dissolve":{zh:"解散收纳夹",en:"Dissolve folder"},"home.folderMenu.moveOut":{zh:"移出收纳夹",en:"Move out"},"home.pill":{zh:"问点什么…",en:"Ask anything…"},"home.card.continue":{zh:"继续:{title}",en:"Continue: {title}"},"home.card.claimable":{zh:"{n} 项可领取",en:"{n} to claim"},"home.card.earned":{zh:"已得 {n} 项",en:"{n} earned"},"home.card.installed":{zh:"已装 {n} 个插件",en:"{n} plugins installed"}});function Js({tiles:t,actions:s,onLaunch:i}){const d=Ys();return e.jsxs("section",{className:"hp-cards",children:[t.filter(l=>l.kind==="space").slice(0,2).map(l=>e.jsxs("button",{type:"button",className:"hp-card","data-space-id":l.space.id,onClick:o=>{o.stopPropagation(),i(l.space.id)},children:[e.jsx("span",{className:"hp-card-icon",children:l.space.icon&&e.jsx(l.space.icon,{})}),e.jsx("span",{className:"hp-card-name",children:O(l.space.name)}),e.jsx("span",{className:"hp-card-status",children:d(l.space.id)})]},l.id)),s.map(l=>e.jsxs("button",{type:"button",className:"hp-card","data-fixed-id":l.id,onClick:o=>{o.stopPropagation(),l.onClick?.()},children:[e.jsx("span",{className:"hp-card-icon",children:l.icon&&e.jsx(l.icon,{})}),e.jsx("span",{className:"hp-card-name",children:l.tooltip?O(l.tooltip):""}),e.jsx("span",{className:"hp-card-status",children:d(l.id)})]},l.id))]})}function Ys(){const{t}=en(),s=F(o=>o.sessions[0]),i=ts(o=>o.recents[0]),d=os(o=>o.plugins.filter(c=>!c.builtin&&!c.preinstalled).length),l=as(tn(o=>({counters:o.counters,claimed:o.claimed,pluginSeries:o.pluginSeries})));return o=>{if(o==="tangu")return s?t("home.card.continue",{title:xs(s.title,t)}):"";if(o==="amadeus")return i?(i.split("/").pop()??i).replace(/\.md$/i,""):"";if(o==="rb-market")return d?t("home.card.installed",{n:String(d)}):"";if(o==="rb-achievements"){const c=rs(l).flatMap(m=>m.achievements),x=c.filter(m=>!l.claimed[m.id]&&(l.counters[m.event]||0)>=m.goal).length,u=c.filter(m=>l.claimed[m.id]).length;return x?t("home.card.claimable",{n:String(x)}):u?t("home.card.earned",{n:String(u)}):""}return""}}function wt(t){const{t:s,locale:i}=en(),d=i==="zh",l=qs(i),o=Gs(),c=An(),x=ve(n=>n.spaces),u=ne(n=>n.items),{tiles:m,topIds:f,order:S}=Ks(),[I,v]=g.useState($s),[N,a]=g.useState(null),[w,q]=g.useState(null),[T,k]=g.useState(!1),[W,M]=g.useState(null),[E,y]=g.useState(null),[cn,Ne]=g.useState(!1),[oe,ae]=g.useState(!1),[G,B]=g.useState(!1),[h,re]=g.useState(Ms),[R,ie]=g.useState(null),[H,dn]=g.useState([]),[Me,Pe]=g.useState(!1),[Ee,K]=g.useState(""),[pn,un]=g.useState(0),J=g.useRef(null),le=g.useRef(null),L=g.useRef(null),Y=g.useRef(null),[De]=g.useState(()=>{try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}),ce=On(Ue(zn,{activationConstraint:{distance:6}}),Ue(Wn,{coordinateGetter:In}));g.useEffect(()=>{Ps(h)},[h]),g.useEffect(()=>{try{localStorage.setItem(ln,JSON.stringify(I))}catch{}},[I]),g.useEffect(()=>{let n=!0;return Is().then(r=>{if(n){if(!r){re(p=>p.source==="custom"?{...p,source:"theme"}:p);return}ie(URL.createObjectURL(r))}}).catch(()=>{}),()=>{n=!1}},[]),g.useEffect(()=>()=>{R&&URL.revokeObjectURL(R)},[R]),g.useEffect(()=>{if(h.source!=="bing")return;let n=!0;return Pe(!0),K(""),Ds(i).then(r=>{n&&(dn(r),r[0]&&re(p=>p.source==="bing"&&p.bingDaily&&p.bing?.id!==r[0].id?{...p,bing:r[0]}:p))}).catch(()=>{n&&K(s("home.wallpaper.bingError"))}).finally(()=>{n&&Pe(!1)}),()=>{n=!1}},[pn,i,s,h.source]),g.useEffect(()=>()=>{L.current&&(window.clearTimeout(L.current),L.current=null);const n=Y.current;Y.current=null,n?.()},[]);const de=n=>L.current?!1:De?(n(),!0):(Ne(!0),Y.current=n,L.current=window.setTimeout(()=>{L.current=null,Y.current=null,n(),Ne(!1)},Ts),!0),U=n=>{const r=cs?ds()?.openSpace:void 0;r?r(n):de(()=>we(n))},Z=x.some(n=>n.id==="tangu"),Ae=l.hour<5?"home.greet.night":l.hour<11?"home.greet.morning":l.hour<18?"home.greet.afternoon":"home.greet.evening",D=()=>ne.getState(),hn=()=>{M(null),k(!1),y(null)},X=h.source==="bing"?h.bing?.url||null:h.source==="custom"?R:null,A=n=>{re(r=>({...r,...n}))},mn=n=>{if(n==="custom"&&!R){le.current?.click();return}if(n==="bing"){A({source:n,bing:h.bing||H[0]||null});return}A({source:n})},gn=n=>{n&&(K(""),Ws(n).then(()=>{ie(URL.createObjectURL(n)),A({source:"custom"})}).catch(r=>{K(s(r instanceof Error&&r.message==="TOO_LARGE"?"home.wallpaper.tooLarge":"home.wallpaper.invalid"))}))},fn=()=>{zs().catch(()=>{}),ie(null),A({source:"theme"})},xn=(n,r)=>{if(!n||n===r)return;const p=is(S,f),j=p.indexOf(r);D().setZoneOrder("top",Ge(p,n,j>=0?j:p.length))},jn=(n,r)=>{!n||n===r||n.startsWith("folder:")||(D().moveIntoFolder(r,n),D().setZoneOrder("top",Je(S,f,n)))},wn=n=>{D().moveOutOfFolder(n),D().setZoneOrder("top",[...Je(S,f,n),n]),k(!0)},bn=()=>{y(null),qe(d?"新建收纳夹":"New folder",d?"收纳夹":"Folder").then(n=>{const r=n?.trim();r&&(D().addFolder("top",r),k(!0))})},Oe=()=>{a(null),q(null)},Ie=n=>{M(null),y(null),a(String(n.active.id))},We=n=>q(n.over?String(n.over.id):null),ze=n=>Oe(),Te=n=>{const r=String(n.active.id),p=n.over?String(n.over.id):null;if(Oe(),r.startsWith(V)){if(p!==be){const b=r.slice(V.length);v(P=>P.filter(He=>He!==b))}return}if(p===be){const b=m.find(P=>P.id===r);b?.kind==="space"&&b.space.id!==te&&v(P=>P.includes(b.space.id)?P:[...P,b.space.id]);return}if(!p||r===p)return;const j=m.find(b=>b.id===p);!r.startsWith("folder:")&&j?.kind==="folder"?jn(r,p):xn(r,p)},pe=(n,r,p)=>{n.preventDefault(),n.stopPropagation(),M(null),y({x:n.clientX,y:n.clientY,kind:r,id:p})},Re=(n,r)=>{const p=n.currentTarget.getBoundingClientRect(),j=J.current?.getBoundingClientRect();y(null),k(!1),M(b=>b?.id===r?null:{id:r,dx:j?p.left+p.width/2-(j.left+j.width/2):0,dy:j?p.top+p.height/2-(j.top+j.height/2):0})},C=W?m.find(n=>n.id===W.id):void 0,Q=C?.kind==="folder"?C.members:[],ee=m.slice(0,Rs),Le=Math.max(0,m.length-ee.length),_=N?m.find(n=>n.id===N):void 0,ue=N?.startsWith(V)?x.find(n=>n.id===N.slice(V.length)):void 0,vn=I.map(n=>x.find(r=>r.id===n)).filter(n=>!!n),_e=Ls.map(n=>u.find(r=>r.id===n)).filter(n=>!!n),Cn=Math.max(0,x.length-(x.some(n=>n.id===te)?1:0)),Sn=n=>{if(!C||C.kind!=="folder"||!n.over)return;const r=String(n.active.id),p=String(n.over.id);if(r===p)return;const j=C.folder.items.indexOf(p);D().setFolderItems(C.id,Ge(C.folder.items,r,j<0?C.folder.items.length:j))},kn=(n,r,p,j,b)=>Z?new Promise(P=>{de(()=>{we("tangu"),Ke.getState().openView("chat",{followActive:!0,reuseKey:"primary"},"main"),P(F.getState().send(n,r,p,j,b,null))})||P(!1)}):Promise.resolve(!1),yn=()=>Z?new Promise(n=>{de(()=>{we("tangu"),Ke.getState().openView("chat",{followActive:!0,reuseKey:"primary"},"main");const p=F.getState().activeId;F.getState().newSession().then(()=>{const j=F.getState().activeId;n(j&&j!==p?j:null)},()=>n(null))})||n(null)}):Promise.resolve(null),he=()=>{const n=document.activeElement;n instanceof HTMLTextAreaElement&&n.matches(".hp-composer .t2c-ta")&&n.blur(),ae(!1)},Nn=(n=!1)=>{Zn.flushSync(()=>ae(!0));const r=J.current?.querySelector(".hp-composer");n?r?.querySelector(".t2c-mic-control")?.click():r?.querySelector(".t2c-ta")?.focus()},[Fe,Mn]=g.useState("");g.useEffect(()=>{c&&!oe&&Mn(J.current?.querySelector(".hp-composer .t2c-ta")?.value.trim()??"")},[c,oe]);const $e=()=>{he(),B(!1),M(null),y(null),k(!0)},Pn=n=>{n.target.closest('button, input, textarea, [contenteditable="true"], .hp-composer, .ctx-menu, .hp-wallpaper-sheet')||(n.preventDefault(),n.stopPropagation(),y(null),W?M(null):T?k(!1):G?B(!1):$e())},Be=n=>n.kind==="member"?[{id:"move-out",label:s("home.folderMenu.moveOut"),icon:e.jsx(bs,{size:13}),run:()=>{wn(n.id),y(null),M(null)}}]:[{id:"rename",label:s("home.folderMenu.rename"),icon:e.jsx(vs,{size:13}),run:()=>{const r=n.id,p=m.find(j=>j.id===r);y(null),qe(s("home.folderMenu.renameTitle"),p?.kind==="folder"?p.folder.name:"").then(j=>{const b=j?.trim();b&&D().renameFolder(r,b)})}},{id:"dissolve",label:s("home.folderMenu.dissolve"),icon:e.jsx(Ss,{size:13}),run:()=>{D().removeFolder(n.id),y(null)}}],En=ps(E,()=>{if(!E)return null;const n=E.kind==="folder"?m.find(r=>r.id===E.id):void 0;return{...n?.kind==="folder"?{title:n.folder.name}:{},sections:[{items:Be(E)}]}},()=>y(null));return e.jsxs("div",{ref:J,className:`hp-root${c?" hp-phone":""}${De?" hp-still":""}${oe?" hp-composer-focused":""}${G?" hp-layer-focused":""}${W||T?" hp-secondary-open":""}`,"data-wallpaper":X||h.themePreset==="hack2gate"?"true":void 0,"data-theme-preset":h.themePreset,"data-focus-blur":h.focusBlur?"true":"false","data-vignette":h.vignette?"true":"false",onPointerDown:n=>{n.target.closest(".hp-composer")||he()},onContextMenu:Pn,onClick:hn,children:[e.jsx("div",{className:"hp-wallpaper",style:X?{backgroundImage:`url(${JSON.stringify(X)})`}:void 0,"aria-hidden":!0}),e.jsx("div",{className:"hp-wallpaper-art","aria-hidden":!0}),e.jsx("div",{className:"hp-wallpaper-edge","aria-hidden":!0}),e.jsx("div",{className:"hp-wallpaper-tone","aria-hidden":!0}),e.jsx("div",{className:"hp-glow","aria-hidden":!0}),e.jsx("button",{type:"button",className:`hp-wallpaper-button${G?" on":""}`,"aria-label":s("home.wallpaper.open"),title:s("home.wallpaper.open"),onClick:n=>{n.stopPropagation(),he(),y(null),M(null),k(!1),B(r=>!r)},children:e.jsx(Tn,{size:16})}),e.jsxs("div",{className:`hp-stack${cn?" leaving":""}`,children:[e.jsxs("div",{className:"hp-title",children:[e.jsx("div",{className:"hp-brand",children:"Forsion is All You Need"}),e.jsx("div",{className:"hp-clock",children:l.time}),e.jsx("div",{className:"hp-date",children:l.date}),e.jsx("div",{className:"hp-greet",children:o?s(Ae+".named",{name:o}):s(Ae)})]}),Z&&e.jsx(Fs,{onDispatch:kn,onStartCall:yn,onInputModeChange:ae}),c&&Z&&e.jsxs("button",{type:"button",className:"hp-pill","data-act":"home-pill",onClick:n=>{n.stopPropagation(),Nn(!!n.target.closest(".hp-pill-mic"))},children:[e.jsx("span",{className:"hp-pill-text","data-draft":Fe?"":void 0,children:Fe||s("home.pill")}),e.jsx("span",{className:"hp-pill-mic","aria-hidden":!0,children:e.jsx(Rn,{})}),e.jsx("span",{className:"hp-pill-send","aria-hidden":!0,children:e.jsx(Ln,{})})]}),c&&e.jsx(Js,{tiles:m,actions:_e,onLaunch:U}),!c&&e.jsx("section",{className:"hp-spaces","data-total":m.length,children:e.jsxs(me,{sensors:ce,collisionDetection:Xe,onDragStart:Ie,onDragOver:We,onDragCancel:ze,onDragEnd:Te,children:[e.jsxs("div",{className:"hp-space-row",children:[e.jsx(Us,{actions:_e,spaces:vn,labelText:s("home.pinnedSpaces"),onLaunch:U}),e.jsx("span",{className:"hp-space-divider","aria-hidden":!0}),e.jsx("div",{className:"hp-space-main",children:ee.length>0?e.jsx(ge,{items:ee.map(n=>n.id),strategy:fe,children:e.jsxs("div",{className:"hp-dock",children:[ee.map(n=>e.jsx(Qe,{tile:n,over:w===n.id,open:W?.id===n.id,onOpen:Re,onLaunch:U,onMenu:(r,p)=>pe(r,"folder",p)},n.id)),Le>0&&e.jsxs("button",{type:"button",className:"hp-tile hp-more",onClick:n=>{n.stopPropagation(),$e()},title:s("home.showAll"),children:[e.jsx("span",{className:"hp-tile-icon",children:e.jsx(Ye,{size:20})}),e.jsx("span",{className:"hp-tile-name",children:s("home.showAll")}),e.jsxs("span",{className:"hp-more-count",children:["+",Le]})]})]})}):e.jsx("div",{className:"hp-spaces-empty",children:s("home.noSpaces")})})]}),e.jsxs(Ve,{dropAnimation:null,children:[_&&!T&&e.jsx("div",{className:`hp-tile hp-drag-overlay${_.kind==="folder"?" hp-folder":""}`,children:e.jsx($,{tile:_})}),ue&&!T&&e.jsx("div",{className:"hp-tile hp-drag-overlay hp-pinned-space",children:e.jsx($,{tile:{kind:"space",id:`space:${ue.id}`,space:ue}})})]})]})})]}),e.jsx("input",{ref:le,className:"hp-wallpaper-file",type:"file",accept:"image/*",onChange:n=>{gn(n.currentTarget.files?.[0]),n.currentTarget.value=""}}),X&&h.source==="bing"&&h.bing?.copyright&&e.jsx("div",{className:"hp-wallpaper-credit",title:h.bing.copyright,children:h.bing.copyright}),G&&e.jsx("div",{className:"hp-wallpaper-stage",onClick:()=>B(!1),children:e.jsxs("section",{className:"hp-wallpaper-sheet","aria-label":s("home.wallpaper.title"),onClick:n=>n.stopPropagation(),children:[e.jsxs("header",{className:"hp-wallpaper-head",children:[e.jsxs("div",{children:[e.jsx("strong",{children:s("home.wallpaper.title")}),e.jsx("span",{children:s("home.wallpaper.subtitle")})]}),e.jsx("button",{type:"button",onClick:()=>B(!1),"aria-label":s("common.close"),children:e.jsx(xe,{size:16})})]}),e.jsx("div",{className:"hp-wallpaper-sources","aria-label":s("home.wallpaper.source"),children:["theme","bing","custom"].map(n=>e.jsxs("button",{type:"button",className:h.source===n?"on":"","aria-pressed":h.source===n,"data-source":n,onClick:()=>mn(n),children:[h.source===n&&e.jsx(je,{size:12}),s(`home.wallpaper.${n}`)]},n))}),Ee&&e.jsx("div",{className:"hp-wallpaper-error",children:Ee}),h.source==="theme"&&e.jsxs("div",{className:"hp-theme-presets",children:[e.jsx("p",{children:s("home.wallpaper.themeHint")}),e.jsx("div",{children:_s.map(n=>e.jsxs("button",{type:"button",className:h.themePreset===n?"on":"","data-preset":n,"aria-pressed":h.themePreset===n,onClick:()=>A({source:"theme",themePreset:n}),children:[e.jsx("span",{className:"hp-theme-preview","data-preset":n,"aria-hidden":!0}),e.jsx("span",{children:s(`home.wallpaper.preset.${n}`)}),h.themePreset===n&&e.jsx("i",{children:e.jsx(je,{size:11})})]},n))})]}),h.source==="bing"&&e.jsxs("div",{className:"hp-wallpaper-bing",children:[e.jsxs("div",{className:"hp-wallpaper-row",children:[e.jsxs("button",{type:"button",className:`hp-wallpaper-switch${h.bingDaily?" on":""}`,role:"switch","aria-checked":h.bingDaily,onClick:()=>{const n=!h.bingDaily;A({bingDaily:n,bing:n&&H[0]||h.bing})},children:[e.jsx("span",{"aria-hidden":!0})," ",s("home.wallpaper.daily")]}),e.jsxs("button",{type:"button",className:"hp-wallpaper-refresh",disabled:Me,onClick:()=>un(n=>n+1),children:[e.jsx(_n,{size:13})," ",s("home.wallpaper.refresh")]})]}),Me&&H.length===0&&e.jsx("div",{className:"hp-wallpaper-loading",children:s("home.wallpaper.loading")}),H.length>0&&e.jsx("div",{className:"hp-wallpaper-grid",children:H.map((n,r)=>e.jsxs("button",{type:"button",className:h.bing?.id===n.id?"on":"",title:n.copyright||n.title,"aria-label":n.title||n.copyright||s("home.wallpaper.bing"),onClick:()=>A({source:"bing",bing:n,bingDaily:r===0&&h.bingDaily}),children:[e.jsx("img",{src:n.thumbnailUrl,alt:""}),h.bing?.id===n.id&&e.jsx("span",{children:e.jsx(je,{size:12})})]},n.id))})]}),h.source==="custom"&&e.jsxs("div",{className:"hp-wallpaper-custom",children:[e.jsx("div",{className:"hp-wallpaper-custom-preview",style:R?{backgroundImage:`url(${JSON.stringify(R)})`}:void 0}),e.jsxs("div",{children:[e.jsx("strong",{children:s("home.wallpaper.customReady")}),e.jsx("span",{children:s("home.wallpaper.customHint")})]}),e.jsxs("button",{type:"button",onClick:()=>le.current?.click(),children:[e.jsx(js,{size:13})," ",s("home.wallpaper.replace")]}),e.jsx("button",{type:"button",onClick:fn,children:s("home.wallpaper.remove")})]}),e.jsxs("div",{className:"hp-wallpaper-options",children:[e.jsxs("button",{type:"button",className:h.focusBlur?"on":"",role:"switch","aria-checked":h.focusBlur,onClick:()=>A({focusBlur:!h.focusBlur}),children:[e.jsxs("span",{children:[e.jsx("strong",{children:s("home.wallpaper.focusBlur")}),e.jsx("small",{children:s("home.wallpaper.focusBlurHint")})]}),e.jsx("i",{"aria-hidden":!0})]}),e.jsxs("button",{type:"button",className:h.vignette?"on":"",role:"switch","aria-checked":h.vignette,onClick:()=>A({vignette:!h.vignette}),children:[e.jsxs("span",{children:[e.jsx("strong",{children:s("home.wallpaper.vignette")}),e.jsx("small",{children:s("home.wallpaper.vignetteHint")})]}),e.jsx("i",{"aria-hidden":!0})]})]})]})}),T&&e.jsx("div",{className:"hp-organizer-stage",onClick:()=>k(!1),children:e.jsxs("section",{className:"hp-organizer-panel","aria-label":s("home.organizer.title"),onClick:n=>n.stopPropagation(),children:[e.jsxs("header",{className:"hp-organizer-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"hp-organizer-mark",children:e.jsx(Ye,{size:16})}),e.jsxs("span",{children:[e.jsx("strong",{children:s("home.organizer.title")}),e.jsx("small",{children:s("home.spaceCount",{n:Cn})})]})]}),e.jsx("button",{type:"button",onClick:()=>k(!1),"aria-label":s("common.close"),children:e.jsx(xe,{size:16})})]}),e.jsxs(me,{sensors:ce,collisionDetection:Xe,onDragStart:Ie,onDragOver:We,onDragCancel:ze,onDragEnd:Te,children:[e.jsx(ge,{items:m.map(n=>n.id),strategy:fe,children:e.jsxs("div",{className:"hp-organizer-grid",children:[m.map(n=>e.jsx(Qe,{tile:n,over:w===n.id,open:!1,onOpen:Re,onLaunch:r=>{k(!1),U(r)},onMenu:(r,p)=>pe(r,"folder",p)},n.id)),e.jsxs("button",{type:"button",className:"hp-organizer-new",onClick:bn,children:[e.jsx("span",{children:e.jsx(ws,{size:22})}),e.jsx("small",{children:s("home.newFolder")})]})]})}),e.jsx(Ve,{dropAnimation:null,children:_&&e.jsx("div",{className:`hp-tile hp-drag-overlay${_.kind==="folder"?" hp-folder":""}`,children:e.jsx($,{tile:_})})})]}),e.jsx("footer",{children:s("home.organizer.hint")})]})}),W&&C?.kind==="folder"&&e.jsx("div",{className:"hp-folder-stage",onClick:()=>M(null),children:e.jsxs("section",{className:"hp-folder-panel",style:{"--hp-folder-dx":`${W.dx}px`,"--hp-folder-dy":`${W.dy}px`},"aria-label":C.folder.name,onClick:n=>n.stopPropagation(),children:[e.jsxs("header",{className:"hp-folder-head",children:[e.jsxs("div",{className:"hp-folder-identity",children:[e.jsx("span",{className:"hp-folder-hero",children:e.jsx($,{tile:C})}),e.jsxs("span",{children:[e.jsx("strong",{children:C.folder.name}),e.jsx("small",{children:s("home.folderCount",{n:Q.length})})]})]}),e.jsx("button",{type:"button",onClick:()=>M(null),"aria-label":s("common.close"),children:e.jsx(xe,{size:16})})]}),Q.length===0&&e.jsx("div",{className:"hp-folder-empty",children:s("home.folderEmpty")}),Q.length>0&&e.jsx(me,{sensors:ce,collisionDetection:sn,onDragEnd:Sn,children:e.jsx(ge,{items:C.folder.items,strategy:fe,children:e.jsx("div",{className:"hp-folder-grid",children:Q.map(n=>e.jsx(Vs,{member:n,onLaunch:r=>{M(null),U(r)},onMenu:(r,p)=>pe(r,"member",p)},n.id))})})}),e.jsx("footer",{children:s("home.folderHint")})]})}),E&&En&&e.jsx(Fn,{className:"ctx-menu",x:E.x,y:E.y,onClick:n=>n.stopPropagation(),children:e.jsx(us,{items:Be(E)})})]})}export{wt as HomepageView};
@@ -1 +0,0 @@
1
- import{u as F,d as o,j as t}from"./index-BYUntVIZ.js";import{G as xe,aF as fe,aN as te,aO as R,V as Z,kQ as Se,bV as je,bI as $e,bJ as Re,bK as ve,a5 as Ae,ar as Be,T as Fe,e3 as Ue,kR as He,a6 as Ve,b2 as _e,u as qe,fK as Ke,fX as q,aL as We,L as Ye,kS as Ge,N as Xe,d$ as Qe,cP as Je,kT as Ze,fT as et}from"./appStore-affnJoin.js";import"./client-BqhpYbYL.js";import{u as tt}from"./gestures-BwPbZDkU.js";import{C as st,a as it}from"./Chrome-amTcZNE4.js";import{b as M,i as be,u as r,a as at,C as nt,r as ce,m as rt,c as ot,d as ye,e as ue,f as me,g as lt,n as dt,h as ct}from"./RightPanel-BRexwQ3W.js";import{s as ut,d as ee,r as mt,h as gt,a as pt,b as Ce,c as we,p as B,e as ke,I as ht,i as xt,f as ft,l as St,u as jt,g as A,S as ge,j as vt,k as K,L as bt,m as yt,n as Ct,o as wt}from"./imageStudio-Axwmd4GW.js";import{L as kt}from"./lock-kffGfeHt.js";import{L as zt}from"./InlineFiles-DKPH5JHz.js";import{U as W}from"./upload-D20PZHXc.js";/* empty css */import{F as Nt,R as It}from"./redo-2-QgiKEg9T.js";import{U as Et}from"./undo-2-yMeXc8Wi.js";import{L as Lt}from"./layout-grid-Hs3eDA07.js";import{A as Pt}from"./arrow-up-right-R4P9Mmxz.js";import{H as Tt}from"./hand-DRu7IJdU.js";import{T as Mt,F as Ot}from"./type-DmIL6FB-.js";import"./nativeDownload-Udrv_tmU.js";import"./ipc-D7yENkjV.js";import"./minus-CfoZ4oxr.js";import"./book-open-CcXCToyx.js";import"./folder-plus-BJKT1Pqg.js";import"./folder-CCZqnwRc.js";import"./pencil-DGiTRzW1.js";const Dt=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],$t=xe("clipboard-paste",Dt);const Rt=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],At=xe("copy-plus",Rt);function Bt({board:s,selection:i,onClose:j}){const{t:c}=F(),[g,v]=o.useState("png"),[b,w]=o.useState(1),[l,p]=o.useState("transparent"),[S,y]=o.useState(.92),[N,C]=o.useState(!1),[u,d]=o.useState(""),z=ut(s,i),L=z?.bounds,P=Math.round((L?.w||0)*b),O=Math.round((L?.h||0)*b),D=!L||P<1||O<1||P*O>4e7||Math.max(P,O)>16384;return t.jsxs("section",{className:"ims-export ims-panel","aria-label":c("imageStudio.exportOptions"),children:[t.jsxs("div",{className:"ims-section-head",children:[t.jsx("h3",{children:c("imageStudio.exportOptions")}),t.jsx("button",{"aria-label":c("imageStudio.close"),onClick:j,children:t.jsx(fe,{size:15})})]}),t.jsxs("div",{className:"ims-fields",children:[t.jsxs("label",{children:[c("imageStudio.format"),t.jsx("select",{"aria-label":c("imageStudio.format"),value:g,onChange:h=>v(h.target.value),children:["png","jpeg","webp","svg"].map(h=>t.jsx("option",{value:h,children:h.toUpperCase()},h))})]}),t.jsxs("label",{children:[c("imageStudio.scale"),t.jsx("select",{"aria-label":c("imageStudio.scale"),value:b,onChange:h=>w(Number(h.target.value)),children:[.5,1,2,3].map(h=>t.jsxs("option",{value:h,children:[h,"×"]},h))})]}),t.jsxs("label",{children:[c("imageStudio.background"),t.jsxs("select",{"aria-label":c("imageStudio.background"),value:l,onChange:h=>p(h.target.value),children:[t.jsx("option",{value:"transparent",children:c("imageStudio.transparent")}),t.jsx("option",{value:"#ffffff",children:c("imageStudio.white")}),t.jsx("option",{value:"#000000",children:c("imageStudio.black")})]})]}),(g==="jpeg"||g==="webp")&&t.jsxs("label",{children:[c("imageStudio.quality"),t.jsx("input",{"aria-label":c("imageStudio.quality"),type:"range",min:".1",max:"1",step:".05",value:S,onChange:h=>y(Number(h.target.value))})]})]}),t.jsxs("p",{children:[P," × ",O," px · ",c(i.length?"imageStudio.selectedOnly":"imageStudio.allVisible")]}),g==="svg"&&t.jsx("p",{children:c("imageStudio.svgHint")}),g==="jpeg"&&l==="transparent"&&t.jsx("p",{children:c("imageStudio.jpegHint")}),D&&t.jsx("p",{role:"alert",children:c("imageStudio.exportLimit")}),t.jsxs("button",{className:"ims-primary",disabled:N||D,onClick:async()=>{C(!0),d("");try{ee(await mt(s,i,{format:g,scale:b,background:l,quality:S}),`${s.name}.${g==="jpeg"?"jpg":g}`)}catch(h){d(String(h))}finally{C(!1)}},children:[N?t.jsx(te,{className:"ims-spin",size:15}):t.jsx(R,{size:15}),c("imageStudio.download")]}),u&&t.jsx("p",{role:"alert",children:c("imageStudio.error",{error:u})})]})}function Ft({target:s,board:i,busy:j,onClose:c,onImport:g,onExport:v,onInspect:b,run:w}){const{t:l}=F(),p=i?M(i).filter(d=>s.ids.includes(d.id)):[],S=p.length===1&&be(p[0])?p[0]:void 0,y=p.filter(d=>!d.locked).map(d=>d.id),N=/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl+",C=d=>()=>{i&&r.getState().activeId!==i.id||(r.setState({selection:p.map(z=>z.id)}),d())},u=[];return S&&u.push({label:l("imageStudio.downloadImage"),icon:t.jsx(R,{size:14}),disabled:j,run:C(()=>{w(async()=>ee(await pt([S],!0),S.name.replace(/\.[^.]+$/,"")+".png"))})},{label:l("imageStudio.downloadOriginal"),icon:t.jsx(R,{size:14}),run:C(()=>{const d={"image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/gif":"gif"}[S.blob.type]||"png";ee(S.blob,S.name.replace(/\.[^.]+$/,"")+"-original."+d)})}),p.length&&i?u.push({label:l("imageStudio.exportSelection"),icon:t.jsx(R,{size:14}),disabled:j,run:C(v)},{label:l("imageStudio.reference"),icon:t.jsx(Z,{size:14}),separatorBefore:!0,disabled:j||p.length>8,run:C(()=>{w(Ce)})},{label:l("imageStudio.inspector"),icon:t.jsx(Se,{size:14}),run:C(b)},{label:l("imageStudio.copyObjects"),icon:t.jsx(je,{size:14}),shortcut:`${N}C`,separatorBefore:!0,run:C(we)},{label:l("imageStudio.duplicate"),icon:t.jsx(At,{size:14}),shortcut:`${N}D`,run:C(()=>B(!0))},{label:l("imageStudio.layerUp"),icon:t.jsx($e,{size:14}),separatorBefore:!0,disabled:!y.length,run:C(()=>r.getState().update(i.id,d=>ce(d,y,"up")))},{label:l("imageStudio.layerDown"),icon:t.jsx(Re,{size:14}),disabled:!y.length,run:C(()=>r.getState().update(i.id,d=>ce(d,y,"down")))},{label:l(y.length?"imageStudio.lock":"imageStudio.unlock"),icon:y.length?t.jsx(kt,{size:14}):t.jsx(zt,{size:14}),run:C(()=>r.getState().update(i.id,d=>rt(d,z=>s.ids.includes(z.id)?{...z,locked:!!y.length}:z)))},{label:l("imageStudio.remove"),icon:t.jsx(ve,{size:14}),shortcut:"⌫",separatorBefore:!0,danger:!0,disabled:!y.length,run:C(ke)}):u.push({label:l("imageStudio.import"),icon:t.jsx(W,{size:14}),disabled:j,run:g},{label:l("imageStudio.pasteObjects"),icon:t.jsx($t,{size:14}),shortcut:`${N}V`,disabled:!i||!gt(),run:C(()=>B())},{label:l("imageStudio.selectAll"),icon:t.jsx(at,{size:14}),disabled:!i?.images.length&&!i?.elements?.length,run:()=>r.setState({selection:i?M(i).filter(d=>!d.hidden).map(d=>d.id):[]})},{label:l("imageStudio.exportBoard"),icon:t.jsx(R,{size:14}),separatorBefore:!0,disabled:j||!i||!M(i).some(d=>!d.hidden),run:C(v)}),t.jsx(nt,{menu:{x:s.x,y:s.y,items:u},onClose:c,autoFocus:!0})}const pe=4/3,Ut=.05;function Ht({board:s}){const i=ot(s,2);if(!i.length)return t.jsx("span",{className:"ims-cover is-empty",children:t.jsx("span",{className:"ims-cover-in",children:t.jsx(He,{size:22,strokeWidth:1.4})})});const j=i.map(g=>{const v=ye(g);return v.w/v.h}),c=Math.min(1,(1-Ut*(i.length-1))*pe/j.reduce((g,v)=>g+v,0));return t.jsx("span",{className:"ims-cover",children:t.jsx("span",{className:"ims-cover-in",children:i.map((g,v)=>t.jsx("span",{className:"ims-cover-img",style:{width:`${j[v]*c/pe*100}%`,aspectRatio:String(j[v])},children:t.jsx(ht,{image:g})},g.id))})})}function Vt(){const{t:s,locale:i}=F(),j=r(u=>u.boards),[c,g]=o.useState(""),[v,b]=o.useState(!1),[w,l]=o.useState(""),p=o.useRef(null),S=o.useMemo(()=>Object.values(j).sort((u,d)=>d.updatedAt-u.updatedAt),[j]),y=c.trim().toLocaleLowerCase(),N=y?S.filter(u=>u.name.toLocaleLowerCase().includes(y)):S,C=async u=>{b(!0),l("");try{const d=await xt(u),z=r.getState().create(d.name);r.getState().update(z,L=>({...d,id:L.id}))}catch(d){l(String(d))}finally{b(!1)}};return t.jsx("div",{className:"csl-launchpad ims-launch",children:t.jsx("div",{className:"csl-inner",children:t.jsxs("main",{className:"csl-catalog",children:[t.jsxs("header",{className:"csl-catalog-header",children:[t.jsxs("div",{children:[t.jsx("h1",{children:s("imageStudio.projects")}),t.jsx("p",{children:s("imageStudio.launch.subtitle")})]}),t.jsxs("div",{className:"csl-catalog-actions",children:[t.jsxs("button",{type:"button",className:"csl-import",disabled:v,onClick:()=>p.current?.click(),children:[t.jsx(Ae,{size:15}),s("imageStudio.restore")]}),t.jsxs("button",{type:"button",className:"csl-new",onClick:()=>r.getState().create(s("imageStudio.untitled")),children:[t.jsx(Be,{size:16}),s("imageStudio.new")]})]})]}),w&&t.jsx("div",{className:"ims-error",role:"alert",children:s("imageStudio.error",{error:w})}),S.length>0&&t.jsx("div",{className:"csl-catalog-toolbar",children:t.jsxs("label",{className:"csl-search",children:[t.jsx(Fe,{size:15}),t.jsx("input",{type:"search","aria-label":s("imageStudio.launch.search"),placeholder:s("imageStudio.launch.search"),value:c,onChange:u=>g(u.target.value)})]})}),N.length?t.jsx("div",{className:"ims-launch-grid",role:"group","aria-label":s("imageStudio.projects"),children:N.map(u=>t.jsxs("button",{type:"button",className:"ims-launch-card","data-project-id":u.id,onClick:()=>r.getState().open(u.id),children:[t.jsx(Ht,{board:u}),t.jsxs("span",{className:"ims-launch-meta",children:[t.jsx("strong",{children:u.name}),t.jsxs("small",{children:[s("imageStudio.itemCount",{count:M(u).length})," · ",Ue(u.updatedAt,{locale:i})]})]})]},u.id))}):t.jsxs("div",{className:"csl-empty",children:[t.jsx("strong",{children:s(S.length?"imageStudio.launch.noMatch":"imageStudio.launch.empty")}),!S.length&&t.jsx("p",{children:s("imageStudio.launch.emptyHint")})]}),t.jsx("input",{ref:p,type:"file",accept:".json",hidden:!0,onChange:u=>{const d=u.target.files?.[0];u.target.value="",d&&C(d)}})]})})})}const he=[];function xs(s){const{t:i}=F(),j=r(l=>l.ready),c=r(l=>l.error),g=r(l=>l.activeId);o.useEffect(()=>{r.getState().hydrate();const l=()=>{r.getState().flush()},p=S=>{const y=r.getState();(y.saving||y.ready&&y.error)&&(l(),S.preventDefault(),S.returnValue="")};return window.addEventListener("pagehide",l),window.addEventListener("beforeunload",p),()=>{window.removeEventListener("pagehide",l),window.removeEventListener("beforeunload",p),l()}},[]);const v=Ve(l=>l.activeSpaceId==="image-studio")&&_e()==="main",b=!!g,w=o.useRef(!1);return o.useEffect(()=>{!j||!v||(b?ft():St(w.current),w.current=b)},[j,v,b]),j?g?t.jsx(_t,{},g):t.jsx(Vt,{}):t.jsx("div",{className:"ims-panel ims-panel-empty",children:c?t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",children:i("imageStudio.error",{error:c})}),t.jsx("button",{onClick:()=>{r.getState().hydrate()},children:i("imageStudio.retry")})]}):t.jsx(te,{className:"ims-spin"})})}function _t(){const{t:s}=F(),i=r(e=>e.activeId?e.boards[e.activeId]:void 0),j=r(e=>e.saving),c=r(e=>e.error),g=r(e=>i&&e.past[i.id]?.length||0),v=r(e=>i&&e.future[i.id]?.length||0),b=r(e=>e.selection),w=r(e=>i&&e.placeholders[i.id]||he),l=qe(e=>!!(i?.sessionId&&e.runningBySession[i.sessionId])),[p,S]=o.useState(!1),[y,N]=o.useState(""),[C,u]=o.useState(0),[d,z]=o.useState(!1),[L,P]=o.useState(!1),[O,D]=o.useState(!1),h=o.useRef(null),[se,ze]=o.useState(!0),[ie,Ne]=o.useState(!1),[Ie,Y]=o.useState(!1),I=o.useRef(null),U=o.useRef(null),[ae,ne]=o.useState(null),Ee=o.useCallback(()=>{ne(null),I.current?.focus({preventScroll:!0})},[]),m=Ke(I,`image-studio:${i?.id||""}`,void 0,{x:56,y:64,z:1}),H=i?.images||[],T=i?M(i):[],V=T.filter(e=>!e.hidden),Le=!T.length&&!g&&!v,G=[...V,...w],_=o.useRef(!0);o.useEffect(()=>(_.current=!0,()=>{_.current=!1}),[]);const re=o.useCallback(e=>{_.current&&N(e)},[]);jt(i||qt,re,C);const x=tt(I,m,{boxes:()=>new Map(V.map(e=>[e.id,e])),identity:()=>i?.id,commit:e=>{i&&r.getState().update(i.id,a=>me(a,e))},constrain:(e,a)=>{if(a.kind!=="resize")return e;const n=H.find(De=>De.id===a.key),f=e.get(a.key);if(!n||!f)return e;const k=ye(n),E=Math.max(48,f.w),Oe=E*k.h/k.w;return new Map(e).set(a.key,{...f,w:E,h:Oe})},hitKey:e=>e.closest("[data-image-id]")?.dataset.imageId||null,isEditing:e=>!!T.find(a=>a.id===e)?.locked,hitEdge:e=>e.dataset.resize||null,onDelete:e=>{i&&r.getState().update(i.id,a=>ue(a,M(a).filter(n=>n.locked||!e.includes(n.id))))},onDoubleClick:e=>{e&&(r.setState({selection:[e]}),A(K))},onContextMenu:(e,a)=>{const n=e?x.sel.includes(e)?x.sel:[e]:[];x.setSel(n),r.setState({selection:n}),ne({x:a.clientX,y:a.clientY,ids:n})},minW:48,minH:48,repel:!1},se);o.useEffect(()=>x.bind(I.current),[x.bind]),o.useEffect(()=>m.bindWheel(I.current),[m.bindWheel]),o.useEffect(()=>{const e=()=>{D(!1),h.current=null};return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[]);const oe=o.useRef(x.sel);o.useEffect(()=>{oe.current!==x.sel&&(oe.current=x.sel,r.setState({selection:x.sel}))},[x.sel]),o.useEffect(()=>{if(b.join("|")!==x.sel.join("|")){x.setSel(b);const e=T.find(a=>a.id===b[0]);if(e){const{w:a,h:n}=q(I.current),f=m.vpRef.current,k=(e.x+e.w/2)*f.z+f.x,E=(e.y+e.h/2)*f.z+f.y;(k<0||k>a||E<0||E>n)&&m.centerOn(e.x+e.w/2,e.y+e.h/2)}}},[b,x.setSel]);const le=o.useRef(0);o.useEffect(()=>{const e=T.length+w.length;e>le.current&&m.fitTo(G,64),le.current=e},[T,w,m.fitTo]);const $=async e=>{S(!0),N("");try{await e()}catch(a){re(String(a))}finally{_.current&&S(!1)}},X=()=>i?.id||r.getState().create(s("imageStudio.untitled")),de=async e=>{const a=await Promise.all(e.map(f=>wt(f,f.name,"import")));if(!a.length)return;const n=X();r.getState().update(n,f=>{const k=[...f.images];for(const E of a)k.push({...E,...ct(E.width,E.height,k)});return{...f,images:k}})},Pe=e=>{$(async()=>{const a=X();await yt(a,s(e))})},Q=T.filter(e=>b.includes(e.id)),Te=i&&x.live?M(me(i,x.live)):T,J=e=>{const a=X(),{w:n,h:f}=q(I.current),k=dt(e,s(`imageStudio.new.${e}`),(n/2-m.vp.x)/m.vp.z,(f/2-m.vp.y)/m.vp.z);k.x-=k.w/2,k.y-=k.h/2,r.getState().update(a,E=>ue(E,[...M(E),k])),r.setState({selection:[k.id]}),A(K)},Me=e=>{const{w:a,h:n}=q(I.current);m.setVp(et(m.vp,m.vp.z*e,a/2,n/2))};return t.jsxs("div",{className:"ims",onKeyDownCapture:e=>{if(e.target.closest('input, select, textarea, button, [contenteditable="true"]'))return;const a=e.metaKey||e.ctrlKey,n=e.key.toLowerCase();let f=!0;a&&n==="z"&&i?r.getState().undo(i.id,e.shiftKey):a&&n==="c"?we():a&&n==="v"?B():a&&n==="d"?B(!0):a&&n==="e"?z(!0):!a&&n==="t"?J("text"):!a&&n==="f"?J("frame"):!a&&n==="h"?P(!0):!a&&n==="v"?P(!1):n===" "?D(!0):(n==="escape"&&(P(!1),z(!1)),f=!1),f&&(e.preventDefault(),e.stopPropagation())},onKeyUpCapture:e=>{e.key===" "&&(D(!1),e.preventDefault(),e.stopPropagation())},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(D(!1),h.current=null)},children:[t.jsxs("header",{className:"ims-header",children:[t.jsxs("button",{className:"ims-back",title:s("imageStudio.back"),onClick:()=>r.getState().close(),children:[t.jsx(We,{size:15}),t.jsx("span",{children:i?.name})]}),t.jsxs("div",{className:"ims-head-actions",children:[i&&t.jsx("button",{disabled:p,title:s("imageStudio.backup"),"aria-label":s("imageStudio.backup"),onClick:()=>{$(()=>Ct(i))},children:t.jsx(Nt,{size:16})}),t.jsxs("button",{className:"ims-primary",disabled:!V.length||p,onClick:()=>z(!d),children:[t.jsx(R,{size:14}),t.jsx("span",{children:s("imageStudio.exportOptions")})]})]})]}),t.jsxs("div",{className:"ims-toolbar",role:"toolbar","aria-label":s("imageStudio.title"),children:[t.jsxs("button",{disabled:p,onClick:()=>U.current?.click(),children:[t.jsx(W,{size:15}),t.jsx("span",{children:s("imageStudio.import")})]}),!Le&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"ims-divider"}),t.jsx("button",{disabled:!g,title:s("imageStudio.undo"),"aria-label":s("imageStudio.undo"),onClick:()=>i&&r.getState().undo(i.id),children:t.jsx(Et,{size:15})}),t.jsx("button",{disabled:!v,title:s("imageStudio.redo"),"aria-label":s("imageStudio.redo"),onClick:()=>i&&r.getState().undo(i.id,!0),children:t.jsx(It,{size:15})}),t.jsx("button",{disabled:!H.some(e=>!e.locked&&!e.hidden),title:s("imageStudio.arrange"),"aria-label":s("imageStudio.arrange"),onClick:()=>{if(i){const e=lt(H.filter(a=>!a.locked&&!a.hidden));r.getState().update(i.id,a=>({...a,images:a.images.map(n=>e.find(f=>f.id===n.id)||n)})),m.fitTo(e)}},children:t.jsx(Lt,{size:15})}),t.jsx("button",{disabled:!Q.length,title:s("imageStudio.remove"),"aria-label":s("imageStudio.remove"),onClick:ke,children:t.jsx(ve,{size:15})}),t.jsx("button",{disabled:!Q.length,title:s("imageStudio.duplicate"),"aria-label":s("imageStudio.duplicate"),onClick:()=>B(!0),children:t.jsx(je,{size:15})}),t.jsx("button",{disabled:!Q.length||p,title:s("imageStudio.reference"),"aria-label":s("imageStudio.reference"),onClick:()=>{$(Ce)},children:t.jsx(Z,{size:15})})]}),t.jsx("span",{className:"ims-toolbar-space"}),[[ge,Z,"imageStudio.chat"],[vt,Ye,"imageStudio.layers"],[K,Se,"imageStudio.inspector"]].map(([e,a,n])=>t.jsx("button",{title:s(n),"aria-label":s(n),onClick:()=>A(e),children:t.jsx(a,{size:16})},e))]}),d&&i&&t.jsx(Bt,{board:i,selection:b,onClose:()=>z(!1)}),c&&t.jsxs("div",{className:"ims-error",role:"alert",children:[s("imageStudio.saveError"),t.jsx("button",{onClick:()=>{r.getState().flush()},children:s("imageStudio.retry")})]}),y&&t.jsxs("div",{className:"ims-error",role:"alert",children:[s("imageStudio.error",{error:y}),t.jsx("button",{onClick:()=>{N(""),u(e=>e+1)},children:s("imageStudio.retry")})]}),t.jsxs("div",{ref:I,className:`ims-stage${L||O?" is-panning":""}`,tabIndex:0,onContextMenu:e=>e.stopPropagation(),onPointerDownCapture:e=>{e.button===2||!(L||O)||e.target.closest(".amx-stage-tools, .amx-stage-hud, .amx-stage-minimap")||(e.stopPropagation(),e.preventDefault(),e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId),h.current={id:e.pointerId,x:e.clientX,y:e.clientY,vx:m.vp.x,vy:m.vp.y})},onPointerMoveCapture:e=>{const a=h.current;if(!a||a.id!==e.pointerId)return;e.stopPropagation();const{u:n}=q(I.current);m.setVp({...m.vp,x:a.vx+(e.clientX-a.x)/n,y:a.vy+(e.clientY-a.y)/n})},onPointerUpCapture:e=>{h.current?.id===e.pointerId&&(e.stopPropagation(),h.current=null)},onPointerCancel:()=>{h.current=null},"aria-label":s("imageStudio.title"),onDragOver:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),Y(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||Y(!1)},onDrop:e=>{e.preventDefault(),Y(!1),p||$(()=>de(Array.from(e.dataTransfer.files)))},children:[t.jsx("div",{className:"ims-grid",style:Ge(m.vp)}),t.jsxs("div",{className:"ims-world",style:{transform:`translate(${m.vp.x}px, ${m.vp.y}px) scale(${m.vp.z})`},children:[V.map(e=>{const a=Te.find(n=>n.id===e.id)||e;return t.jsxs("div",{"data-image-id":e.id,className:`ims-layer ${be(e)?"ims-image":`ims-${e.kind}`}${x.sel.includes(e.id)?" is-selected":""}${e.locked?" is-locked":""}`,style:{left:a.x,top:a.y,width:a.w,height:a.h},children:[t.jsx(bt,{item:e}),t.jsx("div",{className:"ims-image-label",children:e.name}),x.sel.includes(e.id)&&!e.locked&&t.jsx("div",{className:"ims-resize","data-resize":"se"})]},e.id)}),w.map(e=>{const a=H.find(n=>n.id===e.sourceIds[0]);return t.jsxs("div",{"data-generation-id":e.id,className:`ims-generation${e.status==="failed"?" is-failed":""}`,style:{left:e.x,top:e.y,width:e.w,height:e.h},role:e.status==="failed"?"alert":"status","aria-live":"polite",onPointerDown:n=>n.stopPropagation(),children:[t.jsx("div",{className:"ims-generation-sheen"}),t.jsxs("div",{className:"ims-generation-copy",children:[t.jsx(Xe,{size:20,strokeWidth:1.5}),t.jsx("strong",{children:s(e.kind==="edit"?"imageStudio.generation.editing":"imageStudio.generation.creating")}),t.jsx("span",{children:e.status==="failed"?s("imageStudio.generation.failed"):s(e.status==="preparing"?"imageStudio.generation.preparing":"imageStudio.generation.running")}),a&&t.jsx("small",{children:s("imageStudio.generation.versionOf",{name:a.name})}),e.count>1&&t.jsxs("small",{children:[e.index+1," / ",e.count]})]}),e.status==="failed"&&t.jsxs("div",{className:"ims-generation-actions amx-stage-tools",children:[t.jsx("button",{onClick:()=>A(ge),children:s("imageStudio.generation.openChat")}),t.jsx("button",{title:s("imageStudio.generation.dismiss"),"aria-label":s("imageStudio.generation.dismiss"),onClick:()=>r.getState().removeGeneration(i.id,e.id),children:t.jsx(fe,{size:14})})]})]},e.id)}),x.marquee&&t.jsx("div",{className:"ims-marquee",style:{left:x.marquee.x,top:x.marquee.y,width:x.marquee.w,height:x.marquee.h}})]}),!T.length&&!w.length&&t.jsxs("div",{className:"ims-empty amx-stage-tools",children:[t.jsxs("div",{className:"ims-eyebrow",children:[s("imageStudio.title")," ",t.jsx("span",{children:"/"})," ",s("imageStudio.new")]}),t.jsx("h1",{children:s("imageStudio.headline")}),t.jsx("p",{children:s("imageStudio.intro")}),t.jsx("div",{className:"ims-starters",children:["poster","product","illustration"].map(e=>t.jsxs("button",{disabled:p,onClick:()=>Pe(`imageStudio.${e}Prompt`),children:[t.jsx("span",{children:s(`imageStudio.${e}`)}),t.jsx(Pt,{size:14})]},e))}),t.jsxs("button",{className:"ims-empty-import",disabled:p,onClick:()=>U.current?.click(),children:[t.jsx(W,{size:16}),s("imageStudio.import")]}),t.jsx("small",{children:s("imageStudio.importLimit")})]}),!w.length&&(l||p)&&t.jsxs("div",{className:"ims-progress amx-stage-tools",role:"status",children:[t.jsx(te,{size:15,className:"ims-spin"}),s(l?"imageStudio.generating":"imageStudio.busy")]}),Ie&&t.jsxs("div",{className:"ims-drop",children:[t.jsx(W,{size:28}),s("imageStudio.drop")]}),t.jsxs("div",{className:"ims-create-tools amx-stage-tools",role:"toolbar","aria-label":s("imageStudio.canvasTools"),children:[t.jsx("button",{title:s("imageStudio.selectTool"),"aria-label":s("imageStudio.selectTool"),"aria-pressed":!L,onClick:()=>{P(!1),I.current?.focus()},children:t.jsx(Qe,{size:17})}),t.jsx("button",{title:s("imageStudio.handTool"),"aria-label":s("imageStudio.handTool"),"aria-pressed":L,onClick:()=>{P(!0),I.current?.focus()},children:t.jsx(Tt,{size:17})}),t.jsx("span",{}),[["text",Mt],["rectangle",Je],["ellipse",Ze],["frame",Ot]].map(([e,a])=>t.jsx("button",{title:s(`imageStudio.add.${e}`),"aria-label":s(`imageStudio.add.${e}`),onClick:()=>J(e),children:t.jsx(a,{size:17})},e))]}),ie&&t.jsx(st,{hostRef:I,vp:m.vp,items:G.map(e=>({key:e.id,kind:"card",box:e})),onCenter:m.centerOn}),t.jsx(it,{zoom:m.vp.z,onZoomBy:Me,onFit:()=>m.fitTo(G),snap:se,onSnap:ze,mini:ie,onMini:Ne})]}),t.jsxs("footer",{className:"ims-footer",children:[t.jsx("span",{title:s("imageStudio.hint"),children:s(i?c?"imageStudio.unsaved":j?"imageStudio.saving":"imageStudio.local":"imageStudio.empty")}),i&&t.jsx("input",{"aria-label":s("imageStudio.name"),value:i.name,onChange:e=>r.getState().update(i.id,a=>({...a,name:e.target.value}),!1)}),t.jsx("span",{children:s("imageStudio.itemCount",{count:T.length})})]}),ae&&t.jsx(Ft,{target:ae,board:i,busy:p,onClose:Ee,onImport:()=>U.current?.click(),onExport:()=>z(!0),onInspect:()=>A(K),run:$}),t.jsx("input",{ref:U,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",multiple:!0,hidden:!0,onChange:e=>{const a=Array.from(e.target.files||[]);e.target.value="",$(()=>de(a))}})]})}const qt={version:1,id:"",name:"",updatedAt:0,sessionId:null,images:[],collected:[]};export{xs as ImageStudioView};
@@ -1 +0,0 @@
1
- import{G as z,mX as x,ly as L,cj as w,lA as p,lz as k,mY as U,k$ as f}from"./appStore-affnJoin.js";import{j as s,d as y}from"./index-BYUntVIZ.js";import{n as T}from"./nativeDownload-Udrv_tmU.js";const S=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],W=z("lock-open",S),R=t=>(t.mime?.startsWith("image/")??!1)||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(t.name);function N(t){const n=t.match(/^data:([^;]+);base64,(.*)$/),e=p(n?.[2]||"");return{mimeType:n?.[1]||"application/octet-stream",bytes:e,size:e.length}}function E(t,n,e,i){e=t.sourceSessionId||e;const o=i==="host"?x(e):null,l=r=>{T({text:r?.message||String(r),level:"error"})},a=o?.downloadHostFile;return{name:t.name,path:o?.local&&t.path&&/^([/~]|[A-Za-z]:[\\/])/.test(t.path)?t.path:void 0,load:async()=>{if(t.dataUrl)return N(t.dataUrl);if(!t.path)return null;if(o){const c=await o.readHostFile(t.path);return c.tooLarge?{tooLarge:!0,size:c.size}:{mimeType:c.mimeType,bytes:p(c.content),size:c.size}}const r=await k(w(e),e,t.path);return{mimeType:r.mimeType,bytes:p(r.content),size:r.size}},download:t.path?i==="host"?a?()=>{a(t.path,t.name).catch(l)}:void 0:()=>{L(w(e),e,t.path).catch(l)}:void 0}}const v=({f:t,onClick:n})=>{const e=f(t.mime||"",t.name);return s.jsxs("button",{className:"inline-file-card",title:t.name,onClick:n,children:[s.jsx(e,{size:15}),s.jsx("span",{className:"inline-file-name",children:t.name})]})},A=({f:t,cfg:n,sessionId:e,execMode:i,onClick:o})=>{e=t.sourceSessionId||e;const l=t.dataUrl||(t.path&&i!=="host"?U(w(e),e,t.path):null),[a,r]=y.useState(l),[c,h]=y.useState(!1),d=y.useRef(null);return y.useEffect(()=>{if(h(!1),l){r(l);return}let u=!1;return(async()=>{if(!t.path)return;const j=i==="host"?x(e):null;try{let g=null,b="";if(j){const m=await j.readHostFile(t.path);if(u)return;if(m.tooLarge){h(!0);return}g=p(m.content),b=m.mimeType}else if(i!=="host"){const m=await k(w(e),e,t.path);if(u)return;g=p(m.content),b=m.mimeType}if(!g||u)return;const F=URL.createObjectURL(new Blob([g],{type:b||t.mime||"image/png"}));d.current=F,r(F)}catch{u||h(!0)}})(),()=>{u=!0,d.current&&(URL.revokeObjectURL(d.current),d.current=null)}},[t.path,t.dataUrl]),c?s.jsx(v,{f:t,onClick:o}):a?s.jsx("img",{className:"inline-file-img",src:a,alt:t.name,title:t.name,onClick:o,draggable:!1,onError:()=>h(!0)}):null},$=({files:t,cfg:n,sessionId:e,execMode:i,onOpenPreview:o})=>{if(!t.length)return null;const l=a=>o?.(E(a,n,e,i));return s.jsx("div",{className:"inline-file-grid",children:t.map((a,r)=>R(a)?s.jsx(A,{f:a,cfg:n,sessionId:e,execMode:i,onClick:()=>l(a)},r):s.jsx(v,{f:a,onClick:()=>l(a)},r))})};export{$ as I,W as L,E as t};
@@ -1 +0,0 @@
1
- .slash-category-tabs{display:flex;flex-shrink:0;gap:3px;margin:4px 6px 8px;padding:3px;border-radius:var(--radius-pill);background:var(--overlay-light)}.slash-menu .slash-category-tab{flex:1;min-width:0;border:0;border-radius:var(--radius-pill);padding:4px 8px;background:transparent;color:var(--text-sec);font-family:var(--font-ui);font-size:var(--menu-text-size, var(--ui-font-meta));line-height:var(--ui-line-meta);white-space:nowrap;cursor:pointer}.slash-menu .slash-category-tab[aria-selected=true]{background:var(--menu-hover);color:var(--text)}.slash-menu .slash-list{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.slash-menu .slash-scroll{min-height:0}.slash-menu .slash-foot{flex-shrink:0;flex-wrap:wrap}