chatlab-cli 0.36.0 → 0.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/README.md +7 -7
  2. package/dist/{chat-command-SXW67RF7.mjs → chat-command-XPJ43KSW.mjs} +10 -10
  3. package/dist/chat-command-XPJ43KSW.mjs.map +1 -0
  4. package/dist/{chunk-BSGLH6G3.mjs → chunk-2JPFBIAG.mjs} +144 -79
  5. package/dist/chunk-2JPFBIAG.mjs.map +1 -0
  6. package/dist/{chunk-VDWI4A4U.mjs → chunk-5MJO4AJB.mjs} +2 -2
  7. package/dist/{chunk-GVW3BDGZ.mjs → chunk-67HNPYZJ.mjs} +3 -3
  8. package/dist/{chunk-UNIKQFI5.mjs → chunk-6QP47LID.mjs} +2 -2
  9. package/dist/{chunk-4YPNYQSP.mjs → chunk-FJOGBUXU.mjs} +390 -96
  10. package/dist/chunk-FJOGBUXU.mjs.map +1 -0
  11. package/dist/{chunk-XDF6PMVZ.mjs → chunk-JOVL7OTW.mjs} +2 -2
  12. package/dist/{chunk-CNEWMCGX.mjs → chunk-L7TIIVAY.mjs} +57 -57
  13. package/dist/chunk-L7TIIVAY.mjs.map +1 -0
  14. package/dist/{chunk-U2NXHIJK.mjs → chunk-NFTCEJBJ.mjs} +3 -3
  15. package/dist/{chunk-AAGDVTP2.mjs → chunk-NQHZPSW2.mjs} +2 -2
  16. package/dist/{chunk-OWOEWZIC.mjs → chunk-Q3NEL2KK.mjs} +82 -28
  17. package/dist/chunk-Q3NEL2KK.mjs.map +1 -0
  18. package/dist/{chunk-LZGOIRLV.mjs → chunk-R73XMAB2.mjs} +9 -5
  19. package/dist/chunk-R73XMAB2.mjs.map +1 -0
  20. package/dist/{chunk-JHON5FN7.mjs → chunk-X2QBH24F.mjs} +8 -3
  21. package/dist/chunk-X2QBH24F.mjs.map +1 -0
  22. package/dist/cli.mjs +9 -9
  23. package/dist/contacts-worker.mjs +2 -2
  24. package/dist/global-insight-worker.mjs +1 -1
  25. package/dist/{http-LVOGJFDL.mjs → http-5RVY5J5U.mjs} +12 -12
  26. package/dist/{import-7OU57ZHM.mjs → import-ILTWVHKU.mjs} +7 -7
  27. package/dist/index.mjs +12 -12
  28. package/dist/{mcp-CUKHTTII.mjs → mcp-Y2YXOFB4.mjs} +8 -8
  29. package/dist/people-relationships-worker.mjs +2 -2
  30. package/dist/semantic-index-worker.mjs +1 -1
  31. package/dist/{service-KZTHBDQ5.mjs → service-ZAHXRSFD.mjs} +6 -6
  32. package/dist/service-ZAHXRSFD.mjs.map +1 -0
  33. package/dist/{src-LORFXAUE.mjs → src-OV5ZNE3Z.mjs} +10 -6
  34. package/dist/{stream-import-7YUWIAD6.mjs → stream-import-XOUM3Z5W.mjs} +7 -7
  35. package/dist/{undici-MU5I3L6Q.mjs → undici-UGXDRJLV.mjs} +193 -193
  36. package/dist/undici-UGXDRJLV.mjs.map +1 -0
  37. package/dist/{update-checker-3N7HQEP2.mjs → update-checker-UL2FBLXH.mjs} +3 -5
  38. package/dist/{update-checker-3N7HQEP2.mjs.map → update-checker-UL2FBLXH.mjs.map} +1 -1
  39. package/dist/{worker-runtime-GQ5SY7E3.mjs → worker-runtime-JNGURHDM.mjs} +5 -5
  40. package/dist-cli-web/assets/AISettingsTab-vvjijrc5.js +1 -0
  41. package/dist-cli-web/assets/AboutTab-CxI8zJNz.js +1 -0
  42. package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-w0hHEodr.js +110 -0
  43. package/dist-cli-web/assets/{Alert-DJzXKcec.js → Alert-_MYcI_E2.js} +1 -1
  44. package/dist-cli-web/assets/ApiSettingsTab-CK7U6dVA.js +2 -0
  45. package/dist-cli-web/assets/BatchManageTab-1WnEqqpB.js +1 -0
  46. package/dist-cli-web/assets/{BufferResource-DY3P-dGs.js → BufferResource-i64DlwQT.js} +1 -1
  47. package/dist-cli-web/assets/{CanvasRenderer-As2MJTWZ.js → CanvasRenderer-B76mEt9A.js} +1 -1
  48. package/dist-cli-web/assets/ChatRecordDrawer-Bp6OSCrz.js +1 -0
  49. package/dist-cli-web/assets/{ChatRecordWorkspace-CVDPBmcl.js → ChatRecordWorkspace-CyfPIlIy.js} +1 -1
  50. package/dist-cli-web/assets/{Checkbox-4F1WAuVF.js → Checkbox-Ci7IeRw1.js} +1 -1
  51. package/dist-cli-web/assets/DataDirCleanupNotice-Dh63pOLt.js +1 -0
  52. package/dist-cli-web/assets/DatePicker.vue_vue_type_script_setup_true_lang-DqNBNa1D.js +1 -0
  53. package/dist-cli-web/assets/{DebugToolsPanel-BLU6SY8a.js → DebugToolsPanel-CbNsD9co.js} +1 -1
  54. package/dist-cli-web/assets/EChart.vue_vue_type_script_setup_true_lang-YeqmodwE.js +1 -0
  55. package/dist-cli-web/assets/EChartBar.vue_vue_type_script_setup_true_lang-C3pZmq0v.js +1 -0
  56. package/dist-cli-web/assets/{EChartLine.vue_vue_type_script_setup_true_lang-BYhukELX.js → EChartLine.vue_vue_type_script_setup_true_lang-Co6olfwv.js} +1 -1
  57. package/dist-cli-web/assets/{EChartWordcloud-C16xh7Tx.js → EChartWordcloud-rDusZwSq.js} +1 -1
  58. package/dist-cli-web/assets/{Filter-BEtPORqF.js → Filter-yxkeHO78.js} +1 -1
  59. package/dist-cli-web/assets/GlobalTaskBar-BlZ-fFiq.js +1 -0
  60. package/dist-cli-web/assets/GroupRelationshipGalaxyView-BXQBX0zJ.js +1 -0
  61. package/dist-cli-web/assets/{Label-Dgl3ghzT.js → Label-CFAZFBQX.js} +1 -1
  62. package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-CwgpqtMZ.js +1 -0
  63. package/dist-cli-web/assets/MessageExportModal-DU71grc7.js +1 -0
  64. package/dist-cli-web/assets/{PageHeader-CL9AFfvl.js → PageHeader-BDPf4NuI.js} +1 -1
  65. package/dist-cli-web/assets/{PageTabs.vue_vue_type_script_setup_true_lang-C22kOxIK.js → PageTabs.vue_vue_type_script_setup_true_lang-_j82asQU.js} +1 -1
  66. package/dist-cli-web/assets/{RelationshipGalaxyCanvas-BnkcrIpk.js → RelationshipGalaxyCanvas-BODk18aA.js} +14 -14
  67. package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-BJyuRiC-.js +4168 -0
  68. package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-CCasBcBQ.css +1 -0
  69. package/dist-cli-web/assets/{RenderTargetSystem-CPwnC2X3.js → RenderTargetSystem-CVMvAUSv.js} +1 -1
  70. package/dist-cli-web/assets/RovingFocusItem-DC_06OmN.js +1 -0
  71. package/dist-cli-web/assets/{ScreenCaptureModal-ByKxzNQe.js → ScreenCaptureModal-DrBFDOtC.js} +1 -1
  72. package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-C-Zj2biH.js +1 -0
  73. package/dist-cli-web/assets/{Select-jVtfc_xc.js → Select-DLK2LYhO.js} +1 -1
  74. package/dist-cli-web/assets/SettingsModal-BFkxzo0Y.css +1 -0
  75. package/dist-cli-web/assets/SettingsModal-DqaR4Dx5.js +2 -0
  76. package/dist-cli-web/assets/{StorageTab-QdcDqA6Q.js → StorageTab-B0ebN0f8.js} +1 -1
  77. package/dist-cli-web/assets/{Switch-DYHM64k9.js → Switch-CokhQWxm.js} +1 -1
  78. package/dist-cli-web/assets/{Tabs-B6Nzq2NQ.js → Tabs-D1UiZNaZ.js} +1 -1
  79. package/dist-cli-web/assets/Tabs-N3Q-Mpqi.js +1 -0
  80. package/dist-cli-web/assets/{ThemeCard.vue_vue_type_script_setup_true_lang-Bsq7gpC0.js → ThemeCard.vue_vue_type_script_setup_true_lang-OT-I0mbU.js} +1 -1
  81. package/dist-cli-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-Ccunouyf.js +1 -0
  82. package/dist-cli-web/assets/{VisuallyHiddenInput-IQpmK9yR.js → VisuallyHiddenInput-OAJEt_Y5.js} +1 -1
  83. package/dist-cli-web/assets/{WebGLRenderer-8JHbnkTc.js → WebGLRenderer-DuUeftYD.js} +1 -1
  84. package/dist-cli-web/assets/{WebGPURenderer-CLWfB4CC.js → WebGPURenderer-DoWQxiWZ.js} +1 -1
  85. package/dist-cli-web/assets/aiChat-CdADfRnU.js +8 -0
  86. package/dist-cli-web/assets/{browserAll-Cin6ghNg.js → browserAll-Cb-mtR2y.js} +1 -1
  87. package/dist-cli-web/assets/{cli-web-D7IBc3AX.js → cli-web-BHQCZLLg.js} +1 -1
  88. package/dist-cli-web/assets/{fetch-B7kuohCt.js → fetch-AvsnJLWJ.js} +1 -1
  89. package/dist-cli-web/assets/{fetch-BR71C0K9.js → fetch-B-6tyYWu.js} +1 -1
  90. package/dist-cli-web/assets/{fetch-OnnCjzee.js → fetch-B4PYy5JS.js} +1 -1
  91. package/dist-cli-web/assets/{fetch-_CN1EVMt.js → fetch-BbcFaCRB.js} +1 -1
  92. package/dist-cli-web/assets/{fetch-C8tTTsCm.js → fetch-BkA_so1e.js} +1 -1
  93. package/dist-cli-web/assets/{fetch-2QEQPA9q.js → fetch-BzXuAaT3.js} +1 -1
  94. package/dist-cli-web/assets/fetch-CW2fKvGp.js +1 -0
  95. package/dist-cli-web/assets/{fetch-CuUeyk0N.js → fetch-DEub4tOo.js} +1 -1
  96. package/dist-cli-web/assets/{fetch-1NiXh-_B.js → fetch-DLTlYnDB.js} +1 -1
  97. package/dist-cli-web/assets/{fetch-B2agy1hy.js → fetch-Qs38Hx1V.js} +1 -1
  98. package/dist-cli-web/assets/{fetch-Bk-7vxHV.js → fetch-sYDJ-Zs8.js} +1 -1
  99. package/dist-cli-web/assets/{fetch-DPRDSI39.js → fetch-ul8-uQIb.js} +1 -1
  100. package/dist-cli-web/assets/host-B6SQ6OGo.js +1 -0
  101. package/dist-cli-web/assets/host-DYIkQqvY.js +1 -0
  102. package/dist-cli-web/assets/{index-BCEk6ZpL.js → index--IEkRjKe.js} +10 -10
  103. package/dist-cli-web/assets/index-9iaY_EWG.js +1 -0
  104. package/dist-cli-web/assets/index-BnaLj2dx.css +1 -0
  105. package/dist-cli-web/assets/index-C7omDgiJ.js +2 -0
  106. package/dist-cli-web/assets/index-CHsM84U1.js +2 -0
  107. package/dist-cli-web/assets/index-CL8u01Pf.js +137 -0
  108. package/dist-cli-web/assets/{index-BIHFuCJK.js → index-CShh95fU.js} +1 -1
  109. package/dist-cli-web/assets/index-C_OS8Y8W.js +1 -0
  110. package/dist-cli-web/assets/{index-Colc58j-.js → index-D64XYYts.js} +1 -1
  111. package/dist-cli-web/assets/index-DrCc8p_I.css +1 -0
  112. package/dist-cli-web/assets/index-Dz_ddyZS.css +1 -0
  113. package/dist-cli-web/assets/index-UpTe1KzQ.js +1 -0
  114. package/dist-cli-web/assets/index-a8Hw6eD8.js +1 -0
  115. package/dist-cli-web/assets/index-jwjzZNKm.js +1 -0
  116. package/dist-cli-web/assets/index-pkxlF8Ee.js +1 -0
  117. package/dist-cli-web/assets/index-sWxuTsa7.js +36 -0
  118. package/dist-cli-web/assets/{people-page-header-DNPjaSt4.js → people-page-header-0jvXFFnh.js} +1 -1
  119. package/dist-cli-web/assets/{prompt-BgywZQ_g.js → prompt-BPYj29Vq.js} +1 -1
  120. package/dist-cli-web/assets/{semantic-index-config-builder-bji_UxYE.js → semantic-index-config-builder-vO37z355.js} +1 -1
  121. package/dist-cli-web/assets/service-CVoA9yNf.js +1 -0
  122. package/dist-cli-web/assets/{service-DpU9fa-l.js → service-D29Vftq9.js} +1 -1
  123. package/dist-cli-web/assets/service-DMysyLCa.js +1 -0
  124. package/dist-cli-web/assets/{useFormControl-De24E2zT.js → useFormControl-DVawP2DO.js} +1 -1
  125. package/dist-cli-web/assets/useTable-Bv3R_Hux.js +1 -0
  126. package/dist-cli-web/assets/useToast-BA0EwImD.js +1 -0
  127. package/dist-cli-web/assets/{vendor-echarts-DfAMQxdr.js → vendor-echarts-hTLhTs52.js} +5 -5
  128. package/dist-cli-web/assets/{vendor-echarts-wordcloud-BsaEJTPY.js → vendor-echarts-wordcloud-B8CF_NgP.js} +1 -1
  129. package/dist-cli-web/assets/{vendor-zrender-PFmZe1EY.js → vendor-zrender-D8psf1AA.js} +2 -2
  130. package/dist-cli-web/assets/{webworkerAll-BRnv6GvJ.js → webworkerAll-ZPE_yGnC.js} +1 -1
  131. package/dist-cli-web/index.html +2 -2
  132. package/package.json +4 -4
  133. package/dist/chat-command-SXW67RF7.mjs.map +0 -1
  134. package/dist/chunk-4YPNYQSP.mjs.map +0 -1
  135. package/dist/chunk-BSGLH6G3.mjs.map +0 -1
  136. package/dist/chunk-CNEWMCGX.mjs.map +0 -1
  137. package/dist/chunk-JHON5FN7.mjs.map +0 -1
  138. package/dist/chunk-LZGOIRLV.mjs.map +0 -1
  139. package/dist/chunk-OWOEWZIC.mjs.map +0 -1
  140. package/dist/service-KZTHBDQ5.mjs.map +0 -1
  141. package/dist/undici-MU5I3L6Q.mjs.map +0 -1
  142. package/dist-cli-web/assets/AISettingsTab-BmhNcUEh.js +0 -1
  143. package/dist-cli-web/assets/AboutTab-CFklrZt8.js +0 -1
  144. package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-B-dIPvcs.js +0 -110
  145. package/dist-cli-web/assets/ApiSettingsTab-DvDm421U.js +0 -2
  146. package/dist-cli-web/assets/BatchManageTab-DhIDH3Q1.js +0 -1
  147. package/dist-cli-web/assets/ChatRecordDrawer-DHdas7Jp.js +0 -1
  148. package/dist-cli-web/assets/DataDirCleanupNotice-jebQ9il3.js +0 -1
  149. package/dist-cli-web/assets/DatePicker.vue_vue_type_script_setup_true_lang-Cal624eP.js +0 -1
  150. package/dist-cli-web/assets/EChart.vue_vue_type_script_setup_true_lang-CsgJ-Xn3.js +0 -1
  151. package/dist-cli-web/assets/GlobalTaskBar-BvNmFO7q.js +0 -1
  152. package/dist-cli-web/assets/GroupRelationshipGalaxyView-DEUIrvgz.js +0 -1
  153. package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-CwDIA0UP.js +0 -1
  154. package/dist-cli-web/assets/MessageExportModal-DYjhBuzO.js +0 -1
  155. package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-CqdqveEJ.js +0 -4108
  156. package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-TYGOUDiv.css +0 -1
  157. package/dist-cli-web/assets/RovingFocusItem-j33Nsbbn.js +0 -1
  158. package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-C6EHKB_i.js +0 -1
  159. package/dist-cli-web/assets/SettingsModal-CjVax3I6.css +0 -1
  160. package/dist-cli-web/assets/SettingsModal-Dg27piEO.js +0 -2
  161. package/dist-cli-web/assets/Tabs-CRZdCcU4.js +0 -1
  162. package/dist-cli-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-BLpQds4F.js +0 -1
  163. package/dist-cli-web/assets/aiChat-4JvxWGXZ.js +0 -8
  164. package/dist-cli-web/assets/base-D6fxqD_X.js +0 -1
  165. package/dist-cli-web/assets/dateFormat-Bu4-Ux3L.js +0 -1
  166. package/dist-cli-web/assets/index-BUz_Vl9U.js +0 -2
  167. package/dist-cli-web/assets/index-BWZIoPV3.css +0 -1
  168. package/dist-cli-web/assets/index-BYQV3OA5.js +0 -1
  169. package/dist-cli-web/assets/index-CVVv_6qu.js +0 -2
  170. package/dist-cli-web/assets/index-CacwXQL4.js +0 -1
  171. package/dist-cli-web/assets/index-DImo7TQN.js +0 -1
  172. package/dist-cli-web/assets/index-DV9zQVPV.js +0 -137
  173. package/dist-cli-web/assets/index-DXKS-q-w.css +0 -1
  174. package/dist-cli-web/assets/index-DZc5A4_J.js +0 -1
  175. package/dist-cli-web/assets/index-DkWTvE7d.js +0 -36
  176. package/dist-cli-web/assets/index-DmEn0PAI.js +0 -1
  177. package/dist-cli-web/assets/index-b9eEQeVt.js +0 -1
  178. package/dist-cli-web/assets/index-waDxab2e.css +0 -1
  179. package/dist-cli-web/assets/insight-time-range-MJxLEu6o.js +0 -1
  180. package/dist-cli-web/assets/useTable-C7BH94MF.js +0 -1
  181. package/dist-cli-web/assets/useToast-CxhJkhXK.js +0 -1
  182. /package/dist/{chunk-VDWI4A4U.mjs.map → chunk-5MJO4AJB.mjs.map} +0 -0
  183. /package/dist/{chunk-GVW3BDGZ.mjs.map → chunk-67HNPYZJ.mjs.map} +0 -0
  184. /package/dist/{chunk-UNIKQFI5.mjs.map → chunk-6QP47LID.mjs.map} +0 -0
  185. /package/dist/{chunk-XDF6PMVZ.mjs.map → chunk-JOVL7OTW.mjs.map} +0 -0
  186. /package/dist/{chunk-U2NXHIJK.mjs.map → chunk-NFTCEJBJ.mjs.map} +0 -0
  187. /package/dist/{chunk-AAGDVTP2.mjs.map → chunk-NQHZPSW2.mjs.map} +0 -0
  188. /package/dist/{http-LVOGJFDL.mjs.map → http-5RVY5J5U.mjs.map} +0 -0
  189. /package/dist/{import-7OU57ZHM.mjs.map → import-ILTWVHKU.mjs.map} +0 -0
  190. /package/dist/{mcp-CUKHTTII.mjs.map → mcp-Y2YXOFB4.mjs.map} +0 -0
  191. /package/dist/{src-LORFXAUE.mjs.map → src-OV5ZNE3Z.mjs.map} +0 -0
  192. /package/dist/{stream-import-7YUWIAD6.mjs.map → stream-import-XOUM3Z5W.mjs.map} +0 -0
  193. /package/dist/{worker-runtime-GQ5SY7E3.mjs.map → worker-runtime-JNGURHDM.mjs.map} +0 -0
@@ -1 +1 @@
1
- import{a as A,aV as P,bw as W,u as C,aW as J,z as U,o as u,c as f,w as m,b as y,e as a,P as w,r as S,J as X,aZ as Y,B as Z,ac as Q,D as k,aj as aa,s as z,bp as ea,f as _,i as ta,bx as ia,by as sa,m as I,bz as ra,bA as na,aX as la,aY as oa,ao as F,ap as O,bB as da,a2 as M,n as h,ar as j,h as B,v as R,bC as ua,at as V,as as D,aE as ca,a_ as ga,q as K,bD as q,a4 as L,F as N}from"./index-DkWTvE7d.js";import{R as va}from"./RovingFocusItem-j33Nsbbn.js";const[T,fa]=Y("TabsRoot");var pa=A({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(c,{emit:l}){const g=c,e=l,{orientation:p,unmountOnHide:d,dir:t}=P(g),s=W(t);C();const r=J(g,"modelValue",e,{defaultValue:g.defaultValue,passive:g.modelValue===void 0}),n=S(),b=X(new Set);return fa({modelValue:r,changeModelValue:o=>{r.value=o},orientation:p,dir:s,unmountOnHide:d,activationMode:g.activationMode,baseId:U(void 0,"reka-tabs"),tabsList:n,contentIds:b,registerContent:o=>{b.value=new Set([...b.value,o])},unregisterContent:o=>{const v=new Set(b.value);v.delete(o),b.value=v}}),(o,v)=>(u(),f(a(w),{dir:a(s),"data-orientation":a(p),"as-child":o.asChild,as:o.as},{default:m(()=>[y(o.$slots,"default",{modelValue:a(r)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),ba=pa;function H(c,l){return`${c}-trigger-${l}`}function E(c,l){return`${c}-content-${l}`}var ya=A({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c){const l=c,{forwardRef:g}=C(),e=T(),p=_(()=>H(e.baseId,l.value)),d=_(()=>E(e.baseId,l.value)),t=_(()=>l.value===e.modelValue.value),s=S(t.value);return Z(()=>{e.registerContent(l.value),requestAnimationFrame(()=>{s.value=!1})}),Q(()=>{e.unregisterContent(l.value)}),(r,n)=>(u(),f(a(ea),{present:r.forceMount||t.value,"force-mount":""},{default:m(({present:b})=>[k(a(w),{id:d.value,ref:a(g),"as-child":r.asChild,as:r.as,role:"tabpanel","data-state":t.value?"active":"inactive","data-orientation":a(e).orientation.value,"aria-labelledby":p.value,hidden:!b,tabindex:"0",style:aa({animationDuration:s.value?"0s":void 0})},{default:m(()=>[!a(e).unmountOnHide.value||b?y(r.$slots,"default",{key:0}):z("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),ma=ya,xa=A({__name:"TabsIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c,{expose:l}){const g=c,e=T();l({updateIndicatorStyle:s}),C();const p=ra(),d=S({size:null,position:null}),t=S([]);ta(()=>[e.modelValue.value,e?.dir.value],()=>{s()},{immediate:!0,flush:"post"}),ia(()=>{t.value=Array.from(e.tabsList.value?.querySelectorAll('[role="tab"]')||[])}),sa(_(()=>[e.tabsList.value,...t.value]),s);function s(){const r=e.tabsList.value?.querySelector('[role="tab"][data-state="active"]');r&&(e.orientation.value==="horizontal"?d.value={size:r.offsetWidth,position:r.offsetLeft}:d.value={size:r.offsetHeight,position:r.offsetTop})}return(r,n)=>a(p)&&typeof d.value.size=="number"?(u(),f(a(w),I({key:0},g,{style:{"--reka-tabs-indicator-size":`${d.value.size}px`,"--reka-tabs-indicator-position":`${d.value.position}px`}}),{default:m(()=>[y(r.$slots,"default")]),_:3},16,["style"])):z("v-if",!0)}}),ha=xa,za=A({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c){const l=c,{loop:g}=P(l),{forwardRef:e,currentElement:p}=C(),d=T();return d.tabsList=p,(t,s)=>(u(),f(a(na),{"as-child":"",orientation:a(d).orientation.value,dir:a(d).dir.value,loop:a(g)},{default:m(()=>[k(a(w),{ref:a(e),role:"tablist","as-child":t.asChild,as:t.as,"aria-orientation":a(d).orientation.value},{default:m(()=>[y(t.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),_a=za,qa=A({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(c){const l=c,{forwardRef:g}=C(),e=T(),p=_(()=>H(e.baseId,l.value)),d=_(()=>e.contentIds.value.has(l.value)?E(e.baseId,l.value):void 0),t=_(()=>l.value===e.modelValue.value);return(s,r)=>(u(),f(a(va),{"as-child":"",focusable:!s.disabled,active:t.value},{default:m(()=>[k(a(w),{id:p.value,ref:a(g),role:"tab",type:s.as==="button"?"button":void 0,as:s.as,"as-child":s.asChild,"aria-selected":t.value?"true":"false","aria-controls":d.value,"data-state":t.value?"active":"inactive",disabled:s.disabled,"data-disabled":s.disabled?"":void 0,"data-orientation":a(e).orientation.value,onMousedown:r[0]||(r[0]=oa(n=>{!s.disabled&&n.ctrlKey===!1?a(e).changeModelValue(s.value):n.preventDefault()},["left"])),onKeydown:r[1]||(r[1]=la(n=>a(e).changeModelValue(s.value),["enter","space"])),onFocus:r[2]||(r[2]=()=>{const n=a(e).activationMode!=="manual";!t.value&&!s.disabled&&n&&a(e).changeModelValue(s.value)})},{default:m(()=>[y(s.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),wa=qa;const Ia={slots:{base:"font-medium inline-flex items-center",label:"truncate",leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailingIcon:"shrink-0"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},size:{xs:{base:"text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},sm:{base:"text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},md:{base:"text-xs px-2 py-1 gap-1 rounded-md",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},lg:{base:"text-sm px-2 py-1 gap-1.5 rounded-md",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"text-base px-2.5 py-1 gap-1.5 rounded-md",leadingIcon:"size-6",leadingAvatarSize:"2xs",trailingIcon:"size-6"}},square:{true:""}},compoundVariants:[{color:"primary",variant:"solid",class:"bg-primary text-inverted"},{color:"secondary",variant:"solid",class:"bg-secondary text-inverted"},{color:"success",variant:"solid",class:"bg-success text-inverted"},{color:"info",variant:"solid",class:"bg-info text-inverted"},{color:"warning",variant:"solid",class:"bg-warning text-inverted"},{color:"error",variant:"solid",class:"bg-error text-inverted"},{color:"primary",variant:"outline",class:"text-primary ring ring-inset ring-primary/50"},{color:"secondary",variant:"outline",class:"text-secondary ring ring-inset ring-secondary/50"},{color:"success",variant:"outline",class:"text-success ring ring-inset ring-success/50"},{color:"info",variant:"outline",class:"text-info ring ring-inset ring-info/50"},{color:"warning",variant:"outline",class:"text-warning ring ring-inset ring-warning/50"},{color:"error",variant:"outline",class:"text-error ring ring-inset ring-error/50"},{color:"primary",variant:"soft",class:"bg-primary/10 text-primary"},{color:"secondary",variant:"soft",class:"bg-secondary/10 text-secondary"},{color:"success",variant:"soft",class:"bg-success/10 text-success"},{color:"info",variant:"soft",class:"bg-info/10 text-info"},{color:"warning",variant:"soft",class:"bg-warning/10 text-warning"},{color:"error",variant:"soft",class:"bg-error/10 text-error"},{color:"primary",variant:"subtle",class:"bg-primary/10 text-primary ring ring-inset ring-primary/25"},{color:"secondary",variant:"subtle",class:"bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"},{color:"success",variant:"subtle",class:"bg-success/10 text-success ring ring-inset ring-success/25"},{color:"info",variant:"subtle",class:"bg-info/10 text-info ring ring-inset ring-info/25"},{color:"warning",variant:"subtle",class:"bg-warning/10 text-warning ring ring-inset ring-warning/25"},{color:"error",variant:"subtle",class:"bg-error/10 text-error ring ring-inset ring-error/25"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default"},{color:"neutral",variant:"soft",class:"text-default bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated"},{size:"xs",square:!0,class:"p-0.5"},{size:"sm",square:!0,class:"p-1"},{size:"md",square:!0,class:"p-1"},{size:"lg",square:!0,class:"p-1"},{size:"xl",square:!0,class:"p-1"}],defaultVariants:{color:"primary",variant:"solid",size:"md"}},Sa={__name:"Badge",props:{as:{type:null,required:!1,default:"span"},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(c){const l=c,g=F(),e=O("badge",l),p=D(),{orientation:d,size:t}=da(l),{isLeading:s,isTrailing:r,leadingIconName:n,trailingIconName:b}=ua(e),o=_(()=>V({extend:V(Ia),...p.ui?.badge||{}})({color:e.color,variant:e.variant,size:t.value??e.size,square:e.square||!g.default&&!e.label,fieldGroup:d.value}));return(v,$)=>(u(),f(a(w),{as:a(e).as,"data-slot":"base",class:h(o.value.base({class:[a(e).ui?.base,a(e).class]}))},{default:m(()=>[y(v.$slots,"leading",{ui:o.value},()=>[a(s)&&a(n)?(u(),f(M,{key:0,name:a(n),"data-slot":"leadingIcon",class:h(o.value.leadingIcon({class:a(e).ui?.leadingIcon}))},null,8,["name","class"])):a(e).avatar?(u(),f(j,I({key:1,size:a(e).ui?.leadingAvatarSize||o.value.leadingAvatarSize()},a(e).avatar,{"data-slot":"leadingAvatar",class:o.value.leadingAvatar({class:a(e).ui?.leadingAvatar})}),null,16,["size","class"])):z("",!0)]),y(v.$slots,"default",{ui:o.value},()=>[a(e).label!==void 0&&a(e).label!==null?(u(),B("span",{key:0,"data-slot":"label",class:h(o.value.label({class:a(e).ui?.label}))},R(a(e).label),3)):z("",!0)]),y(v.$slots,"trailing",{ui:o.value},()=>[a(r)&&a(b)?(u(),f(M,{key:0,name:a(b),"data-slot":"trailingIcon",class:h(o.value.trailingIcon({class:a(e).ui?.trailingIcon}))},null,8,["name","class"])):z("",!0)])]),_:3},8,["as","class"]))}},ka={slots:{root:"flex items-center gap-2",list:"relative flex p-1 group",indicator:"absolute transition-[translate,width] duration-200",trigger:["group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",label:"truncate",trailingBadge:"shrink-0",trailingBadgeSize:"sm",content:"w-full rounded-md focus-visible:outline-3"},variants:{color:{primary:{content:"outline-primary/25"},secondary:{content:"outline-secondary/25"},success:{content:"outline-success/25"},info:{content:"outline-info/25"},warning:{content:"outline-warning/25"},error:{content:"outline-error/25"},neutral:{content:"outline-inverted/25"}},variant:{pill:{list:"bg-elevated rounded-lg",trigger:["grow","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate"],indicator:"rounded-md shadow-xs"},link:{list:"border-default",indicator:"rounded-full",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full"}},orientation:{horizontal:{root:"flex-col",list:"w-full",indicator:"left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",trigger:"justify-center"},vertical:{list:"flex-col",indicator:"top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"}},size:{xs:{trigger:"px-2 py-1 text-xs gap-1",leadingIcon:"size-4",leadingAvatarSize:"3xs"},sm:{trigger:"px-2.5 py-1.5 text-xs gap-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs"},md:{trigger:"px-3 py-1.5 text-sm gap-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs"},lg:{trigger:"px-3 py-2 text-sm gap-2",leadingIcon:"size-5",leadingAvatarSize:"2xs"},xl:{trigger:"px-3 py-2 text-base gap-2",leadingIcon:"size-6",leadingAvatarSize:"xs"}}},compoundVariants:[{orientation:"horizontal",variant:"pill",class:{indicator:"inset-y-1"}},{orientation:"horizontal",variant:"link",class:{list:"border-b -mb-px",indicator:"-bottom-px h-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px"}},{orientation:"vertical",variant:"pill",class:{indicator:"inset-x-1",list:"items-center",trigger:"w-full justify-center"}},{orientation:"vertical",variant:"link",class:{list:"border-s -ms-px",indicator:"-start-px w-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px"}},{color:"primary",variant:"pill",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary"]}},{color:"secondary",variant:"pill",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary"]}},{color:"success",variant:"pill",class:{indicator:"bg-success",trigger:["data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success"]}},{color:"info",variant:"pill",class:{indicator:"bg-info",trigger:["data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info"]}},{color:"warning",variant:"pill",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning"]}},{color:"error",variant:"pill",class:{indicator:"bg-error",trigger:["data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error"]}},{color:"neutral",variant:"pill",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted"]}},{color:"primary",variant:"link",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary"]}},{color:"secondary",variant:"link",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary"]}},{color:"success",variant:"link",class:{indicator:"bg-success",trigger:["data-[state=active]:text-success outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success"]}},{color:"info",variant:"link",class:{indicator:"bg-info",trigger:["data-[state=active]:text-info outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info"]}},{color:"warning",variant:"link",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning"]}},{color:"error",variant:"link",class:{indicator:"bg-error",trigger:["data-[state=active]:text-error outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error"]}},{color:"neutral",variant:"link",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted"]}}],defaultVariants:{color:"primary",variant:"pill",size:"md"}},Ba={__name:"Tabs",props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:"0"},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(c,{expose:l,emit:g}){const e=c,p=g,d=F(),t=O("tabs",e),s=D(),r=ca(ga(t,"as","unmountOnHide"),p),n=_(()=>V({extend:V(ka),...s.ui?.tabs||{}})({color:t.color,variant:t.variant,size:t.size,orientation:t.orientation})),b=S([]);function o(v,$){b.value[v]=$}return l({triggersRef:b}),(v,$)=>(u(),f(a(ba),I(a(r),{"model-value":a(t).modelValue,"default-value":a(t).defaultValue,orientation:a(t).orientation,"activation-mode":a(t).activationMode,"data-slot":"root",class:n.value.root({class:[a(t).ui?.root,a(t).class]})}),{default:m(()=>[k(a(_a),{"data-slot":"list",class:h(n.value.list({class:a(t).ui?.list}))},{default:m(()=>[k(a(ha),{"data-slot":"indicator",class:h(n.value.indicator({class:a(t).ui?.indicator}))},null,8,["class"]),y(v.$slots,"list-leading"),(u(!0),B(N,null,K(a(t).items,(i,x)=>(u(),f(a(wa),{key:a(q)(i,a(t).valueKey)??x,ref_for:!0,ref:G=>o(x,G),value:a(q)(i,a(t).valueKey)??String(x),disabled:i.disabled,"data-slot":"trigger",class:h(n.value.trigger({class:[a(t).ui?.trigger,i.ui?.trigger]}))},{default:m(()=>[y(v.$slots,"leading",{item:i,index:x,ui:n.value},()=>[i.icon?(u(),f(M,{key:0,name:i.icon,"data-slot":"leadingIcon",class:h(n.value.leadingIcon({class:[a(t).ui?.leadingIcon,i.ui?.leadingIcon]}))},null,8,["name","class"])):i.avatar?(u(),f(j,I({key:1,size:i.ui?.leadingAvatarSize||a(t).ui?.leadingAvatarSize||n.value.leadingAvatarSize()},{ref_for:!0},i.avatar,{"data-slot":"leadingAvatar",class:n.value.leadingAvatar({class:[a(t).ui?.leadingAvatar,i.ui?.leadingAvatar]})}),null,16,["size","class"])):z("",!0)]),a(q)(i,a(t).labelKey)||d.default?(u(),B("span",{key:0,"data-slot":"label",class:h(n.value.label({class:[a(t).ui?.label,i.ui?.label]}))},[y(v.$slots,"default",{item:i,index:x},()=>[L(R(a(q)(i,a(t).labelKey)),1)])],2)):z("",!0),y(v.$slots,"trailing",{item:i,index:x,ui:n.value},()=>[i.badge||i.badge===0?(u(),f(Sa,I({key:0,color:"neutral",variant:"outline",size:i.ui?.trailingBadgeSize||a(t).ui?.trailingBadgeSize||n.value.trailingBadgeSize()},{ref_for:!0},typeof i.badge=="string"||typeof i.badge=="number"?{label:i.badge}:i.badge,{"data-slot":"trailingBadge",class:n.value.trailingBadge({class:[a(t).ui?.trailingBadge,i.ui?.trailingBadge]})}),null,16,["size","class"])):z("",!0)])]),_:2},1032,["value","disabled","class"]))),128)),y(v.$slots,"list-trailing")]),_:3},8,["class"]),a(t).content?(u(!0),B(N,{key:0},K(a(t).items,(i,x)=>(u(),f(a(ma),{key:a(q)(i,a(t).valueKey)??x,value:a(q)(i,a(t).valueKey)??String(x),"data-slot":"content",class:h(n.value.content({class:[a(t).ui?.content,i.ui?.content,i.class]}))},{default:m(()=>[y(v.$slots,i.slot||"content",{item:i,index:x,ui:n.value},()=>[L(R(i.content),1)])]),_:2},1032,["value","class"]))),128)):z("",!0)]),_:3},16,["model-value","default-value","orientation","activation-mode","class"]))}};export{Ba as _,Sa as a};
1
+ import{a as A,aM as P,bv as J,u as C,aN as Q,s as U,o as u,c as f,w as m,b as y,e as a,P as w,r as S,G as W,aQ as X,x as Y,ak as Z,z as k,am as aa,l as z,bm as ea,f as _,J as ta,bw as ia,bx as sa,m as I,by as ra,bz as na,aO as la,aP as oa,aq as O,ar as F,bA as da,a4 as M,n as h,at as j,h as B,p as R,bB as ua,av as V,au as G,aR as ca,aS as ga,F as K,j as L,bC as q,a6 as N}from"./index-sWxuTsa7.js";import{R as va}from"./RovingFocusItem-DC_06OmN.js";const[T,fa]=X("TabsRoot");var pa=A({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(c,{emit:l}){const g=c,e=l,{orientation:p,unmountOnHide:d,dir:t}=P(g),s=J(t);C();const r=Q(g,"modelValue",e,{defaultValue:g.defaultValue,passive:g.modelValue===void 0}),n=S(),b=W(new Set);return fa({modelValue:r,changeModelValue:o=>{r.value=o},orientation:p,dir:s,unmountOnHide:d,activationMode:g.activationMode,baseId:U(void 0,"reka-tabs"),tabsList:n,contentIds:b,registerContent:o=>{b.value=new Set([...b.value,o])},unregisterContent:o=>{const v=new Set(b.value);v.delete(o),b.value=v}}),(o,v)=>(u(),f(a(w),{dir:a(s),"data-orientation":a(p),"as-child":o.asChild,as:o.as},{default:m(()=>[y(o.$slots,"default",{modelValue:a(r)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),ba=pa;function H(c,l){return`${c}-trigger-${l}`}function D(c,l){return`${c}-content-${l}`}var ya=A({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c){const l=c,{forwardRef:g}=C(),e=T(),p=_(()=>H(e.baseId,l.value)),d=_(()=>D(e.baseId,l.value)),t=_(()=>l.value===e.modelValue.value),s=S(t.value);return Y(()=>{e.registerContent(l.value),requestAnimationFrame(()=>{s.value=!1})}),Z(()=>{e.unregisterContent(l.value)}),(r,n)=>(u(),f(a(ea),{present:r.forceMount||t.value,"force-mount":""},{default:m(({present:b})=>[k(a(w),{id:d.value,ref:a(g),"as-child":r.asChild,as:r.as,role:"tabpanel","data-state":t.value?"active":"inactive","data-orientation":a(e).orientation.value,"aria-labelledby":p.value,hidden:!b,tabindex:"0",style:aa({animationDuration:s.value?"0s":void 0})},{default:m(()=>[!a(e).unmountOnHide.value||b?y(r.$slots,"default",{key:0}):z("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),ma=ya,xa=A({__name:"TabsIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c,{expose:l}){const g=c,e=T();l({updateIndicatorStyle:s}),C();const p=ra(),d=S({size:null,position:null}),t=S([]);ta(()=>[e.modelValue.value,e?.dir.value],()=>{s()},{immediate:!0,flush:"post"}),ia(()=>{t.value=Array.from(e.tabsList.value?.querySelectorAll('[role="tab"]')||[])}),sa(_(()=>[e.tabsList.value,...t.value]),s);function s(){const r=e.tabsList.value?.querySelector('[role="tab"][data-state="active"]');r&&(e.orientation.value==="horizontal"?d.value={size:r.offsetWidth,position:r.offsetLeft}:d.value={size:r.offsetHeight,position:r.offsetTop})}return(r,n)=>a(p)&&typeof d.value.size=="number"?(u(),f(a(w),I({key:0},g,{style:{"--reka-tabs-indicator-size":`${d.value.size}px`,"--reka-tabs-indicator-position":`${d.value.position}px`}}),{default:m(()=>[y(r.$slots,"default")]),_:3},16,["style"])):z("v-if",!0)}}),ha=xa,za=A({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c){const l=c,{loop:g}=P(l),{forwardRef:e,currentElement:p}=C(),d=T();return d.tabsList=p,(t,s)=>(u(),f(a(na),{"as-child":"",orientation:a(d).orientation.value,dir:a(d).dir.value,loop:a(g)},{default:m(()=>[k(a(w),{ref:a(e),role:"tablist","as-child":t.asChild,as:t.as,"aria-orientation":a(d).orientation.value},{default:m(()=>[y(t.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),_a=za,qa=A({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(c){const l=c,{forwardRef:g}=C(),e=T(),p=_(()=>H(e.baseId,l.value)),d=_(()=>e.contentIds.value.has(l.value)?D(e.baseId,l.value):void 0),t=_(()=>l.value===e.modelValue.value);return(s,r)=>(u(),f(a(va),{"as-child":"",focusable:!s.disabled,active:t.value},{default:m(()=>[k(a(w),{id:p.value,ref:a(g),role:"tab",type:s.as==="button"?"button":void 0,as:s.as,"as-child":s.asChild,"aria-selected":t.value?"true":"false","aria-controls":d.value,"data-state":t.value?"active":"inactive",disabled:s.disabled,"data-disabled":s.disabled?"":void 0,"data-orientation":a(e).orientation.value,onMousedown:r[0]||(r[0]=oa(n=>{!s.disabled&&n.ctrlKey===!1?a(e).changeModelValue(s.value):n.preventDefault()},["left"])),onKeydown:r[1]||(r[1]=la(n=>a(e).changeModelValue(s.value),["enter","space"])),onFocus:r[2]||(r[2]=()=>{const n=a(e).activationMode!=="manual";!t.value&&!s.disabled&&n&&a(e).changeModelValue(s.value)})},{default:m(()=>[y(s.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),wa=qa;const Ia={slots:{base:"font-medium inline-flex items-center",label:"truncate",leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailingIcon:"shrink-0"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},size:{xs:{base:"text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},sm:{base:"text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},md:{base:"text-xs px-2 py-1 gap-1 rounded-md",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},lg:{base:"text-sm px-2 py-1 gap-1.5 rounded-md",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"text-base px-2.5 py-1 gap-1.5 rounded-md",leadingIcon:"size-6",leadingAvatarSize:"2xs",trailingIcon:"size-6"}},square:{true:""}},compoundVariants:[{color:"primary",variant:"solid",class:"bg-primary text-inverted"},{color:"secondary",variant:"solid",class:"bg-secondary text-inverted"},{color:"success",variant:"solid",class:"bg-success text-inverted"},{color:"info",variant:"solid",class:"bg-info text-inverted"},{color:"warning",variant:"solid",class:"bg-warning text-inverted"},{color:"error",variant:"solid",class:"bg-error text-inverted"},{color:"primary",variant:"outline",class:"text-primary ring ring-inset ring-primary/50"},{color:"secondary",variant:"outline",class:"text-secondary ring ring-inset ring-secondary/50"},{color:"success",variant:"outline",class:"text-success ring ring-inset ring-success/50"},{color:"info",variant:"outline",class:"text-info ring ring-inset ring-info/50"},{color:"warning",variant:"outline",class:"text-warning ring ring-inset ring-warning/50"},{color:"error",variant:"outline",class:"text-error ring ring-inset ring-error/50"},{color:"primary",variant:"soft",class:"bg-primary/10 text-primary"},{color:"secondary",variant:"soft",class:"bg-secondary/10 text-secondary"},{color:"success",variant:"soft",class:"bg-success/10 text-success"},{color:"info",variant:"soft",class:"bg-info/10 text-info"},{color:"warning",variant:"soft",class:"bg-warning/10 text-warning"},{color:"error",variant:"soft",class:"bg-error/10 text-error"},{color:"primary",variant:"subtle",class:"bg-primary/10 text-primary ring ring-inset ring-primary/25"},{color:"secondary",variant:"subtle",class:"bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"},{color:"success",variant:"subtle",class:"bg-success/10 text-success ring ring-inset ring-success/25"},{color:"info",variant:"subtle",class:"bg-info/10 text-info ring ring-inset ring-info/25"},{color:"warning",variant:"subtle",class:"bg-warning/10 text-warning ring ring-inset ring-warning/25"},{color:"error",variant:"subtle",class:"bg-error/10 text-error ring ring-inset ring-error/25"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default"},{color:"neutral",variant:"soft",class:"text-default bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated"},{size:"xs",square:!0,class:"p-0.5"},{size:"sm",square:!0,class:"p-1"},{size:"md",square:!0,class:"p-1"},{size:"lg",square:!0,class:"p-1"},{size:"xl",square:!0,class:"p-1"}],defaultVariants:{color:"primary",variant:"solid",size:"md"}},Sa={__name:"Badge",props:{as:{type:null,required:!1,default:"span"},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(c){const l=c,g=O(),e=F("badge",l),p=G(),{orientation:d,size:t}=da(l),{isLeading:s,isTrailing:r,leadingIconName:n,trailingIconName:b}=ua(e),o=_(()=>V({extend:V(Ia),...p.ui?.badge||{}})({color:e.color,variant:e.variant,size:t.value??e.size,square:e.square||!g.default&&!e.label,fieldGroup:d.value}));return(v,$)=>(u(),f(a(w),{as:a(e).as,"data-slot":"base",class:h(o.value.base({class:[a(e).ui?.base,a(e).class]}))},{default:m(()=>[y(v.$slots,"leading",{ui:o.value},()=>[a(s)&&a(n)?(u(),f(M,{key:0,name:a(n),"data-slot":"leadingIcon",class:h(o.value.leadingIcon({class:a(e).ui?.leadingIcon}))},null,8,["name","class"])):a(e).avatar?(u(),f(j,I({key:1,size:a(e).ui?.leadingAvatarSize||o.value.leadingAvatarSize()},a(e).avatar,{"data-slot":"leadingAvatar",class:o.value.leadingAvatar({class:a(e).ui?.leadingAvatar})}),null,16,["size","class"])):z("",!0)]),y(v.$slots,"default",{ui:o.value},()=>[a(e).label!==void 0&&a(e).label!==null?(u(),B("span",{key:0,"data-slot":"label",class:h(o.value.label({class:a(e).ui?.label}))},R(a(e).label),3)):z("",!0)]),y(v.$slots,"trailing",{ui:o.value},()=>[a(r)&&a(b)?(u(),f(M,{key:0,name:a(b),"data-slot":"trailingIcon",class:h(o.value.trailingIcon({class:a(e).ui?.trailingIcon}))},null,8,["name","class"])):z("",!0)])]),_:3},8,["as","class"]))}},ka={slots:{root:"flex items-center gap-2",list:"relative flex p-1 group",indicator:"absolute transition-[translate,width] duration-200",trigger:["group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",label:"truncate",trailingBadge:"shrink-0",trailingBadgeSize:"sm",content:"w-full rounded-md focus-visible:outline-3"},variants:{color:{primary:{content:"outline-primary/25"},secondary:{content:"outline-secondary/25"},success:{content:"outline-success/25"},info:{content:"outline-info/25"},warning:{content:"outline-warning/25"},error:{content:"outline-error/25"},neutral:{content:"outline-inverted/25"}},variant:{pill:{list:"bg-elevated rounded-lg",trigger:["grow","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate"],indicator:"rounded-md shadow-xs"},link:{list:"border-default",indicator:"rounded-full",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full"}},orientation:{horizontal:{root:"flex-col",list:"w-full",indicator:"left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",trigger:"justify-center"},vertical:{list:"flex-col",indicator:"top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"}},size:{xs:{trigger:"px-2 py-1 text-xs gap-1",leadingIcon:"size-4",leadingAvatarSize:"3xs"},sm:{trigger:"px-2.5 py-1.5 text-xs gap-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs"},md:{trigger:"px-3 py-1.5 text-sm gap-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs"},lg:{trigger:"px-3 py-2 text-sm gap-2",leadingIcon:"size-5",leadingAvatarSize:"2xs"},xl:{trigger:"px-3 py-2 text-base gap-2",leadingIcon:"size-6",leadingAvatarSize:"xs"}}},compoundVariants:[{orientation:"horizontal",variant:"pill",class:{indicator:"inset-y-1"}},{orientation:"horizontal",variant:"link",class:{list:"border-b -mb-px",indicator:"-bottom-px h-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px"}},{orientation:"vertical",variant:"pill",class:{indicator:"inset-x-1",list:"items-center",trigger:"w-full justify-center"}},{orientation:"vertical",variant:"link",class:{list:"border-s -ms-px",indicator:"-start-px w-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px"}},{color:"primary",variant:"pill",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary"]}},{color:"secondary",variant:"pill",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary"]}},{color:"success",variant:"pill",class:{indicator:"bg-success",trigger:["data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success"]}},{color:"info",variant:"pill",class:{indicator:"bg-info",trigger:["data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info"]}},{color:"warning",variant:"pill",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning"]}},{color:"error",variant:"pill",class:{indicator:"bg-error",trigger:["data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error"]}},{color:"neutral",variant:"pill",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted"]}},{color:"primary",variant:"link",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary"]}},{color:"secondary",variant:"link",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary"]}},{color:"success",variant:"link",class:{indicator:"bg-success",trigger:["data-[state=active]:text-success outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success"]}},{color:"info",variant:"link",class:{indicator:"bg-info",trigger:["data-[state=active]:text-info outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info"]}},{color:"warning",variant:"link",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning"]}},{color:"error",variant:"link",class:{indicator:"bg-error",trigger:["data-[state=active]:text-error outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error"]}},{color:"neutral",variant:"link",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted"]}}],defaultVariants:{color:"primary",variant:"pill",size:"md"}},Ba={__name:"Tabs",props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:"0"},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(c,{expose:l,emit:g}){const e=c,p=g,d=O(),t=F("tabs",e),s=G(),r=ca(ga(t,"as","unmountOnHide"),p),n=_(()=>V({extend:V(ka),...s.ui?.tabs||{}})({color:t.color,variant:t.variant,size:t.size,orientation:t.orientation})),b=S([]);function o(v,$){b.value[v]=$}return l({triggersRef:b}),(v,$)=>(u(),f(a(ba),I(a(r),{"model-value":a(t).modelValue,"default-value":a(t).defaultValue,orientation:a(t).orientation,"activation-mode":a(t).activationMode,"data-slot":"root",class:n.value.root({class:[a(t).ui?.root,a(t).class]})}),{default:m(()=>[k(a(_a),{"data-slot":"list",class:h(n.value.list({class:a(t).ui?.list}))},{default:m(()=>[k(a(ha),{"data-slot":"indicator",class:h(n.value.indicator({class:a(t).ui?.indicator}))},null,8,["class"]),y(v.$slots,"list-leading"),(u(!0),B(K,null,L(a(t).items,(i,x)=>(u(),f(a(wa),{key:a(q)(i,a(t).valueKey)??x,ref_for:!0,ref:E=>o(x,E),value:a(q)(i,a(t).valueKey)??String(x),disabled:i.disabled,"data-slot":"trigger",class:h(n.value.trigger({class:[a(t).ui?.trigger,i.ui?.trigger]}))},{default:m(()=>[y(v.$slots,"leading",{item:i,index:x,ui:n.value},()=>[i.icon?(u(),f(M,{key:0,name:i.icon,"data-slot":"leadingIcon",class:h(n.value.leadingIcon({class:[a(t).ui?.leadingIcon,i.ui?.leadingIcon]}))},null,8,["name","class"])):i.avatar?(u(),f(j,I({key:1,size:i.ui?.leadingAvatarSize||a(t).ui?.leadingAvatarSize||n.value.leadingAvatarSize()},{ref_for:!0},i.avatar,{"data-slot":"leadingAvatar",class:n.value.leadingAvatar({class:[a(t).ui?.leadingAvatar,i.ui?.leadingAvatar]})}),null,16,["size","class"])):z("",!0)]),a(q)(i,a(t).labelKey)||d.default?(u(),B("span",{key:0,"data-slot":"label",class:h(n.value.label({class:[a(t).ui?.label,i.ui?.label]}))},[y(v.$slots,"default",{item:i,index:x},()=>[N(R(a(q)(i,a(t).labelKey)),1)])],2)):z("",!0),y(v.$slots,"trailing",{item:i,index:x,ui:n.value},()=>[i.badge||i.badge===0?(u(),f(Sa,I({key:0,color:"neutral",variant:"outline",size:i.ui?.trailingBadgeSize||a(t).ui?.trailingBadgeSize||n.value.trailingBadgeSize()},{ref_for:!0},typeof i.badge=="string"||typeof i.badge=="number"?{label:i.badge}:i.badge,{"data-slot":"trailingBadge",class:n.value.trailingBadge({class:[a(t).ui?.trailingBadge,i.ui?.trailingBadge]})}),null,16,["size","class"])):z("",!0)])]),_:2},1032,["value","disabled","class"]))),128)),y(v.$slots,"list-trailing")]),_:3},8,["class"]),a(t).content?(u(!0),B(K,{key:0},L(a(t).items,(i,x)=>(u(),f(a(ma),{key:a(q)(i,a(t).valueKey)??x,value:a(q)(i,a(t).valueKey)??String(x),"data-slot":"content",class:h(n.value.content({class:[a(t).ui?.content,i.ui?.content,i.class]}))},{default:m(()=>[y(v.$slots,i.slot||"content",{item:i,index:x,ui:n.value},()=>[N(R(i.content),1)])]),_:2},1032,["value","class"]))),128)):z("",!0)]),_:3},16,["model-value","default-value","orientation","activation-mode","class"]))}};export{Ba as _,Sa as a};
@@ -0,0 +1 @@
1
+ import{_ as T}from"./Tabs-D1UiZNaZ.js";import{a as x,J as V,o as k,h as w,z as y,r as m,f as z,C,ae as W}from"./index-sWxuTsa7.js";const E=x({__name:"Tabs",props:{modelValue:{},items:{},size:{}},emits:["update:modelValue"],setup(s,{emit:d}){const c=s,f=d,o=m(),l=m(),a=z({get:()=>c.modelValue,set:e=>f("update:modelValue",e)}),u=async()=>{if(await C(),!o.value||!l.value)return;const e=c.items.findIndex(h=>h.value===a.value);if(e<0)return;const t=l.value.$el.querySelectorAll('[role="tab"]')[e];if(!t)return;const i=o.value,b=i.clientWidth,p=t.offsetLeft,v=t.offsetWidth,_=p+v/2-b/2;i.scrollTo({left:Math.max(0,_),behavior:"smooth"})};return V(a,()=>{u()},{immediate:!1}),(e,n)=>{const r=T;return k(),w("div",{ref_key:"scrollContainer",ref:o,class:"overflow-x-auto overflow-y-hidden scrollbar-hide"},[y(r,{ref_key:"tabsRef",ref:l,modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=t=>a.value=t),size:s.size,items:s.items,content:!1,class:"min-w-max"},null,8,["modelValue","size","items"])],512)}}}),g=W(E,[["__scopeId","data-v-4a114c59"]]);export{g as T};
@@ -1 +1 @@
1
- import{a,o as r,h as d,n,b as s}from"./index-DkWTvE7d.js";const i=a({__name:"ThemeCard",props:{shadow:{type:Boolean,default:!0}},setup(e){return(o,t)=>(r(),d("div",{class:n(["overflow-hidden rounded-2xl border border-gray-200/60 bg-card-bg transition-shadow duration-300 hover:shadow-lg motion-reduce:transition-none dark:border-white/5 dark:bg-card-dark",{"shadow-elevated":e.shadow}])},[s(o.$slots,"default")],2))}});export{i as _};
1
+ import{a,o as r,h as d,n,b as s}from"./index-sWxuTsa7.js";const i=a({__name:"ThemeCard",props:{shadow:{type:Boolean,default:!0}},setup(e){return(o,t)=>(r(),d("div",{class:n(["overflow-hidden rounded-2xl border border-gray-200/60 bg-card-bg transition-shadow duration-300 hover:shadow-lg motion-reduce:transition-none dark:border-white/5 dark:bg-card-dark",{"shadow-elevated":e.shadow}])},[s(o.$slots,"default")],2))}});export{i as _};
@@ -0,0 +1 @@
1
+ import{aE as D,a as ye,a3 as pe,x as be,ak as Se,J as Ye,o as T,h as $,n as L,z as w,c as xe,a5 as De,i as F,p as Z,l as ee,r as f,f as d,K as Me}from"./index-sWxuTsa7.js";import{_ as he}from"./Select-DLK2LYhO.js";import{T as we}from"./Tabs-N3Q-Mpqi.js";import{_ as ae}from"./DatePicker.vue_vue_type_script_setup_true_lang-DqNBNa1D.js";function te(o){const u=new Date(o*1e3),l=u.getFullYear(),r=String(u.getMonth()+1).padStart(2,"0"),i=String(u.getDate()).padStart(2,"0");return`${l}-${r}-${i}`}function Fe(o){const u=new Date(o*1e3),l=u.getFullYear(),r=String(u.getMonth()+1).padStart(2,"0"),i=String(u.getDate()).padStart(2,"0"),p=String(u.getHours()).padStart(2,"0"),v=String(u.getMinutes()).padStart(2,"0");return`${l}-${r}-${i} ${p}:${v}`}function Ee(o){return D.unix(o).format("YYYY-MM-DD HH:mm:ss")}function Qe(o,u){const l=te(o);if(u===null)return`${l} ~ 至今`;const r=te(u);return l===r?l:`${l} ~ ${r}`}function le(o,u,l="YYYY/MM/DD",r=" - "){const i=D.unix(o).format(l),p=D.unix(u).format(l);return i===p?i:`${i}${r}${p}`}const E=["recent","quarter","year","custom"],ne=[365,730,1825,0];function ze(o){if(!o)return[...E];const u=new Set(o),l=E.filter(r=>u.has(r));return l.length>0?l:[...E]}function qe(o){if(!o)return[...ne];const u=new Set(o),l=ne.filter(r=>u.has(r));return l.length>0?l:[365]}function Te(o,u){return[o??"",u?.availableYears.join(",")??"",u?.fullRange?.start??"",u?.fullRange?.end??""].join("|")}const ke={key:1,class:"flex items-center"},Re={key:2,class:"flex items-center"},Ve={key:3,class:"flex items-center gap-1"},Be=ye({__name:"TimeSelect",props:{sessionId:{},modelValue:{},visible:{type:Boolean,default:!0},initialState:{},rangeSource:{},allowedModes:{},allowedRecentDays:{},size:{default:"md"}},emits:["update:modelValue","update:fullRange","update:availableYears","initializationComplete"],setup(o,{emit:u}){const l=o,r=u,{t:i}=pe(),p=f(!1),v=f([]),c=f(null),k=d(()=>ze(l.allowedModes)),C=d(()=>qe(l.allowedRecentDays)),z=d(()=>l.size==="sm"?"xs":"sm"),Q=d(()=>l.size==="sm"?"text-xs":"text-sm"),b=f("recent"),S=f(365),g=f(0),m=f(0),y=f(1),Y=f(""),x=f(""),R=f(!1);let q=0;function V(a){const e=new Date(a*1e3);return{year:e.getFullYear(),quarter:Math.floor(e.getMonth()/3)+1}}function re(a,e){const t=(e-1)*3,s=new Date(a,t,1,0,0,0),n=new Date(a,t+3,0,23,59,59);return{startTs:Math.floor(s.getTime()/1e3),endTs:Math.floor(n.getTime()/1e3)}}function se(a){const e=new Date(a,0,1,0,0,0),t=new Date(a,11,31,23,59,59);return{startTs:Math.floor(e.getTime()/1e3),endTs:Math.floor(t.getTime()/1e3)}}const ue=d(()=>[{label:i("common.timeSelect.mode.recent"),value:"recent"},{label:i("common.timeSelect.mode.quarter"),value:"quarter"},{label:i("common.timeSelect.mode.year"),value:"year"},{label:i("common.timeSelect.mode.custom"),value:"custom"}].filter(a=>k.value.includes(a.value))),oe=d(()=>{const a=new Map([[365,i("common.timeSelect.recent.oneYear")],[730,i("common.timeSelect.recent.twoYears")],[1825,i("common.timeSelect.recent.fiveYears")],[0,i("common.timeSelect.recent.all")]]);return C.value.map(e=>({label:a.get(e)??String(e),value:e}))}),B=d(()=>c.value?V(c.value.start):{year:0,quarter:1}),O=d(()=>c.value?V(c.value.end):{year:0,quarter:1}),ie=d(()=>{const a=B.value;return m.value>a.year||m.value===a.year&&y.value>a.quarter}),ce=d(()=>{const a=O.value;return m.value<a.year||m.value===a.year&&y.value<a.quarter}),de=d(()=>v.value.length===0?!1:v.value.indexOf(g.value)<v.value.length-1),ve=d(()=>v.value.length===0?!1:v.value.indexOf(g.value)>0),U=d(()=>i("common.timeSelect.quarter.label",{year:m.value,quarter:y.value})),A=d(()=>i("common.timeSelect.year.label",{year:g.value}));function me(a){return{365:i("common.timeSelect.display.recent365"),730:i("common.timeSelect.display.recent730"),1825:i("common.timeSelect.display.recent1825")}[a]||""}function N(a){return C.value.includes(a)?a:C.value[0]??365}function fe(){if(!c.value)return null;const a={mode:b.value};switch(b.value){case"recent":{if(a.recentDays=S.value,S.value===0)return{startTs:c.value.start,endTs:c.value.end,displayLabel:le(c.value.start,c.value.end),isFullRange:!0,state:a};const e=c.value.end;return{startTs:Math.max(e-S.value*86400,c.value.start),endTs:e,displayLabel:me(S.value),isFullRange:!1,state:a}}case"quarter":return a.quarterYear=m.value,a.quarter=y.value,{...re(m.value,y.value),displayLabel:U.value,isFullRange:!1,state:a};case"year":return a.year=g.value,{...se(g.value),displayLabel:A.value,isFullRange:!1,state:a};case"custom":{if(a.customStart=Y.value,a.customEnd=x.value,!Y.value||!x.value)return null;let e=D(Y.value).startOf("day").unix(),t=D(x.value).endOf("day").unix();return e>t&&([e,t]=[t,e]),{startTs:e,endTs:t,displayLabel:le(e,t),isFullRange:!1,state:a}}}}function M(){const a=fe();a&&r("update:modelValue",a)}function P(a){let e=m.value,t=y.value+a;t>4&&(e++,t=1),t<1&&(e--,t=4);const s=B.value,n=O.value;e<s.year||e===s.year&&t<s.quarter||e>n.year||e===n.year&&t>n.quarter||(m.value=e,y.value=t,M())}function _(a){const e=v.value,s=e.indexOf(g.value)-a;s>=0&&s<e.length&&(g.value=e[s],M())}function ge(a){if(c.value)switch(a){case"recent":S.value=N(S.value);break;case"quarter":{const{year:e,quarter:t}=V(c.value.end);m.value=e,y.value=t;break}case"year":{g.value=v.value[0]||new Date(c.value.end*1e3).getFullYear();break}case"custom":{const e=c.value.end,t=Math.max(e-30*86400,c.value.start);Y.value=D.unix(t).format("YYYY-MM-DD"),x.value=D.unix(e).format("YYYY-MM-DD");break}}}const j=d({get:()=>b.value,set:a=>{b.value=a,R.value=!0,ge(a),R.value=!1,M()}}),H=d({get:()=>S.value,set:a=>{S.value=a,M()}}),K=d({get:()=>Y.value,set:a=>{Y.value=a,x.value&&M()}}),J=d({get:()=>x.value,set:a=>{x.value=a,Y.value&&M()}});async function G(){const a=++q;if(!l.rangeSource&&!l.sessionId){v.value=[],c.value=null,r("update:modelValue",null),r("update:fullRange",null),r("update:availableYears",[]),p.value=!0,r("initializationComplete",!1);return}let e=!1;try{let t,s;if(l.rangeSource)t=l.rangeSource.availableYears,s=l.rangeSource.fullRange;else{const h=Me();[t,s]=await Promise.all([h.getAvailableYears(l.sessionId),h.getTimeRange(l.sessionId)])}if(a!==q)return;v.value=t,c.value=s,e=s!==null,r("update:fullRange",s),r("update:availableYears",t);const n=l.initialState,W=n?.mode??k.value[0]??"recent",X=k.value.includes(W)?W:k.value[0]??"recent";switch(b.value=X,R.value=!0,X){case"recent":S.value=N(n?.recentDays??365);break;case"quarter":{if(n?.quarterYear&&n?.quarter)m.value=n.quarterYear,y.value=n.quarter;else if(s){const{year:h,quarter:I}=V(s.end);m.value=h,y.value=I}break}case"year":{n?.year&&t.includes(n.year)?g.value=n.year:g.value=t[0]||0;break}case"custom":{if(n?.customStart&&n?.customEnd)Y.value=n.customStart,x.value=n.customEnd;else if(s){const h=s.end,I=Math.max(h-30*86400,s.start);Y.value=D.unix(I).format("YYYY-MM-DD"),x.value=D.unix(h).format("YYYY-MM-DD")}break}}R.value=!1,e?M():r("update:modelValue",null)}catch(t){if(a!==q)return;console.error("TimeSelect 加载数据失败:",t),v.value=[],c.value=null,r("update:modelValue",null),r("update:fullRange",null),r("update:availableYears",[])}finally{a===q&&(p.value=!0,r("initializationComplete",e))}}return be(()=>{G()}),Se(()=>{q++}),Ye(()=>Te(l.sessionId,l.rangeSource),()=>{p.value=!1,G()}),(a,e)=>{const t=he,s=De;return p.value?(T(),$("div",{key:0,class:L(["flex items-center gap-2",{invisible:!o.visible}])},[w(t,{modelValue:j.value,"onUpdate:modelValue":e[0]||(e[0]=n=>j.value=n),items:ue.value,"value-key":"value",size:z.value,color:"neutral",variant:"soft",ui:{item:"py-1.5"},class:"h-8 w-[88px] shrink-0 rounded-lg bg-elevated focus-visible:ring-1 focus-visible:ring-gray-300/60 dark:focus-visible:ring-white/15"},null,8,["modelValue","items","size"]),b.value==="recent"?(T(),xe(we,{key:0,modelValue:H.value,"onUpdate:modelValue":e[1]||(e[1]=n=>H.value=n),items:oe.value,size:z.value,class:"min-w-0 shrink"},null,8,["modelValue","items","size"])):b.value==="quarter"?(T(),$("div",ke,[w(s,{icon:"i-heroicons-chevron-left",size:z.value,variant:"ghost",color:"neutral",disabled:!ie.value,onClick:e[2]||(e[2]=n=>P(-1))},null,8,["size","disabled"]),F("span",{class:L(["whitespace-nowrap px-0.5 font-medium text-gray-700 dark:text-gray-300",Q.value])},Z(U.value),3),w(s,{icon:"i-heroicons-chevron-right",size:z.value,variant:"ghost",color:"neutral",disabled:!ce.value,onClick:e[3]||(e[3]=n=>P(1))},null,8,["size","disabled"])])):b.value==="year"?(T(),$("div",Re,[w(s,{icon:"i-heroicons-chevron-left",size:z.value,variant:"ghost",color:"neutral",disabled:!de.value,onClick:e[4]||(e[4]=n=>_(-1))},null,8,["size","disabled"]),F("span",{class:L(["whitespace-nowrap px-0.5 font-medium text-gray-700 dark:text-gray-300",Q.value])},Z(A.value),3),w(s,{icon:"i-heroicons-chevron-right",size:z.value,variant:"ghost",color:"neutral",disabled:!ve.value,onClick:e[5]||(e[5]=n=>_(1))},null,8,["size","disabled"])])):b.value==="custom"?(T(),$("div",Ve,[w(ae,{modelValue:K.value,"onUpdate:modelValue":e[6]||(e[6]=n=>K.value=n),"width-class":"w-28",clearable:!1,size:o.size},null,8,["modelValue","size"]),e[8]||(e[8]=F("span",{class:"text-xs text-gray-400"},"-",-1)),w(ae,{modelValue:J.value,"onUpdate:modelValue":e[7]||(e[7]=n=>J.value=n),"width-class":"w-28",clearable:!1,size:o.size},null,8,["modelValue","size"])])):ee("",!0)],2)):ee("",!0)}}});export{Be as _,Ee as a,Qe as b,le as c,Fe as d,te as f};
@@ -1 +1 @@
1
- import{a as m,i as h,o as n,c as o,m as p,aa as g,ab as E,f as d,h as f,s as B,F as c,q as V}from"./index-DkWTvE7d.js";var k=m({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,{primitiveElement:s,currentElement:l}=E(),t=d(()=>e.checked??e.value);return h(t,(a,r)=>{if(!l.value)return;const u=l.value,_=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(_,"value").set;if(v&&a!==r){const b=new Event("input",{bubbles:!0}),q=new Event("change",{bubbles:!0});v.call(u,a),u.dispatchEvent(b),u.dispatchEvent(q)}}),(a,r)=>(n(),o(g,p({ref_key:"primitiveElement",ref:s},{...e,...a.$attrs},{as:"input"}),null,16))}}),y=k,A=m({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,s=d(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),l=d(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((t,a)=>typeof t=="object"?Object.entries(t).map(([r,u])=>({name:`${e.name}[${a}][${r}]`,value:u})):{name:`${e.name}[${a}]`,value:t}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([t,a])=>({name:`${e.name}[${t}]`,value:a})):[]);return(t,a)=>(n(),f(c,null,[B(" We render single input if it's required "),s.value?(n(),o(y,p({key:t.name},{...e,...t.$attrs},{name:t.name,value:t.value}),null,16,["name","value"])):(n(!0),f(c,{key:1},V(l.value,r=>(n(),o(y,p({key:r.name},{ref_for:!0},{...e,...t.$attrs},{name:r.name,value:r.value}),null,16,["name","value"]))),128))],2112))}}),I=A;export{I as V};
1
+ import{a as m,J as h,o as l,c as o,m as p,ac as g,ad as E,f as d,h as c,l as B,F as f,j as V}from"./index-sWxuTsa7.js";var k=m({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,{primitiveElement:s,currentElement:n}=E(),t=d(()=>e.checked??e.value);return h(t,(a,r)=>{if(!n.value)return;const u=n.value,_=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(_,"value").set;if(v&&a!==r){const b=new Event("input",{bubbles:!0}),q=new Event("change",{bubbles:!0});v.call(u,a),u.dispatchEvent(b),u.dispatchEvent(q)}}),(a,r)=>(l(),o(g,p({ref_key:"primitiveElement",ref:s},{...e,...a.$attrs},{as:"input"}),null,16))}}),y=k,A=m({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,s=d(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),n=d(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((t,a)=>typeof t=="object"?Object.entries(t).map(([r,u])=>({name:`${e.name}[${a}][${r}]`,value:u})):{name:`${e.name}[${a}]`,value:t}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([t,a])=>({name:`${e.name}[${t}]`,value:a})):[]);return(t,a)=>(l(),c(f,null,[B(" We render single input if it's required "),s.value?(l(),o(y,p({key:t.name},{...e,...t.$attrs},{name:t.name,value:t.value}),null,16,["name","value"])):(l(!0),c(f,{key:1},V(n.value,r=>(l(),o(y,p({key:r.name},{ref_for:!0},{...e,...t.$attrs},{name:r.name,value:r.value}),null,16,["name","value"]))),128))],2112))}}),I=A;export{I as V};
@@ -1,4 +1,4 @@
1
- import{D as R,a as F,j as d,z as P,d as B,w as b,g as q,b as Ce,S as O,T as S,ak as Ne,L as Z,al as De,c as T,ab as X,q as y,K as C,N as M,r as g,M as J,am as Q,an as Ie,ao as ee,ap as Ge,aq as Ue,A as Fe,R as Pe}from"./RelationshipGalaxyCanvas-BnkcrIpk.js";import{e as Oe,G as Me,c as Le,b as we,U as He,B as te,d as N,f as re,g as Ve}from"./BufferResource-DY3P-dGs.js";import{R as Xe,S as ke,d as We}from"./RenderTargetSystem-CPwnC2X3.js";import"./index-DkWTvE7d.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-BUz_Vl9U.js";import"./Tabs-B6Nzq2NQ.js";import"./RovingFocusItem-j33Nsbbn.js";import"./useToast-CxhJkhXK.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-CwDIA0UP.js";import"./people-page-header-DNPjaSt4.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-BEtPORqF.js";function je(){const{userAgent:t}=R.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}class ne{constructor(){this._tempState=F.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,r,n){const s=e.renderer,i=this._didUploadHash[n.uid];s.shader.bind(n,i),i||(this._didUploadHash[n.uid]=!0),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,n.glProgram)}execute(e,r){const n=e.renderer;this._tempState.blendMode=r.blendMode,n.state.set(this._tempState);const s=r.textures.textures;for(let i=0;i<r.textures.count;i++)n.texture.bind(s[i],i);n.geometry.draw(r.topology,r.size,r.start)}}ne.extension={type:[d.WebGLPipesAdaptor],name:"batch"};var A=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(A||{});class Ke{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1}}class se{constructor(e){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._managedBuffers=new P({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"})}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={}}contextChange(){this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,n=this.getGlBuffer(e);r.bindBuffer(n.type,n.buffer)}bindBufferBase(e,r){const{_gl:n}=this;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,n.bindBufferBase(n.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let n=0,s=this._nextBindBaseIndex;for(;n<2;){s>=this._maxBindings&&(s=this._minBaseLocation,n++);const i=this._boundBufferBases[s];if(i&&i._lastBindCallId===this._bindCallId){s++;continue}break}return r=s,this._nextBindBaseIndex=s+1,n>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,n,s){const{_gl:i}=this;n||(n=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,n*256,s||256)}updateBuffer(e){const{_gl:r}=this,n=this.getGlBuffer(e);if(e._updateID===n.updateID)return n;n.updateID=e._updateID,r.bindBuffer(n.type,n.buffer);const s=e.data,i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return s?n.byteLength>=s.byteLength?r.bufferSubData(n.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(n.byteLength=s.byteLength,r.bufferData(n.type,s,i)):(n.byteLength=e.descriptor.size,r.bufferData(n.type,n.byteLength,i)),n}destroyAll(e=!1){this._managedBuffers.removeAll(e)}onBufferUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];n&&(r||this._gl.deleteBuffer(n.buffer))}createGLBuffer(e){const{_gl:r}=this;let n=A.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?n=A.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(n=A.UNIFORM_BUFFER);const s=new Ke(r.createBuffer(),n);return e._gpuData[this._renderer.uid]=s,this._managedBuffers.add(e),s}resetState(){this._boundBufferBases=Object.create(null)}}se.extension={type:[d.WebGLSystem],name:"buffer"};const L=class ie{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...ie.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(b("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=R.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const n=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:n,premultipliedAlpha:s,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&b("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width<e.width||r.height<e.height)&&(r.width=Math.max(e.width,e.width),r.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof R.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let n;const s=this.canvas;if(e===2&&(n=s.getContext("webgl2",r)),!n&&(n=s.getContext("webgl",r),!n))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=n,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const n=e.getExtension("WEBGL_provoking_vertex");n&&n.provokingVertexWEBGL(n.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&b("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=this.supports,s=this.webGLVersion===2,i=this.extensions;n.uint32Indices=s||!!i.uint32ElementIndex,n.uniformBufferObject=s,n.vertexArrayObject=s||!!i.vertexArrayObject,n.srgbTextures=s||!!i.srgb,n.nonPowOf2wrapping=s,n.nonPowOf2mipmaps=s,n.msaa=s,n.uint32Indices||b("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};L.extension={type:[d.WebGLSystem],name:"context"};L.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let $e=L;var G=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(G||{}),w=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(w||{}),h=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(h||{});const k={uint8x2:h.UNSIGNED_BYTE,uint8x4:h.UNSIGNED_BYTE,sint8x2:h.BYTE,sint8x4:h.BYTE,unorm8x2:h.UNSIGNED_BYTE,unorm8x4:h.UNSIGNED_BYTE,snorm8x2:h.BYTE,snorm8x4:h.BYTE,uint16x2:h.UNSIGNED_SHORT,uint16x4:h.UNSIGNED_SHORT,sint16x2:h.SHORT,sint16x4:h.SHORT,unorm16x2:h.UNSIGNED_SHORT,unorm16x4:h.UNSIGNED_SHORT,snorm16x2:h.SHORT,snorm16x4:h.SHORT,float16x2:h.HALF_FLOAT,float16x4:h.HALF_FLOAT,float32:h.FLOAT,float32x2:h.FLOAT,float32x3:h.FLOAT,float32x4:h.FLOAT,uint32:h.UNSIGNED_INT,uint32x2:h.UNSIGNED_INT,uint32x3:h.UNSIGNED_INT,uint32x4:h.UNSIGNED_INT,sint32:h.INT,sint32x2:h.INT,sint32x3:h.INT,sint32x4:h.INT};function Ye(t){return k[t]??k.float32}const ze={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class qe{constructor(){this.vaoCache=Object.create(null)}destroy(){this.vaoCache=Object.create(null)}}class ae{constructor(e){this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new P({renderer:e,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"})}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");this.destroyAll(!0);const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=s=>r.bindVertexArrayOES(s),e.deleteVertexArray=s=>r.deleteVertexArrayOES(s));const n=this._renderer.context.extensions.vertexAttribDivisorANGLE;n&&(e.drawArraysInstanced=(s,i,a,c)=>{n.drawArraysInstancedANGLE(s,i,a,c)},e.drawElementsInstanced=(s,i,a,c,o)=>{n.drawElementsInstancedANGLE(s,i,a,c,o)},e.vertexAttribDivisor=(s,i)=>n.vertexAttribDivisorANGLE(s,i)),this._activeGeometry=null,this._activeVao=null}bind(e,r){const n=this.gl;this._activeGeometry=e;const s=this.getVao(e,r);this._activeVao!==s&&(this._activeVao=s,n.bindVertexArray(s)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let n=0;n<e.buffers.length;n++){const s=e.buffers[n];r.updateBuffer(s)}e._gcLastUsed=this._renderer.gc.now}checkCompatibility(e,r){const n=e.attributes,s=r._attributeData;for(const i in s)if(!n[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const n=e.attributes,s=r._attributeData,i=["g",e.uid];for(const a in n)s[a]&&i.push(a,s[a].location);return i.join("-")}getVao(e,r){return e._gpuData[this._renderer.uid]?.vaoCache[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,n=!0){const s=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);let c=e._gpuData[this._renderer.uid];c||(c=new qe,e._gpuData[this._renderer.uid]=c,this._managedGeometries.add(e));const o=c.vaoCache;let u=o[a];if(u)return o[r._key]=u,u;Oe(e,r._attributeData);const _=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let l=0;l<_.length;l++){const f=_[l];i.bind(f)}return this.activateVao(e,r),o[r._key]=u,o[a]=u,s.bindVertexArray(null),u}onGeometryUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];if(!n)return;const s=n.vaoCache;if(!r)for(const i in s)this._activeVao!==s[i]&&this.resetState(),this.gl.deleteVertexArray(s[i])}destroyAll(e=!1){this._managedGeometries.removeAll(e)}activateVao(e,r){const n=this._renderer.gl,s=this._renderer.buffer,i=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let a=null;for(const c in i){const o=i[c],u=o.buffer,_=s.getGlBuffer(u),l=r._attributeData[c];if(l){a!==_&&(s.bind(u),a=_);const f=l.location;n.enableVertexAttribArray(f);const m=q(o.format),p=Ye(o.format);if(l.format?.substring(1,4)==="int"?n.vertexAttribIPointer(f,m.size,p,o.stride,o.offset):n.vertexAttribPointer(f,m.size,p,m.normalised,o.stride,o.offset),o.instance)if(this.hasInstance){const E=o.divisor??1;n.vertexAttribDivisor(f,E)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,n,s){const{gl:i}=this._renderer,a=this._activeGeometry,c=ze[e||a.topology];if(s??(s=a.instanceCount),a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,u=o===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;s!==1?i.drawElementsInstanced(c,r||a.indexBuffer.data.length,u,(n||0)*o,s):i.drawElements(c,r||a.indexBuffer.data.length,u,(n||0)*o)}else s!==1?i.drawArraysInstanced(c,n||0,r||a.getSize(),s):i.drawArrays(c,n||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ae.extension={type:[d.WebGLSystem],name:"geometry"};const Ze=new Ne({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),H=class oe{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:n}={...oe.defaultOptions,...e};this.useBackBuffer=r,this._antialias=n,this._renderer.context.supports.msaa||(b("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=F.for2d();const s=new Ce({vertex:`
1
+ import{D as R,a as F,j as d,z as P,d as B,w as b,g as q,b as Ce,S as O,T as S,ak as Ne,L as Z,al as De,c as T,ab as X,q as y,K as C,N as M,r as g,M as J,am as Q,an as Ie,ao as ee,ap as Ge,aq as Ue,A as Fe,R as Pe}from"./RelationshipGalaxyCanvas-BODk18aA.js";import{e as Oe,G as Me,c as Le,b as we,U as He,B as te,d as N,f as re,g as Ve}from"./BufferResource-i64DlwQT.js";import{R as Xe,S as ke,d as We}from"./RenderTargetSystem-CVMvAUSv.js";import"./index-sWxuTsa7.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-C7omDgiJ.js";import"./Tabs-D1UiZNaZ.js";import"./RovingFocusItem-DC_06OmN.js";import"./useToast-BA0EwImD.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-CwgpqtMZ.js";import"./people-page-header-0jvXFFnh.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-yxkeHO78.js";function je(){const{userAgent:t}=R.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}class ne{constructor(){this._tempState=F.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,r,n){const s=e.renderer,i=this._didUploadHash[n.uid];s.shader.bind(n,i),i||(this._didUploadHash[n.uid]=!0),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,n.glProgram)}execute(e,r){const n=e.renderer;this._tempState.blendMode=r.blendMode,n.state.set(this._tempState);const s=r.textures.textures;for(let i=0;i<r.textures.count;i++)n.texture.bind(s[i],i);n.geometry.draw(r.topology,r.size,r.start)}}ne.extension={type:[d.WebGLPipesAdaptor],name:"batch"};var A=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(A||{});class Ke{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1}}class se{constructor(e){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._managedBuffers=new P({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"})}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={}}contextChange(){this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,n=this.getGlBuffer(e);r.bindBuffer(n.type,n.buffer)}bindBufferBase(e,r){const{_gl:n}=this;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,n.bindBufferBase(n.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let n=0,s=this._nextBindBaseIndex;for(;n<2;){s>=this._maxBindings&&(s=this._minBaseLocation,n++);const i=this._boundBufferBases[s];if(i&&i._lastBindCallId===this._bindCallId){s++;continue}break}return r=s,this._nextBindBaseIndex=s+1,n>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,n,s){const{_gl:i}=this;n||(n=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,n*256,s||256)}updateBuffer(e){const{_gl:r}=this,n=this.getGlBuffer(e);if(e._updateID===n.updateID)return n;n.updateID=e._updateID,r.bindBuffer(n.type,n.buffer);const s=e.data,i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return s?n.byteLength>=s.byteLength?r.bufferSubData(n.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(n.byteLength=s.byteLength,r.bufferData(n.type,s,i)):(n.byteLength=e.descriptor.size,r.bufferData(n.type,n.byteLength,i)),n}destroyAll(e=!1){this._managedBuffers.removeAll(e)}onBufferUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];n&&(r||this._gl.deleteBuffer(n.buffer))}createGLBuffer(e){const{_gl:r}=this;let n=A.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?n=A.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(n=A.UNIFORM_BUFFER);const s=new Ke(r.createBuffer(),n);return e._gpuData[this._renderer.uid]=s,this._managedBuffers.add(e),s}resetState(){this._boundBufferBases=Object.create(null)}}se.extension={type:[d.WebGLSystem],name:"buffer"};const L=class ie{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...ie.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(b("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=R.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const n=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:n,premultipliedAlpha:s,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&b("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width<e.width||r.height<e.height)&&(r.width=Math.max(e.width,e.width),r.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof R.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let n;const s=this.canvas;if(e===2&&(n=s.getContext("webgl2",r)),!n&&(n=s.getContext("webgl",r),!n))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=n,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const n=e.getExtension("WEBGL_provoking_vertex");n&&n.provokingVertexWEBGL(n.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&b("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=this.supports,s=this.webGLVersion===2,i=this.extensions;n.uint32Indices=s||!!i.uint32ElementIndex,n.uniformBufferObject=s,n.vertexArrayObject=s||!!i.vertexArrayObject,n.srgbTextures=s||!!i.srgb,n.nonPowOf2wrapping=s,n.nonPowOf2mipmaps=s,n.msaa=s,n.uint32Indices||b("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};L.extension={type:[d.WebGLSystem],name:"context"};L.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let $e=L;var G=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(G||{}),w=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(w||{}),h=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(h||{});const k={uint8x2:h.UNSIGNED_BYTE,uint8x4:h.UNSIGNED_BYTE,sint8x2:h.BYTE,sint8x4:h.BYTE,unorm8x2:h.UNSIGNED_BYTE,unorm8x4:h.UNSIGNED_BYTE,snorm8x2:h.BYTE,snorm8x4:h.BYTE,uint16x2:h.UNSIGNED_SHORT,uint16x4:h.UNSIGNED_SHORT,sint16x2:h.SHORT,sint16x4:h.SHORT,unorm16x2:h.UNSIGNED_SHORT,unorm16x4:h.UNSIGNED_SHORT,snorm16x2:h.SHORT,snorm16x4:h.SHORT,float16x2:h.HALF_FLOAT,float16x4:h.HALF_FLOAT,float32:h.FLOAT,float32x2:h.FLOAT,float32x3:h.FLOAT,float32x4:h.FLOAT,uint32:h.UNSIGNED_INT,uint32x2:h.UNSIGNED_INT,uint32x3:h.UNSIGNED_INT,uint32x4:h.UNSIGNED_INT,sint32:h.INT,sint32x2:h.INT,sint32x3:h.INT,sint32x4:h.INT};function Ye(t){return k[t]??k.float32}const ze={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class qe{constructor(){this.vaoCache=Object.create(null)}destroy(){this.vaoCache=Object.create(null)}}class ae{constructor(e){this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new P({renderer:e,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"})}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");this.destroyAll(!0);const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=s=>r.bindVertexArrayOES(s),e.deleteVertexArray=s=>r.deleteVertexArrayOES(s));const n=this._renderer.context.extensions.vertexAttribDivisorANGLE;n&&(e.drawArraysInstanced=(s,i,a,c)=>{n.drawArraysInstancedANGLE(s,i,a,c)},e.drawElementsInstanced=(s,i,a,c,o)=>{n.drawElementsInstancedANGLE(s,i,a,c,o)},e.vertexAttribDivisor=(s,i)=>n.vertexAttribDivisorANGLE(s,i)),this._activeGeometry=null,this._activeVao=null}bind(e,r){const n=this.gl;this._activeGeometry=e;const s=this.getVao(e,r);this._activeVao!==s&&(this._activeVao=s,n.bindVertexArray(s)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let n=0;n<e.buffers.length;n++){const s=e.buffers[n];r.updateBuffer(s)}e._gcLastUsed=this._renderer.gc.now}checkCompatibility(e,r){const n=e.attributes,s=r._attributeData;for(const i in s)if(!n[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const n=e.attributes,s=r._attributeData,i=["g",e.uid];for(const a in n)s[a]&&i.push(a,s[a].location);return i.join("-")}getVao(e,r){return e._gpuData[this._renderer.uid]?.vaoCache[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,n=!0){const s=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);let c=e._gpuData[this._renderer.uid];c||(c=new qe,e._gpuData[this._renderer.uid]=c,this._managedGeometries.add(e));const o=c.vaoCache;let u=o[a];if(u)return o[r._key]=u,u;Oe(e,r._attributeData);const _=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let l=0;l<_.length;l++){const f=_[l];i.bind(f)}return this.activateVao(e,r),o[r._key]=u,o[a]=u,s.bindVertexArray(null),u}onGeometryUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];if(!n)return;const s=n.vaoCache;if(!r)for(const i in s)this._activeVao!==s[i]&&this.resetState(),this.gl.deleteVertexArray(s[i])}destroyAll(e=!1){this._managedGeometries.removeAll(e)}activateVao(e,r){const n=this._renderer.gl,s=this._renderer.buffer,i=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let a=null;for(const c in i){const o=i[c],u=o.buffer,_=s.getGlBuffer(u),l=r._attributeData[c];if(l){a!==_&&(s.bind(u),a=_);const f=l.location;n.enableVertexAttribArray(f);const m=q(o.format),p=Ye(o.format);if(l.format?.substring(1,4)==="int"?n.vertexAttribIPointer(f,m.size,p,o.stride,o.offset):n.vertexAttribPointer(f,m.size,p,m.normalised,o.stride,o.offset),o.instance)if(this.hasInstance){const E=o.divisor??1;n.vertexAttribDivisor(f,E)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,n,s){const{gl:i}=this._renderer,a=this._activeGeometry,c=ze[e||a.topology];if(s??(s=a.instanceCount),a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,u=o===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;s!==1?i.drawElementsInstanced(c,r||a.indexBuffer.data.length,u,(n||0)*o,s):i.drawElements(c,r||a.indexBuffer.data.length,u,(n||0)*o)}else s!==1?i.drawArraysInstanced(c,n||0,r||a.getSize(),s):i.drawArrays(c,n||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ae.extension={type:[d.WebGLSystem],name:"geometry"};const Ze=new Ne({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),H=class oe{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:n}={...oe.defaultOptions,...e};this.useBackBuffer=r,this._antialias=n,this._renderer.context.supports.msaa||(b("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=F.for2d();const s=new Ce({vertex:`
2
2
  attribute vec2 aPosition;
3
3
  out vec2 vUv;
4
4
 
@@ -1,4 +1,4 @@
1
- import{y as L,a as D,j as l,z as k,e as pe,H as le,D as T,c as C,d as B,B as fe,I as z,J as w,w as v,K as y,q as ge,L as me,N as O,O as R,r as G,M as F,Q as I,V as _e,W,X as be,S as H,T as E,A as xe,R as ye}from"./RelationshipGalaxyCanvas-BnkcrIpk.js";import{c as Ge,u as Pe,U as Se,B as Te,G as Be,e as Ce,l as ve,a as Ue,t as Me}from"./BufferResource-DY3P-dGs.js";import{R as we,S as Re,d as Ee}from"./RenderTargetSystem-CPwnC2X3.js";import"./index-DkWTvE7d.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-BUz_Vl9U.js";import"./Tabs-B6Nzq2NQ.js";import"./RovingFocusItem-j33Nsbbn.js";import"./useToast-CxhJkhXK.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-CwDIA0UP.js";import"./people-page-header-DNPjaSt4.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-BEtPORqF.js";const P=D.for2d();class N{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),P.blendMode="normal",s.pipeline.getPipeline(t,n,P);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=L(u.textures,u.count,s.limits.maxBatchableTextures)}P.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,P,t.topology);t.bindGroup._touch(s.gc.now,s.tick),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}N.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class V{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const g in i){const p=e.resources[g]??e.resources[i[g]];let h;if(p._resourceType==="uniformGroup"){const d=p;o.ubo.updateUniformGroup(d);const f=d.buffer;h={buffer:o.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(p._resourceType==="buffer"){const d=p;h={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(p._resourceType==="bufferResource"){const d=p;h={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(p._resourceType==="textureSampler"){const d=p;h=o.texture.getGpuSampler(d)}else if(p._resourceType==="textureSource"){const d=p;h=o.texture.getTextureView(d)}n.push({binding:i[g],resource:h})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){this._hash=null,this._renderer=null}}V.extension={type:[l.WebGPUSystem],name:"bindGroup"};class Ae{constructor(e){this.gpuBuffer=e}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null}}class j{constructor(e){this._renderer=e,this._managedBuffers=new k({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"})}contextChange(e){this._gpu=e}getGPUBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(e)}updateBuffer(e){const t=this.getGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){this._managedBuffers.removeAll()}onBufferUnload(e){e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this)}createGPUBuffer(e){const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e._resourceId=pe("resource"),e.data&&(le(e.data.buffer,t.getMappedRange(),e.data.byteOffset,e.data.byteLength),t.unmap()),e._gpuData[this._renderer.uid]=new Ae(t),this._managedBuffers.add(e)&&(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this)),t}onBufferChange(e){this._managedBuffers.remove(e),e._updateID=0,this.createGPUBuffer(e)}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null}}j.extension={type:[l.WebGPUSystem],name:"buffer"};class Le{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this.data=null}}class K{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}K.extension={type:[l.WebGPUSystem],name:"colorMask"};class U{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):this._createDeviceAndAdaptor(e)).then(t=>{this.gpu=t,this.extensions={transientAttachment:typeof GPUTextureUsage.TRANSIENT_ATTACHMENT=="number"},this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await T.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this.extensions=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class q{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.gc.now,this._renderer.tick);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(parseInt(s,10),e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u??t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u??t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1],this._renderer.renderTarget.mipLevel,this._renderer.renderTarget.layer);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}q.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class Y{constructor(e){this._renderer=e}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}Y.extension={type:[l.WebGPUSystem],name:"limits"};class ${constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:C.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}$.extension={type:[l.WebGPUSystem],name:"stencil"};const S={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function De(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=S[s.data.type].size;const n=S[s.data.type].align;if(!S[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function ke(a,e){const{size:t,align:r}=S[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
1
+ import{y as L,a as D,j as l,z as k,e as pe,H as le,D as T,c as C,d as B,B as fe,I as z,J as w,w as v,K as y,q as ge,L as me,N as O,O as R,r as G,M as F,Q as I,V as _e,W,X as be,S as H,T as E,A as xe,R as ye}from"./RelationshipGalaxyCanvas-BODk18aA.js";import{c as Ge,u as Pe,U as Se,B as Te,G as Be,e as Ce,l as ve,a as Ue,t as Me}from"./BufferResource-i64DlwQT.js";import{R as we,S as Re,d as Ee}from"./RenderTargetSystem-CVMvAUSv.js";import"./index-sWxuTsa7.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-C7omDgiJ.js";import"./Tabs-D1UiZNaZ.js";import"./RovingFocusItem-DC_06OmN.js";import"./useToast-BA0EwImD.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-CwgpqtMZ.js";import"./people-page-header-0jvXFFnh.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-yxkeHO78.js";const P=D.for2d();class N{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),P.blendMode="normal",s.pipeline.getPipeline(t,n,P);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=L(u.textures,u.count,s.limits.maxBatchableTextures)}P.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,P,t.topology);t.bindGroup._touch(s.gc.now,s.tick),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}N.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class V{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const g in i){const p=e.resources[g]??e.resources[i[g]];let h;if(p._resourceType==="uniformGroup"){const d=p;o.ubo.updateUniformGroup(d);const f=d.buffer;h={buffer:o.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(p._resourceType==="buffer"){const d=p;h={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(p._resourceType==="bufferResource"){const d=p;h={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(p._resourceType==="textureSampler"){const d=p;h=o.texture.getGpuSampler(d)}else if(p._resourceType==="textureSource"){const d=p;h=o.texture.getTextureView(d)}n.push({binding:i[g],resource:h})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){this._hash=null,this._renderer=null}}V.extension={type:[l.WebGPUSystem],name:"bindGroup"};class Ae{constructor(e){this.gpuBuffer=e}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null}}class j{constructor(e){this._renderer=e,this._managedBuffers=new k({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"})}contextChange(e){this._gpu=e}getGPUBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(e)}updateBuffer(e){const t=this.getGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){this._managedBuffers.removeAll()}onBufferUnload(e){e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this)}createGPUBuffer(e){const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e._resourceId=pe("resource"),e.data&&(le(e.data.buffer,t.getMappedRange(),e.data.byteOffset,e.data.byteLength),t.unmap()),e._gpuData[this._renderer.uid]=new Ae(t),this._managedBuffers.add(e)&&(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this)),t}onBufferChange(e){this._managedBuffers.remove(e),e._updateID=0,this.createGPUBuffer(e)}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null}}j.extension={type:[l.WebGPUSystem],name:"buffer"};class Le{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this.data=null}}class K{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}K.extension={type:[l.WebGPUSystem],name:"colorMask"};class U{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):this._createDeviceAndAdaptor(e)).then(t=>{this.gpu=t,this.extensions={transientAttachment:typeof GPUTextureUsage.TRANSIENT_ATTACHMENT=="number"},this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await T.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this.extensions=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class q{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.gc.now,this._renderer.tick);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(parseInt(s,10),e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u??t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u??t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1],this._renderer.renderTarget.mipLevel,this._renderer.renderTarget.layer);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}q.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class Y{constructor(e){this._renderer=e}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}Y.extension={type:[l.WebGPUSystem],name:"limits"};class ${constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:C.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}$.extension={type:[l.WebGPUSystem],name:"stencil"};const S={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function De(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=S[s.data.type].size;const n=S[s.data.type].align;if(!S[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function ke(a,e){const{size:t,align:r}=S[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
2
2
  v = uv.${a.data.name};
3
3
  ${e!==0?`offset += ${e};`:""}
4
4
 
@@ -0,0 +1,8 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-sWxuTsa7.js","assets/vendor-snapdom--nZvo8Sg.js","assets/index-DrCc8p_I.css"])))=>i.map(i=>d[i]);
2
+ import{X as Mt,d as ct,r as D,f as se,aA as He,bO as We,bP as Ke,bQ as qt,W as Dt,bs as Ft,bR as gt,ao as Ot,a8 as $t,bS as zt,az as Wt,K as mt,aK as oe,bT as et}from"./index-sWxuTsa7.js";import{u as jt}from"./prompt-BPYj29Vq.js";import{C as Nt}from"./chatlabSiteLocale-CrCNb8QP.js";const xe="chart_runtime",Ht=4e3,Jt=`
3
+ …[truncated]`;function It(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function yt(e){return!It(e)||!Array.isArray(e.content)?"":e.content.map(s=>It(s)&&s.type==="text"&&typeof s.text=="string"?s.text:"").filter(s=>s.length>0).join(`
4
+ `)}function kt(e,s=Ht){return e.length<=s?e:e.slice(0,s)+Jt}function X(){return Mt("assistant-crud")}function ue(){return Mt("skill-crud")}const St=Nt,Vt={"zh-CN":"cn","zh-TW":"cn","en-US":"en","ja-JP":"ja"},Pt=ct("assistant",()=>{const e=D([]),s=D(null),d=D(!1),c=new Set;let l=null;const y=D([]),x=D([]),w=D([]),M=D(!1),_=D(null),U=D("group"),J=D("zh-CN"),L=se(()=>s.value?e.value.find(m=>m.id===s.value)??null:null),V=se(()=>e.value.filter(m=>{const f=!m.applicableChatTypes?.length||m.applicableChatTypes.includes(U.value),T=!m.supportedLocales?.length||m.supportedLocales.some(W=>J.value.startsWith(W));return f&&T})),F=4,Y=se(()=>V.value.slice(0,F)),de=se(()=>V.value.slice(F)),E=se(()=>V.value.length>F),K=se(()=>{const m=new Set(e.value.map(f=>f.id));return w.value.map(f=>({...f,imported:m.has(f.id)}))});function fe(m,f){U.value=m,J.value=f}async function N(){try{const m=X();e.value=await m.getAll(),d.value=!0}catch(m){console.error("[AssistantStore] Failed to load assistants:",m)}}async function ye(){try{y.value=await X().getBuiltinCatalog()}catch(m){console.error("[AssistantStore] Failed to load builtin catalog:",m)}}async function Re(){try{x.value=await X().getBuiltinToolCatalog()}catch(m){console.error("[AssistantStore] Failed to load builtin tool catalog:",m)}}async function ie(m){const f=Vt[m||J.value]??"en",T=`${St}/${f}/assistant.json`;M.value=!0,_.value=null;try{const W=await He().fetchRemoteConfig(T);if(!W.success||!W.data){_.value=W.error||"Failed to fetch cloud catalog",w.value=[];return}const n=W.data;if(!Array.isArray(n)){_.value="Invalid catalog format",w.value=[];return}w.value=n.filter(t=>t.id&&t.name&&t.path)}catch(W){_.value=String(W),w.value=[]}finally{M.value=!1}}async function he(m){const f=`${St}${m.path}`;try{const T=await He().fetchRemoteConfig(f);if(!T.success||typeof T.data!="string")return{success:!1,error:T.error||"Failed to fetch assistant content"};const W=await X().importFromMd(T.data);return W.success&&await N(),W}catch(T){return{success:!1,error:String(T)}}}function Me(m){return e.value.some(f=>f.id===m)}function ve(m){s.value=m}function Ne(){s.value=null}async function Pe(m){try{return await X().getConfig(m)}catch(f){return console.error("[AssistantStore] Failed to get config:",f),null}}async function I(m,f){try{const T=await X().update(m,f);return T.success&&await N(),T}catch(T){return{success:!1,error:String(T)}}}async function k(m){try{const f=await X().reset(m);return f.success&&await N(),f}catch(f){return{success:!1,error:String(f)}}}async function R(m){const f=We(m);if(c.has(f))return null;c.add(f);try{const T=await X().getUpgradeInfo(f);if(!T)return null;try{if(l||(l={...(await Ke().getPreferences()).assistantUpgradeSkippedVersions}),T.latestVersion!==null&&l[T.builtinId]===T.latestVersion)return null}catch(W){console.error("[AssistantStore] Failed to load skipped assistant upgrades:",W)}return T}catch(T){return c.delete(f),console.error("[AssistantStore] Failed to check assistant upgrade:",T),null}}async function ee(m){if(m.latestVersion===null)return{success:!1,error:"Assistant template version is unavailable"};try{l||(l={...(await Ke().getPreferences()).assistantUpgradeSkippedVersions});const f={...l,[m.builtinId]:m.latestVersion},T=await Ke().savePreferences({assistantUpgradeSkippedVersions:f});return T.success&&(l=f),T}catch(f){return{success:!1,error:String(f)}}}async function pe(m,f){try{const T=await X().upgradeWithBackup(m.assistantId,f);return T.success&&await N(),T}catch(T){return{success:!1,error:String(T)}}}async function Ae(m){try{const f=await X().importBuiltin(m);return f.success&&(await N(),await ye()),f}catch(f){return{success:!1,error:String(f)}}}async function Ue(m){try{const f=await X().reimport(m);return f.success&&(await N(),await ye()),f}catch(f){return{success:!1,error:String(f)}}}async function Le(m){try{const f=await X().create(m);return f.success&&await N(),f}catch(f){return{success:!1,error:String(f)}}}async function Je(m){try{const f=X(),T=await f.getConfig(m);if(!T)return{success:!1,error:"Assistant not found"};const{id:W,builtinId:n,...t}=T,o=await f.create({...t,name:`${T.name}${qt.global.t("ai.assistant.duplicateSuffix")}`});return o.success&&await N(),o}catch(f){return{success:!1,error:String(f)}}}async function Ve(m){try{const f=await X().delete(m);return f.success&&await N(),f}catch(f){return{success:!1,error:String(f)}}}return{assistants:e,selectedAssistantId:s,selectedAssistant:L,isLoaded:d,builtinCatalog:y,builtinToolCatalog:x,cloudCatalog:w,cloudLoading:M,cloudError:_,cloudCatalogWithStatus:K,currentChatType:U,currentLocale:J,filteredAssistants:V,defaultAssistants:Y,moreAssistants:de,hasMoreAssistants:E,loadAssistants:N,loadBuiltinCatalog:ye,loadBuiltinToolCatalog:Re,fetchCloudCatalog:ie,importFromCloud:he,isCloudItemImported:Me,selectAssistant:ve,clearSelection:Ne,setFilterContext:fe,getAssistantConfig:Pe,updateAssistant:I,createAssistant:Le,duplicateAssistant:Je,resetAssistant:k,checkDefaultAssistantUpgrade:R,skipAssistantUpgrade:ee,upgradeAssistantWithBackup:pe,importAssistant:Ae,reimportAssistant:Ue,deleteAssistant:Ve}}),Tt=Nt,Gt={"zh-CN":"cn","zh-TW":"cn","en-US":"en","ja-JP":"ja"},Yt=ct("skill",()=>{const e=D([]),s=D(null),d=D(!1),c=D([]),l=D([]),y=D(!1),x=D(null),w=D("group"),M=D("zh-CN");function _(){const I=M.value.startsWith("zh");return{id:xe,name:I?"绘图助手":"Chart Assistant",description:I?"按本轮问题生成灵活的聊天数据图表":"Generate flexible charts for this chat question",tags:[I?"图表":"chart"],chatScope:"all",tools:["render_chart","get_schema"],builtinId:xe}}const U=se(()=>s.value?s.value===xe?_():e.value.find(I=>I.id===s.value)??null:null),J=se(()=>_()),L=se(()=>e.value.filter(I=>I.chatScope==="all"||I.chatScope===w.value)),V=se(()=>{const k=Pt().selectedAssistant,R=[J.value,...L.value];return k?R.filter(ee=>(ee.tools.length,!0)):R}),F=se(()=>{const I={};for(const k of V.value){const R=k.tags[0]||"other";I[R]||(I[R]=[]),I[R].push(k)}return I}),Y=se(()=>{const I=new Set(e.value.map(k=>k.id));return l.value.map(k=>({...k,imported:I.has(k.id)}))});function de(I,k){w.value=I,k&&(M.value=k)}async function E(){try{e.value=await ue().getAll(),d.value=!0}catch(I){console.error("[SkillStore] Failed to load skills:",I)}}async function K(){try{c.value=await ue().getBuiltinCatalog()}catch(I){console.error("[SkillStore] Failed to load builtin catalog:",I)}}async function fe(){const I=Gt[M.value]??"en",k=`${Tt}/${I}/skill.json`;y.value=!0,x.value=null;try{const R=await He().fetchRemoteConfig(k);if(!R.success||!R.data){x.value=R.error||"Failed to fetch cloud catalog",l.value=[];return}const ee=R.data;if(!Array.isArray(ee)){x.value="Invalid catalog format",l.value=[];return}l.value=ee.filter(pe=>pe.id&&pe.name&&pe.path)}catch(R){x.value=String(R),l.value=[]}finally{y.value=!1}}async function N(I){const k=`${Tt}${I.path}`;try{const R=await He().fetchRemoteConfig(k);if(!R.success||typeof R.data!="string")return{success:!1,error:R.error||"Failed to fetch skill content"};const ee=await ue().importFromMd(R.data);return ee.success&&await E(),ee}catch(R){return{success:!1,error:String(R)}}}function ye(I){return e.value.some(k=>k.id===I)}function Re(I){s.value=I}async function ie(I){if(I===xe)return{..._(),prompt:"",builtinId:xe};try{return await ue().getConfig(I)}catch(k){return console.error("[SkillStore] Failed to get skill config:",k),null}}async function he(I,k){try{const R=await ue().update(I,k);return R.success&&await E(),R}catch(R){return{success:!1,error:String(R)}}}async function Me(I){try{const k=await ue().create(I);return k.success&&await E(),k}catch(k){return{success:!1,error:String(k)}}}async function ve(I){try{const k=await ue().delete(I);return k.success&&(s.value===I&&(s.value=null),await E()),k}catch(k){return{success:!1,error:String(k)}}}async function Ne(I){try{const k=await ue().importBuiltin(I);return k.success&&(await E(),await K()),k}catch(k){return{success:!1,error:String(k)}}}async function Pe(I){try{const k=await ue().reimport(I);return k.success&&(await E(),await K()),k}catch(k){return{success:!1,error:String(k)}}}return{skills:e,activeSkillId:s,builtinCatalog:c,isLoaded:d,currentChatType:w,currentLocale:M,activeSkill:U,scopedSkills:L,compatibleSkills:V,groupedSkills:F,cloudCatalog:l,cloudLoading:y,cloudError:x,cloudCatalogWithStatus:Y,setFilterContext:de,loadSkills:E,loadBuiltinCatalog:K,fetchCloudCatalog:fe,importFromCloud:N,isCloudItemImported:ye,activateSkill:Re,getSkillConfig:ie,updateSkill:he,createSkill:Me,deleteSkill:ve,importSkill:Ne,reimportSkill:Pe}});async function _t(e){const{url:s,method:d="POST",headers:c={},body:l,signal:y,onEvent:x}=e,w=await Dt(s,{method:d,headers:{"Content-Type":"application/json",...c},body:l!=null?JSON.stringify(l):void 0,signal:y});if(!w.ok){const L=await w.text().catch(()=>"");throw new Error(`SSE request failed: HTTP ${w.status} ${L}`)}if(!w.body)throw new Error("SSE response has no body");const M=w.body.getReader(),_=new TextDecoder;let U="",J="";for(;;){const{done:L,value:V}=await M.read();if(L)break;U+=_.decode(V,{stream:!0});const F=U.split(`
5
+ `);U=F.pop()||"";for(const Y of F)Y.startsWith("event: ")?J=Y.slice(7).trim():Y.startsWith("data: ")&&(x({event:J,data:Y.slice(6)}),J="")}U.trim()&&U.startsWith("data: ")&&x({event:J,data:U.slice(6)})}function gs(){return{async chatStream(e,s,d){let c;try{return await _t({url:"/_web/ai/llm/chat-stream",body:{messages:e,options:s},onEvent:({data:l})=>{try{const y=JSON.parse(l);y.finishReason==="error"&&y.error&&(c=y.error),d?.(y)}catch{}}}),c?{success:!1,error:c}:{success:!0}}catch(l){const y=l instanceof Error?l.message:String(l);return{success:!1,error:c??y}}}}}const Be=new Map;function tt(){return{runStream(e,s){const d=Date.now();gt("ai_request_started");const c=new AbortController,l=`local_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;Be.set(l,{serverId:"",abortController:c});const x=new Promise(w=>{let M="";const _=[];let U=0,J,L=!1,V;_t({url:"/_web/ai/agent/stream",body:e,signal:c.signal,onEvent:({event:F,data:Y})=>{try{const de=JSON.parse(Y);if(F==="meta"){const K=Be.get(l);K&&(K.serverId=de.requestId??"");return}const E=de;switch(s?.(E),E.type){case"content":E.content&&(M+=E.content);break;case"tool_start":E.toolName&&_.push(E.toolName);break;case"status":E.status&&(U=E.status.round);break;case"done":E.usage&&(J=E.usage);break;case"error":L=!0,V=E.error;break}}catch{}}}).then(()=>{Be.delete(l),w({success:!L,result:{content:M,toolsUsed:_,toolRounds:U,totalUsage:J},...L&&V?{error:V}:{}})}).catch(F=>{Be.delete(l),c.signal.aborted?w({success:!1,result:{content:M,toolsUsed:_,toolRounds:U,aborted:!0}}):w({success:!1,error:{name:"FetchError",message:F.message??String(F),stack:null}})})}).then(w=>(gt("ai_request_completed",{success:w.success,duration_ms:Date.now()-d,...w.success?{}:{failure_reason:w.result?.aborted?"aborted":w.error?.name==="FetchError"?"network":"unknown"}}),w));return{requestId:l,promise:x}},async abort(e){const s=Be.get(e);if(!s)return{success:!1,error:"Request not found"};if(s.abortController.abort(),s.serverId)try{const{post:d}=await Ft(async()=>{const{post:c}=await import("./index-sWxuTsa7.js").then(l=>l.cY);return{post:c}},__vite__mapDeps([0,1,2]));await d("/ai/agent/abort",{requestId:s.serverId})}catch{}return Be.delete(e),{success:!0}}}}function Xt(e){return e.desensitize&&!e.desensitizeRules.some(s=>s.builtin)}function Qt(e){if(e.dataCleaning||e.mergeConsecutive||e.blacklistKeywords.length>0||e.denoise||e.desensitize||e.anonymizeNames)return{dataCleaning:e.dataCleaning,mergeConsecutive:e.mergeConsecutive,mergeWindowSeconds:e.mergeWindowSeconds,blacklistKeywords:[...e.blacklistKeywords],denoise:e.denoise,desensitize:e.desensitize,desensitizeRules:e.desensitizeRules.map(d=>({...d,locales:[...d.locales]})),anonymizeNames:e.anonymizeNames}}function le(e){return e==="render_chart"}function Zt(e,s,d){if(!e||!le(e))return null;const c=e;return{type:"tool",tool:{name:c,displayName:c,status:"running",params:s,toolCallId:d,transient:!0}}}function Et(e,s,d){if(!Q(e))return!1;const c=e;return c.type!=="tool"||!c.tool||c.tool.transient!==!0||c.tool.name!==s||d&&c.tool.toolCallId!==d?!1:le(String(c.tool.name))}function Kt(e,s,d){let c=!1;const l=[...e];for(let y=l.length-1;y>=0;y--)if(Et(l[y],s,d)){l.splice(y,1),c=!0;break}return c?l:[...e]}function Q(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ht(e){return Q(e)&&e.version===1&&Q(e.spec)&&Q(e.dataset)}function ot(e){if(!Q(e))return[];const s=Q(e.details)?e.details:e,d=[];if(ht(s.chart)&&d.push(s.chart),Array.isArray(s.charts))for(const c of s.charts)ht(c)&&d.push(c);return d}function xt(e){return{...e,dataset:{...e.dataset,rows:[]}}}function Ut(e){return e.map(s=>({type:"chart",chart:xt(s)}))}function at(e){return Array.isArray(e)?`[${e.map(at).join(",")}]`:Q(e)?`{${Object.keys(e).sort().map(s=>`${JSON.stringify(s)}:${at(e[s])}`).join(",")}}`:JSON.stringify(e)}function vt(e){const s=xt(e);return at({spec:s.spec,columns:s.dataset.columns,data:s.data,rowCount:s.rowCount,truncated:s.truncated})}function es(e,s){const d=vt(s);return e.some(c=>{if(!Q(c))return!1;const l=c;return l.type==="chart"&&l.chart?vt(l.chart)===d:!1})}function ts(e,s,d,c){const l=[...e];let y=-1;for(let _=l.length-1;_>=0;_--)if(Et(l[_],s,d)){y=_;break}const x=y>=0?l.filter((_,U)=>U!==y):l,w=c.filter(_=>!es(x,_)),M=Ut(w);return y>=0?(l.splice(y,1,...M),l):[...l,...M]}function ss(e,s,d,c,l){if(c.length>0)return ts(e,s,d,c);const y=Kt(e,s,d);return l?[...y,l]:y}function ms(e,s,d){const c=e[s];return!Q(c)||c.type!=="error"||!Q(c.error)||c.error.name!=="ChartRenderError"?!1:d?.isStreaming?!0:e.slice(s+1).some(l=>Q(l)&&l.type==="chart")}function ns(e){return Q(e)?typeof e.error=="string"?e.error:Q(e.error)&&typeof e.error.message=="string"?e.error.message:Array.isArray(e.content)?e.content.map(s=>Q(s)&&s.type==="text"&&typeof s.text=="string"?s.text:"").join(`
6
+ `).trim():null:null}function At(e,s){if(!le(e)||ot(s).length>0)return null;const d=ns(s);if(!d)return null;const l=/^Error:\s*(.+)$/is.exec(d)?.[1]?.trim();return!l||/^Call get_schema before render_chart\b/i.test(l)?null:{type:"error",error:{name:"ChartRenderError",message:l,stack:null}}}function je(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function st(e){return je(e)&&e.version===1&&typeof e.query=="string"&&Array.isArray(e.groups)}function Ct(e){if(!je(e))return null;const s=je(e.details)?e.details:null;if(s&&st(s.evidence))return s.evidence;const d=je(e.data)?e.data:null;return d&&st(d.evidence)?d.evidence:st(e.evidence)?e.evidence:null}function rs(e){return{type:"evidence",evidence:e}}function bt(e){return JSON.parse(JSON.stringify(e))}function ut(e){return JSON.parse(JSON.stringify(e))}function Lt(e){return e?.type==="plan_draft"&&typeof e.text=="string"}function os(e,s){const d=e.map(ut),c=d[d.length-1];return Lt(c)?c.text+=s:d.push({type:"plan_draft",version:1,status:"streaming",text:s}),d}function as(e,s){const d=e.map(ut);for(let c=d.length-1;c>=0;c--){const l=d[c];if(Lt(l)){const y=l.text.trim();return d[c]={...bt(s),...y?{displayText:y}:{}},d}}return d.push(bt(s)),d}function ls(e){return e.filter(s=>s.type!=="plan_draft").map(ut)}function wt(e){if(!e)return;const s=JSON.parse(JSON.stringify(e));for(const d of s)d.type==="tool"&&delete d.tool.displayResult;return s}function nt(e){return e.toolCallId?`id:${e.toolCallId}`:`name:${e.name}`}function Bt(){const e=new Map;let s=null;const d=()=>{if(s){const l=e.get(s);if(l)return l}const c=Array.from(e.entries()).at(-1);return s=c?.[0]??null,c?.[1]??null};return{start(c){const l=nt(c),y={name:c.name,displayName:c.name,status:"running",toolCallId:c.toolCallId};return e.set(l,y),s=l,y},update(c){const l=nt(c),y=e.get(l);if(!y)return d();const x={...y,progress:c.progress};return e.set(l,x),s=l,x},finish(c){const l=nt(c),y=e.get(l);e.delete(l),s===l&&(s=null);const x=d();return x||(y?{...y,status:c.status}:null)},current(){return d()},clear(){e.clear(),s=null}}}const ae="__draft__";function is(e){return e?`${e.startTs}_${e.endTs}`:"all"}function cs(e){return`${e.sessionId}:${e.chatType}:${is(e.timeFilter)}`}function lt(){return{promptTokens:0,completionTokens:0,totalTokens:0,cacheReadTokens:0,cacheWriteTokens:0}}function Rt(e){return{promptTokens:e.promptTokens??0,completionTokens:e.completionTokens??0,totalTokens:e.totalTokens??0,cacheReadTokens:e.cacheReadTokens??0,cacheWriteTokens:e.cacheWriteTokens??0}}function $e(e){if(e&&typeof e=="object"){const s=e;return{name:typeof s.name=="string"?s.name:null,message:typeof s.message=="string"?s.message:"未知错误",stack:typeof s.stack=="string"?s.stack:null,statusCode:typeof s.statusCode=="number"?s.statusCode:null,url:typeof s.url=="string"?s.url:null,responseBody:typeof s.responseBody=="string"?s.responseBody:null,responseHeaders:s.responseHeaders&&typeof s.responseHeaders=="object"?s.responseHeaders:null,requestBody:typeof s.requestBody=="string"?s.requestBody:null,cause:typeof s.cause=="string"?s.cause:null,provider:typeof s.provider=="string"?s.provider:null,friendlyMessage:typeof s.friendlyMessage=="string"?s.friendlyMessage:null}}return{name:null,message:e?String(e):"未知错误",stack:null}}function ze(e){return{id:e.id,role:e.role,content:e.content,timestamp:e.timestamp*1e3,parentId:e.parentId,contentBlocks:e.contentBlocks}}function it(e=null){return{messages:[],sourceMessages:[],currentKeywords:[],assistantId:e,loaded:!1}}function us(e){const s=it(null);return{sessionId:e.sessionId,sessionName:e.sessionName,chatType:e.chatType,locale:e.locale,timeFilter:e.timeFilter,selectedAssistantId:null,messages:s.messages,sourceMessages:s.sourceMessages,currentKeywords:s.currentKeywords,isLoadingSource:!1,isAIThinking:!1,currentAIChatId:null,currentToolStatus:null,toolsUsedInCurrentRound:[],sessionTokenUsage:lt(),agentStatus:null,ownerInfo:void 0,ownerInfoInitialized:!1,isAborted:!1,currentRequestId:"",currentAgentRequestId:"",aiChatBuffers:{[ae]:s}}}function rt(e){return e.currentAIChatId??ae}const Is=ct("aiChatRuntime",()=>{const e=D({}),s=D(null),d=jt(),c=Ot(),l=$t(),y=Pt(),x=Yt(),w=zt(),{aiGlobalSettings:M}=Wt(d);let _=!1;function U(n){return`${n}_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function J(n){const t=cs(n),o=e.value[t];if(o)return o.sessionName=n.sessionName,o.chatType=n.chatType,o.locale=n.locale,o.timeFilter=n.timeFilter,{chatKey:t,state:o};const r=us(n);e.value[t]=r;const i=e.value[t];return K(t),{chatKey:t,state:i}}function L(n){return e.value[n]??null}function V(){return s.value?L(s.value.chatKey):null}function F(n,t,o=null){return n.aiChatBuffers[t]||(n.aiChatBuffers[t]=it(o)),n.aiChatBuffers[t]}function Y(n,t){const o=n.currentAIChatId??ae,r=n.aiChatBuffers[o];r&&(r.sessionTokenUsage={...n.sessionTokenUsage});const i=F(n,t);n.currentAIChatId=t===ae?null:t,n.messages=i.messages,n.sourceMessages=i.sourceMessages,n.currentKeywords=i.currentKeywords,n.selectedAssistantId=i.assistantId,n.sessionTokenUsage=i.sessionTokenUsage?{...i.sessionTokenUsage}:lt(),n.agentStatus=null}function de(n,t,o){const r=F(n,t);return n.aiChatBuffers[o]=r,t!==o&&delete n.aiChatBuffers[t],n.currentAIChatId===null&&t===ae&&(n.currentAIChatId=o),r}function E(n){const t=L(n);t&&(t.selectedAssistantId?y.selectAssistant(t.selectedAssistantId):y.clearSelection())}async function K(n){const t=L(n);if(!t)return;const r=c.sessions.find(i=>i.id===t.sessionId)?.ownerId;if(!r){t.ownerInfo=void 0,t.ownerInfoInitialized=!0;return}if(!(t.ownerInfoInitialized&&t.ownerInfo?.platformId===r))try{const B=(await mt().getMembers(t.sessionId)).find(b=>b.platformId===r);t.ownerInfo=B?{platformId:r,displayName:B.groupNickname||B.accountName||r}:{platformId:r,displayName:r},t.ownerInfoInitialized=!0}catch(i){console.error("[AI] 获取 Owner 信息失败:",i),t.ownerInfo=void 0,t.ownerInfoInitialized=!0}}function fe(n,t,o,r=null){const i=L(n);i&&(s.value={requestId:o,chatKey:n,sessionId:i.sessionId,sessionName:i.sessionName,chatType:i.chatType,aiChatId:r,questionPreview:t.trim().slice(0,80),startedAt:Date.now()})}function N(n,t){s.value&&s.value.chatKey===n&&(t&&s.value.requestId!==t||(s.value=null))}function ye(n,t){s.value&&s.value.chatKey===n&&(s.value.aiChatId=t)}function Re(n){return{phase:"preparing",round:0,toolsUsed:n.toolsUsedInCurrentRound.length,contextTokens:0,totalUsage:{...n.sessionTokenUsage},updatedAt:Date.now()}}function ie(n,t,o){const r=n.agentStatus?{...n.agentStatus}:Re(n);n.agentStatus={...r,...o,phase:t,updatedAt:Date.now()}}function he(n,t){const o=L(n);if(!o||o.isAIThinking)return!1;const r=F(o,rt(o),t);return r.assistantId=t,o.selectedAssistantId=t,y.selectAssistant(t),!0}async function Me(n,t){const o=L(n);if(!o)return!1;try{const r=await oe().getAIChat(t),i=F(o,t,r?.assistantId??null);if(!i.loaded){const[B,b]=await Promise.all([oe().getMessages(t),oe().getAIChatTokenUsage(t)]);i.messages.splice(0,i.messages.length,...B.map(S=>ze(S))),i.sourceMessages.splice(0,i.sourceMessages.length),i.currentKeywords.splice(0,i.currentKeywords.length),i.sessionTokenUsage=Rt(b),i.loaded=!0}return i.assistantId=r?.assistantId??i.assistantId??null,Y(o,t),E(n),!0}catch(r){return console.error("[AI] 加载对话历史失败:",r),!1}}function ve(n,t){const o=L(n);if(!o)return!1;const r=t??ae;return o.aiChatBuffers[r]?(Y(o,r),E(n),!0):!1}function Ne(){return s.value?(_=!0,ve(s.value.chatKey,s.value.aiChatId)):!1}async function Pe(n){if(_){_=!1;return}const t=L(n);if(!(!t||t.isAIThinking)){if(y.isLoaded||await y.loadAssistants(),!t.selectedAssistantId){const o=We(t.locale);he(n,o)}I(n)}}function I(n,t){const o=L(n);if(!o||o.isAIThinking)return!1;const r=it(o.selectedAssistantId);return o.aiChatBuffers[ae]=r,Y(o,ae),o.currentToolStatus=null,o.toolsUsedInCurrentRound=[],o.isLoadingSource=!1,o.sessionTokenUsage=lt(),o.agentStatus=null,o.isAborted=!1,o.currentRequestId="",o.currentAgentRequestId="",t&&r.messages.push({id:U("welcome"),role:"assistant",content:t,timestamp:Date.now()}),!0}async function k(){}async function R(){}function ee(n,t){const o=g=>{const v=t();n.messages[v]={...n.messages[v],...g}};return{updateAIMessage:o,appendTextToBlocks:g=>{if(!g)return;const v=t(),u=n.messages[v].contentBlocks||[],A=u[u.length-1];g.trim().length===0&&(!A||A.type!=="text")||(A&&A.type==="text"?A.text+=g:u.push({type:"text",text:g}),o({contentBlocks:[...u],content:n.messages[v].content+g}))},appendThinkToBlocks:(g,v,u)=>{if(!g&&u===void 0)return;const A=t(),C=n.messages[A].contentBlocks||[],H=v||"think",z=C[C.length-1];let q=z;if(z&&z.type==="think"&&z.tag===H)z.text+=g;else if(g.trim().length>0)q={type:"think",tag:H,text:g},C.push(q);else if(u!==void 0)for(let G=C.length-1;G>=0;G--){const Se=C[G];if(Se.type==="think"&&Se.tag===H){q=Se;break}}u!==void 0&&q&&q.type==="think"&&(q.durationMs=u),o({contentBlocks:[...C]})},appendChartsToBlocks:g=>{if(g.length===0)return;const v=t(),u=n.messages[v].contentBlocks||[];u.push(...Ut(g)),o({contentBlocks:[...u]})},appendEvidenceToBlocks:g=>{const v=t(),u=n.messages[v].contentBlocks||[];u.push(rs(g)),o({contentBlocks:[...u]})},appendPlanDraftToBlocks:g=>{if(!g)return;const v=t(),u=n.messages[v].contentBlocks||[];o({contentBlocks:[...os(u,g)]})},appendPlanToBlocks:g=>{const v=t(),u=n.messages[v].contentBlocks||[];o({contentBlocks:[...as(u,g)]})},removePlanDraftsFromBlocks:()=>{const g=t(),v=n.messages[g].contentBlocks||[];o({contentBlocks:[...ls(v)]})},updatePlanBlockStatus:g=>{const v=t(),u=n.messages[v].contentBlocks||[];for(let A=u.length-1;A>=0;A--){const C=u[A];if(C.type==="plan"){C.status=g;break}}o({contentBlocks:[...u]})},appendErrorToBlocks:g=>{const v=t(),u=n.messages[v].contentBlocks||[];u.push({type:"error",error:g}),o({contentBlocks:[...u]})},addToolBlock:(g,v,u)=>{const A=t(),C=n.messages[A].contentBlocks||[];C.push({type:"tool",tool:{name:g,displayName:g,status:"running",params:v,toolCallId:u}}),o({contentBlocks:[...C]})},addRenderOnlyToolPendingBlock:(g,v,u)=>{const A=Zt(g,v,u);if(!A)return;const C=t(),H=n.messages[C].contentBlocks||[];H.push(A),o({contentBlocks:[...H]})},updateRenderOnlyToolResult:(g,v,u,A)=>{const C=t(),H=n.messages[C].contentBlocks||[];o({contentBlocks:ss(H,g,v,u,A)})},updateToolBlockStatus:(g,v,u)=>{const A=t(),C=n.messages[A].contentBlocks||[],H=q=>q.type==="tool"&&q.tool.status==="running";let z;if(u?.toolCallId)for(let q=C.length-1;q>=0;q--){const G=C[q];if(H(G)&&G.tool.toolCallId===u.toolCallId){z=G;break}}if(!z)for(let q=C.length-1;q>=0;q--){const G=C[q];if(H(G)&&G.tool.name===g){z=G;break}}z&&(z.tool.status=v,u?.result!==void 0&&(z.tool.result=u.result),u?.displayResult!==void 0&&(z.tool.displayResult=u.displayResult),u?.isError!==void 0&&(z.tool.isError=u.isError)),o({contentBlocks:[...C]})}}}async function pe(n,t,o){const r=L(n);if(!r)return{success:!1,reason:"error"};if(!t.trim())return{success:!1,reason:"empty"};if(r.isAIThinking||s.value)return{success:!1,reason:"busy",activeTask:s.value};const i=U("req"),B=rt(r);let b=B===ae?null:B;const S=F(r,B,r.selectedAssistantId);let P,h;S.assistantId=r.selectedAssistantId,S.loaded=!0,fe(n,t,i,b),E(n),K(n);const j=x.activeSkillId,ne=x.activeSkill?.name,ke=M.value.enableAutoSkill??!0,_e=ke?M.value.chartAutoMode??"suggest":"explicit",ce=(o?.mentionedMembers??[]).map(O=>({memberId:O.memberId,platformId:O.platformId,displayName:O.displayName,aliases:[...O.aliases],mentionText:O.mentionText}));r.isAIThinking=!0,r.isLoadingSource=!0,r.currentToolStatus=null,r.toolsUsedInCurrentRound=[],r.agentStatus=null,r.isAborted=!1,r.currentRequestId=i,r.currentAgentRequestId="";try{const O=await et().hasConfig();if(r.isAborted)return N(n,i),{success:!1,reason:"aborted"};if(r.currentRequestId!==i)return N(n,i),{success:!1,reason:"busy",activeTask:s.value};if(!O)return S.messages.push({id:U("error"),role:"assistant",content:"⚠️ 请先配置 AI 服务。点击左下角「设置」按钮前往「模型配置Tab」进行配置。",timestamp:Date.now()}),N(n,i),{success:!1,reason:"no_config"};const g={id:U("user"),role:"user",content:t,timestamp:Date.now(),toolCalls:[]};P=g,S.messages.push(g);const v={id:U("ai"),role:"assistant",content:"",timestamp:Date.now(),isStreaming:!0,contentBlocks:[]};j&&ne&&v.contentBlocks.push({type:"skill",skillId:j,skillName:ne}),S.messages.push(v);let u=S.messages.length-1,A=!1;const C=Bt(),{updateAIMessage:H,appendTextToBlocks:z,appendThinkToBlocks:q,appendChartsToBlocks:G,appendEvidenceToBlocks:Se,appendPlanDraftToBlocks:Ge,appendPlanToBlocks:qe,removePlanDraftsFromBlocks:Ce,updatePlanBlockStatus:Ee,appendErrorToBlocks:Ye,addToolBlock:Xe,addRenderOnlyToolPendingBlock:Qe,updateRenderOnlyToolResult:De,updateToolBlockStatus:te}=ee(S,()=>u),ge=S.assistantId??We(r.locale);if(!b){const a=t.slice(0,50)+(t.length>50?"...":""),$=await oe().createAIChat(r.sessionId,a,ge);if(r.isAborted)return H({isStreaming:!1}),N(n,i),{success:!1,reason:"aborted"};if(r.currentRequestId!==i)return H({isStreaming:!1}),N(n,i),{success:!1,reason:"busy",activeTask:s.value};b=$.id,de(r,ae,$.id),S.assistantId=ge,ye(n,$.id)}const me={sessionId:r.sessionId,aiChatId:b,timeFilter:r.timeFilter?{startTs:r.timeFilter.startTs,endTs:r.timeFilter.endTs}:void 0,maxMessagesLimit:M.value.maxMessagesPerRequest,ownerInfo:r.ownerInfo?{platformId:r.ownerInfo.platformId,displayName:r.ownerInfo.displayName}:void 0,mentionedMembers:ce.length>0?ce:void 0,preprocessConfig:await Ue(),searchContextBefore:M.value.searchContextBefore,searchContextAfter:M.value.searchContextAfter},{requestId:Te,promise:Ze}=tt().runStream({userMessage:t,sessionId:r.sessionId,aiChatId:b,timeFilter:me.timeFilter,maxMessagesLimit:me.maxMessagesLimit,ownerInfo:me.ownerInfo,mentionedMembers:me.mentionedMembers,preprocessConfig:me.preprocessConfig,chatType:r.chatType,locale:r.locale,assistantId:ge,skillId:j,enableAutoSkill:j?void 0:ke,chartAutoMode:j?void 0:_e,thinkingLevel:(()=>{const a=w.defaultAssistant;if(!(!a?.configId||!a?.modelId))return d.getThinkingLevel(a.configId,a.modelId)})()},a=>{if(!(r.isAborted||i!==r.currentRequestId))switch(a.type){case"content":a.content&&(r.currentToolStatus=C.current(),z(a.content));break;case"think":a.content?q(a.content,a.thinkTag):a.thinkDurationMs!==void 0&&q("",a.thinkTag,a.thinkDurationMs);break;case"tool_start":if(a.toolName){const $=a.toolParams;r.currentToolStatus=C.start({name:a.toolName,toolCallId:a.toolCallId}),r.toolsUsedInCurrentRound.push(a.toolName),le(a.toolName)?Qe(a.toolName,$,a.toolCallId):Xe(a.toolName,$,a.toolCallId)}break;case"tool_update":a.toolName&&a.toolProgress&&(r.currentToolStatus=C.update({name:a.toolName,toolCallId:a.toolCallId,progress:a.toolProgress}));break;case"tool_result":if(a.toolName){const $=ot(a.toolResult),Z=At(a.toolName,a.toolResult);le(a.toolName)?De(a.toolName,a.toolCallId,$,Z):G($);const Fe=Ct(a.toolResult);Fe&&Se(Fe),Z&&(le(a.toolName)||Ye(Z.error));const be=Z!==null||a.toolIsError===!0;if(r.currentToolStatus?.name===a.toolName&&(r.currentToolStatus={...r.currentToolStatus,status:be?"error":"done"}),!le(a.toolName)){const we=yt(a.toolResult);te(a.toolName,be?"error":"done",{toolCallId:a.toolCallId,result:kt(we),displayResult:we,isError:a.toolIsError})}r.currentToolStatus=C.finish({name:a.toolName,toolCallId:a.toolCallId,status:be?"error":"done"})}r.isLoadingSource=!1;break;case"plan_delta":a.planDelta&&Ge(a.planDelta);break;case"plan":a.plan&&(qe(a.plan),Ee("executing"));break;case"plan_skipped":Ce();break;case"status":a.status&&(!r.agentStatus||a.status.updatedAt>=r.agentStatus.updatedAt)&&(r.agentStatus=a.status);break;case"compression_done":if(a.compressionResult){const $={id:`summary-${Date.now()}`,role:"summary",content:a.compressionResult.summaryContent,timestamp:a.compressionResult.timestamp},Z=Math.max(0,S.messages.length-1);S.messages.splice(Z,0,$),u++}break;case"done":C.clear(),r.currentToolStatus=null,A||Ee("done"),a.usage&&(h={...a.usage},r.sessionTokenUsage={promptTokens:r.sessionTokenUsage.promptTokens+a.usage.promptTokens,completionTokens:r.sessionTokenUsage.completionTokens+a.usage.completionTokens,totalTokens:r.sessionTokenUsage.totalTokens+a.usage.totalTokens,cacheReadTokens:r.sessionTokenUsage.cacheReadTokens+a.usage.cacheReadTokens,cacheWriteTokens:r.sessionTokenUsage.cacheWriteTokens+a.usage.cacheWriteTokens}),ie(r,"completed",a.usage?{totalUsage:a.usage}:void 0);break;case"error":if(Ce(),Ee("skipped"),r.currentToolStatus&&(r.currentToolStatus={...r.currentToolStatus,status:"error"},te(r.currentToolStatus.name,"error",{toolCallId:r.currentToolStatus.toolCallId})),C.clear(),!A){A=!0;const $=S.messages[u].contentBlocks||[];$.push({type:"error",error:$e(a.error)}),H({contentBlocks:[...$],isStreaming:!1})}ie(r,"error");break}});r.currentAgentRequestId=Te,fe(n,t,Te,b);const re=await Ze;if(r.isAborted)return N(n,Te),{success:!1,reason:"aborted"};if(i!==r.currentRequestId)return N(n,Te),{success:!1,reason:"busy",activeTask:s.value};if(re.success&&re.result){S.messages[u]={...S.messages[u],dataSource:{toolsUsed:re.result.toolsUsed,toolRounds:re.result.toolRounds},isStreaming:!1};const a=await Ae(b,g,S.messages[u],h);a&&(Object.assign(g,a.userMessage),S.messages[u]={...S.messages[u],...a.assistantMessage,isStreaming:!1})}else if(A){const a=await Ae(b,g,S.messages[u],h);a&&(Object.assign(g,a.userMessage),S.messages[u]={...S.messages[u],...a.assistantMessage,isStreaming:!1})}else{const a=S.messages[u].contentBlocks||[];a.push({type:"error",error:$e(re.error)}),S.messages[u]={...S.messages[u],contentBlocks:[...a],isStreaming:!1};const $=await Ae(b,g,S.messages[u],h);$&&(Object.assign(g,$.userMessage),S.messages[u]={...S.messages[u],...$.assistantMessage,isStreaming:!1})}return{success:!0}}catch(O){console.error("[AI] 处理失败:",O),r.agentStatus=null;const g=S.messages[S.messages.length-1];if(g&&g.role==="assistant"){const v={name:O instanceof Error?O.name:null,message:O instanceof Error?O.message:String(O),stack:O instanceof Error?O.stack??null:null},u=g.contentBlocks||[];u.push({type:"error",error:v}),g.contentBlocks=[...u],g.isStreaming=!1;const A=P||S.messages.findLast(C=>C.role==="user");A&&await Ae(b,A,g,h)}return{success:!1,reason:"error"}}finally{r.isAIThinking=!1,r.isLoadingSource=!1,r.currentToolStatus=null,r.isAborted=!1,r.currentRequestId="",r.currentAgentRequestId="",N(n)}}async function Ae(n,t,o,r){try{if(!n)return null;const i=await oe().addMessage(n,"user",t.content),B=wt(o.contentBlocks),b=await oe().addMessage(n,"assistant",o.content,void 0,void 0,B,r);return{userMessage:ze(i),assistantMessage:ze(b)}}catch(i){return console.error("[AI] 保存对话失败:",i),null}}async function Ue(){const n=l.aiPreprocessConfig;return Xt(n)&&await l.ensureDesensitizeRules(),Qt(l.aiPreprocessConfig)}function Le(n){return n.trim().replace(/^[\s"'“”‘’([{<]+|[\s"'“”‘’)\]}>.,!?;:,。!?;:、]+$/g,"").toLocaleLowerCase()}async function Je(n,t){const o=new Set;for(const r of t.matchAll(/@([^\s@]+)/g)){const i=Le(r[1]??"");i&&o.add(i)}if(o.size===0)return[];try{const r=await mt().getMembers(n.sessionId),i=new Map;r.forEach(P=>{const h=P.groupNickname||P.accountName||P.platformId;i.set(h,(i.get(h)??0)+1)});const B=r.map(P=>{const h=P.groupNickname||P.accountName||P.platformId,j=(i.get(h)??0)>1?`${h}·${P.platformId}`:h,ne=[...P.aliases],ke=[h,P.groupNickname||"",P.accountName||"",P.platformId,j,...ne].map(Le).filter(Boolean);return{memberId:P.id,platformId:P.platformId,displayName:h,aliases:ne,mentionText:`@${j}`,lookupValues:ke}}),b=[],S=new Set;for(const P of o){const h=B.find(j=>!S.has(j.memberId)&&j.lookupValues.includes(P));h&&(S.add(h.memberId),b.push({memberId:h.memberId,platformId:h.platformId,displayName:h.displayName,aliases:h.aliases,mentionText:h.mentionText}))}return b}catch(r){return console.error("[AI] Failed to resolve mentioned members for edited message:",r),[]}}async function Ve(n,t,o,r){const i=L(n),B=o.trim();if(!i||!i.currentAIChatId)return{success:!1,reason:"error"};if(!B)return{success:!1,reason:"empty"};if(i.isAIThinking||s.value)return{success:!1,reason:"busy",activeTask:s.value};const b=r?.overwriteSubsequent??!1,S=F(i,i.currentAIChatId,i.selectedAssistantId),P=S.messages.findIndex(j=>j.id===t),h=S.messages[P];return!h||h.role!=="user"||h.isStreaming?{success:!1,reason:"error"}:h.content.trim()===B?{success:!1,reason:"empty"}:b?m(n,i,S,P,h,B):f(n,i,S,P,h,B)}async function m(n,t,o,r,i,B){try{return await et().hasConfig()?t.isAborted?{success:!1,reason:"aborted"}:t.isAIThinking||s.value?{success:!1,reason:"busy",activeTask:s.value}:(await oe().deleteMessagesFrom(t.currentAIChatId,i.id),o.messages.splice(r,o.messages.length-r),pe(n,B)):{success:!1,reason:"no_config"}}catch(b){return console.error("[AI] edit and overwrite failed:",b),{success:!1,reason:"error"}}}async function f(n,t,o,r,i,B){const b=U("req");let S,P=!1;const h=Bt();fe(n,B,b,t.currentAIChatId),E(n),K(n),t.isAIThinking=!0,t.isLoadingSource=!0,t.currentToolStatus=null,t.toolsUsedInCurrentRound=[],t.agentStatus=null,t.isAborted=!1,t.currentRequestId=b,t.currentAgentRequestId="";const j=o.messages[r+1],ne=j?.role==="assistant",ke=ne?o.messages.slice(r+2):o.messages.slice(r+1),_e={id:U("ai"),role:"assistant",content:"",timestamp:Date.now(),isStreaming:!0,contentBlocks:[]},ce=x.activeSkillId,O=x.activeSkill?.name;ce&&O&&_e.contentBlocks.push({type:"skill",skillId:ce,skillName:O});const g={...i,content:B},v=ne?2:1;o.messages.splice(r,v,g,_e);const u=r+1,A=()=>{o.messages.splice(r,o.messages.length-r,i),ne&&o.messages.splice(r+1,0,j),o.messages.push(...ke)},{updateAIMessage:C,appendTextToBlocks:H,appendThinkToBlocks:z,appendChartsToBlocks:q,appendEvidenceToBlocks:G,appendPlanDraftToBlocks:Se,appendPlanToBlocks:Ge,removePlanDraftsFromBlocks:qe,updatePlanBlockStatus:Ce,appendErrorToBlocks:Ee,addToolBlock:Ye,addRenderOnlyToolPendingBlock:Xe,updateRenderOnlyToolResult:Qe,updateToolBlockStatus:De}=ee(o,()=>u);try{if(!await et().hasConfig())return A(),N(n,b),{success:!1,reason:"no_config"};const ge=o.assistantId??We(t.locale),me=await Je(t,B);if(t.isAborted)return A(),N(n,b),{success:!1,reason:"aborted"};if(b!==t.currentRequestId)return A(),N(n,b),{success:!1,reason:"busy",activeTask:s.value};const Te=M.value.enableAutoSkill??!0,Ze=Te?M.value.chartAutoMode??"suggest":"explicit",re={sessionId:t.sessionId,aiChatId:t.currentAIChatId,historyLeafMessageId:i.parentId??null,timeFilter:t.timeFilter?{startTs:t.timeFilter.startTs,endTs:t.timeFilter.endTs}:void 0,maxMessagesLimit:M.value.maxMessagesPerRequest,ownerInfo:t.ownerInfo?{platformId:t.ownerInfo.platformId,displayName:t.ownerInfo.displayName}:void 0,mentionedMembers:me.length>0?me:void 0,preprocessConfig:await Ue(),searchContextBefore:M.value.searchContextBefore,searchContextAfter:M.value.searchContextAfter},{requestId:a,promise:$}=tt().runStream({userMessage:B,sessionId:t.sessionId,aiChatId:t.currentAIChatId,historyLeafMessageId:i.parentId??null,timeFilter:re.timeFilter,maxMessagesLimit:re.maxMessagesLimit,ownerInfo:re.ownerInfo,mentionedMembers:re.mentionedMembers,preprocessConfig:re.preprocessConfig,chatType:t.chatType,locale:t.locale,assistantId:ge,skillId:ce,enableAutoSkill:ce?void 0:Te,chartAutoMode:ce?void 0:Ze,thinkingLevel:(()=>{const p=w.defaultAssistant;if(!(!p?.configId||!p?.modelId))return d.getThinkingLevel(p.configId,p.modelId)})()},p=>{if(!(t.isAborted||b!==t.currentRequestId))switch(p.type){case"content":t.currentToolStatus=h.current(),H(p.content||"");break;case"think":p.content?z(p.content,p.thinkTag):p.thinkDurationMs!==void 0&&z("",p.thinkTag,p.thinkDurationMs);break;case"tool_start":if(p.toolName){const Ie=p.toolParams;t.currentToolStatus=h.start({name:p.toolName,toolCallId:p.toolCallId}),t.toolsUsedInCurrentRound.push(p.toolName),le(p.toolName)?Xe(p.toolName,Ie,p.toolCallId):Ye(p.toolName,Ie,p.toolCallId)}break;case"tool_update":p.toolName&&p.toolProgress&&(t.currentToolStatus=h.update({name:p.toolName,toolCallId:p.toolCallId,progress:p.toolProgress}));break;case"tool_result":if(p.toolName){const Ie=ot(p.toolResult),Oe=At(p.toolName,p.toolResult),dt=Oe!==null||p.toolIsError===!0;le(p.toolName)?Qe(p.toolName,p.toolCallId,Ie,Oe):q(Ie);const ft=Ct(p.toolResult);if(ft&&G(ft),Oe&&(le(p.toolName)||Ee(Oe.error)),!le(p.toolName)){const pt=yt(p.toolResult);De(p.toolName,dt?"error":"done",{toolCallId:p.toolCallId,result:kt(pt),displayResult:pt,isError:p.toolIsError})}t.currentToolStatus=h.finish({name:p.toolName,toolCallId:p.toolCallId,status:dt?"error":"done"})}t.isLoadingSource=!1;break;case"plan_delta":p.planDelta&&Se(p.planDelta);break;case"plan":p.plan&&(Ge(p.plan),Ce("executing"));break;case"plan_skipped":qe();break;case"status":p.status&&(!t.agentStatus||p.status.updatedAt>=t.agentStatus.updatedAt)&&(t.agentStatus=p.status);break;case"done":h.clear(),t.currentToolStatus=null,P||Ce("done"),p.usage&&(S={...p.usage}),ie(t,"completed",p.usage?{totalUsage:p.usage}:void 0);break;case"error":{qe(),Ce("skipped"),P=!0,t.currentToolStatus&&De(t.currentToolStatus.name,"error",{toolCallId:t.currentToolStatus.toolCallId}),h.clear();const Ie=o.messages[u].contentBlocks||[];Ie.push({type:"error",error:$e(p.error)}),C({contentBlocks:[...Ie],isStreaming:!1}),ie(t,"error");break}}});t.currentAgentRequestId=a,fe(n,B,a,t.currentAIChatId);const Z=await $;if(t.isAborted)return A(),N(n,a),{success:!1,reason:"aborted"};if(b!==t.currentRequestId)return A(),N(n,a),{success:!1,reason:"busy",activeTask:s.value};if(Z.success&&Z.result)C({dataSource:{toolsUsed:Z.result.toolsUsed,toolRounds:Z.result.toolRounds},isStreaming:!1});else if(!P){const p=o.messages[u].contentBlocks||[];p.push({type:"error",error:$e(Z.error)}),C({contentBlocks:[...p],isStreaming:!1})}if(!Z.success)return A(),{success:!1,reason:"error"};await oe().updateMessageContent(i.id,B),ne&&await oe().deleteAndRelinkMessage(t.currentAIChatId,j.id);const Fe=wt(o.messages[u].contentBlocks),be=await oe().insertMessageAfter(t.currentAIChatId,i.id,"assistant",o.messages[u].content,Fe,S);o.messages[u]={...ze(be),dataSource:o.messages[u].dataSource,isStreaming:!1},o.messages[r]={...o.messages[r],content:B};const we=u+1;return we<o.messages.length&&(o.messages[we]={...o.messages[we],parentId:be.id}),o.sessionTokenUsage=Rt(await oe().getAIChatTokenUsage(t.currentAIChatId)),t.sessionTokenUsage={...o.sessionTokenUsage},{success:!0}}catch(te){if(t.isAborted)return A(),{success:!1,reason:"aborted"};console.error("[AI] edit and regenerate failed:",te);const ge=o.messages[u]?.contentBlocks||[];return ge.push({type:"error",error:{name:te instanceof Error?te.name:null,message:te instanceof Error?te.message:String(te),stack:te instanceof Error?te.stack??null:null}}),o.messages[u]&&C({contentBlocks:[...ge],isStreaming:!1}),{success:!1,reason:"error"}}finally{t.isAIThinking=!1,t.isLoadingSource=!1,t.currentToolStatus=null,t.isAborted=!1,t.currentRequestId="",t.currentAgentRequestId="",N(n)}}async function T(n){const t=L(n);if(!t||!t.isAIThinking)return!1;t.isAborted=!0,t.isAIThinking=!1,t.isLoadingSource=!1,t.currentToolStatus=null,ie(t,"aborted");const o=s.value?.chatKey===n?s.value.aiChatId??ae:rt(t),r=t.aiChatBuffers[o],i=r?r.messages[r.messages.length-1]:void 0;if(i&&i.role==="assistant"&&i.isStreaming&&(i.isStreaming=!1,i.content+=`
7
+
8
+ _(已停止生成)_`),t.currentAgentRequestId)try{await tt().abort(t.currentAgentRequestId)}catch(B){console.error("[AI] 中止 Agent 请求失败:",B)}return t.currentRequestId="",t.currentAgentRequestId="",N(n),!0}async function W(){return s.value?T(s.value.chatKey):!1}return{sessionStates:e,activeTask:s,ensureSessionState:J,getSessionState:L,getActiveTaskState:V,applySessionAssistantSelection:E,selectAssistantForSession:he,loadAIChat:Me,focusAIChat:ve,focusActiveTaskAIChat:Ne,resetToSelectorOnEnter:Pe,startNewAIChat:I,loadMoreSourceMessages:k,updateMaxMessages:R,sendMessage:pe,editMessageAndRegenerate:Ve,stopGeneration:T,stopActiveTask:W}});export{gs as a,Yt as b,Pt as c,ms as s,Is as u};
@@ -1,4 +1,4 @@
1
- import{t as M,U as Z,P as f,v as te,j as y,E as ie,w as g,r as P,x as V}from"./RelationshipGalaxyCanvas-BnkcrIpk.js";import"./webworkerAll-BRnv6GvJ.js";import"./index-DkWTvE7d.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-BUz_Vl9U.js";import"./Tabs-B6Nzq2NQ.js";import"./RovingFocusItem-j33Nsbbn.js";import"./useToast-CxhJkhXK.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-CwDIA0UP.js";import"./people-page-header-DNPjaSt4.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-BEtPORqF.js";class q{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,n=this._canvas.height,s=t.width/i*this._renderer.resolution,o=t.height/n*this._renderer.resolution,r=t.left,l=t.top,d=`translate(${r}px, ${l}px) scale(${s}, ${o})`;d!==this._lastTransform&&(this._domElement.style.transform=d,this._lastTransform=d)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const i=this.canvas.width,n=this.canvas.height,s=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||M.shared.add(this.updateTranslation,this,Z.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&M.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class w{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=w.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new f,this.page=new f,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,B=/iPod/i,C=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,v=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,K=/BlackBerry/i,Y=/BB10/i,H=/Opera Mini/i,F=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i,$=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ne(a){return function(e){return e.test(a)}}function j(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ne(t),s={apple:{phone:n(I)&&!n(v),ipod:n(B),tablet:!n(I)&&(n(C)||$(e))&&!n(v),universal:n(U),device:(n(I)||n(B)||n(C)||n(U)||$(e))&&!n(v)},amazon:{phone:n(b),tablet:!n(b)&&n(O),device:n(b)||n(O)},android:{phone:!n(v)&&n(b)||!n(v)&&n(k),tablet:!n(v)&&!n(b)&&!n(k)&&(n(O)||n(R)),device:!n(v)&&(n(b)||n(O)||n(k)||n(R))||n(/\bokhttp\b/i)},windows:{phone:n(v),tablet:n(X),device:n(v)||n(X)},other:{blackberry:n(K),blackberry10:n(Y),opera:n(H),firefox:n(N),chrome:n(F),device:n(K)||n(Y)||n(H)||n(N)||n(F)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const se=j.default??j,oe=se(globalThis.navigator),re=9,G=100,ae=0,le=0,W=2,z=1,he=-1e3,ce=-1e3,de=2,L=class J{constructor(e,t=oe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${he}px`,e.style.left=`${ce}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${ae}px`,this._div.style.left=`${le}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=W.toString(),this._canvasObserver=new q({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){const i={accessibilityOptions:{...J.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i))}for(let i=this._children.length-1;i>=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,te(this._children,i,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){const n=this._children[i];if(!n._accessibleActive||!n._accessibleDiv)continue;const s=n._accessibleDiv,o=n.hitArea||n.getBounds().rectangle;if(n.hitArea){const r=n.worldTransform;s.style.left=`${r.tx+o.x*r.a}px`,s.style.top=`${r.ty+o.y*r.d}px`,s.style.width=`${o.width*r.a}px`,s.style.height=`${o.height*r.d}px`}else this._capHitArea(o),s.style.left=`${o.x}px`,s.style.top=`${o.y}px`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
1
+ import{t as M,U as Z,P as f,v as te,j as y,E as ie,w as g,r as P,x as V}from"./RelationshipGalaxyCanvas-BODk18aA.js";import"./webworkerAll-ZPE_yGnC.js";import"./index-sWxuTsa7.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-C7omDgiJ.js";import"./Tabs-D1UiZNaZ.js";import"./RovingFocusItem-DC_06OmN.js";import"./useToast-BA0EwImD.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-CwgpqtMZ.js";import"./people-page-header-0jvXFFnh.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-yxkeHO78.js";class q{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,n=this._canvas.height,s=t.width/i*this._renderer.resolution,o=t.height/n*this._renderer.resolution,r=t.left,l=t.top,d=`translate(${r}px, ${l}px) scale(${s}, ${o})`;d!==this._lastTransform&&(this._domElement.style.transform=d,this._lastTransform=d)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const i=this.canvas.width,n=this.canvas.height,s=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||M.shared.add(this.updateTranslation,this,Z.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&M.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class w{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=w.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new f,this.page=new f,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,B=/iPod/i,C=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,v=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,K=/BlackBerry/i,Y=/BB10/i,H=/Opera Mini/i,F=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i,$=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ne(a){return function(e){return e.test(a)}}function j(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ne(t),s={apple:{phone:n(I)&&!n(v),ipod:n(B),tablet:!n(I)&&(n(C)||$(e))&&!n(v),universal:n(U),device:(n(I)||n(B)||n(C)||n(U)||$(e))&&!n(v)},amazon:{phone:n(b),tablet:!n(b)&&n(O),device:n(b)||n(O)},android:{phone:!n(v)&&n(b)||!n(v)&&n(k),tablet:!n(v)&&!n(b)&&!n(k)&&(n(O)||n(R)),device:!n(v)&&(n(b)||n(O)||n(k)||n(R))||n(/\bokhttp\b/i)},windows:{phone:n(v),tablet:n(X),device:n(v)||n(X)},other:{blackberry:n(K),blackberry10:n(Y),opera:n(H),firefox:n(N),chrome:n(F),device:n(K)||n(Y)||n(H)||n(N)||n(F)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const se=j.default??j,oe=se(globalThis.navigator),re=9,G=100,ae=0,le=0,W=2,z=1,he=-1e3,ce=-1e3,de=2,L=class J{constructor(e,t=oe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${he}px`,e.style.left=`${ce}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${ae}px`,this._div.style.left=`${le}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=W.toString(),this._canvasObserver=new q({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){const i={accessibilityOptions:{...J.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i))}for(let i=this._children.length-1;i>=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,te(this._children,i,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){const n=this._children[i];if(!n._accessibleActive||!n._accessibleDiv)continue;const s=n._accessibleDiv,o=n.hitArea||n.getBounds().rectangle;if(n.hitArea){const r=n.worldTransform;s.style.left=`${r.tx+o.x*r.a}px`,s.style.top=`${r.ty+o.y*r.d}px`,s.style.width=`${o.width*r.a}px`,s.style.height=`${o.height*r.d}px`}else this._capHitArea(o),s.style.left=`${o.x}px`,s.style.top=`${o.y}px`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
2
2
  color: transparent;
3
3
  pointer-events: none;
4
4
  padding: 0;
@@ -1 +1 @@
1
- import{T as a,V as n}from"./index-DkWTvE7d.js";import"./vendor-snapdom--nZvo8Sg.js";class p{async getVersion(){return"0.36.0"}async fetchRemoteConfig(e){try{const t=await fetch(e);return t.ok?{success:!0,data:(t.headers.get("content-type")||"").includes("application/json")||e.split("?")[0].endsWith(".json")?await t.json():await t.text()}:{success:!1,error:`HTTP ${t.status}`}}catch(t){return{success:!1,error:String(t)}}}setThemeSource(e){}async getOpenAtLogin(){return!1}async setOpenAtLogin(e){return{success:!1,error:"Not available in CLI Web"}}async getDesktopCloseBehavior(){return"background"}async setDesktopCloseBehavior(e){return{success:!1,error:"Not available in CLI Web"}}async getAnalyticsEnabled(){try{return(await(await a("/_web/telemetry/enabled")).json()).enabled===!0}catch{return!1}}async setAnalyticsEnabled(e){try{return await(await a("/_web/telemetry/enabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})})).json()}catch{return{success:!1}}}async trackDailyActive(e){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:"app_active",properties:{app_locale:e}})}).catch(()=>{})}async trackAnalyticsEvent(e,t){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:e,properties:t})}).catch(()=>{})}async showOpenDialog(e){return{canceled:!0,filePaths:[]}}async copyImageToClipboard(e){if(globalThis.isSecureContext===!1)return{success:!1,error:"Image clipboard requires HTTPS or localhost"};if(typeof navigator>"u"||typeof navigator.clipboard?.write!="function"||typeof ClipboardItem>"u")return{success:!1,error:"Image clipboard is not supported by this browser"};try{const t=fetch(e).then(async r=>{if(!r.ok)throw new Error(`Failed to read screenshot data: HTTP ${r.status}`);const s=await r.blob();if(s.type!=="image/png")throw new Error(`Unsupported screenshot MIME type: ${s.type||"unknown"}`);return s});return await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),{success:!0}}catch(t){const r=t instanceof Error?`${t.name}: ${t.message}`:String(t);return n(`Image clipboard write failed: ${r}`,t instanceof Error?t.stack:void 0),{success:!1,error:r}}}async checkUpdate(){try{return await(await a("/_web/system/check-update")).json()}catch(e){return{hasUpdate:!1,currentVersion:"unknown",error:e instanceof Error?e.message:String(e)}}}async performUpdate(){return{success:!1,error:"Web update is unavailable. Run clb update in your terminal."}}async relaunch(){window.location.reload()}}export{p as CliWebPlatformAdapter};
1
+ import{W as a,Y as n}from"./index-sWxuTsa7.js";import"./vendor-snapdom--nZvo8Sg.js";class p{async getVersion(){return"0.36.1"}async fetchRemoteConfig(e){try{const t=await fetch(e);return t.ok?{success:!0,data:(t.headers.get("content-type")||"").includes("application/json")||e.split("?")[0].endsWith(".json")?await t.json():await t.text()}:{success:!1,error:`HTTP ${t.status}`}}catch(t){return{success:!1,error:String(t)}}}setThemeSource(e){}async getOpenAtLogin(){return!1}async setOpenAtLogin(e){return{success:!1,error:"Not available in CLI Web"}}async getDesktopCloseBehavior(){return"background"}async setDesktopCloseBehavior(e){return{success:!1,error:"Not available in CLI Web"}}async getAnalyticsEnabled(){try{return(await(await a("/_web/telemetry/enabled")).json()).enabled===!0}catch{return!1}}async setAnalyticsEnabled(e){try{return await(await a("/_web/telemetry/enabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})})).json()}catch{return{success:!1}}}async trackDailyActive(e){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:"app_active",properties:{app_locale:e}})}).catch(()=>{})}async trackAnalyticsEvent(e,t){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:e,properties:t})}).catch(()=>{})}async showOpenDialog(e){return{canceled:!0,filePaths:[]}}async copyImageToClipboard(e){if(globalThis.isSecureContext===!1)return{success:!1,error:"Image clipboard requires HTTPS or localhost"};if(typeof navigator>"u"||typeof navigator.clipboard?.write!="function"||typeof ClipboardItem>"u")return{success:!1,error:"Image clipboard is not supported by this browser"};try{const t=fetch(e).then(async r=>{if(!r.ok)throw new Error(`Failed to read screenshot data: HTTP ${r.status}`);const s=await r.blob();if(s.type!=="image/png")throw new Error(`Unsupported screenshot MIME type: ${s.type||"unknown"}`);return s});return await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),{success:!0}}catch(t){const r=t instanceof Error?`${t.name}: ${t.message}`:String(t);return n(`Image clipboard write failed: ${r}`,t instanceof Error?t.stack:void 0),{success:!1,error:r}}}async checkUpdate(){try{return await(await a("/_web/system/check-update")).json()}catch(e){return{hasUpdate:!1,currentVersion:"unknown",error:e instanceof Error?e.message:String(e)}}}async performUpdate(){return{success:!1,error:"Web update is unavailable. Run clb update in your terminal."}}async relaunch(){window.location.reload()}}export{p as CliWebPlatformAdapter};
@@ -1 +1 @@
1
- import{K as s,O as l,N as o,L as i}from"./index-DkWTvE7d.js";import"./vendor-snapdom--nZvo8Sg.js";class g{async hasConfig(){return s("/ai/llm/has-config")}async getConfigStore(){return s("/ai/llm/configs")}async getAllConfigs(){return(await this.getConfigStore()).configs}async getDefaultAssistantSlot(){return s("/ai/llm/default-assistant-slot")}async getFastModelSlot(){return s("/ai/llm/fast-model-slot")}async setDefaultAssistantModel(e,t){return l("/ai/llm/default-assistant-slot",{configId:e,modelId:t})}async setFastModel(e){return l("/ai/llm/fast-model-slot",e)}async getProviders(){return s("/ai/llm/providers")}async getProviderRegistry(){return s("/ai/llm/provider-registry")}async getModelCatalog(){return s("/ai/llm/model-catalog")}async addConfig(e){return o("/ai/llm/configs",e)}async updateConfig(e,t){return l(`/ai/llm/configs/${e}`,t)}async deleteConfig(e){return i(`/ai/llm/configs/${e}`)}async validateApiKey(e,t,a,r,n,m){return o("/ai/llm/validate-key",{provider:e,apiKey:t,baseUrl:a,model:r,apiFormat:n,configId:m})}async fetchRemoteModels(e,t,a,r,n){return o("/ai/llm/remote-models",{provider:e,apiKey:t,baseUrl:a,apiFormat:r,configId:n})}async addCustomProvider(e){return o("/ai/llm/custom-providers",e)}async updateCustomProvider(e,t){return l(`/ai/llm/custom-providers/${e}`,t)}async deleteCustomProvider(e){return i(`/ai/llm/custom-providers/${e}`)}async addCustomModel(e){return o("/ai/llm/custom-models",e)}async updateCustomModel(e,t,a){return l(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`,a)}async deleteCustomModel(e,t){return i(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`)}}export{g as FetchLLMAdapter};
1
+ import{N as s,T as l,S as o,O as i}from"./index-sWxuTsa7.js";import"./vendor-snapdom--nZvo8Sg.js";class g{async hasConfig(){return s("/ai/llm/has-config")}async getConfigStore(){return s("/ai/llm/configs")}async getAllConfigs(){return(await this.getConfigStore()).configs}async getDefaultAssistantSlot(){return s("/ai/llm/default-assistant-slot")}async getFastModelSlot(){return s("/ai/llm/fast-model-slot")}async setDefaultAssistantModel(e,t){return l("/ai/llm/default-assistant-slot",{configId:e,modelId:t})}async setFastModel(e){return l("/ai/llm/fast-model-slot",e)}async getProviders(){return s("/ai/llm/providers")}async getProviderRegistry(){return s("/ai/llm/provider-registry")}async getModelCatalog(){return s("/ai/llm/model-catalog")}async addConfig(e){return o("/ai/llm/configs",e)}async updateConfig(e,t){return l(`/ai/llm/configs/${e}`,t)}async deleteConfig(e){return i(`/ai/llm/configs/${e}`)}async validateApiKey(e,t,a,r,n,m){return o("/ai/llm/validate-key",{provider:e,apiKey:t,baseUrl:a,model:r,apiFormat:n,configId:m})}async fetchRemoteModels(e,t,a,r,n){return o("/ai/llm/remote-models",{provider:e,apiKey:t,baseUrl:a,apiFormat:r,configId:n})}async addCustomProvider(e){return o("/ai/llm/custom-providers",e)}async updateCustomProvider(e,t){return l(`/ai/llm/custom-providers/${e}`,t)}async deleteCustomProvider(e){return i(`/ai/llm/custom-providers/${e}`)}async addCustomModel(e){return o("/ai/llm/custom-models",e)}async updateCustomModel(e,t,a){return l(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`,a)}async deleteCustomModel(e,t){return i(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`)}}export{g as FetchLLMAdapter};
@@ -1 +1 @@
1
- import{K as i,N as r,O as s,L as l}from"./index-DkWTvE7d.js";import"./vendor-snapdom--nZvo8Sg.js";class c{async getAll(){return i("/ai/skills")}async getConfig(t){try{return await i(`/ai/skills/${t}`)}catch{return null}}async create(t){return r("/ai/skills",{rawMd:t})}async update(t,a){return s(`/ai/skills/${t}`,{rawMd:a})}async delete(t){return l(`/ai/skills/${t}`)}async importFromMd(t){return r("/ai/skills/import",{rawMd:t})}async importBuiltin(t){return r("/ai/skills/import-builtin",{builtinId:t})}async reimport(t){return r(`/ai/skills/${t}/reimport`,{})}async getBuiltinCatalog(){try{return await i("/ai/skills/builtin-catalog")}catch{return[]}}}export{c as FetchSkillAdapter};
1
+ import{N as i,S as r,T as s,O as l}from"./index-sWxuTsa7.js";import"./vendor-snapdom--nZvo8Sg.js";class c{async getAll(){return i("/ai/skills")}async getConfig(t){try{return await i(`/ai/skills/${t}`)}catch{return null}}async create(t){return r("/ai/skills",{rawMd:t})}async update(t,a){return s(`/ai/skills/${t}`,{rawMd:a})}async delete(t){return l(`/ai/skills/${t}`)}async importFromMd(t){return r("/ai/skills/import",{rawMd:t})}async importBuiltin(t){return r("/ai/skills/import-builtin",{builtinId:t})}async reimport(t){return r(`/ai/skills/${t}/reimport`,{})}async getBuiltinCatalog(){try{return await i("/ai/skills/builtin-catalog")}catch{return[]}}}export{c as FetchSkillAdapter};
@@ -1,4 +1,4 @@
1
- import{U as O}from"./index-DkWTvE7d.js";import"./vendor-snapdom--nZvo8Sg.js";const N=`
1
+ import{X as O}from"./index-sWxuTsa7.js";import"./vendor-snapdom--nZvo8Sg.js";const N=`
2
2
  msg.id,
3
3
  m.id as senderId,
4
4
  COALESCE(m.group_nickname, m.account_name, m.platform_id) as senderName,