chatlab-cli 0.35.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.
- package/README.md +7 -7
- package/dist/{chat-command-24RYGJAS.mjs → chat-command-XPJ43KSW.mjs} +11 -11
- package/dist/chat-command-XPJ43KSW.mjs.map +1 -0
- package/dist/{chunk-7IGBPZMI.mjs → chunk-2JPFBIAG.mjs} +268 -76
- package/dist/chunk-2JPFBIAG.mjs.map +1 -0
- package/dist/{chunk-GQMCDWZQ.mjs → chunk-5MJO4AJB.mjs} +2 -2
- package/dist/{chunk-QKEARRFH.mjs → chunk-67HNPYZJ.mjs} +3 -3
- package/dist/{chunk-U36TQMAF.mjs → chunk-6QP47LID.mjs} +2 -2
- package/dist/{chunk-4GWWKHWA.mjs → chunk-FJOGBUXU.mjs} +892 -6990
- package/dist/chunk-FJOGBUXU.mjs.map +1 -0
- package/dist/{chunk-KIMJXKZO.mjs → chunk-JOVL7OTW.mjs} +2 -2
- package/dist/{chunk-ZBPPLXM4.mjs → chunk-L7TIIVAY.mjs} +63 -63
- package/dist/chunk-L7TIIVAY.mjs.map +1 -0
- package/dist/{chunk-DC7IUDNV.mjs → chunk-NFTCEJBJ.mjs} +27 -9
- package/dist/chunk-NFTCEJBJ.mjs.map +1 -0
- package/dist/{chunk-KXDJ7N6N.mjs → chunk-NQHZPSW2.mjs} +2 -2
- package/dist/chunk-Q3NEL2KK.mjs +19126 -0
- package/dist/chunk-Q3NEL2KK.mjs.map +1 -0
- package/dist/{chunk-DEFEU567.mjs → chunk-R73XMAB2.mjs} +13 -11
- package/dist/chunk-R73XMAB2.mjs.map +1 -0
- package/dist/{chunk-BRZ6YIBR.mjs → chunk-X2QBH24F.mjs} +8 -3
- package/dist/chunk-X2QBH24F.mjs.map +1 -0
- package/dist/chunk-YKMQLAVP.mjs +25 -0
- package/dist/chunk-YKMQLAVP.mjs.map +1 -0
- package/dist/cli.mjs +10 -10
- package/dist/contacts-worker.mjs +2 -2
- package/dist/global-insight-worker.mjs +136 -4
- package/dist/global-insight-worker.mjs.map +1 -1
- package/dist/{http-3K4YMWDE.mjs → http-5RVY5J5U.mjs} +13 -13
- package/dist/{import-D4LV565A.mjs → import-ILTWVHKU.mjs} +8 -8
- package/dist/index.mjs +13 -13
- package/dist/{mcp-KL22FKQ2.mjs → mcp-Y2YXOFB4.mjs} +9 -9
- package/dist/people-relationships-worker.mjs +2 -2
- package/dist/semantic-index-worker.mjs +1 -1
- package/dist/{service-KZTHBDQ5.mjs → service-ZAHXRSFD.mjs} +6 -6
- package/dist/service-ZAHXRSFD.mjs.map +1 -0
- package/dist/{src-COIB6Z4P.mjs → src-OV5ZNE3Z.mjs} +124 -98
- package/dist/{stream-import-FSXCFG4M.mjs → stream-import-XOUM3Z5W.mjs} +8 -8
- package/dist/{undici-MU5I3L6Q.mjs → undici-UGXDRJLV.mjs} +193 -193
- package/dist/undici-UGXDRJLV.mjs.map +1 -0
- package/dist/{update-checker-3N7HQEP2.mjs → update-checker-UL2FBLXH.mjs} +3 -5
- package/dist/{update-checker-3N7HQEP2.mjs.map → update-checker-UL2FBLXH.mjs.map} +1 -1
- package/dist/{worker-runtime-DPS2LURI.mjs → worker-runtime-JNGURHDM.mjs} +6 -6
- package/dist-cli-web/assets/AISettingsTab-vvjijrc5.js +1 -0
- package/dist-cli-web/assets/{AboutTab-DMPziKjj.js → AboutTab-CxI8zJNz.js} +1 -1
- package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-w0hHEodr.js +110 -0
- package/dist-cli-web/assets/Alert-_MYcI_E2.js +1 -0
- package/dist-cli-web/assets/ApiSettingsTab-CK7U6dVA.js +2 -0
- package/dist-cli-web/assets/BatchManageTab-1WnEqqpB.js +1 -0
- package/dist-cli-web/assets/{BufferResource-BXSJADxx.js → BufferResource-i64DlwQT.js} +1 -1
- package/dist-cli-web/assets/{CanvasRenderer-Cq--8UQ_.js → CanvasRenderer-B76mEt9A.js} +1 -1
- package/dist-cli-web/assets/ChatRecordDrawer-Bp6OSCrz.js +1 -0
- package/dist-cli-web/assets/ChatRecordWorkspace-CyfPIlIy.js +11 -0
- package/dist-cli-web/assets/ChatRecordWorkspace-D_oJMtqh.css +1 -0
- package/dist-cli-web/assets/Checkbox-Ci7IeRw1.js +1 -0
- package/dist-cli-web/assets/DataDirCleanupNotice-Dh63pOLt.js +1 -0
- package/dist-cli-web/assets/DatePicker.vue_vue_type_script_setup_true_lang-DqNBNa1D.js +1 -0
- package/dist-cli-web/assets/DebugToolsPanel-CbNsD9co.js +1 -0
- package/dist-cli-web/assets/EChart.vue_vue_type_script_setup_true_lang-YeqmodwE.js +1 -0
- package/dist-cli-web/assets/EChartBar.vue_vue_type_script_setup_true_lang-C3pZmq0v.js +1 -0
- package/dist-cli-web/assets/EChartLine.vue_vue_type_script_setup_true_lang-Co6olfwv.js +1 -0
- package/dist-cli-web/assets/{EChartWordcloud-KV0MdsDE.js → EChartWordcloud-rDusZwSq.js} +1 -1
- package/dist-cli-web/assets/{Filter-DVaqcFmI.js → Filter-yxkeHO78.js} +1 -1
- package/dist-cli-web/assets/GlobalTaskBar-BlZ-fFiq.js +1 -0
- package/dist-cli-web/assets/GroupRelationshipGalaxyView-BXQBX0zJ.js +1 -0
- package/dist-cli-web/assets/Label-CFAZFBQX.js +1 -0
- package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-CwgpqtMZ.js +1 -0
- package/dist-cli-web/assets/MessageExportModal-DU71grc7.js +1 -0
- package/dist-cli-web/assets/PageHeader-BDPf4NuI.js +1 -0
- package/dist-cli-web/assets/PageTabs.vue_vue_type_script_setup_true_lang-_j82asQU.js +1 -0
- package/dist-cli-web/assets/{RelationshipGalaxyCanvas-6EamagxG.js → RelationshipGalaxyCanvas-BODk18aA.js} +14 -14
- package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-BJyuRiC-.js +4168 -0
- package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-CCasBcBQ.css +1 -0
- package/dist-cli-web/assets/{RenderTargetSystem-mYuj4uBS.js → RenderTargetSystem-CVMvAUSv.js} +1 -1
- package/dist-cli-web/assets/RovingFocusItem-DC_06OmN.js +1 -0
- package/dist-cli-web/assets/ScreenCaptureModal-DrBFDOtC.js +1 -0
- package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-C-Zj2biH.js +1 -0
- package/dist-cli-web/assets/Select-DLK2LYhO.js +1 -0
- package/dist-cli-web/assets/SettingsModal-BFkxzo0Y.css +1 -0
- package/dist-cli-web/assets/SettingsModal-DqaR4Dx5.js +2 -0
- package/dist-cli-web/assets/StorageTab-B0ebN0f8.js +1 -0
- package/dist-cli-web/assets/Switch-CokhQWxm.js +1 -0
- package/dist-cli-web/assets/Tabs-D1UiZNaZ.js +1 -0
- package/dist-cli-web/assets/Tabs-N3Q-Mpqi.js +1 -0
- package/dist-cli-web/assets/{ThemeCard.vue_vue_type_script_setup_true_lang-DPIvbq75.js → ThemeCard.vue_vue_type_script_setup_true_lang-OT-I0mbU.js} +1 -1
- package/dist-cli-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-Ccunouyf.js +1 -0
- package/dist-cli-web/assets/{VisuallyHiddenInput-BOdkR_GC.js → VisuallyHiddenInput-OAJEt_Y5.js} +1 -1
- package/dist-cli-web/assets/{WebGLRenderer-BB8ukBI_.js → WebGLRenderer-DuUeftYD.js} +1 -1
- package/dist-cli-web/assets/{WebGPURenderer-DDOzF1Kc.js → WebGPURenderer-DoWQxiWZ.js} +1 -1
- package/dist-cli-web/assets/aiChat-CdADfRnU.js +8 -0
- package/dist-cli-web/assets/{browserAll-BRqlnNxq.js → browserAll-Cb-mtR2y.js} +1 -1
- package/dist-cli-web/assets/{cli-web-ClAJ6Tao.js → cli-web-BHQCZLLg.js} +1 -1
- package/dist-cli-web/assets/{fetch-LY-yerw1.js → fetch-AvsnJLWJ.js} +1 -1
- package/dist-cli-web/assets/{fetch-Dy38lkAa.js → fetch-B-6tyYWu.js} +1 -1
- package/dist-cli-web/assets/{fetch-Bcy2T8Fe.js → fetch-B4PYy5JS.js} +1 -1
- package/dist-cli-web/assets/{fetch-DWAIk_6_.js → fetch-BbcFaCRB.js} +1 -1
- package/dist-cli-web/assets/fetch-BkA_so1e.js +1 -0
- package/dist-cli-web/assets/{fetch-q480XYZQ.js → fetch-BzXuAaT3.js} +8 -5
- package/dist-cli-web/assets/fetch-CW2fKvGp.js +1 -0
- package/dist-cli-web/assets/{fetch-DijSOvop.js → fetch-DEub4tOo.js} +1 -1
- package/dist-cli-web/assets/{fetch-CGu53cxT.js → fetch-DLTlYnDB.js} +1 -1
- package/dist-cli-web/assets/fetch-Qs38Hx1V.js +1 -0
- package/dist-cli-web/assets/{fetch-CP1afnT0.js → fetch-sYDJ-Zs8.js} +1 -1
- package/dist-cli-web/assets/{fetch-DzKlTaLz.js → fetch-ul8-uQIb.js} +1 -1
- package/dist-cli-web/assets/host-B6SQ6OGo.js +1 -0
- package/dist-cli-web/assets/host-DYIkQqvY.js +1 -0
- package/dist-cli-web/assets/{index-Di6FmCdk.js → index--IEkRjKe.js} +10 -10
- package/dist-cli-web/assets/index-9iaY_EWG.js +1 -0
- package/dist-cli-web/assets/index-B4J99zv3.css +1 -0
- package/dist-cli-web/assets/index-BBeqtL8d.css +1 -0
- package/dist-cli-web/assets/index-BnaLj2dx.css +1 -0
- package/dist-cli-web/assets/index-C7omDgiJ.js +2 -0
- package/dist-cli-web/assets/index-CHsM84U1.js +2 -0
- package/dist-cli-web/assets/index-CL8u01Pf.js +137 -0
- package/dist-cli-web/assets/{index-CNzv7aBW.js → index-CShh95fU.js} +1 -1
- package/dist-cli-web/assets/index-C_OS8Y8W.js +1 -0
- package/dist-cli-web/assets/{index-BRV_D8dv.js → index-D64XYYts.js} +1 -1
- package/dist-cli-web/assets/index-DrCc8p_I.css +1 -0
- package/dist-cli-web/assets/index-Dz_ddyZS.css +1 -0
- package/dist-cli-web/assets/index-UpTe1KzQ.js +1 -0
- package/dist-cli-web/assets/index-a8Hw6eD8.js +1 -0
- package/dist-cli-web/assets/index-jwjzZNKm.js +1 -0
- package/dist-cli-web/assets/index-pkxlF8Ee.js +1 -0
- package/dist-cli-web/assets/index-sWxuTsa7.js +36 -0
- package/dist-cli-web/assets/{people-page-header-Bh3KXD4g.js → people-page-header-0jvXFFnh.js} +1 -1
- package/dist-cli-web/assets/{prompt-DcAcgQiB.js → prompt-BPYj29Vq.js} +1 -1
- package/dist-cli-web/assets/{semantic-index-config-builder-CK6v64Y1.js → semantic-index-config-builder-vO37z355.js} +1 -1
- package/dist-cli-web/assets/service-CVoA9yNf.js +1 -0
- package/dist-cli-web/assets/{service-YZnJyEMq.js → service-D29Vftq9.js} +1 -1
- package/dist-cli-web/assets/service-DMysyLCa.js +1 -0
- package/dist-cli-web/assets/{useFormControl-B-aXrJZN.js → useFormControl-DVawP2DO.js} +1 -1
- package/dist-cli-web/assets/useTable-Bv3R_Hux.js +1 -0
- package/dist-cli-web/assets/useToast-BA0EwImD.js +1 -0
- package/dist-cli-web/assets/{vendor-echarts-DfAMQxdr.js → vendor-echarts-hTLhTs52.js} +5 -5
- package/dist-cli-web/assets/{vendor-echarts-wordcloud-BsaEJTPY.js → vendor-echarts-wordcloud-B8CF_NgP.js} +1 -1
- package/dist-cli-web/assets/{vendor-zrender-PFmZe1EY.js → vendor-zrender-D8psf1AA.js} +2 -2
- package/dist-cli-web/assets/{webworkerAll-Dwqmy_YO.js → webworkerAll-ZPE_yGnC.js} +1 -1
- package/dist-cli-web/index.html +2 -2
- package/package.json +4 -4
- package/dist/chat-command-24RYGJAS.mjs.map +0 -1
- package/dist/chunk-22YJOBA3.mjs +0 -9826
- package/dist/chunk-22YJOBA3.mjs.map +0 -1
- package/dist/chunk-4GWWKHWA.mjs.map +0 -1
- package/dist/chunk-7IGBPZMI.mjs.map +0 -1
- package/dist/chunk-BRZ6YIBR.mjs.map +0 -1
- package/dist/chunk-DC7IUDNV.mjs.map +0 -1
- package/dist/chunk-DEFEU567.mjs.map +0 -1
- package/dist/chunk-QZCNVAH6.mjs +0 -14
- package/dist/chunk-QZCNVAH6.mjs.map +0 -1
- package/dist/chunk-ZBPPLXM4.mjs.map +0 -1
- package/dist/service-KZTHBDQ5.mjs.map +0 -1
- package/dist/undici-MU5I3L6Q.mjs.map +0 -1
- package/dist-cli-web/assets/AISettingsTab-rQC2ocFH.js +0 -1
- package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-CnRLt_1j.js +0 -110
- package/dist-cli-web/assets/Alert--bTQXRcZ.js +0 -1
- package/dist-cli-web/assets/ApiSettingsTab-CtXl4I28.js +0 -2
- package/dist-cli-web/assets/BatchManageTab-1KaCPweN.js +0 -1
- package/dist-cli-web/assets/ChatRecordDrawer-BC0F7ok1.js +0 -11
- package/dist-cli-web/assets/ChatRecordDrawer-Tt6UduRC.css +0 -1
- package/dist-cli-web/assets/Checkbox-CwajNPGF.js +0 -1
- package/dist-cli-web/assets/DataDirCleanupNotice-D0Oruka2.js +0 -1
- package/dist-cli-web/assets/DatePicker.vue_vue_type_script_setup_true_lang-C4CsoIlq.js +0 -1
- package/dist-cli-web/assets/DebugToolsPanel-DVDwS-wz.js +0 -1
- package/dist-cli-web/assets/GlobalTaskBar-DpPMX0jx.js +0 -1
- package/dist-cli-web/assets/GroupRelationshipGalaxyView-CLnO3phW.js +0 -1
- package/dist-cli-web/assets/Label-Bt2U4lGy.js +0 -1
- package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-Cnshyn0f.js +0 -1
- package/dist-cli-web/assets/MessageExportModal-BozaR9UZ.js +0 -1
- package/dist-cli-web/assets/PageHeader-CEe0xTl3.js +0 -1
- package/dist-cli-web/assets/PageTabs.vue_vue_type_script_setup_true_lang-D2DZrrnv.js +0 -1
- package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-B6GB4PWS.js +0 -4108
- package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-TYGOUDiv.css +0 -1
- package/dist-cli-web/assets/RovingFocusItem-B2y6BG1a.js +0 -1
- package/dist-cli-web/assets/ScreenCaptureModal-BvAtSNNR.js +0 -1
- package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-ueEF4zHE.js +0 -1
- package/dist-cli-web/assets/Select-Cm4I8u9n.js +0 -1
- package/dist-cli-web/assets/SettingsModal-CjVax3I6.css +0 -1
- package/dist-cli-web/assets/SettingsModal-Cwshzj7i.js +0 -2
- package/dist-cli-web/assets/StorageTab-D7HzH16Y.js +0 -1
- package/dist-cli-web/assets/Switch-BVw4e_19.js +0 -1
- package/dist-cli-web/assets/Tabs-Dqwkh3Ea.js +0 -1
- package/dist-cli-web/assets/Tabs-OrJkANIA.js +0 -1
- package/dist-cli-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-dEdo6CqM.js +0 -1
- package/dist-cli-web/assets/aiChat-CzFSFuOJ.js +0 -8
- package/dist-cli-web/assets/annual-summary-time-range-CmrAqcuj.js +0 -1
- package/dist-cli-web/assets/base-CawUl6ET.js +0 -1
- package/dist-cli-web/assets/dateFormat-DXuDxIye.js +0 -1
- package/dist-cli-web/assets/fetch-3_xX8Yi8.js +0 -1
- package/dist-cli-web/assets/index-0dp58uL4.css +0 -1
- package/dist-cli-web/assets/index-1X7zdLgJ.css +0 -1
- package/dist-cli-web/assets/index-4enwdBcq.css +0 -1
- package/dist-cli-web/assets/index-AudHHbMs.js +0 -1
- package/dist-cli-web/assets/index-CF4DTbvD.js +0 -1
- package/dist-cli-web/assets/index-CMLoht5R.js +0 -1
- package/dist-cli-web/assets/index-CMPHZH6B.css +0 -1
- package/dist-cli-web/assets/index-CXUTiy-V.js +0 -1
- package/dist-cli-web/assets/index-D5m0P4ss.js +0 -36
- package/dist-cli-web/assets/index-DkOrt7_X.js +0 -2
- package/dist-cli-web/assets/index-Dlb6fC68.js +0 -1
- package/dist-cli-web/assets/index-IA7YUjQX.js +0 -2
- package/dist-cli-web/assets/index-ZsZwPLWy.css +0 -1
- package/dist-cli-web/assets/index-kzU381y1.js +0 -1
- package/dist-cli-web/assets/index-z8Vogc-b.js +0 -137
- package/dist-cli-web/assets/lazy-overlay-visibility-Bd9ZFOgR.js +0 -1
- package/dist-cli-web/assets/member-select-utils-BXZ3oHct.js +0 -1
- package/dist-cli-web/assets/useTable-DPEMaGby.js +0 -1
- package/dist-cli-web/assets/useToast-B36MzFFy.js +0 -1
- /package/dist/{chunk-GQMCDWZQ.mjs.map → chunk-5MJO4AJB.mjs.map} +0 -0
- /package/dist/{chunk-QKEARRFH.mjs.map → chunk-67HNPYZJ.mjs.map} +0 -0
- /package/dist/{chunk-U36TQMAF.mjs.map → chunk-6QP47LID.mjs.map} +0 -0
- /package/dist/{chunk-KIMJXKZO.mjs.map → chunk-JOVL7OTW.mjs.map} +0 -0
- /package/dist/{chunk-KXDJ7N6N.mjs.map → chunk-NQHZPSW2.mjs.map} +0 -0
- /package/dist/{http-3K4YMWDE.mjs.map → http-5RVY5J5U.mjs.map} +0 -0
- /package/dist/{import-D4LV565A.mjs.map → import-ILTWVHKU.mjs.map} +0 -0
- /package/dist/{mcp-KL22FKQ2.mjs.map → mcp-Y2YXOFB4.mjs.map} +0 -0
- /package/dist/{src-COIB6Z4P.mjs.map → src-OV5ZNE3Z.mjs.map} +0 -0
- /package/dist/{stream-import-FSXCFG4M.mjs.map → stream-import-XOUM3Z5W.mjs.map} +0 -0
- /package/dist/{worker-runtime-DPS2LURI.mjs.map → worker-runtime-JNGURHDM.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aq as S,ar as C,as as j,o as a,c as l,w as B,b as c,e as r,at as V,m as d,a4 as P,n as s,l as o,i as A,h as u,a6 as m,p as x,F as b,j as w,a5 as p,P as N,f as O,au as F,av as h}from"./index-sWxuTsa7.js";const I={slots:{root:"relative overflow-hidden w-full rounded-lg p-4 flex gap-2.5",wrapper:"min-w-0 flex-1 flex flex-col",title:"text-sm font-medium",description:"text-sm opacity-90",icon:"shrink-0 size-5",avatar:"shrink-0",avatarSize:"2xl",actions:"flex flex-wrap gap-1.5 shrink-0",close:"p-0"},variants:{color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},orientation:{horizontal:{root:"items-center",actions:"items-center"},vertical:{root:"items-start",actions:"items-start mt-2.5"}},title:{true:{description:"mt-1"}}},compoundVariants:[{color:"primary",variant:"solid",class:{root:"bg-primary text-inverted"}},{color:"secondary",variant:"solid",class:{root:"bg-secondary text-inverted"}},{color:"success",variant:"solid",class:{root:"bg-success text-inverted"}},{color:"info",variant:"solid",class:{root:"bg-info text-inverted"}},{color:"warning",variant:"solid",class:{root:"bg-warning text-inverted"}},{color:"error",variant:"solid",class:{root:"bg-error text-inverted"}},{color:"primary",variant:"outline",class:{root:"text-primary ring ring-inset ring-primary/25"}},{color:"secondary",variant:"outline",class:{root:"text-secondary ring ring-inset ring-secondary/25"}},{color:"success",variant:"outline",class:{root:"text-success ring ring-inset ring-success/25"}},{color:"info",variant:"outline",class:{root:"text-info ring ring-inset ring-info/25"}},{color:"warning",variant:"outline",class:{root:"text-warning ring ring-inset ring-warning/25"}},{color:"error",variant:"outline",class:{root:"text-error ring ring-inset ring-error/25"}},{color:"primary",variant:"soft",class:{root:"bg-primary/10 text-primary"}},{color:"secondary",variant:"soft",class:{root:"bg-secondary/10 text-secondary"}},{color:"success",variant:"soft",class:{root:"bg-success/10 text-success"}},{color:"info",variant:"soft",class:{root:"bg-info/10 text-info"}},{color:"warning",variant:"soft",class:{root:"bg-warning/10 text-warning"}},{color:"error",variant:"soft",class:{root:"bg-error/10 text-error"}},{color:"primary",variant:"subtle",class:{root:"bg-primary/10 text-primary ring ring-inset ring-primary/25"}},{color:"secondary",variant:"subtle",class:{root:"bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"}},{color:"success",variant:"subtle",class:{root:"bg-success/10 text-success ring ring-inset ring-success/25"}},{color:"info",variant:"subtle",class:{root:"bg-info/10 text-info ring ring-inset ring-info/25"}},{color:"warning",variant:"subtle",class:{root:"bg-warning/10 text-warning ring ring-inset ring-warning/25"}},{color:"error",variant:"subtle",class:{root:"bg-error/10 text-error ring ring-inset ring-error/25"}},{color:"neutral",variant:"solid",class:{root:"text-inverted bg-inverted"}},{color:"neutral",variant:"outline",class:{root:"text-highlighted bg-default ring ring-inset ring-default"}},{color:"neutral",variant:"soft",class:{root:"text-highlighted bg-elevated/50"}},{color:"neutral",variant:"subtle",class:{root:"text-highlighted bg-elevated/50 ring ring-inset ring-accented"}}],defaultVariants:{color:"primary",variant:"solid"}},D={__name:"Alert",props:{as:{type:null,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},orientation:{type:null,required:!1,default:"vertical"},actions:{type:Array,required:!1},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},emits:["update:open"],setup(k,{emit:q}){const z=k,$=q,i=S(),t=C("alert",z),{t:_}=j(),f=F(),e=O(()=>h({extend:h(I),...f.ui?.alert||{}})({color:t.color,variant:t.variant,orientation:t.orientation,title:!!t.title||!!i.title}));return(n,y)=>(a(),l(r(N),{as:r(t).as,"data-orientation":r(t).orientation,"data-slot":"root",class:s(e.value.root({class:[r(t).ui?.root,r(t).class]}))},{default:B(()=>[c(n.$slots,"leading",{ui:e.value},()=>[r(t).avatar?(a(),l(V,d({key:0,size:r(t).ui?.avatarSize||e.value.avatarSize()},r(t).avatar,{"data-slot":"avatar",class:e.value.avatar({class:r(t).ui?.avatar})}),null,16,["size","class"])):r(t).icon?(a(),l(P,{key:1,name:r(t).icon,"data-slot":"icon",class:s(e.value.icon({class:r(t).ui?.icon}))},null,8,["name","class"])):o("",!0)]),A("div",{"data-slot":"wrapper",class:s(e.value.wrapper({class:r(t).ui?.wrapper}))},[r(t).title||i.title?(a(),u("div",{key:0,"data-slot":"title",class:s(e.value.title({class:r(t).ui?.title}))},[c(n.$slots,"title",{},()=>[m(x(r(t).title),1)])],2)):o("",!0),r(t).description||i.description?(a(),u("div",{key:1,"data-slot":"description",class:s(e.value.description({class:r(t).ui?.description}))},[c(n.$slots,"description",{},()=>[m(x(r(t).description),1)])],2)):o("",!0),r(t).orientation==="vertical"&&(r(t).actions?.length||i.actions)?(a(),u("div",{key:2,"data-slot":"actions",class:s(e.value.actions({class:r(t).ui?.actions}))},[c(n.$slots,"actions",{},()=>[(a(!0),u(b,null,w(r(t).actions,(g,v)=>(a(),l(p,d({key:v,size:"xs"},{ref_for:!0},g),null,16))),128))])],2)):o("",!0)],2),r(t).orientation==="horizontal"&&(r(t).actions?.length||i.actions)||r(t).close?(a(),u("div",{key:0,"data-slot":"actions",class:s(e.value.actions({class:r(t).ui?.actions,orientation:"horizontal"}))},[r(t).orientation==="horizontal"&&(r(t).actions?.length||i.actions)?c(n.$slots,"actions",{key:0},()=>[(a(!0),u(b,null,w(r(t).actions,(g,v)=>(a(),l(p,d({key:v,size:"xs"},{ref_for:!0},g),null,16))),128))]):o("",!0),c(n.$slots,"close",{ui:e.value},()=>[r(t).close?(a(),l(p,d({key:0,icon:r(t).closeIcon||r(f).ui.icons.close,color:"neutral",variant:"link","aria-label":r(_)("alert.close")},typeof r(t).close=="object"?r(t).close:{},{"data-slot":"close",class:e.value.close({class:r(t).ui?.close}),onClick:y[0]||(y[0]=g=>$("update:open",!1))}),null,16,["icon","aria-label","class"])):o("",!0)])],2)):o("",!0)]),_:3},8,["as","data-orientation","class"]))}};export{D as _};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as re,a3 as de,bi as _e,J as ge,o as r,c as Q,w as b,i as e,p as a,e as t,h as p,F as W,z as o,ap as ve,a6 as g,l as V,aO as je,aP as ye,a5 as ue,j as ie,n as G,f as D,r as k,a7 as xe,bj as Be,a4 as ke,az as Oe,I as Ne,x as Fe,y as He}from"./index-sWxuTsa7.js";import{_ as Ke}from"./Switch-CokhQWxm.js";import{_ as We}from"./SectionTabs.vue_vue_type_script_setup_true_lang-C-Zj2biH.js";import{_ as qe}from"./Checkbox-Ci7IeRw1.js";import{_ as Je}from"./Tabs-D1UiZNaZ.js";import"./vendor-snapdom--nZvo8Sg.js";import"./Label-CFAZFBQX.js";import"./useFormControl-DVawP2DO.js";import"./VisuallyHiddenInput-OAJEt_Y5.js";import"./RovingFocusItem-DC_06OmN.js";function me(I){const s=String(I.type||"").trim().toLowerCase(),f=String(I.id||"").trim().toLowerCase();return s==="group"||f.endsWith("@chatroom")?"group":s==="private"?"private":(s==="channel"||s==="official"||s==="other"||f.startsWith("gh_")||f.includes("@openim")||f.startsWith("weixin")&&f!=="weixin","other")}const Ge={class:"p-6",style:{"min-width":"480px","max-height":"80vh","overflow-y":"auto"}},Ye={class:"mb-4 text-lg font-semibold text-gray-900 dark:text-white"},Xe={class:"space-y-4"},Ze={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},Qe={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},et={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},tt={class:"grid grid-cols-2 gap-3"},at={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},st={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},ot={key:1,class:"rounded-md bg-red-50 p-3 text-xs text-red-600 dark:bg-red-900/20 dark:text-red-400"},lt={key:2},nt={class:"mb-2 flex items-center justify-between"},it={class:"text-xs font-medium text-gray-700 dark:text-gray-300"},rt={class:"mb-3 flex items-center gap-2"},dt={class:"mb-2 flex flex-wrap items-center gap-2"},ut={class:"text-xs text-gray-500 dark:text-gray-400"},ct={class:"inline-flex rounded-lg bg-gray-100 p-0.5 dark:bg-gray-800"},pt=["disabled","onClick"],mt={key:0,class:"max-h-64 overflow-y-auto rounded-lg border border-gray-200 dark:border-gray-600"},gt=["onClick"],vt={class:"min-w-0 flex-1"},xt={class:"flex items-center gap-2 truncate text-sm font-medium text-gray-900 dark:text-white"},bt={key:0,class:"rounded-full bg-green-100 px-1.5 py-0.5 text-[10px] text-green-700 dark:bg-green-900/30 dark:text-green-400"},yt={class:"flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400"},ft={class:"rounded bg-gray-100 px-1 dark:bg-gray-700"},ht={key:0},_t={key:1,class:"rounded-lg border border-dashed border-gray-200 px-3 py-6 text-center text-xs text-gray-500 dark:border-gray-700 dark:text-gray-400"},kt={key:2,class:"mt-3 flex justify-center"},St={class:"flex justify-end gap-2 pt-2"},fe=200,wt=5e3,he=re({__name:"DataSourceAddModal",props:{open:{type:Boolean},manageSource:{},subscribedRemoteIds:{}},emits:["update:open","sourceAdded","sessionsAdded"],setup(I,{emit:s}){const f=I,h=s,{t:l}=de(),S=_e(),M=D(()=>!!f.manageSource),v=k({name:"",baseUrl:"",token:"",intervalMinutes:60,pullLimit:1e3}),_=k([]),n=k(new Set),T=k(!1),U=k(!1),w=k(!1),E=k(""),P=k(""),O=k(),F=k(!1),R=k(!1),j=k("all");ge(()=>f.open,async d=>{d&&(M.value&&f.manageSource?v.value={name:f.manageSource.name||"",baseUrl:f.manageSource.baseUrl,token:f.manageSource.token,intervalMinutes:f.manageSource.intervalMinutes,pullLimit:f.manageSource.pullLimit}:v.value={name:"",baseUrl:"",token:"",intervalMinutes:60,pullLimit:1e3},_.value=[],n.value=new Set,E.value="",P.value="",O.value=void 0,F.value=!1,R.value=!1,j.value="all",M.value&&await K())},{immediate:!0});const L=D(()=>_.value.filter(d=>me(d)!=="other")),q=D(()=>j.value==="all"?L.value:L.value.filter(d=>me(d)===j.value)),J=D(()=>q.value.filter(d=>!f.subscribedRemoteIds?.has(d.id))),Y=D(()=>J.value.length>0&&J.value.every(d=>n.value.has(d.id))),X=D(()=>[{value:"all",label:l("settings.api.dataSources.discovery.typeAll")},{value:"private",label:l("settings.api.dataSources.discovery.typePrivate")},{value:"group",label:l("settings.api.dataSources.discovery.typeGroup")}].map(d=>({...d,count:d.value==="all"?L.value.length:L.value.filter(i=>me(i)===d.value).length})));function ee(d){j.value=d}function Z(){const d=J.value.map(i=>i.id);if(Y.value){const i=new Set(n.value);for(const z of d)i.delete(z);n.value=i}else n.value=new Set([...n.value,...d])}function H(d){if(f.subscribedRemoteIds?.has(d))return;const i=new Set(n.value);i.has(d)?i.delete(d):i.add(d),n.value=i}function N(){h("update:open",!1)}async function K(){await ae({append:!1,resetSelection:!0})}async function B(){await ae({append:!1,resetSelection:!0})}async function se(){!F.value||!O.value||await ae({append:!0,resetSelection:!1})}function te(d,i){const z=new Map(d.map(A=>[A.id,A]));for(const A of i)z.set(A.id,A);return[...z.values()]}async function ae(d){if(v.value.baseUrl){d.append?U.value=!0:T.value=!0,R.value=!0,E.value="",d.append||(_.value=[],O.value=void 0,F.value=!1,j.value="all",d.resetSelection&&(n.value=new Set));try{const i=await S.fetchRemoteSessions(v.value.baseUrl,v.value.token,{keyword:P.value.trim()||void 0,limit:fe,cursor:d.append?O.value:void 0});if(!d.append&&!i.page&&i.sessions.length>=fe){const z=await S.fetchRemoteSessions(v.value.baseUrl,v.value.token,{keyword:P.value.trim()||void 0,limit:wt});_.value=z.sessions,F.value=!1,O.value=void 0}else _.value=d.append?te(_.value,i.sessions):i.sessions,F.value=!!i.page?.hasMore,O.value=i.page?.nextCursor}catch(i){E.value=i.message||l("settings.api.dataSources.discovery.error")}finally{T.value=!1,U.value=!1}}}async function oe(){if(M.value){if(n.value.size===0||!f.manageSource)return;const d=_.value.filter(i=>n.value.has(i.id)).map(i=>({name:i.name,remoteSessionId:i.id}));h("sessionsAdded",f.manageSource.id,d),N();return}w.value=!0,E.value="";try{await S.fetchRemoteSessions(v.value.baseUrl,v.value.token,{limit:1})}catch(d){E.value=d.message||l("settings.api.dataSources.discovery.connectionCheckFailed");return}finally{w.value=!1}w.value=!0;try{await S.addDataSource({name:v.value.name||void 0,baseUrl:v.value.baseUrl,token:v.value.token,intervalMinutes:v.value.intervalMinutes,pullLimit:v.value.pullLimit||void 0}),h("sourceAdded"),N()}finally{w.value=!1}}function ce(d){return d===void 0?"-":d>=1e4?`${(d/1e4).toFixed(1)}w`:d>=1e3?`${(d/1e3).toFixed(1)}k`:String(d)}return(d,i)=>{const z=ve,A=ue,pe=qe,le=xe;return r(),Q(le,{open:I.open,ui:{content:"z-[101]",overlay:"z-[100]"},"onUpdate:open":i[7]||(i[7]=x=>h("update:open",x))},{content:b(()=>[e("div",Ge,[e("h3",Ye,a(M.value?t(l)("settings.api.dataSources.edit.manageSessions"):t(l)("settings.api.dataSources.form.modalTitle")),1),e("div",Xe,[M.value?V("",!0):(r(),p(W,{key:0},[e("div",null,[e("label",Ze,a(t(l)("settings.api.dataSources.form.name")),1),o(z,{modelValue:v.value.name,"onUpdate:modelValue":i[0]||(i[0]=x=>v.value.name=x),class:"w-full",placeholder:t(l)("settings.api.dataSources.form.namePlaceholder")},null,8,["modelValue","placeholder"])]),e("div",null,[e("label",Qe,a(t(l)("settings.api.dataSources.discovery.baseUrl")),1),o(z,{modelValue:v.value.baseUrl,"onUpdate:modelValue":i[1]||(i[1]=x=>v.value.baseUrl=x),class:"w-full",placeholder:t(l)("settings.api.dataSources.discovery.baseUrlPlaceholder")},null,8,["modelValue","placeholder"])]),e("div",null,[e("label",et,[g(a(t(l)("settings.api.dataSources.form.token"))+" ",1),i[8]||(i[8]=e("span",{class:"text-red-500"},"*",-1))]),o(z,{modelValue:v.value.token,"onUpdate:modelValue":i[2]||(i[2]=x=>v.value.token=x),class:"w-full",placeholder:t(l)("settings.api.dataSources.form.tokenPlaceholder")},null,8,["modelValue","placeholder"])]),e("div",tt,[e("div",null,[e("label",at,a(t(l)("settings.api.dataSources.form.interval")),1),o(z,{modelValue:v.value.intervalMinutes,"onUpdate:modelValue":i[3]||(i[3]=x=>v.value.intervalMinutes=x),modelModifiers:{number:!0},type:"number",min:1,class:"w-full"},null,8,["modelValue"])]),e("div",null,[e("label",st,a(t(l)("settings.api.dataSources.form.pullLimit")),1),o(z,{modelValue:v.value.pullLimit,"onUpdate:modelValue":i[4]||(i[4]=x=>v.value.pullLimit=x),modelModifiers:{number:!0},type:"number",min:100,max:1e4,class:"w-full",placeholder:t(l)("settings.api.dataSources.form.pullLimitPlaceholder")},null,8,["modelValue","placeholder"])])])],64)),E.value?(r(),p("div",ot,a(E.value),1)):V("",!0),M.value&&R.value?(r(),p("div",lt,[e("div",nt,[e("span",it,a(t(l)("settings.api.dataSources.discovery.found",{count:L.value.length})),1),e("button",{class:"text-xs text-blue-500 hover:text-blue-700 dark:hover:text-blue-400",onClick:Z},a(Y.value?t(l)("settings.api.dataSources.discovery.deselectAll"):t(l)("settings.api.dataSources.discovery.selectAll")),1)]),e("div",rt,[o(z,{modelValue:P.value,"onUpdate:modelValue":i[5]||(i[5]=x=>P.value=x),class:"flex-1",placeholder:t(l)("settings.api.dataSources.discovery.searchPlaceholder"),onKeydown:je(ye(B,["prevent"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"]),o(A,{color:"primary",variant:"soft",loading:T.value,onClick:B},{default:b(()=>[g(a(t(l)("settings.api.dataSources.discovery.search")),1)]),_:1},8,["loading"])]),e("div",dt,[e("span",ut,a(t(l)("settings.api.dataSources.discovery.selectByType")),1),e("div",ct,[(r(!0),p(W,null,ie(X.value,x=>(r(),p("button",{key:x.value,type:"button",class:G(["rounded-md px-2.5 py-1 text-xs transition-colors",j.value===x.value?"bg-white text-blue-600 shadow-sm dark:bg-gray-700 dark:text-blue-300":"text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-200"]),disabled:x.count===0,onClick:ne=>ee(x.value)},a(x.label)+" ("+a(x.count)+") ",11,pt))),128))])]),L.value.length>0?(r(),p("div",mt,[(r(!0),p(W,null,ie(q.value,x=>(r(),p("div",{key:x.id,class:G(["flex items-center gap-3 border-b border-gray-100 px-3 py-2 last:border-0",I.subscribedRemoteIds?.has(x.id)?"opacity-60":"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800"]),onClick:ne=>H(x.id)},[o(pe,{"model-value":I.subscribedRemoteIds?.has(x.id)||n.value.has(x.id),disabled:I.subscribedRemoteIds?.has(x.id),onClick:i[6]||(i[6]=ye(()=>{},["stop"])),"onUpdate:modelValue":ne=>H(x.id)},null,8,["model-value","disabled","onUpdate:modelValue"]),e("div",vt,[e("div",xt,[g(a(x.name)+" ",1),I.subscribedRemoteIds?.has(x.id)?(r(),p("span",bt,a(t(l)("settings.api.dataSources.edit.subscribed")),1)):V("",!0)]),e("div",yt,[e("span",ft,a(x.platform),1),e("span",null,a(x.type),1),x.messageCount!==void 0?(r(),p("span",ht,a(ce(x.messageCount))+" "+a(t(l)("settings.api.dataSources.discovery.messages")),1)):V("",!0)])])],10,gt))),128))])):(r(),p("div",_t,a(t(l)("settings.api.dataSources.discovery.found",{count:0})),1)),F.value?(r(),p("div",kt,[o(A,{color:"neutral",variant:"soft",loading:U.value,onClick:se},{default:b(()=>[g(a(t(l)("settings.api.dataSources.discovery.loadMore")),1)]),_:1},8,["loading"])])):V("",!0)])):V("",!0),e("div",St,[o(A,{variant:"soft",onClick:N},{default:b(()=>[g(a(t(l)("common.cancel")),1)]),_:1}),M.value?(r(),Q(A,{key:0,color:"primary",disabled:n.value.size===0,onClick:oe},{default:b(()=>[g(a(t(l)("settings.api.dataSources.discovery.subscribe",{count:n.value.size})),1)]),_:1},8,["disabled"])):(r(),Q(A,{key:1,color:"primary",disabled:!v.value.baseUrl||!v.value.token,loading:w.value,onClick:oe},{default:b(()=>[g(a(t(l)("settings.api.dataSources.addBtn")),1)]),_:1},8,["disabled","loading"]))])])])]),_:1},8,["open"])}}}),$t={class:"p-6",style:{"min-width":"420px"}},Ct={class:"mb-4 text-lg font-semibold text-gray-900 dark:text-white"},Ut={class:"space-y-4"},Vt={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},Mt={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},zt={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},It={class:"grid grid-cols-2 gap-3"},Dt={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},Tt={class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"},Lt={class:"flex justify-end gap-2 pt-2"},At=re({__name:"DataSourceEditModal",props:{open:{type:Boolean},dataSource:{}},emits:["update:open","saved"],setup(I,{emit:s}){const f=I,h=s,{t:l}=de(),S=k({name:"",baseUrl:"",token:"",intervalMinutes:60,pullLimit:1e3});ge(()=>f.open,v=>{v&&f.dataSource&&(S.value={name:f.dataSource.name,baseUrl:f.dataSource.baseUrl,token:f.dataSource.token,intervalMinutes:f.dataSource.intervalMinutes,pullLimit:f.dataSource.pullLimit})});function M(){h("saved",{name:S.value.name,baseUrl:S.value.baseUrl,token:S.value.token,intervalMinutes:S.value.intervalMinutes,pullLimit:S.value.pullLimit}),h("update:open",!1)}return(v,_)=>{const n=ve,T=ue,U=xe;return r(),Q(U,{open:I.open,ui:{content:"z-[101]",overlay:"z-[100]"},"onUpdate:open":_[6]||(_[6]=w=>h("update:open",w))},{content:b(()=>[e("div",$t,[e("h3",Ct,a(t(l)("settings.api.dataSources.edit.title")),1),e("div",Ut,[e("div",null,[e("label",Vt,a(t(l)("settings.api.dataSources.form.name")),1),o(n,{modelValue:S.value.name,"onUpdate:modelValue":_[0]||(_[0]=w=>S.value.name=w),class:"w-full",placeholder:t(l)("settings.api.dataSources.form.namePlaceholder")},null,8,["modelValue","placeholder"])]),e("div",null,[e("label",Mt,a(t(l)("settings.api.dataSources.discovery.baseUrl")),1),o(n,{modelValue:S.value.baseUrl,"onUpdate:modelValue":_[1]||(_[1]=w=>S.value.baseUrl=w),class:"w-full",placeholder:"https://example.com"},null,8,["modelValue"])]),e("div",null,[e("label",zt,a(t(l)("settings.api.dataSources.form.token")),1),o(n,{modelValue:S.value.token,"onUpdate:modelValue":_[2]||(_[2]=w=>S.value.token=w),class:"w-full",placeholder:t(l)("settings.api.dataSources.form.tokenPlaceholder")},null,8,["modelValue","placeholder"])]),e("div",It,[e("div",null,[e("label",Dt,a(t(l)("settings.api.dataSources.form.interval")),1),o(n,{modelValue:S.value.intervalMinutes,"onUpdate:modelValue":_[3]||(_[3]=w=>S.value.intervalMinutes=w),modelModifiers:{number:!0},type:"number",min:1,class:"w-full"},null,8,["modelValue"])]),e("div",null,[e("label",Tt,a(t(l)("settings.api.dataSources.form.pullLimit")),1),o(n,{modelValue:S.value.pullLimit,"onUpdate:modelValue":_[4]||(_[4]=w=>S.value.pullLimit=w),modelModifiers:{number:!0},type:"number",min:100,max:1e4,class:"w-full",placeholder:t(l)("settings.api.dataSources.form.pullLimitPlaceholder")},null,8,["modelValue","placeholder"])])]),e("div",Lt,[o(T,{variant:"soft",onClick:_[5]||(_[5]=w=>h("update:open",!1))},{default:b(()=>[g(a(t(l)("settings.api.dataSources.edit.cancel")),1)]),_:1}),o(T,{color:"primary",onClick:M},{default:b(()=>[g(a(t(l)("settings.api.dataSources.edit.save")),1)]),_:1})])])])]),_:1},8,["open"])}}}),Pt={class:"space-y-6 pb-6"},Rt={class:"mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white"},Et={class:"rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800/50"},jt={class:"p-4"},Bt={class:"text-sm text-gray-600 dark:text-gray-300"},Ot={class:"mt-3 flex flex-wrap gap-2"},Nt={class:"inline-flex items-center gap-1.5 rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-medium text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400"},Ft={class:"inline-flex items-center gap-1.5 rounded-full bg-blue-100 px-2.5 py-1 text-xs font-medium text-blue-700 dark:bg-blue-900/30 dark:text-blue-400"},Ht={class:"p-4"},Kt={class:"text-sm text-gray-600 dark:text-gray-300"},Wt={class:"mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white"},qt={class:"rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800/50"},Jt={class:"flex items-center justify-between p-4"},Gt={class:"flex-1 pr-4"},Yt={class:"text-sm font-medium text-gray-900 dark:text-white"},Xt={class:"w-72"},Zt={class:"p-4"},Qt={class:"relative"},ea={class:"overflow-x-auto rounded-lg bg-gray-900 p-4 text-xs leading-relaxed text-gray-100 dark:bg-page-dark"},ta={class:"mt-2 text-xs text-gray-500 dark:text-gray-400"},aa={class:"mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white"},sa={class:"rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50"},oa={class:"space-y-2 text-xs text-gray-600 dark:text-gray-400"},la={class:"flex items-start gap-2"},na={class:"flex items-start gap-2"},ia={class:"flex items-start gap-2"},ra={class:"flex items-start gap-2"},da=re({__name:"McpSettingsTab",setup(I){const{t:s}=de(),{copy:f,copied:h}=Be({copiedDuring:2e3}),l=k("claude"),S=D(()=>[{label:"ClaudeCode",value:"claude"},{label:"Codex",value:"codex"},{label:"OpenClaw",value:"openclaw"},{label:s("settings.mcp.clients.other"),value:"other"}]),M=D(()=>{const n=["mcp"];switch(l.value){case"codex":return["[mcp_servers.chatlab]",'command = "clb"',`args = ["${n[0]}"]`].join(`
|
|
2
|
+
`);case"openclaw":return JSON.stringify({mcp:{servers:{chatlab:{command:"clb",args:n}}}},null,2);case"claude":return JSON.stringify({mcpServers:{chatlab:{command:"clb",args:n}}},null,2);default:return JSON.stringify({command:"clb",args:n},null,2)}});function v(){f(M.value)}return(_,n)=>{const T=ke,U=Je,w=ue;return r(),p("div",Pt,[e("div",null,[e("h3",Rt,[o(T,{name:"i-heroicons-command-line",class:"h-4 w-4 text-emerald-500"}),g(" "+a(t(s)("settings.mcp.overview.title")),1)]),e("div",Et,[e("div",jt,[e("p",Bt,a(t(s)("settings.mcp.overview.description")),1),e("div",Ot,[e("span",Nt,[n[1]||(n[1]=e("span",{class:"h-1.5 w-1.5 rounded-full bg-emerald-500"},null,-1)),g(" "+a(t(s)("settings.mcp.overview.toolCount",{count:33})),1)]),e("span",Ft,[n[2]||(n[2]=e("span",{class:"h-1.5 w-1.5 rounded-full bg-blue-500"},null,-1)),g(" "+a(t(s)("settings.mcp.overview.resourceCount",{count:3})),1)]),n[3]||(n[3]=e("span",{class:"inline-flex items-center gap-1.5 rounded-full bg-purple-100 px-2.5 py-1 text-xs font-medium text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"},[e("span",{class:"h-1.5 w-1.5 rounded-full bg-purple-500"}),g(" stdio ")],-1))])]),n[5]||(n[5]=e("div",{class:"border-t border-gray-200 dark:border-gray-700"},null,-1)),e("div",Ht,[e("p",Kt,a(t(s)("settings.mcp.overview.installHint")),1),n[4]||(n[4]=e("div",{class:"mt-2"},[e("code",{class:"inline-block rounded-md bg-gray-900 px-3 py-1.5 text-xs text-gray-100 dark:bg-page-dark"}," npm install -g chatlab-cli ")],-1))])])]),e("div",null,[e("h3",Wt,[o(T,{name:"i-heroicons-clipboard-document",class:"h-4 w-4 text-pink-500"}),g(" "+a(t(s)("settings.mcp.config.title")),1)]),e("div",qt,[e("div",Jt,[e("div",Gt,[e("p",Yt,a(t(s)("settings.mcp.config.clientLabel")),1)]),e("div",Xt,[o(U,{modelValue:l.value,"onUpdate:modelValue":n[0]||(n[0]=E=>l.value=E),size:"sm",class:"gap-0",items:S.value},null,8,["modelValue","items"])])]),n[6]||(n[6]=e("div",{class:"border-t border-gray-200 dark:border-gray-700"},null,-1)),e("div",Zt,[e("div",Qt,[e("pre",ea,[e("code",null,a(M.value),1)]),o(w,{icon:t(h)?"i-heroicons-check":"i-heroicons-clipboard",color:t(h)?"success":"neutral",variant:"soft",size:"xs",class:"absolute right-2 top-2",onClick:v},{default:b(()=>[g(a(t(h)?t(s)("settings.mcp.config.copied"):t(s)("settings.mcp.config.copy")),1)]),_:1},8,["icon","color"])]),e("p",ta,a(t(s)(`settings.mcp.config.${l.value}Hint`)),1)])])]),e("div",null,[e("h3",aa,[o(T,{name:"i-heroicons-light-bulb",class:"h-4 w-4 text-amber-500"}),g(" "+a(t(s)("settings.mcp.tips.title")),1)]),e("div",sa,[e("ul",oa,[e("li",la,[n[7]||(n[7]=e("span",{class:"mt-0.5 text-gray-400"},"•",-1)),g(" "+a(t(s)("settings.mcp.tips.dataDir")),1)]),e("li",na,[n[8]||(n[8]=e("span",{class:"mt-0.5 text-gray-400"},"•",-1)),g(" "+a(t(s)("settings.mcp.tips.readOnly")),1)]),e("li",ia,[n[9]||(n[9]=e("span",{class:"mt-0.5 text-gray-400"},"•",-1)),g(" "+a(t(s)("settings.mcp.tips.nodeRequired")),1)]),e("li",ra,[n[10]||(n[10]=e("span",{class:"mt-0.5 text-gray-400"},"•",-1)),g(" "+a(t(s)("settings.mcp.tips.docs")),1)])])])])])}}}),ua={class:"flex h-full flex-col -mx-6 -mt-6"},ca={class:"flex-1 min-h-0 overflow-auto"},pa={class:"space-y-6 px-6 pt-4 pb-6"},ma={key:0},ga={class:"mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white"},va={class:"rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50"},xa={class:"mb-3 text-xs text-gray-500 dark:text-gray-400"},ba={key:0,class:"mb-4 space-y-4"},ya={class:"flex items-center justify-between border-b border-gray-100 px-3 py-2 dark:border-gray-700"},fa={class:"flex items-center gap-2"},ha={key:0,class:"text-xs font-medium text-gray-700 dark:text-gray-300"},_a={class:"text-xs font-mono text-gray-500 dark:text-gray-400"},ka={key:1,class:"text-xs text-gray-400"},Sa={class:"flex items-center gap-1"},wa={key:0,class:"max-h-80 overflow-y-auto"},$a={class:"flex items-center justify-between"},Ca={class:"flex items-center gap-2"},Ua={class:"text-sm font-medium text-gray-900 dark:text-white"},Va={class:"flex items-center gap-1"},Ma={class:"mt-1 flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400"},za={key:0,class:"text-blue-500"},Ia={key:1,class:"text-blue-500"},Da={key:2},Ta={class:"text-gray-400"},La={key:0,class:"text-green-500"},Aa={key:1,class:"text-red-500"},Pa={key:1,class:"px-3 py-4 text-center text-xs text-gray-400"},Ra={key:1,class:"mb-4 py-4 text-center text-xs text-gray-400"},Ea={key:0},ja={class:"mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white"},Ba={class:"rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50"},Oa={class:"flex items-center gap-2"},Na={class:"text-xs text-green-500"},Fa={class:"mt-3 space-y-2 border-t border-gray-200 pt-3 text-xs text-gray-600 dark:border-gray-700 dark:text-gray-400"},Ha={class:"flex items-center justify-between"},Ka={class:"font-mono text-gray-700 dark:text-gray-300"},Wa={key:0,class:"flex items-center justify-between gap-2"},qa={class:"flex items-center gap-1"},Ja={class:"rounded bg-gray-100 px-2 py-0.5 font-mono text-gray-700 dark:bg-gray-800 dark:text-gray-300"},Ga={class:"mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white"},Ya={class:"rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50"},Xa={class:"flex items-center justify-between"},Za={class:"flex-1 pr-4"},Qa={class:"text-sm font-medium text-gray-900 dark:text-white"},es={class:"mt-1 text-xs text-gray-500 dark:text-gray-400"},ts={key:0,class:"mt-3 flex items-center gap-2 border-t border-gray-200 pt-3 dark:border-gray-700"},as={key:0,class:"ml-auto text-xs text-gray-500 dark:text-gray-400"},ss={key:1,class:"mt-2 rounded-md bg-red-50 p-2 text-xs text-red-600 dark:bg-red-900/20 dark:text-red-400"},os={class:"mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white"},ls={class:"rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50"},ns={class:"flex items-center justify-between"},is={class:"flex-1 pr-4"},rs={class:"text-sm font-medium text-gray-900 dark:text-white"},ds={class:"mt-1 text-xs text-gray-500 dark:text-gray-400"},us={key:0,class:"flex items-center gap-2"},cs={key:1,class:"flex items-center gap-2"},ps={class:"font-mono text-sm text-gray-700 dark:text-gray-300"},ms={class:"mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white"},gs={class:"rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50"},vs={class:"mb-2 text-sm font-medium text-gray-900 dark:text-white"},xs={class:"mb-3 text-xs text-gray-500 dark:text-gray-400"},bs={key:0,class:"flex items-center gap-2"},ys={class:"flex-1 rounded bg-gray-100 px-3 py-2 font-mono text-xs text-gray-700 dark:bg-gray-800 dark:text-gray-300"},fs={key:1,class:"text-xs text-gray-400"},hs={class:"mt-3"},_s={class:"mt-3 border-t border-gray-200 pt-3 dark:border-gray-700"},ks={class:"text-xs text-gray-500 dark:text-gray-400"},Ss={class:"mt-1 rounded bg-gray-100 p-2 font-mono text-xs text-gray-700 dark:bg-gray-800 dark:text-gray-300"},ws={class:"mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white"},$s={class:"rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50"},Cs={class:"text-xs text-gray-600 dark:text-gray-400"},Us=["href"],Vs={class:"p-4"},Ms={class:"mb-3 font-semibold text-gray-900 dark:text-white"},zs={class:"mb-4 text-sm text-gray-600 dark:text-gray-400"},Is={class:"flex justify-end gap-2"},Ds={class:"p-4"},Ts={class:"mb-3 font-semibold text-gray-900 dark:text-white"},Ls={class:"mb-4 text-sm text-gray-600 dark:text-gray-400"},As={class:"flex justify-end gap-2"},Ws=re({__name:"ApiSettingsTab",setup(I){const{t:s,locale:f}=de(),h=_e(),{config:l,status:S,loading:M,isRunning:v,hasError:_,isPortInUse:n,dataSources:T,pullingIds:U,syncProgress:w,isWebMode:E}=Oe(h),P=k("sync"),O=Ne();ge(()=>O.settingsSubTab,u=>{O.settingsTab==="api"&&u&&["sync","api","mcp"].includes(u)&&(P.value=u)},{immediate:!0});const F=D(()=>[{id:"sync",label:s("settings.tabs.apiSubTabs.autoSync"),icon:"i-heroicons-cloud-arrow-down"},{id:"api",label:s("settings.tabs.apiSubTabs.apiService"),icon:"i-heroicons-server-stack"},{id:"mcp",label:s("settings.tabs.apiSubTabs.mcp"),icon:"i-heroicons-command-line"}]),R=k(!1),j=k(!1),L=k(3110),q=k(!1),J=k(!1),Y=k(!1),X=k(null),ee=k(!1),Z=k(null),H=k(!1),N=k(null),K=k(!1),B=k(null);let se=null;Fe(async()=>{await h.refresh(),L.value=l.value.port,se=h.listenStartupError()}),He(()=>{se?.()});const te=D(()=>l.value.token?l.value.token.slice(0,8)+"••••••••••••••••":""),ae=D(()=>M.value?s("settings.api.status.starting"):v.value?s("settings.api.status.running"):n.value?s("settings.api.status.portInUse"):_.value?s("settings.api.status.error"):s("settings.api.status.stopped")),oe=D(()=>M.value?"text-yellow-500":v.value?"text-green-500":_.value?"text-red-500":"text-gray-400"),ce=D(()=>`http://127.0.0.1:${S.value.port||l.value.port}/api/v1`),d=D(()=>f.value==="zh-CN"||f.value==="zh-TW"?"https://docs.chatlab.fun/cn/standard/chatlab-api":"https://docs.chatlab.fun/en/standard/chatlab-api");async function i(){await h.setEnabled(!l.value.enabled)}async function z(){const u=L.value;u<1024||u>65535||(await h.setPort(u),j.value=!1)}function A(){j.value=!0,L.value=l.value.port}function pe(){L.value=l.value.port,j.value=!1}async function le(){try{await navigator.clipboard.writeText(l.value.token),q.value=!0,setTimeout(()=>{q.value=!1},2e3)}catch{}}async function x(){await h.regenerateToken()}function ne(u){X.value=u,Y.value=!0}async function Se(u){X.value&&await h.updateDataSource(X.value.id,u)}function we(u){Z.value=u,ee.value=!0}async function $e(u,c){await h.addImportSessions(u,c)}async function Ce(u){await h.updateDataSource(u.id,{enabled:!u.enabled})}function Ue(u){N.value=u,H.value=!0}async function Ve(){if(!N.value)return;const u=N.value;u.enabled&&await h.updateDataSource(u.id,{enabled:!1}),await h.deleteDataSource(u.id),H.value=!1,N.value=null}function Me(u,c){B.value={ds:u,sess:c},K.value=!0}async function ze(){if(!B.value)return;const{ds:u,sess:c}=B.value;await h.removeImportSession(u.id,c.id,!1),K.value=!1,B.value=null}async function Ie(){if(!B.value)return;const{ds:u,sess:c}=B.value;await h.removeImportSession(u.id,c.id,!0),K.value=!1,B.value=null}async function De(u){await h.triggerPullAll(u.id)}async function Te(u,c){await h.triggerPull(u.id,c.id)}function Le(u){return u?new Date(u*1e3).toLocaleString():"-"}function Ae(u){return new Set(u.sessions.map(c=>c.remoteSessionId))}return(u,c)=>{const $=ke,C=ue,Pe=Ke,Re=ve,be=xe;return r(),p("div",ua,[o(t(We),{modelValue:P.value,"onUpdate:modelValue":c[0]||(c[0]=m=>P.value=m),items:F.value,"persist-key":"apiSubTab"},null,8,["modelValue","items"]),e("div",ca,[e("div",pa,[P.value==="sync"?(r(),p("div",ma,[e("h3",ga,[o($,{name:"i-heroicons-cloud-arrow-down",class:"h-4 w-4 text-indigo-500"}),g(" "+a(t(s)("settings.api.dataSources.title")),1)]),e("div",va,[e("p",xa,a(t(s)("settings.api.dataSources.desc")),1),t(T).length>0?(r(),p("div",ba,[(r(!0),p(W,null,ie(t(T),m=>(r(),p("div",{key:m.id,class:"rounded-lg border border-gray-200 bg-white dark:border-gray-600 dark:bg-gray-800"},[e("div",ya,[e("div",fa,[o($,{name:"i-heroicons-server-stack",class:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),m.name?(r(),p("span",ha,a(m.name),1)):V("",!0),e("span",_a,a(m.baseUrl),1),m.enabled?V("",!0):(r(),p("span",ka," ("+a(t(s)("settings.api.dataSources.disabled"))+") ",1))]),e("div",Sa,[o(C,{size:"xs",variant:"ghost",onClick:y=>ne(m)},{default:b(()=>[o($,{name:"i-heroicons-pencil-square",class:"mr-1 h-3.5 w-3.5"}),g(" "+a(t(s)("settings.api.dataSources.edit.editSource")),1)]),_:1},8,["onClick"]),o(C,{size:"xs",variant:"ghost",onClick:y=>we(m)},{default:b(()=>[o($,{name:"i-heroicons-queue-list",class:"mr-1 h-3.5 w-3.5"}),g(" "+a(t(s)("settings.api.dataSources.edit.manageSessions")),1)]),_:1},8,["onClick"]),o(C,{size:"xs",variant:"ghost",onClick:y=>Ce(m)},{default:b(()=>[o($,{name:m.enabled?"i-heroicons-pause":"i-heroicons-play",class:"h-3.5 w-3.5"},null,8,["name"])]),_:2},1032,["onClick"]),o(C,{size:"xs",variant:"ghost",disabled:t(U).has(m.id)||m.sessions.some(y=>t(U).has(y.id)),onClick:y=>De(m)},{default:b(()=>[o($,{name:"i-heroicons-arrow-path",class:G(["h-3.5 w-3.5",{"animate-spin":t(U).has(m.id)||m.sessions.some(y=>t(U).has(y.id))}])},null,8,["class"])]),_:2},1032,["disabled","onClick"]),o(C,{size:"xs",variant:"ghost",color:"error",disabled:m.sessions.some(y=>t(U).has(y.id)),onClick:y=>Ue(m)},{default:b(()=>[o($,{name:"i-heroicons-trash",class:"h-3.5 w-3.5"})]),_:1},8,["disabled","onClick"])])]),m.sessions.length>0?(r(),p("div",wa,[(r(!0),p(W,null,ie(m.sessions,y=>(r(),p("div",{key:y.id,class:"border-b border-gray-50 px-3 py-2.5 last:border-0 dark:border-gray-700/50"},[e("div",$a,[e("div",Ca,[e("span",{class:G(["inline-block h-2 w-2 rounded-full",t(U).has(y.id)?"animate-pulse bg-blue-500":y.lastStatus==="success"?"bg-green-500":y.lastStatus==="error"?"bg-red-500":"bg-gray-400"])},null,2),e("span",Ua,a(y.name),1)]),e("div",Va,[o(C,{size:"xs",variant:"ghost",disabled:t(U).has(y.id),onClick:Ee=>Te(m,y)},{default:b(()=>[o($,{name:"i-heroicons-arrow-path",class:G(["h-3.5 w-3.5",{"animate-spin":t(U).has(y.id)}])},null,8,["class"])]),_:2},1032,["disabled","onClick"]),o(C,{size:"xs",variant:"ghost",color:"error",disabled:t(U).has(y.id),onClick:Ee=>Me(m,y)},{default:b(()=>[o($,{name:"i-heroicons-trash",class:"h-3.5 w-3.5"})]),_:1},8,["disabled","onClick"])])]),e("div",Ma,[t(w).get(y.id)?(r(),p("span",za,a(t(s)("settings.api.dataSources.syncing"))+"... "+a(t(w).get(y.id).current)+" "+a(t(s)("settings.api.dataSources.messages")),1)):t(U).has(y.id)&&!t(w).get(y.id)?(r(),p("span",Ia,a(t(s)("settings.api.dataSources.syncing"))+"...",1)):(r(),p("span",Da,a(t(s)("settings.api.dataSources.every"))+" "+a(m.intervalMinutes)+" "+a(t(s)("settings.api.dataSources.minutes")),1)),!t(U).has(y.id)&&y.lastPullAt?(r(),p(W,{key:3},[c[13]||(c[13]=e("span",{class:"text-gray-300 dark:text-gray-600"},"·",-1)),e("span",Ta,a(t(s)("settings.api.dataSources.lastSync"))+": "+a(Le(y.lastPullAt)),1),y.lastStatus==="success"?(r(),p("span",La," (+"+a(y.lastNewMessages)+") ",1)):V("",!0),y.lastStatus==="error"?(r(),p("span",Aa,a(y.lastError),1)):V("",!0)],64)):V("",!0)])]))),128))])):(r(),p("div",Pa,a(t(s)("settings.api.dataSources.noSessions")),1))]))),128))])):(r(),p("div",Ra,a(t(s)("settings.api.dataSources.empty")),1)),o(C,{variant:"soft",onClick:c[1]||(c[1]=m=>J.value=!0)},{default:b(()=>[o($,{name:"i-heroicons-plus",class:"mr-2 h-4 w-4"}),g(" "+a(t(s)("settings.api.dataSources.addBtn")),1)]),_:1})])])):V("",!0),P.value==="api"?(r(),p(W,{key:1},[t(E)?(r(),p("div",Ea,[e("h3",ja,[o($,{name:"i-heroicons-server-stack",class:"h-4 w-4 text-blue-500"}),g(" "+a(t(s)("settings.api.service.title")),1)]),e("div",Ba,[e("div",Oa,[c[14]||(c[14]=e("span",{class:"inline-block h-2 w-2 rounded-full bg-green-500"},null,-1)),e("span",Na,a(t(s)("settings.api.status.running")),1)]),e("div",Fa,[e("div",Ha,[e("span",null,a(t(s)("settings.api.port.label")),1),e("span",Ka,a(t(l).port||"-"),1)]),t(l).token?(r(),p("div",Wa,[e("span",null,a(t(s)("settings.api.token.label")),1),e("div",qa,[e("code",Ja,a(R.value?t(l).token:te.value),1),o(C,{size:"xs",variant:"ghost",onClick:c[2]||(c[2]=m=>R.value=!R.value)},{default:b(()=>[o($,{name:R.value?"i-heroicons-eye-slash":"i-heroicons-eye",class:"h-3.5 w-3.5"},null,8,["name"])]),_:1}),o(C,{size:"xs",variant:"ghost",onClick:le},{default:b(()=>[o($,{name:q.value?"i-heroicons-check":"i-heroicons-clipboard",class:"h-3.5 w-3.5"},null,8,["name"])]),_:1})])])):V("",!0)])])])):(r(),p(W,{key:1},[e("div",null,[e("h3",Ga,[o($,{name:"i-heroicons-server-stack",class:"h-4 w-4 text-blue-500"}),g(" "+a(t(s)("settings.api.service.title")),1)]),e("div",Ya,[e("div",Xa,[e("div",Za,[e("p",Qa,a(t(s)("settings.api.service.enable")),1),e("p",es,a(t(s)("settings.api.service.enableDesc")),1)]),o(Pe,{"model-value":t(l).enabled,loading:t(M),"onUpdate:modelValue":i},null,8,["model-value","loading"])]),t(l).enabled?(r(),p("div",ts,[e("span",{class:G(["inline-block h-2 w-2 rounded-full",t(v)?"bg-green-500":t(_)?"bg-red-500":"bg-gray-400"])},null,2),e("span",{class:G(["text-xs",oe.value])},a(ae.value),3),t(v)&&t(S).port?(r(),p("span",as,a(ce.value),1)):V("",!0)])):V("",!0),t(n)?(r(),p("div",ss,a(t(s)("settings.api.service.portInUseHint")),1)):V("",!0)])]),e("div",null,[e("h3",os,[o($,{name:"i-heroicons-globe-alt",class:"h-4 w-4 text-purple-500"}),g(" "+a(t(s)("settings.api.port.title")),1)]),e("div",ls,[e("div",ns,[e("div",is,[e("p",rs,a(t(s)("settings.api.port.label")),1),e("p",ds,a(t(s)("settings.api.port.desc")),1)]),j.value?(r(),p("div",us,[o(Re,{modelValue:L.value,"onUpdate:modelValue":c[3]||(c[3]=m=>L.value=m),modelModifiers:{number:!0},type:"number",min:1024,max:65535,size:"sm",class:"w-24"},null,8,["modelValue"]),o(C,{size:"xs",color:"primary",loading:t(M),onClick:z},{default:b(()=>[g(a(t(s)("settings.api.port.save")),1)]),_:1},8,["loading"]),o(C,{size:"xs",variant:"ghost",onClick:pe},{default:b(()=>[g(a(t(s)("settings.api.port.cancel")),1)]),_:1})])):(r(),p("div",cs,[e("span",ps,a(t(l).port),1),o(C,{size:"xs",variant:"ghost",onClick:A},{default:b(()=>[g(a(t(s)("settings.api.port.edit")),1)]),_:1})]))])])]),e("div",null,[e("h3",ms,[o($,{name:"i-heroicons-key",class:"h-4 w-4 text-amber-500"}),g(" "+a(t(s)("settings.api.token.title")),1)]),e("div",gs,[e("p",vs,a(t(s)("settings.api.token.label")),1),e("p",xs,a(t(s)("settings.api.token.desc")),1),t(l).token?(r(),p("div",bs,[e("code",ys,a(R.value?t(l).token:te.value),1),o(C,{size:"xs",variant:"ghost",onClick:c[4]||(c[4]=m=>R.value=!R.value)},{default:b(()=>[o($,{name:R.value?"i-heroicons-eye-slash":"i-heroicons-eye",class:"h-4 w-4"},null,8,["name"])]),_:1}),o(C,{size:"xs",variant:"ghost",onClick:le},{default:b(()=>[o($,{name:q.value?"i-heroicons-check":"i-heroicons-clipboard",class:"h-4 w-4"},null,8,["name"])]),_:1})])):(r(),p("div",fs,a(t(s)("settings.api.token.noToken")),1)),e("div",hs,[o(C,{variant:"soft",color:"warning",onClick:x},{default:b(()=>[o($,{name:"i-heroicons-arrow-path",class:"mr-1 h-4 w-4"}),g(" "+a(t(s)("settings.api.token.regenerate")),1)]),_:1})]),e("div",_s,[e("p",ks,a(t(s)("settings.api.usage.authHint")),1),e("div",Ss," Authorization: Bearer "+a(t(l).token?te.value:"clb_..."),1)])])])],64)),e("div",null,[e("h3",ws,[o($,{name:"i-heroicons-book-open",class:"h-4 w-4 text-teal-500"}),g(" "+a(t(s)("settings.api.usage.title")),1)]),e("div",$s,[e("p",Cs,a(t(s)("settings.api.usage.desc")),1),e("a",{href:d.value,target:"_blank",class:"mt-2 inline-flex items-center gap-1 text-xs text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300"},[o($,{name:"i-heroicons-arrow-top-right-on-square",class:"h-3.5 w-3.5"}),g(" "+a(t(s)("settings.api.usage.docLink")),1)],8,Us)])])],64)):V("",!0),P.value==="mcp"?(r(),Q(da,{key:2})):V("",!0)])]),o(he,{open:J.value,"onUpdate:open":c[5]||(c[5]=m=>J.value=m),onSourceAdded:c[6]||(c[6]=m=>t(h).fetchDataSources())},null,8,["open"]),o(At,{open:Y.value,"onUpdate:open":c[7]||(c[7]=m=>Y.value=m),"data-source":X.value,onSaved:Se},null,8,["open","data-source"]),Z.value?(r(),Q(he,{key:0,open:ee.value,"onUpdate:open":c[8]||(c[8]=m=>ee.value=m),"manage-source":Z.value,"subscribed-remote-ids":Ae(Z.value),onSessionsAdded:$e},null,8,["open","manage-source","subscribed-remote-ids"])):V("",!0),o(be,{open:H.value,"onUpdate:open":c[10]||(c[10]=m=>H.value=m),ui:{content:"z-[101]",overlay:"z-[100]"}},{content:b(()=>[e("div",Vs,[e("h3",Ms,a(t(s)("settings.api.dataSources.deleteConfirm.title")),1),e("p",zs,a(t(s)("settings.api.dataSources.deleteConfirm.message",{name:N.value?.baseUrl})),1),e("div",Is,[o(C,{variant:"soft",onClick:c[9]||(c[9]=m=>H.value=!1)},{default:b(()=>[g(a(t(s)("common.cancel")),1)]),_:1}),o(C,{color:"error",onClick:Ve},{default:b(()=>[g(a(t(s)("common.delete")),1)]),_:1})])])]),_:1},8,["open"]),o(be,{open:K.value,"onUpdate:open":c[12]||(c[12]=m=>K.value=m),ui:{content:"z-[101]",overlay:"z-[100]"}},{content:b(()=>[e("div",Ds,[e("h3",Ts,a(t(s)("settings.api.dataSources.deleteSessionConfirm.title")),1),e("p",Ls,a(t(s)("settings.api.dataSources.deleteSessionConfirm.message",{name:B.value?.sess.name})),1),e("div",As,[o(C,{variant:"soft",onClick:c[11]||(c[11]=m=>K.value=!1)},{default:b(()=>[g(a(t(s)("common.cancel")),1)]),_:1}),o(C,{variant:"soft",onClick:ze},{default:b(()=>[g(a(t(s)("settings.api.dataSources.deleteSessionConfirm.keepData")),1)]),_:1}),o(C,{color:"error",onClick:Ie},{default:b(()=>[g(a(t(s)("settings.api.dataSources.deleteSessionConfirm.deleteData")),1)]),_:1})])])]),_:1},8,["open"])])}}});export{Ws as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{be as He,a as qe,aE as _e,a3 as Ge,ao as We,az as Qe,J as Je,bf as Ye,x as Xe,o as d,h as u,z as i,a4 as Ze,i as a,p as n,e as s,l as K,ap as et,w as A,a5 as tt,a6 as L,bg as at,F as se,j as me,n as R,am as Se,aP as Me,aL as st,aH as rt,aI as lt,aO as Ce,c as ot,a7 as nt,r as b,f as w,C as Te,bh as it}from"./index-sWxuTsa7.js";import{_ as ct}from"./Checkbox-Ci7IeRw1.js";import{u as dt}from"./useToast-BA0EwImD.js";import{u as ut,a as gt,_ as mt}from"./useTable-Bv3R_Hux.js";import"./vendor-snapdom--nZvo8Sg.js";import"./useFormControl-DVawP2DO.js";import"./VisuallyHiddenInput-OAJEt_Y5.js";import"./RovingFocusItem-DC_06OmN.js";import"./Label-CFAZFBQX.js";var re={exports:{}},ft=re.exports,Ae;function ht(){return Ae||(Ae=1,(function(le,oe){(function(N,l){le.exports=l()})(ft,(function(){return function(N,l,C){N=N||{};var h=l.prototype,p={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function z(m,v,V,H){return h.fromToBase(m,v,V,H)}C.en.relativeTime=p,h.fromToBase=function(m,v,V,H,ee){for(var q,O,B,F=V.$locale().relativeTime||p,G=N.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],ne=G.length,g=0;g<ne;g+=1){var y=G[g];y.d&&(q=H?C(m).diff(V,y.d,!0):V.diff(m,y.d,!0));var T=(N.rounding||Math.round)(Math.abs(q));if(B=q>0,T<=y.r||!y.r){T<=1&&g>0&&(y=G[g-1]);var D=F[y.l];ee&&(T=ee(""+T)),O=typeof D=="string"?D.replace("%d",T):D(T,v,y.l,B);break}}if(v)return O;var W=B?F.future:F.past;return typeof W=="function"?W(O):W.replace("%s",O)},h.to=function(m,v){return z(m,v,this,!0)},h.from=function(m,v){return z(m,v,this)};var j=function(m){return m.$u?C.utc():C()};h.toNow=function(m){return this.to(j(this),m)},h.fromNow=function(m){return this.from(j(this),m)}}}))})(re)),re.exports}var pt=ht();const vt=He(pt),xt={class:"flex h-full flex-col"},bt={class:"mb-4"},yt={class:"mb-4 flex items-center justify-between"},wt={class:"flex items-center gap-4"},kt={class:"text-xs text-gray-400 dark:text-gray-500"},_t={key:0,class:"text-sm text-gray-500 dark:text-gray-400"},St={key:1,class:"text-sm text-gray-500 dark:text-gray-400"},Mt={class:"flex gap-2"},Ct={key:1,class:"flex flex-1 items-center justify-center"},Tt={class:"text-center text-gray-500 dark:text-gray-400"},At={key:2,class:"flex flex-1 items-center justify-center"},zt={class:"text-center text-gray-500 dark:text-gray-400"},It={key:3,class:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-gray-200/50 dark:border-gray-700/50"},$t={class:"flex shrink-0 items-center gap-3 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs font-medium text-gray-500 dark:border-gray-700 dark:bg-page-dark/80 dark:text-gray-400"},Et=["onClick"],Rt={class:"flex shrink-0 flex-col leading-none"},Nt=["onClick"],Vt={class:"w-6"},jt={class:"w-8"},Ot={class:"min-w-0 flex-1"},Bt={class:"flex items-center gap-1.5"},Ft=["title","onClick"],Dt={class:"w-20 text-center"},Pt=["title","onClick"],Ut={class:"truncate"},Kt={class:"w-24 text-right text-sm text-gray-600 dark:text-gray-300"},Lt={class:"w-16 text-right text-sm text-gray-600 dark:text-gray-300"},Ht={class:"w-16 text-right text-sm text-gray-600 dark:text-gray-300"},qt={class:"w-28 text-right text-xs text-gray-500 dark:text-gray-400"},Gt={class:"p-4"},Wt={class:"mb-4 flex items-center gap-3"},Qt={class:"flex h-10 w-10 items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30"},Jt={class:"text-lg font-semibold text-gray-900 dark:text-white"},Yt={class:"mb-4 text-gray-600 dark:text-gray-400"},Xt={class:"mb-4 max-h-40 overflow-y-auto rounded-lg border border-gray-200 dark:border-gray-700"},Zt={class:"text-sm text-gray-700 dark:text-gray-300"},ea={class:"text-xs text-gray-400"},ta={class:"mb-4"},aa={key:0,class:"mb-4 rounded-lg border border-red-200 bg-red-50 px-3 py-2 dark:border-red-800/50 dark:bg-red-900/20"},sa={class:"flex items-start gap-2"},ra={class:"text-xs leading-5 text-red-700 dark:text-red-300"},la={key:1,class:"mb-4 rounded-lg bg-blue-50 px-4 py-3 dark:bg-blue-900/20"},oa={class:"flex items-center gap-2"},na={class:"text-sm text-blue-700 dark:text-blue-300"},ia={class:"flex justify-end gap-2"},ca={class:"p-4"},da={class:"mb-4 flex items-center gap-3"},ua={class:"flex h-10 w-10 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30"},ga={class:"text-lg font-semibold text-gray-900 dark:text-white"},ma={class:"mb-6 text-gray-600 dark:text-gray-400"},fa={class:"flex justify-end gap-2"},ha=48,Ma=qe({__name:"BatchManageTab",props:{focusOwnerIssues:{type:Boolean,default:!1}},setup(le){_e.extend(vt);const oe=dt(),N=le,{t:l,locale:C}=Ge(),h=We(),{sessions:p}=Qe(h),z=b("");function j(e){return e.ownerStatus!=="resolved"&&!e.ownerExcluded}const m=w(()=>p.value.filter(j).length),v=w(()=>{if(!z.value.trim())return p.value;const e=z.value.toLowerCase().trim();return p.value.filter(t=>t.name.toLowerCase().includes(e)||t.platform.toLowerCase().includes(e))}),V=[{key:"spacer-select",type:"spacer",class:"w-6"},{key:"spacer-avatar",type:"spacer",class:"w-8"},{key:"name",type:"sortable",field:"name",labelKey:"tools.batchManage.columns.name",class:"min-w-0 flex-1",align:"left"},{key:"platform",type:"sortable",field:"platform",labelKey:"tools.batchManage.columns.platform",class:"w-20",align:"center"},{key:"owner",type:"sortable",field:"owner",labelKey:"tools.batchManage.columns.owner",class:"w-28",align:"left"},{key:"messages",type:"sortable",field:"messageCount",labelKey:"tools.batchManage.columns.messages",class:"w-24",align:"right"},{key:"summaries",type:"static",labelKey:"tools.batchManage.columns.summaries",class:"w-16",align:"right"},{key:"aiChats",type:"static",labelKey:"tools.batchManage.columns.aiChats",class:"w-16",align:"right"},{key:"importedAt",type:"sortable",field:"importedAt",labelKey:"tools.batchManage.columns.importedAt",class:"w-28",align:"right"}],{sortState:H,toggleSort:ee,setSort:q,isSortActive:O}=ut({initialState:{field:"importedAt",direction:"desc"}});function B(e,t){return O(e,t)?"text-primary-500 dark:text-primary-400":"text-gray-300 dark:text-gray-600"}function F(e){return e==="left"?"justify-start text-left":e==="center"?"justify-center text-center":"justify-end text-right"}function G(e){return`${e.class} ${F(e.align)}`}function ne(e){return`${e.class} flex items-center gap-1 transition-colors hover:text-gray-700 dark:hover:text-gray-200 ${F(e.align)}`}const g=w(()=>{const e=[...v.value],{field:t,direction:c}=H.value;if(!t||!c)return e;const k=c==="asc"?1:-1;return e.sort((M,x)=>{if(t==="name")return M.name.localeCompare(x.name,C.value)*k;if(t==="platform")return ge(M.platform).localeCompare(ge(x.platform),C.value)*k;if(t==="owner"){const U=_=>_.ownerStatus==="resolved"?`0:${_.ownerName||_.ownerId||""}`:_.ownerExcluded?"1:":_.ownerStatus==="unresolved"?"2:":"3:";return U(M).localeCompare(U(x),C.value)*k}return t==="messageCount"?(M.messageCount-x.messageCount)*k:(M.importedAt-x.importedAt)*k}),e}),y=b(null);function T(){q("owner","desc"),Te(()=>y.value?.scrollTo({top:0}))}Je(()=>N.focusOwnerIssues,e=>{e&&T()},{immediate:!0});const D=Ye(w(()=>({count:g.value.length,getScrollElement:()=>y.value,estimateSize:()=>ha,overscan:10,getItemKey:e=>g.value[e]?.id??e}))),W=w(()=>D.value.getVirtualItems().map(e=>({virtualItem:e,session:g.value[e.index]}))),ze=w(()=>D.value.getTotalSize()),{selectedIds:f,setSelection:fe,clearSelection:he,isSelected:pe,handleRowClick:ve,handleRowMouseDown:xe}=gt({rows:g,getRowId:e=>e.id}),Q=b(!1),J=b(!1),I=b(null),$=b(""),ie=b(null),te=b(!1),ce=b(!1),de=w(()=>p.value.find(e=>e.id===ie.value)??null);function Ie(e,t){t.stopPropagation(),ie.value=e.id,ce.value=j(e),te.value=!0}async function be(){if(await h.loadSessions(),!ce.value)return;await Te();const e=g.value.find(j);e?(ie.value=e.id,te.value=!0):ce.value=!1}const ye=w(()=>p.value.filter(e=>f.value.has(e.id))),$e=w(()=>new Set(ye.value.map(e=>e.type))),ae=w(()=>f.value.size<2?!1:$e.value.size===1),we=w(()=>g.value.length>0&&g.value.every(e=>f.value.has(e.id))),Ee=w(()=>{const e=g.value.filter(t=>f.value.has(t.id)).length;return e>0&&e<g.value.length});function Re(){if(we.value){const e=new Set(g.value.map(t=>t.id));fe([...f.value].filter(t=>!e.has(t)))}else{const e=new Set(f.value);for(const t of g.value)e.add(t.id);fe(e)}}function Ne(e){return _e.unix(e).locale({"zh-CN":"zh-cn","zh-TW":"zh-tw","ja-JP":"ja"}[C.value]??"en").fromNow()}function Y(e){return e.type==="private"}function Ve(e){return Y(e)?e.memberAvatar||null:e.groupAvatar||null}function je(e){const t=e.name||"";return t?Y(e)?t.length<=2?t:t.slice(-2):t.length<=2?t:t.slice(0,2):"?"}const ue={qq:{label:"QQ",class:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},weixin:{label:"微信",class:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"},discord:{label:"Discord",class:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300"},whatsapp:{label:"WhatsApp",class:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300"},instagram:{label:"Instagram",class:"bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-300"},line:{label:"LINE",class:"bg-lime-100 text-lime-700 dark:bg-lime-900/30 dark:text-lime-300"},unknown:{label:"未知",class:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300"}};function ge(e){return ue[e]?.label||e}function Oe(e){return ue[e]?.class||ue.unknown.class}function Be(e,t){t.stopPropagation(),I.value=e.id,$.value=e.name}async function ke(){if(!I.value||!$.value.trim()){I.value=null,$.value="";return}const e=$.value.trim(),t=p.value.find(c=>c.id===I.value);t&&t.name!==e&&await h.renameSession(I.value,e),I.value=null,$.value=""}function Fe(){I.value=null,$.value=""}function De(){f.value.size!==0&&(Q.value=!0)}const X=b(!1),P=b(!1),E=b(""),Z=b(!1);async function Pe(){ae.value&&(Z.value=!1,X.value=!0)}async function Ue(){if(!ae.value)return;P.value=!0,E.value=l("tools.batchManage.mergeSteps.exporting");const e=Array.from(f.value);let t=[];try{const c=await window.mergeApi.exportSessionsToTempFiles(e);if(!c.success)throw new Error(c.error||"导出失败");t=c.tempFiles,E.value=l("tools.batchManage.mergeSteps.parsing");for(const r of t)await window.mergeApi.parseFileInfo(r);E.value=l("tools.batchManage.mergeSteps.checking");const k=await window.mergeApi.checkConflicts(t);k.conflicts.length>0&&console.log(`[BatchDelete] 检测到 ${k.conflicts.length} 个冲突,使用默认解决方案`),E.value=l("tools.batchManage.mergeSteps.merging");const U=`${p.value.find(r=>f.value.has(r.id))?.name||"聊天记录"}(${l("tools.batchManage.mergedSuffix")})`,_=await window.mergeApi.mergeFiles({filePaths:t,outputName:U,outputFormat:"json",conflictResolutions:k.conflicts.map(r=>({id:r.id,resolution:"keep1"})),andAnalyze:!0,sessionGapThreshold:it()});if(!_.success)throw new Error(_.error||"合并失败");if(Z.value){E.value=l("tools.batchManage.mergeSteps.cleaning");for(const r of e)await h.deleteSession(r)}await window.mergeApi.cleanupTempExportFiles(t),await h.loadSessions(),he(),X.value=!1,oe.success(l("tools.batchManage.mergeSuccess",{count:e.length}))}catch(c){console.error("[BatchDelete] 合并失败:",c),oe.fail(l("tools.batchManage.mergeError",{error:String(c)})),t.length>0&&await window.mergeApi.cleanupTempExportFiles(t)}finally{P.value=!1,E.value=""}}async function Ke(){if(f.value.size!==0){J.value=!0;try{const e=Array.from(f.value);for(const t of e)await h.deleteSession(t);he(),Q.value=!1}catch(e){console.error("Batch delete failed:",e)}finally{J.value=!1}}}function Le(){Q.value=!1}return Xe(()=>{h.loadSessions()}),(e,t)=>{const c=Ze,k=et,M=ct,x=tt,U=at,_=nt;return d(),u("div",xt,[m.value>0?(d(),u("button",{key:0,type:"button",class:"mb-3 inline-flex w-fit max-w-full items-center gap-2 rounded-lg bg-amber-50 px-3 py-2 text-left text-xs text-amber-800 transition-colors hover:bg-amber-100 dark:bg-amber-950/20 dark:text-amber-300 dark:hover:bg-amber-950/30",onClick:T},[i(c,{name:"i-heroicons-user-circle",class:"h-4 w-4 shrink-0"}),a("span",null,n(s(l)("tools.batchManage.ownerIssues",{count:m.value})),1),i(c,{name:"i-heroicons-arrow-right",class:"h-3.5 w-3.5 shrink-0 opacity-70"})])):K("",!0),a("div",bt,[i(k,{modelValue:z.value,"onUpdate:modelValue":t[0]||(t[0]=r=>z.value=r),placeholder:s(l)("tools.batchManage.searchPlaceholder"),icon:"i-heroicons-magnifying-glass",size:"md",class:"w-80"},null,8,["modelValue","placeholder"])]),a("div",yt,[a("div",wt,[i(M,{"model-value":we.value,indeterminate:Ee.value,label:s(l)("tools.batchManage.selectAll"),"onUpdate:modelValue":Re},null,8,["model-value","indeterminate","label"]),a("span",kt,n(s(l)("tools.batchManage.shiftClickHint")),1),s(f).size>0?(d(),u("span",_t,n(s(l)("tools.batchManage.selected",{count:s(f).size})),1)):K("",!0),z.value.trim()&&v.value.length!==s(p).length?(d(),u("span",St,n(s(l)("tools.batchManage.searchResult",{count:v.value.length,total:s(p).length})),1)):K("",!0)]),a("div",Mt,[i(U,{text:ae.value?"":s(l)("tools.batchManage.mergeHint")},{default:A(()=>[i(x,{color:"primary",disabled:!ae.value,icon:"i-heroicons-document-duplicate",onClick:Pe},{default:A(()=>[L(n(s(l)("tools.batchManage.merge")),1)]),_:1},8,["disabled"])]),_:1},8,["text"]),i(x,{color:"primary",disabled:s(f).size===0,icon:"i-heroicons-trash",onClick:De},{default:A(()=>[L(n(s(l)("tools.batchManage.delete")),1)]),_:1},8,["disabled"])])]),s(p).length===0?(d(),u("div",Ct,[a("div",Tt,[i(c,{name:"i-heroicons-inbox",class:"mb-2 h-12 w-12"}),a("p",null,n(s(l)("tools.batchManage.empty")),1)])])):v.value.length===0?(d(),u("div",At,[a("div",zt,[i(c,{name:"i-heroicons-magnifying-glass",class:"mb-2 h-12 w-12"}),a("p",null,n(s(l)("tools.batchManage.noSearchResult")),1)])])):(d(),u("div",It,[a("div",$t,[(d(),u(se,null,me(V,r=>(d(),u(se,{key:r.key},[r.type==="spacer"?(d(),u("div",{key:0,class:R(r.class)},null,2)):r.type==="static"?(d(),u("div",{key:1,class:R(G(r))},n(s(l)(r.labelKey)),3)):(d(),u("button",{key:2,class:R(ne(r)),onClick:o=>s(ee)(r.field)},[a("span",null,n(s(l)(r.labelKey)),1),a("span",Rt,[i(c,{name:"i-heroicons-chevron-up",class:R(["h-2.5 w-2.5",B(r.field,"asc")])},null,8,["class"]),i(c,{name:"i-heroicons-chevron-down",class:R(["-mt-0.5 h-2.5 w-2.5",B(r.field,"desc")])},null,8,["class"])])],10,Et))],64))),64))]),a("div",{ref_key:"listScrollRef",ref:y,class:"min-h-0 flex-1 overflow-y-auto"},[a("div",{class:"relative",style:Se({height:`${ze.value}px`})},[(d(!0),u(se,null,me(W.value,({virtualItem:r,session:o})=>(d(),u("div",{key:String(r.key),class:R(["absolute left-0 right-0 top-0 flex h-12 cursor-pointer items-center gap-3 px-3 py-2 transition-colors hover:bg-gray-100 dark:hover:bg-gray-800",[s(pe)(o.id)?"bg-pink-50 dark:bg-pink-900/20":"",r.index!==g.value.length-1?"border-b border-gray-100 dark:border-gray-800":""]]),style:Se({transform:`translateY(${r.start}px)`}),onMousedown:t[3]||(t[3]=(...S)=>s(xe)&&s(xe)(...S)),onClick:S=>s(ve)(r.index,o.id,S)},[a("div",Vt,[i(M,{"model-value":s(pe)(o.id),onClick:Me(S=>s(ve)(r.index,o.id,S),["stop"])},null,8,["model-value","onClick"])]),a("div",jt,[i(st,{src:Ve(o),alt:o.name,text:je(o),"fallback-class":["flex h-8 w-8 items-center justify-center rounded-full text-[10px] font-bold",Y(o)?"bg-pink-500 text-white":"bg-primary-500 text-white"]},null,8,["src","alt","text","fallback-class"])]),a("div",Ot,[a("div",Bt,[i(c,{name:Y(o)?"i-heroicons-user":"i-heroicons-user-group",class:"h-3.5 w-3.5 shrink-0 text-gray-400"},null,8,["name"]),I.value===o.id?rt((d(),u("input",{key:0,"onUpdate:modelValue":t[1]||(t[1]=S=>$.value=S),type:"text",class:"w-full rounded border border-pink-300 bg-white px-2 py-0.5 text-sm font-medium text-gray-900 focus:border-pink-500 focus:outline-none focus:ring-1 focus:ring-pink-500 dark:border-pink-600 dark:bg-gray-800 dark:text-white",autofocus:"",onBlur:ke,onKeydown:[Ce(ke,["enter"]),Ce(Fe,["escape"])],onClick:t[2]||(t[2]=Me(()=>{},["stop"]))},null,544)),[[lt,$.value]]):(d(),u("p",{key:1,class:"cursor-text truncate rounded px-1 text-sm font-medium text-gray-900 hover:bg-gray-200 dark:text-white dark:hover:bg-gray-700",title:s(l)("tools.batchManage.clickToEdit"),onClick:S=>Be(o,S)},n(o.name),9,Ft))])]),a("div",Dt,[a("span",{class:R(["inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",Oe(o.platform)])},n(ge(o.platform)),3)]),a("button",{type:"button",class:R(["flex w-28 min-w-0 items-center gap-1.5 text-left text-xs transition-colors hover:text-primary-600 dark:hover:text-primary-400",o.ownerStatus==="resolved"||o.ownerExcluded?"text-gray-600 dark:text-gray-300":"text-amber-600 dark:text-amber-400"]),title:o.ownerId||s(l)("tools.batchManage.ownerStatus.missing"),onClick:S=>Ie(o,S)},[i(c,{name:o.ownerStatus==="resolved"?"i-heroicons-user-circle":o.ownerExcluded?"i-heroicons-user-minus":"i-heroicons-exclamation-circle",class:"h-3.5 w-3.5 shrink-0"},null,8,["name"]),a("span",Ut,n(o.ownerStatus==="resolved"?o.ownerName||o.ownerId:s(l)(`tools.batchManage.ownerStatus.${o.ownerStatus}`)),1),i(c,{name:"i-heroicons-chevron-right",class:"h-3 w-3 shrink-0 opacity-60"})],10,Pt),a("div",Kt,n(o.messageCount.toLocaleString()),1),a("div",Lt,n(o.summaryCount||0),1),a("div",Ht,n(o.aiConversationCount||0),1),a("div",qt,n(Ne(o.importedAt)),1)],46,Nt))),128))],4)],512)])),de.value?(d(),ot(mt,{key:4,modelValue:te.value,"onUpdate:modelValue":t[4]||(t[4]=r=>te.value=r),"session-id":de.value.id,"chat-type":de.value.type,onSaved:be,onCleared:be},null,8,["modelValue","session-id","chat-type"])):K("",!0),i(_,{open:X.value,"onUpdate:open":t[7]||(t[7]=r=>X.value=r),ui:{content:"z-[101]",overlay:"z-[100]"}},{content:A(()=>[a("div",Gt,[a("div",Wt,[a("div",Qt,[i(c,{name:"i-heroicons-document-duplicate",class:"h-5 w-5 text-blue-600 dark:text-blue-400"})]),a("h3",Jt,n(s(l)("tools.batchManage.mergeConfirmTitle")),1)]),a("p",Yt,n(s(l)("tools.batchManage.mergeConfirmMessage",{count:s(f).size})),1),a("div",Xt,[(d(!0),u(se,null,me(ye.value,r=>(d(),u("div",{key:r.id,class:"flex items-center gap-2 border-b border-gray-100 px-3 py-2 last:border-b-0 dark:border-gray-800"},[i(c,{name:Y(r)?"i-heroicons-user":"i-heroicons-user-group",class:"h-4 w-4 text-gray-400"},null,8,["name"]),a("span",Zt,n(r.name),1),a("span",ea,n(r.messageCount.toLocaleString())+" 条",1)]))),128))]),a("div",ta,[i(M,{modelValue:Z.value,"onUpdate:modelValue":t[5]||(t[5]=r=>Z.value=r),label:s(l)("tools.batchManage.deleteOriginalsLabel")},null,8,["modelValue","label"])]),Z.value?(d(),u("div",aa,[a("div",sa,[i(c,{name:"i-heroicons-exclamation-triangle",class:"mt-0.5 h-4 w-4 shrink-0 text-red-600"}),a("p",ra,n(s(l)("tools.batchManage.mergeRiskWarning")),1)])])):K("",!0),P.value?(d(),u("div",la,[a("div",oa,[i(c,{name:"i-heroicons-arrow-path",class:"h-4 w-4 animate-spin text-blue-600 dark:text-blue-400"}),a("span",na,n(E.value),1)])])):K("",!0),a("div",ia,[i(x,{variant:"soft",disabled:P.value,onClick:t[6]||(t[6]=r=>X.value=!1)},{default:A(()=>[L(n(s(l)("common.cancel")),1)]),_:1},8,["disabled"]),i(x,{color:"primary",loading:P.value,onClick:Ue},{default:A(()=>[L(n(P.value?E.value:s(l)("tools.batchManage.merge")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"]),i(_,{open:Q.value,"onUpdate:open":t[8]||(t[8]=r=>Q.value=r),ui:{content:"z-[101]",overlay:"z-[100]"}},{content:A(()=>[a("div",ca,[a("div",da,[a("div",ua,[i(c,{name:"i-heroicons-exclamation-triangle",class:"h-5 w-5 text-red-600 dark:text-red-400"})]),a("h3",ga,n(s(l)("tools.batchManage.confirmTitle")),1)]),a("p",ma,n(s(l)("tools.batchManage.confirmMessage",{count:s(f).size})),1),a("div",fa,[i(x,{variant:"soft",disabled:J.value,onClick:Le},{default:A(()=>[L(n(s(l)("common.cancel")),1)]),_:1},8,["disabled"]),i(x,{color:"error",loading:J.value,onClick:Ke},{default:A(()=>[L(n(J.value?s(l)("tools.batchManage.deleting"):s(l)("common.delete")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"])])}}});export{Ma as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as U,g,c,u as S,B as _,d as m,E as I,e as p}from"./RelationshipGalaxyCanvas-
|
|
1
|
+
import{w as U,g,c,u as S,B as _,d as m,E as I,e as p}from"./RelationshipGalaxyCanvas-BODk18aA.js";const x={name:"local-uniform-bit",vertex:{header:`
|
|
2
2
|
|
|
3
3
|
struct LocalUniforms {
|
|
4
4
|
uTransformMatrix:mat3x3<f32>,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as C,h as Ce,i as Te,m as Z,M as A,j as _,k as Le,w as Oe,s as Pe,l as ke,n as je,C as be,T as _e,o as Ne,F as Ye,p as Ve,q as $e,D as Se,A as Xe,R as Je,r as te}from"./RelationshipGalaxyCanvas-6EamagxG.js";import{R as Ke,S as Qe,B as ze,a as Ze,b as et,c as tt,A as st,C as nt}from"./RenderTargetSystem-mYuj4uBS.js";import"./index-D5m0P4ss.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-IA7YUjQX.js";import"./Tabs-OrJkANIA.js";import"./RovingFocusItem-B2y6BG1a.js";import"./useToast-B36MzFFy.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-Cnshyn0f.js";import"./people-page-header-Bh3KXD4g.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-DVaqcFmI.js";const he=class L{static _getPatternRepeat(e,t){const a=e&&e!=="clamp-to-edge",s=t&&t!=="clamp-to-edge";return a&&s?"repeat":a?"repeat-x":s?"repeat-y":"no-repeat"}start(e,t,a){}execute(e,t){const a=t.elements;if(!a||!a.length)return;const s=e.renderer,o=s.canvasContext,r=o.activeContext;for(let l=0;l<a.length;l++){const i=a[l];if(!i.packAsQuad)continue;const d=i,h=d.texture,v=h?C.getCanvasSource(h):null;if(!v)continue;const y=h.source.style,H=o.smoothProperty,W=y.scaleMode!=="nearest";r[H]!==W&&(r[H]=W),o.setBlendMode(t.blendMode);const F=s.globalUniforms.globalUniformData?.worldColor??4294967295,S=d.color,G=(F>>>24&255)/255,P=(S>>>24&255)/255,g=s.filter?.alphaMultiplier??1,M=G*P*g;if(M<=0)continue;r.globalAlpha=M;const K=F&16777215,k=S&16777215,q=Te(Z(k,K)),I=h.frame,V=y.addressModeU??y.addressMode,O=y.addressModeV??y.addressMode,u=L._getPatternRepeat(V,O),m=h.source._resolution??h.source.resolution??1,f=d.renderable?.renderGroup?.isCachedAsTexture,D=I.x*m,j=I.y*m,b=I.width*m,E=I.height*m,x=d.bounds,w=s.renderTarget.renderTarget.isRoot,R=x.minX,$=x.minY,U=x.maxX-x.minX,B=x.maxY-x.minY,T=h.rotate,c=h.uvs,se=Math.min(c.x0,c.x1,c.x2,c.x3,c.y0,c.y1,c.y2,c.y3),Fe=Math.max(c.x0,c.x1,c.x2,c.x3,c.y0,c.y1,c.y2,c.y3),de=u!=="no-repeat"&&(se<0||Fe>1),Q=T&&!(!de&&(q!==16777215||T));Q?(L._tempPatternMatrix.copyFrom(d.transform),Ce.matrixAppendRotationInv(L._tempPatternMatrix,T,R,$,U,B),o.setContextTransform(L._tempPatternMatrix,d.roundPixels===1,void 0,f&&w)):o.setContextTransform(d.transform,d.roundPixels===1,void 0,f&&w);const ne=U,ae=B;let X=Q?0:R,J=Q?0:$;if(!Q&&d.roundPixels===1&&(X|=0,J|=0),de){let oe=v;const N=q!==16777215&&!T,Y=I.width<=h.source.width&&I.height<=h.source.height;N&&Y&&(oe=C.getTintedCanvas({texture:h},q));const re=r.createPattern(oe,u);if(!re)continue;const pe=ne,ue=ae;if(pe===0||ue===0)continue;const me=1/pe,fe=1/ue,ge=(c.x1-c.x0)*me,ve=(c.y1-c.y0)*me,ye=(c.x3-c.x0)*fe,xe=(c.y3-c.y0)*fe,qe=c.x0-ge*X-ye*J,Ue=c.y0-ve*X-xe*J,ie=h.source.pixelWidth,ce=h.source.pixelHeight;L._tempPatternMatrix.set(ge*ie,ve*ce,ye*ie,xe*ce,qe*ie,Ue*ce),C.applyPatternTransform(re,L._tempPatternMatrix),r.fillStyle=re,r.fillRect(X,J,ne,ae)}else{const N=q!==16777215||T?C.getTintedCanvas({texture:h},q):v,Y=N!==v;r.drawImage(N,Y?0:D,Y?0:j,Y?N.width:b,Y?N.height:E,X,J,ne,ae)}}}};he._tempPatternMatrix=new A;he.extension={type:[_.CanvasPipesAdaptor],name:"batch"};let at=he;class Me{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(e,t,a){this._renderer.renderPipes.batch.break(a);const s=this._colorStack;s[this._colorStackIndex]=s[this._colorStackIndex-1]&e.mask;const o=this._colorStack[this._colorStackIndex];o!==this._currentColor&&(this._currentColor=o,a.add({renderPipeId:"colorMask",colorMask:o,canBundle:!1})),this._colorStackIndex++}pop(e,t,a){this._renderer.renderPipes.batch.break(a);const s=this._colorStack;this._colorStackIndex--;const o=s[this._colorStackIndex-1];o!==this._currentColor&&(this._currentColor=o,a.add({renderPipeId:"colorMask",colorMask:o,canBundle:!1}))}execute(e){}destroy(){this._renderer=null,this._colorStack=null}}Me.extension={type:[_.CanvasPipes],name:"colorMask"};function ot(n,e,t,a,s,o){o=Math.max(0,Math.min(o,Math.min(a,s)/2)),n.moveTo(e+o,t),n.lineTo(e+a-o,t),n.quadraticCurveTo(e+a,t,e+a,t+o),n.lineTo(e+a,t+s-o),n.quadraticCurveTo(e+a,t+s,e+a-o,t+s),n.lineTo(e+o,t+s),n.quadraticCurveTo(e,t+s,e,t+s-o),n.lineTo(e,t+o),n.quadraticCurveTo(e,t,e+o,t)}function we(n,e){switch(e.type){case"rectangle":{const t=e;n.rect(t.x,t.y,t.width,t.height);break}case"roundedRectangle":{const t=e;ot(n,t.x,t.y,t.width,t.height,t.radius);break}case"circle":{const t=e;n.moveTo(t.x+t.radius,t.y),n.arc(t.x,t.y,t.radius,0,Math.PI*2);break}case"ellipse":{const t=e;n.ellipse?(n.moveTo(t.x+t.halfWidth,t.y),n.ellipse(t.x,t.y,t.halfWidth,t.halfHeight,0,0,Math.PI*2)):(n.save(),n.translate(t.x,t.y),n.scale(t.halfWidth,t.halfHeight),n.moveTo(1,0),n.arc(0,0,1,0,Math.PI*2),n.restore());break}case"triangle":{const t=e;n.moveTo(t.x,t.y),n.lineTo(t.x2,t.y2),n.lineTo(t.x3,t.y3),n.closePath();break}default:{const t=e,a=t.points;if(!a?.length)break;n.moveTo(a[0],a[1]);for(let s=2;s<a.length;s+=2)n.lineTo(a[s],a[s+1]);t.closePath&&n.closePath();break}}}function rt(n,e,t){const a=[],s=[],o=[];if(!Pe[e.type]?.build(e,a))return!1;const l=e.closePath??!0;ke(a,t,!1,l,s,o);for(let i=0;i<o.length;i+=3){const d=o[i]*2,h=o[i+1]*2,v=o[i+2]*2;n.moveTo(s[d],s[d+1]),n.lineTo(s[h],s[h+1]),n.lineTo(s[v],s[v+1]),n.closePath()}return!0}function it(n,e){if(!e?.length)return!1;for(let t=0;t<e.length;t++){const a=e[t];if(!a?.shape)continue;const s=a.transform,o=s&&!s.isIdentity();o&&(n.save(),n.transform(s.a,s.b,s.c,s.d,s.tx,s.ty)),we(n,a.shape),o&&n.restore()}return!0}class Re{constructor(e){this._warnedMaskTypes=new Set,this._canvasMaskStack=[],this._renderer=e}push(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1})}pop(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"stencilMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1})}execute(e){if(e.action!=="pushMaskBegin"&&e.action!=="popMaskEnd")return;const t=this._renderer,a=t.canvasContext,s=a?.activeContext;if(!s)return;if(e.action==="popMaskEnd"){this._canvasMaskStack.pop()&&s.restore();return}e.inverse&&this._warnOnce("inverse","CanvasRenderer: inverse masks are not supported on Canvas2D; ignoring inverse flag.");const o=e.mask.mask;if(!(o instanceof Le)){this._warnOnce("nonGraphics","CanvasRenderer: only Graphics masks are supported in Canvas2D; skipping mask."),this._canvasMaskStack.push(!1);return}const r=o,l=r.context?.instructions;if(!l?.length){this._canvasMaskStack.push(!1);return}s.save(),a.setContextTransform(r.groupTransform,(t._roundPixels|r._roundPixels)===1),s.beginPath();let i=!1,d=!1;for(let h=0;h<l.length;h++){const v=l[h],y=v.action;if(y!=="fill"&&y!=="stroke")continue;const H=v.data,W=H?.path?.shapePath;if(!W?.shapePrimitives?.length)continue;const F=y==="stroke",S=W.shapePrimitives;for(let G=0;G<S.length;G++){const P=S[G];if(!P?.shape)continue;const g=P.transform,M=g&&!g.isIdentity();M&&(s.save(),s.transform(g.a,g.b,g.c,g.d,g.tx,g.ty)),F&&H.style?i=rt(s,P.shape,H.style)||i:(we(s,P.shape),d=it(s,P.holes)||d,i=!0),M&&s.restore()}}if(!i){s.restore(),this._canvasMaskStack.push(!1);return}d?s.clip("evenodd"):s.clip(),this._canvasMaskStack.push(!0)}destroy(){this._renderer=null,this._warnedMaskTypes=null,this._canvasMaskStack=null}_warnOnce(e,t){this._warnedMaskTypes.has(e)||(this._warnedMaskTypes.add(e),Oe(t))}}Re.extension={type:[_.CanvasPipes],name:"stencilMask"};const p="source-over";function ct(){const n=je(),e=Object.create(null);return e.inherit=p,e.none=p,e.normal="source-over",e.add="lighter",e.multiply=n?"multiply":p,e.screen=n?"screen":p,e.overlay=n?"overlay":p,e.darken=n?"darken":p,e.lighten=n?"lighten":p,e["color-dodge"]=n?"color-dodge":p,e["color-burn"]=n?"color-burn":p,e["hard-light"]=n?"hard-light":p,e["soft-light"]=n?"soft-light":p,e.difference=n?"difference":p,e.exclusion=n?"exclusion":p,e.saturation=n?"saturation":p,e.color=n?"color":p,e.luminosity=n?"luminosity":p,e["linear-burn"]=n?"color-burn":p,e["linear-dodge"]=n?"color-dodge":p,e["linear-light"]=n?"hard-light":p,e["pin-light"]=n?"hard-light":p,e["vivid-light"]=n?"hard-light":p,e["hard-mix"]=p,e.negation=n?"difference":p,e["normal-npm"]=e.normal,e["add-npm"]=e.add,e["screen-npm"]=e.screen,e.erase="destination-out",e.subtract=p,e.divide=p,e.min=p,e.max=p,e}const lt=new A;class Ie{constructor(e){this.activeResolution=1,this.smoothProperty="imageSmoothingEnabled",this.blendModes=ct(),this._activeBlendMode="normal",this._projTransform=null,this._outerBlend=!1,this._warnedBlendModes=new Set,this._renderer=e}resolutionChange(e){this.activeResolution=e}init(){const e=this._renderer.background.alpha<1;if(this.rootContext=this._renderer.canvas.getContext("2d",{alpha:e}),this.activeContext=this.rootContext,this.activeResolution=this._renderer.resolution,!this.rootContext.imageSmoothingEnabled){const t=this.rootContext;t.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":t.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":t.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":t.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")}}setContextTransform(e,t,a,s){const o=s?A.IDENTITY:this._renderer.globalUniforms.globalUniformData?.worldTransformMatrix||A.IDENTITY;let r=lt;r.copyFrom(o),r.append(e);const l=this._projTransform,i=this.activeResolution;if(a=a||i,l){const d=A.shared;d.copyFrom(r),d.prepend(l),r=d}t?this.activeContext.setTransform(r.a*a,r.b*a,r.c*a,r.d*a,r.tx*i|0,r.ty*i|0):this.activeContext.setTransform(r.a*a,r.b*a,r.c*a,r.d*a,r.tx*i,r.ty*i)}clear(e,t){const a=this.activeContext,s=this._renderer;if(a.clearRect(0,0,s.width,s.height),e){const o=be.shared.setValue(e);a.globalAlpha=t??o.alpha,a.fillStyle=o.toHex(),a.fillRect(0,0,s.width,s.height),a.globalAlpha=1}}setBlendMode(e){if(this._activeBlendMode===e)return;this._activeBlendMode=e,this._outerBlend=!1;const t=this.blendModes[e];if(!t){this._warnedBlendModes.has(e)||(console.warn(`CanvasRenderer: blend mode "${e}" is not supported in Canvas2D; falling back to "source-over".`),this._warnedBlendModes.add(e)),this.activeContext.globalCompositeOperation="source-over";return}this.activeContext.globalCompositeOperation=t}destroy(){this.rootContext=null,this.activeContext=null,this._warnedBlendModes.clear()}}Ie.extension={type:[_.CanvasSystem],name:"canvasContext"};class Be{constructor(){this.maxTextures=16,this.maxBatchableTextures=16,this.maxUniformBindings=0}init(){}}Be.extension={type:[_.CanvasSystem],name:"limits"};const ht="#808080",z=new A,dt=new A,pt=new A,le=new A;function ut(n,e,t){n.beginPath();for(let a=0;a<t.length;a+=3){const s=t[a]*2,o=t[a+1]*2,r=t[a+2]*2;n.moveTo(e[s],e[s+1]),n.lineTo(e[o],e[o+1]),n.lineTo(e[r],e[r+1]),n.closePath()}n.fill()}function mt(n){return`#${(n&16777215).toString(16).padStart(6,"0")}`}function ft(n,e,t,a,s,o){o=Math.max(0,Math.min(o,Math.min(a,s)/2)),n.moveTo(e+o,t),n.lineTo(e+a-o,t),n.quadraticCurveTo(e+a,t,e+a,t+o),n.lineTo(e+a,t+s-o),n.quadraticCurveTo(e+a,t+s,e+a-o,t+s),n.lineTo(e+o,t+s),n.quadraticCurveTo(e,t+s,e,t+s-o),n.lineTo(e,t+o),n.quadraticCurveTo(e,t,e+o,t)}function ee(n,e){switch(e.type){case"rectangle":{const t=e;n.rect(t.x,t.y,t.width,t.height);break}case"roundedRectangle":{const t=e;ft(n,t.x,t.y,t.width,t.height,t.radius);break}case"circle":{const t=e;n.arc(t.x,t.y,t.radius,0,Math.PI*2);break}case"ellipse":{const t=e;n.ellipse?n.ellipse(t.x,t.y,t.halfWidth,t.halfHeight,0,0,Math.PI*2):(n.save(),n.translate(t.x,t.y),n.scale(t.halfWidth,t.halfHeight),n.arc(0,0,1,0,Math.PI*2),n.restore());break}case"triangle":{const t=e;n.moveTo(t.x,t.y),n.lineTo(t.x2,t.y2),n.lineTo(t.x3,t.y3),n.closePath();break}default:{const t=e,a=t.points;if(!a?.length)break;n.moveTo(a[0],a[1]);for(let s=2;s<a.length;s+=2)n.lineTo(a[s],a[s+1]);t.closePath&&n.closePath();break}}}function gt(n,e){if(!e?.length)return!1;for(let t=0;t<e.length;t++){const a=e[t];if(!a?.shape)continue;const s=a.transform,o=s&&!s.isIdentity();o&&(n.save(),n.transform(s.a,s.b,s.c,s.d,s.tx,s.ty)),ee(n,a.shape),o&&n.restore()}return!0}function vt(n,e,t,a){const s=n.fill;if(s instanceof Ye){s.buildGradient();const r=s.texture;if(r){const l=C.getTintedPattern(r,e),i=t?le.copyFrom(t).scale(r.source.pixelWidth,r.source.pixelHeight):le.copyFrom(s.transform);return a&&!n.textureSpace&&i.append(a),C.applyPatternTransform(l,i),l}}if(s instanceof Ve){const r=C.getTintedPattern(s.texture,e);return C.applyPatternTransform(r,s.transform,!1),r}const o=n.texture;if(o&&o!==_e.WHITE){if(!o.source.resource)return ht;const r=C.getTintedPattern(o,e),l=t?le.copyFrom(t).scale(o.source.pixelWidth,o.source.pixelHeight):n.matrix;return C.applyPatternTransform(r,l),r}return mt(e)}class Ae{constructor(){this.shader=null}contextChange(e){}execute(e,t){const a=e.renderer,s=a.canvasContext,o=s.activeContext,r=t.groupTransform,l=a.globalUniforms.globalUniformData?.worldColor??4294967295,i=t.groupColorAlpha,d=(l>>>24&255)/255,h=(i>>>24&255)/255,v=a.filter?.alphaMultiplier??1,y=d*h*v;if(y<=0)return;const H=l&16777215,W=i&16777215,F=Te(Z(W,H)),S=a._roundPixels|t._roundPixels;o.save(),s.setContextTransform(r,S===1),s.setBlendMode(t.groupBlendMode);const G=t.context.instructions;for(let P=0;P<G.length;P++){const g=G[P];if(g.action==="texture"){const u=g.data,m=u.image,f=m?C.getCanvasSource(m):null;if(!f)continue;const D=u.alpha*y;if(D<=0)continue;const j=Z(u.style,F);o.globalAlpha=D;let b=f;j!==16777215&&(b=C.getTintedCanvas({texture:m},j));const E=m.frame,x=m.source._resolution??m.source.resolution??1;let w=E.x*x,R=E.y*x;const $=E.width*x,U=E.height*x;b!==f&&(w=0,R=0);const B=u.transform,T=B&&!B.isIdentity(),c=m.rotate;T||c?(z.copyFrom(r),T&&z.append(B),c&&Ce.matrixAppendRotationInv(z,c,u.dx,u.dy,u.dw,u.dh),s.setContextTransform(z,S===1)):s.setContextTransform(r,S===1),o.drawImage(b,w,R,b===f?$:b.width,b===f?U:b.height,c?0:u.dx,c?0:u.dy,u.dw,u.dh),(T||c)&&s.setContextTransform(r,S===1);continue}const M=g.data,K=M?.path?.shapePath;if(!K?.shapePrimitives?.length)continue;const k=M.style,q=Z(k.color,F),I=k.alpha*y;if(I<=0)continue;const V=g.action==="stroke";if(o.globalAlpha=I,V){const u=k;o.lineWidth=u.width,o.lineCap=u.cap,o.lineJoin=u.join,o.miterLimit=u.miterLimit}const O=K.shapePrimitives;if(!V&&M.hole?.shapePath?.shapePrimitives?.length){const u=O[O.length-1];u.holes=M.hole.shapePath.shapePrimitives}for(let u=0;u<O.length;u++){const m=O[u];if(!m?.shape)continue;const f=m.transform,D=f&&!f.isIdentity(),j=k.texture&&k.texture!==_e.WHITE,b=k.textureSpace==="global"?f:null,E=j?Ne(dt,k,m.shape,b):null,x=D?pt.copyFrom(r).append(f):r,w=vt(k,q,E,x);if(D&&(o.save(),o.transform(f.a,f.b,f.c,f.d,f.tx,f.ty)),V){const R=k;if(R.alignment!==.5&&!R.pixelLine){const U=[],B=[],T=[];if(Pe[m.shape.type]?.build(m.shape,U)){const se=m.shape.closePath??!0;ke(U,R,!1,se,B,T),o.fillStyle=w,ut(o,B,T)}else o.strokeStyle=w,o.beginPath(),ee(o,m.shape),o.stroke()}else o.strokeStyle=w,o.beginPath(),ee(o,m.shape),o.stroke()}else o.fillStyle=w,o.beginPath(),ee(o,m.shape),gt(o,m.holes)?o.fill("evenodd"):o.fill();D&&o.restore()}}o.restore()}destroy(){this.shader=null}}Ae.extension={type:[_.CanvasPipesAdaptor],name:"graphics"};class yt{init(e,t){this._renderer=e,this._renderTargetSystem=t}initGpuRenderTarget(e){const t=e.colorTexture,{canvas:a,context:s}=this._ensureCanvas(t);return{canvas:a,context:s,width:a.width,height:a.height}}resizeGpuRenderTarget(e){const t=e.colorTexture,{canvas:a}=this._ensureCanvas(t);a.width=e.pixelWidth,a.height=e.pixelHeight}startRenderPass(e,t,a,s){const o=this._renderTargetSystem.getGpuRenderTarget(e);this._renderer.canvasContext.activeContext=o.context,this._renderer.canvasContext.activeResolution=e.resolution,t&&this.clear(e,t,a,s)}clear(e,t,a,s){const r=this._renderTargetSystem.getGpuRenderTarget(e).context,l=s||{x:0,y:0,width:e.pixelWidth,height:e.pixelHeight};if(r.setTransform(1,0,0,1,0,0),r.clearRect(l.x,l.y,l.width,l.height),a){const i=be.shared.setValue(a);i.alpha>0&&(r.globalAlpha=i.alpha,r.fillStyle=i.toHex(),r.fillRect(l.x,l.y,l.width,l.height),r.globalAlpha=1)}}finishRenderPass(){}copyToTexture(e,t,a,s,o){const l=this._renderTargetSystem.getGpuRenderTarget(e).canvas,i=t.source,{context:d}=this._ensureCanvas(i),h=o?.x??0,v=o?.y??0;return d.drawImage(l,a.x,a.y,s.width,s.height,h,v,s.width,s.height),i.update(),t}destroyGpuRenderTarget(e){}_ensureCanvas(e){let t=e.resource;(!t||!$e.test(t))&&(t=Se.get().createCanvas(e.pixelWidth,e.pixelHeight),e.resource=t),(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(t.width=e.pixelWidth,t.height=e.pixelHeight);const a=t.getContext("2d");return{canvas:t,context:a}}}class He extends Ke{constructor(e){super(e),this.adaptor=new yt,this.adaptor.init(e,this)}}He.extension={type:[_.CanvasSystem],name:"renderTarget"};class Ge{constructor(e){}init(){}initSource(e){}generateCanvas(e){const t=Se.get().createCanvas(),a=t.getContext("2d"),s=C.getCanvasSource(e);if(!s)return t;const o=e.frame,r=e.source._resolution??e.source.resolution??1,l=o.x*r,i=o.y*r,d=o.width*r,h=o.height*r;return t.width=Math.ceil(d),t.height=Math.ceil(h),a.drawImage(s,l,i,d,h,0,0,d,h),t}getPixels(e){const t=this.generateCanvas(e);return{pixels:t.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,t.width,t.height).data,width:t.width,height:t.height}}destroy(){}}Ge.extension={type:[_.CanvasSystem],name:"texture"};const xt=[...Qe,Ie,Be,Ge,He],Ct=[ze,Ze,et,tt,st,Re,Me,nt],Tt=[at,Ae],De=[],Ee=[],We=[];te.handleByNamedList(_.CanvasSystem,De);te.handleByNamedList(_.CanvasPipes,Ee);te.handleByNamedList(_.CanvasPipesAdaptor,We);te.add(...xt,...Ct,...Tt);class Et extends Xe{constructor(){const e={name:"canvas",type:Je.CANVAS,systems:De,renderPipes:Ee,renderPipeAdaptors:We};super(e)}}export{Et as CanvasRenderer};
|
|
1
|
+
import{f as C,h as Ce,i as Te,m as Z,M as A,j as _,k as Le,w as Oe,s as Pe,l as ke,n as je,C as be,T as _e,o as Ne,F as Ye,p as Ve,q as $e,D as Se,A as Xe,R as Je,r as te}from"./RelationshipGalaxyCanvas-BODk18aA.js";import{R as Ke,S as Qe,B as ze,a as Ze,b as et,c as tt,A as st,C as nt}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 he=class L{static _getPatternRepeat(e,t){const a=e&&e!=="clamp-to-edge",s=t&&t!=="clamp-to-edge";return a&&s?"repeat":a?"repeat-x":s?"repeat-y":"no-repeat"}start(e,t,a){}execute(e,t){const a=t.elements;if(!a||!a.length)return;const s=e.renderer,o=s.canvasContext,r=o.activeContext;for(let l=0;l<a.length;l++){const i=a[l];if(!i.packAsQuad)continue;const d=i,h=d.texture,v=h?C.getCanvasSource(h):null;if(!v)continue;const y=h.source.style,H=o.smoothProperty,W=y.scaleMode!=="nearest";r[H]!==W&&(r[H]=W),o.setBlendMode(t.blendMode);const F=s.globalUniforms.globalUniformData?.worldColor??4294967295,S=d.color,G=(F>>>24&255)/255,P=(S>>>24&255)/255,g=s.filter?.alphaMultiplier??1,M=G*P*g;if(M<=0)continue;r.globalAlpha=M;const K=F&16777215,k=S&16777215,q=Te(Z(k,K)),I=h.frame,V=y.addressModeU??y.addressMode,O=y.addressModeV??y.addressMode,u=L._getPatternRepeat(V,O),m=h.source._resolution??h.source.resolution??1,f=d.renderable?.renderGroup?.isCachedAsTexture,D=I.x*m,j=I.y*m,b=I.width*m,E=I.height*m,x=d.bounds,w=s.renderTarget.renderTarget.isRoot,R=x.minX,$=x.minY,U=x.maxX-x.minX,B=x.maxY-x.minY,T=h.rotate,c=h.uvs,se=Math.min(c.x0,c.x1,c.x2,c.x3,c.y0,c.y1,c.y2,c.y3),Fe=Math.max(c.x0,c.x1,c.x2,c.x3,c.y0,c.y1,c.y2,c.y3),de=u!=="no-repeat"&&(se<0||Fe>1),Q=T&&!(!de&&(q!==16777215||T));Q?(L._tempPatternMatrix.copyFrom(d.transform),Ce.matrixAppendRotationInv(L._tempPatternMatrix,T,R,$,U,B),o.setContextTransform(L._tempPatternMatrix,d.roundPixels===1,void 0,f&&w)):o.setContextTransform(d.transform,d.roundPixels===1,void 0,f&&w);const ne=U,ae=B;let X=Q?0:R,J=Q?0:$;if(!Q&&d.roundPixels===1&&(X|=0,J|=0),de){let oe=v;const N=q!==16777215&&!T,Y=I.width<=h.source.width&&I.height<=h.source.height;N&&Y&&(oe=C.getTintedCanvas({texture:h},q));const re=r.createPattern(oe,u);if(!re)continue;const pe=ne,ue=ae;if(pe===0||ue===0)continue;const me=1/pe,fe=1/ue,ge=(c.x1-c.x0)*me,ve=(c.y1-c.y0)*me,ye=(c.x3-c.x0)*fe,xe=(c.y3-c.y0)*fe,qe=c.x0-ge*X-ye*J,Ue=c.y0-ve*X-xe*J,ie=h.source.pixelWidth,ce=h.source.pixelHeight;L._tempPatternMatrix.set(ge*ie,ve*ce,ye*ie,xe*ce,qe*ie,Ue*ce),C.applyPatternTransform(re,L._tempPatternMatrix),r.fillStyle=re,r.fillRect(X,J,ne,ae)}else{const N=q!==16777215||T?C.getTintedCanvas({texture:h},q):v,Y=N!==v;r.drawImage(N,Y?0:D,Y?0:j,Y?N.width:b,Y?N.height:E,X,J,ne,ae)}}}};he._tempPatternMatrix=new A;he.extension={type:[_.CanvasPipesAdaptor],name:"batch"};let at=he;class Me{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(e,t,a){this._renderer.renderPipes.batch.break(a);const s=this._colorStack;s[this._colorStackIndex]=s[this._colorStackIndex-1]&e.mask;const o=this._colorStack[this._colorStackIndex];o!==this._currentColor&&(this._currentColor=o,a.add({renderPipeId:"colorMask",colorMask:o,canBundle:!1})),this._colorStackIndex++}pop(e,t,a){this._renderer.renderPipes.batch.break(a);const s=this._colorStack;this._colorStackIndex--;const o=s[this._colorStackIndex-1];o!==this._currentColor&&(this._currentColor=o,a.add({renderPipeId:"colorMask",colorMask:o,canBundle:!1}))}execute(e){}destroy(){this._renderer=null,this._colorStack=null}}Me.extension={type:[_.CanvasPipes],name:"colorMask"};function ot(n,e,t,a,s,o){o=Math.max(0,Math.min(o,Math.min(a,s)/2)),n.moveTo(e+o,t),n.lineTo(e+a-o,t),n.quadraticCurveTo(e+a,t,e+a,t+o),n.lineTo(e+a,t+s-o),n.quadraticCurveTo(e+a,t+s,e+a-o,t+s),n.lineTo(e+o,t+s),n.quadraticCurveTo(e,t+s,e,t+s-o),n.lineTo(e,t+o),n.quadraticCurveTo(e,t,e+o,t)}function we(n,e){switch(e.type){case"rectangle":{const t=e;n.rect(t.x,t.y,t.width,t.height);break}case"roundedRectangle":{const t=e;ot(n,t.x,t.y,t.width,t.height,t.radius);break}case"circle":{const t=e;n.moveTo(t.x+t.radius,t.y),n.arc(t.x,t.y,t.radius,0,Math.PI*2);break}case"ellipse":{const t=e;n.ellipse?(n.moveTo(t.x+t.halfWidth,t.y),n.ellipse(t.x,t.y,t.halfWidth,t.halfHeight,0,0,Math.PI*2)):(n.save(),n.translate(t.x,t.y),n.scale(t.halfWidth,t.halfHeight),n.moveTo(1,0),n.arc(0,0,1,0,Math.PI*2),n.restore());break}case"triangle":{const t=e;n.moveTo(t.x,t.y),n.lineTo(t.x2,t.y2),n.lineTo(t.x3,t.y3),n.closePath();break}default:{const t=e,a=t.points;if(!a?.length)break;n.moveTo(a[0],a[1]);for(let s=2;s<a.length;s+=2)n.lineTo(a[s],a[s+1]);t.closePath&&n.closePath();break}}}function rt(n,e,t){const a=[],s=[],o=[];if(!Pe[e.type]?.build(e,a))return!1;const l=e.closePath??!0;ke(a,t,!1,l,s,o);for(let i=0;i<o.length;i+=3){const d=o[i]*2,h=o[i+1]*2,v=o[i+2]*2;n.moveTo(s[d],s[d+1]),n.lineTo(s[h],s[h+1]),n.lineTo(s[v],s[v+1]),n.closePath()}return!0}function it(n,e){if(!e?.length)return!1;for(let t=0;t<e.length;t++){const a=e[t];if(!a?.shape)continue;const s=a.transform,o=s&&!s.isIdentity();o&&(n.save(),n.transform(s.a,s.b,s.c,s.d,s.tx,s.ty)),we(n,a.shape),o&&n.restore()}return!0}class Re{constructor(e){this._warnedMaskTypes=new Set,this._canvasMaskStack=[],this._renderer=e}push(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1})}pop(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"stencilMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1})}execute(e){if(e.action!=="pushMaskBegin"&&e.action!=="popMaskEnd")return;const t=this._renderer,a=t.canvasContext,s=a?.activeContext;if(!s)return;if(e.action==="popMaskEnd"){this._canvasMaskStack.pop()&&s.restore();return}e.inverse&&this._warnOnce("inverse","CanvasRenderer: inverse masks are not supported on Canvas2D; ignoring inverse flag.");const o=e.mask.mask;if(!(o instanceof Le)){this._warnOnce("nonGraphics","CanvasRenderer: only Graphics masks are supported in Canvas2D; skipping mask."),this._canvasMaskStack.push(!1);return}const r=o,l=r.context?.instructions;if(!l?.length){this._canvasMaskStack.push(!1);return}s.save(),a.setContextTransform(r.groupTransform,(t._roundPixels|r._roundPixels)===1),s.beginPath();let i=!1,d=!1;for(let h=0;h<l.length;h++){const v=l[h],y=v.action;if(y!=="fill"&&y!=="stroke")continue;const H=v.data,W=H?.path?.shapePath;if(!W?.shapePrimitives?.length)continue;const F=y==="stroke",S=W.shapePrimitives;for(let G=0;G<S.length;G++){const P=S[G];if(!P?.shape)continue;const g=P.transform,M=g&&!g.isIdentity();M&&(s.save(),s.transform(g.a,g.b,g.c,g.d,g.tx,g.ty)),F&&H.style?i=rt(s,P.shape,H.style)||i:(we(s,P.shape),d=it(s,P.holes)||d,i=!0),M&&s.restore()}}if(!i){s.restore(),this._canvasMaskStack.push(!1);return}d?s.clip("evenodd"):s.clip(),this._canvasMaskStack.push(!0)}destroy(){this._renderer=null,this._warnedMaskTypes=null,this._canvasMaskStack=null}_warnOnce(e,t){this._warnedMaskTypes.has(e)||(this._warnedMaskTypes.add(e),Oe(t))}}Re.extension={type:[_.CanvasPipes],name:"stencilMask"};const p="source-over";function ct(){const n=je(),e=Object.create(null);return e.inherit=p,e.none=p,e.normal="source-over",e.add="lighter",e.multiply=n?"multiply":p,e.screen=n?"screen":p,e.overlay=n?"overlay":p,e.darken=n?"darken":p,e.lighten=n?"lighten":p,e["color-dodge"]=n?"color-dodge":p,e["color-burn"]=n?"color-burn":p,e["hard-light"]=n?"hard-light":p,e["soft-light"]=n?"soft-light":p,e.difference=n?"difference":p,e.exclusion=n?"exclusion":p,e.saturation=n?"saturation":p,e.color=n?"color":p,e.luminosity=n?"luminosity":p,e["linear-burn"]=n?"color-burn":p,e["linear-dodge"]=n?"color-dodge":p,e["linear-light"]=n?"hard-light":p,e["pin-light"]=n?"hard-light":p,e["vivid-light"]=n?"hard-light":p,e["hard-mix"]=p,e.negation=n?"difference":p,e["normal-npm"]=e.normal,e["add-npm"]=e.add,e["screen-npm"]=e.screen,e.erase="destination-out",e.subtract=p,e.divide=p,e.min=p,e.max=p,e}const lt=new A;class Ie{constructor(e){this.activeResolution=1,this.smoothProperty="imageSmoothingEnabled",this.blendModes=ct(),this._activeBlendMode="normal",this._projTransform=null,this._outerBlend=!1,this._warnedBlendModes=new Set,this._renderer=e}resolutionChange(e){this.activeResolution=e}init(){const e=this._renderer.background.alpha<1;if(this.rootContext=this._renderer.canvas.getContext("2d",{alpha:e}),this.activeContext=this.rootContext,this.activeResolution=this._renderer.resolution,!this.rootContext.imageSmoothingEnabled){const t=this.rootContext;t.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":t.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":t.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":t.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")}}setContextTransform(e,t,a,s){const o=s?A.IDENTITY:this._renderer.globalUniforms.globalUniformData?.worldTransformMatrix||A.IDENTITY;let r=lt;r.copyFrom(o),r.append(e);const l=this._projTransform,i=this.activeResolution;if(a=a||i,l){const d=A.shared;d.copyFrom(r),d.prepend(l),r=d}t?this.activeContext.setTransform(r.a*a,r.b*a,r.c*a,r.d*a,r.tx*i|0,r.ty*i|0):this.activeContext.setTransform(r.a*a,r.b*a,r.c*a,r.d*a,r.tx*i,r.ty*i)}clear(e,t){const a=this.activeContext,s=this._renderer;if(a.clearRect(0,0,s.width,s.height),e){const o=be.shared.setValue(e);a.globalAlpha=t??o.alpha,a.fillStyle=o.toHex(),a.fillRect(0,0,s.width,s.height),a.globalAlpha=1}}setBlendMode(e){if(this._activeBlendMode===e)return;this._activeBlendMode=e,this._outerBlend=!1;const t=this.blendModes[e];if(!t){this._warnedBlendModes.has(e)||(console.warn(`CanvasRenderer: blend mode "${e}" is not supported in Canvas2D; falling back to "source-over".`),this._warnedBlendModes.add(e)),this.activeContext.globalCompositeOperation="source-over";return}this.activeContext.globalCompositeOperation=t}destroy(){this.rootContext=null,this.activeContext=null,this._warnedBlendModes.clear()}}Ie.extension={type:[_.CanvasSystem],name:"canvasContext"};class Be{constructor(){this.maxTextures=16,this.maxBatchableTextures=16,this.maxUniformBindings=0}init(){}}Be.extension={type:[_.CanvasSystem],name:"limits"};const ht="#808080",z=new A,dt=new A,pt=new A,le=new A;function ut(n,e,t){n.beginPath();for(let a=0;a<t.length;a+=3){const s=t[a]*2,o=t[a+1]*2,r=t[a+2]*2;n.moveTo(e[s],e[s+1]),n.lineTo(e[o],e[o+1]),n.lineTo(e[r],e[r+1]),n.closePath()}n.fill()}function mt(n){return`#${(n&16777215).toString(16).padStart(6,"0")}`}function ft(n,e,t,a,s,o){o=Math.max(0,Math.min(o,Math.min(a,s)/2)),n.moveTo(e+o,t),n.lineTo(e+a-o,t),n.quadraticCurveTo(e+a,t,e+a,t+o),n.lineTo(e+a,t+s-o),n.quadraticCurveTo(e+a,t+s,e+a-o,t+s),n.lineTo(e+o,t+s),n.quadraticCurveTo(e,t+s,e,t+s-o),n.lineTo(e,t+o),n.quadraticCurveTo(e,t,e+o,t)}function ee(n,e){switch(e.type){case"rectangle":{const t=e;n.rect(t.x,t.y,t.width,t.height);break}case"roundedRectangle":{const t=e;ft(n,t.x,t.y,t.width,t.height,t.radius);break}case"circle":{const t=e;n.arc(t.x,t.y,t.radius,0,Math.PI*2);break}case"ellipse":{const t=e;n.ellipse?n.ellipse(t.x,t.y,t.halfWidth,t.halfHeight,0,0,Math.PI*2):(n.save(),n.translate(t.x,t.y),n.scale(t.halfWidth,t.halfHeight),n.arc(0,0,1,0,Math.PI*2),n.restore());break}case"triangle":{const t=e;n.moveTo(t.x,t.y),n.lineTo(t.x2,t.y2),n.lineTo(t.x3,t.y3),n.closePath();break}default:{const t=e,a=t.points;if(!a?.length)break;n.moveTo(a[0],a[1]);for(let s=2;s<a.length;s+=2)n.lineTo(a[s],a[s+1]);t.closePath&&n.closePath();break}}}function gt(n,e){if(!e?.length)return!1;for(let t=0;t<e.length;t++){const a=e[t];if(!a?.shape)continue;const s=a.transform,o=s&&!s.isIdentity();o&&(n.save(),n.transform(s.a,s.b,s.c,s.d,s.tx,s.ty)),ee(n,a.shape),o&&n.restore()}return!0}function vt(n,e,t,a){const s=n.fill;if(s instanceof Ye){s.buildGradient();const r=s.texture;if(r){const l=C.getTintedPattern(r,e),i=t?le.copyFrom(t).scale(r.source.pixelWidth,r.source.pixelHeight):le.copyFrom(s.transform);return a&&!n.textureSpace&&i.append(a),C.applyPatternTransform(l,i),l}}if(s instanceof Ve){const r=C.getTintedPattern(s.texture,e);return C.applyPatternTransform(r,s.transform,!1),r}const o=n.texture;if(o&&o!==_e.WHITE){if(!o.source.resource)return ht;const r=C.getTintedPattern(o,e),l=t?le.copyFrom(t).scale(o.source.pixelWidth,o.source.pixelHeight):n.matrix;return C.applyPatternTransform(r,l),r}return mt(e)}class Ae{constructor(){this.shader=null}contextChange(e){}execute(e,t){const a=e.renderer,s=a.canvasContext,o=s.activeContext,r=t.groupTransform,l=a.globalUniforms.globalUniformData?.worldColor??4294967295,i=t.groupColorAlpha,d=(l>>>24&255)/255,h=(i>>>24&255)/255,v=a.filter?.alphaMultiplier??1,y=d*h*v;if(y<=0)return;const H=l&16777215,W=i&16777215,F=Te(Z(W,H)),S=a._roundPixels|t._roundPixels;o.save(),s.setContextTransform(r,S===1),s.setBlendMode(t.groupBlendMode);const G=t.context.instructions;for(let P=0;P<G.length;P++){const g=G[P];if(g.action==="texture"){const u=g.data,m=u.image,f=m?C.getCanvasSource(m):null;if(!f)continue;const D=u.alpha*y;if(D<=0)continue;const j=Z(u.style,F);o.globalAlpha=D;let b=f;j!==16777215&&(b=C.getTintedCanvas({texture:m},j));const E=m.frame,x=m.source._resolution??m.source.resolution??1;let w=E.x*x,R=E.y*x;const $=E.width*x,U=E.height*x;b!==f&&(w=0,R=0);const B=u.transform,T=B&&!B.isIdentity(),c=m.rotate;T||c?(z.copyFrom(r),T&&z.append(B),c&&Ce.matrixAppendRotationInv(z,c,u.dx,u.dy,u.dw,u.dh),s.setContextTransform(z,S===1)):s.setContextTransform(r,S===1),o.drawImage(b,w,R,b===f?$:b.width,b===f?U:b.height,c?0:u.dx,c?0:u.dy,u.dw,u.dh),(T||c)&&s.setContextTransform(r,S===1);continue}const M=g.data,K=M?.path?.shapePath;if(!K?.shapePrimitives?.length)continue;const k=M.style,q=Z(k.color,F),I=k.alpha*y;if(I<=0)continue;const V=g.action==="stroke";if(o.globalAlpha=I,V){const u=k;o.lineWidth=u.width,o.lineCap=u.cap,o.lineJoin=u.join,o.miterLimit=u.miterLimit}const O=K.shapePrimitives;if(!V&&M.hole?.shapePath?.shapePrimitives?.length){const u=O[O.length-1];u.holes=M.hole.shapePath.shapePrimitives}for(let u=0;u<O.length;u++){const m=O[u];if(!m?.shape)continue;const f=m.transform,D=f&&!f.isIdentity(),j=k.texture&&k.texture!==_e.WHITE,b=k.textureSpace==="global"?f:null,E=j?Ne(dt,k,m.shape,b):null,x=D?pt.copyFrom(r).append(f):r,w=vt(k,q,E,x);if(D&&(o.save(),o.transform(f.a,f.b,f.c,f.d,f.tx,f.ty)),V){const R=k;if(R.alignment!==.5&&!R.pixelLine){const U=[],B=[],T=[];if(Pe[m.shape.type]?.build(m.shape,U)){const se=m.shape.closePath??!0;ke(U,R,!1,se,B,T),o.fillStyle=w,ut(o,B,T)}else o.strokeStyle=w,o.beginPath(),ee(o,m.shape),o.stroke()}else o.strokeStyle=w,o.beginPath(),ee(o,m.shape),o.stroke()}else o.fillStyle=w,o.beginPath(),ee(o,m.shape),gt(o,m.holes)?o.fill("evenodd"):o.fill();D&&o.restore()}}o.restore()}destroy(){this.shader=null}}Ae.extension={type:[_.CanvasPipesAdaptor],name:"graphics"};class yt{init(e,t){this._renderer=e,this._renderTargetSystem=t}initGpuRenderTarget(e){const t=e.colorTexture,{canvas:a,context:s}=this._ensureCanvas(t);return{canvas:a,context:s,width:a.width,height:a.height}}resizeGpuRenderTarget(e){const t=e.colorTexture,{canvas:a}=this._ensureCanvas(t);a.width=e.pixelWidth,a.height=e.pixelHeight}startRenderPass(e,t,a,s){const o=this._renderTargetSystem.getGpuRenderTarget(e);this._renderer.canvasContext.activeContext=o.context,this._renderer.canvasContext.activeResolution=e.resolution,t&&this.clear(e,t,a,s)}clear(e,t,a,s){const r=this._renderTargetSystem.getGpuRenderTarget(e).context,l=s||{x:0,y:0,width:e.pixelWidth,height:e.pixelHeight};if(r.setTransform(1,0,0,1,0,0),r.clearRect(l.x,l.y,l.width,l.height),a){const i=be.shared.setValue(a);i.alpha>0&&(r.globalAlpha=i.alpha,r.fillStyle=i.toHex(),r.fillRect(l.x,l.y,l.width,l.height),r.globalAlpha=1)}}finishRenderPass(){}copyToTexture(e,t,a,s,o){const l=this._renderTargetSystem.getGpuRenderTarget(e).canvas,i=t.source,{context:d}=this._ensureCanvas(i),h=o?.x??0,v=o?.y??0;return d.drawImage(l,a.x,a.y,s.width,s.height,h,v,s.width,s.height),i.update(),t}destroyGpuRenderTarget(e){}_ensureCanvas(e){let t=e.resource;(!t||!$e.test(t))&&(t=Se.get().createCanvas(e.pixelWidth,e.pixelHeight),e.resource=t),(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(t.width=e.pixelWidth,t.height=e.pixelHeight);const a=t.getContext("2d");return{canvas:t,context:a}}}class He extends Ke{constructor(e){super(e),this.adaptor=new yt,this.adaptor.init(e,this)}}He.extension={type:[_.CanvasSystem],name:"renderTarget"};class Ge{constructor(e){}init(){}initSource(e){}generateCanvas(e){const t=Se.get().createCanvas(),a=t.getContext("2d"),s=C.getCanvasSource(e);if(!s)return t;const o=e.frame,r=e.source._resolution??e.source.resolution??1,l=o.x*r,i=o.y*r,d=o.width*r,h=o.height*r;return t.width=Math.ceil(d),t.height=Math.ceil(h),a.drawImage(s,l,i,d,h,0,0,d,h),t}getPixels(e){const t=this.generateCanvas(e);return{pixels:t.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,t.width,t.height).data,width:t.width,height:t.height}}destroy(){}}Ge.extension={type:[_.CanvasSystem],name:"texture"};const xt=[...Qe,Ie,Be,Ge,He],Ct=[ze,Ze,et,tt,st,Re,Me,nt],Tt=[at,Ae],De=[],Ee=[],We=[];te.handleByNamedList(_.CanvasSystem,De);te.handleByNamedList(_.CanvasPipes,Ee);te.handleByNamedList(_.CanvasPipesAdaptor,We);te.add(...xt,...Ct,...Tt);class Et extends Xe{constructor(){const e={name:"canvas",type:Je.CANVAS,systems:De,renderPipes:Ee,renderPipeAdaptors:We};super(e)}}export{Et as CanvasRenderer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aq as V,ar as z,aR as L,aS as j,aW as E,aX as S,o as a,c as s,w as n,e,aY as U,n as i,b as c,l as r,z as y,aZ as W,a_ as P,a$ as C,b0 as A,m as F,b1 as H,ac as I,b2 as x,a6 as h,p as f,b3 as _,i as g,h as q,k as G,f as D,av as R,b4 as K,au as M,a as Q,a3 as X,I as Y,x as Z,a5 as J,r as ee}from"./index-sWxuTsa7.js";import{B as te,C as oe,N as ae,_ as se,S as re,a as ne}from"./ChatRecordWorkspace-CyfPIlIy.js";import"./vendor-snapdom--nZvo8Sg.js";import"./useToast-BA0EwImD.js";import"./DatePicker.vue_vue_type_script_setup_true_lang-DqNBNa1D.js";import"./clamp-jFYhBC76.js";import"./useFormControl-DVawP2DO.js";import"./VisuallyHiddenInput-OAJEt_Y5.js";const le={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default ring ring-default flex focus:outline-none",handle:["shrink-0 !bg-accented","transition-opacity"],container:"w-full flex flex-col gap-4 p-4 overflow-y-auto",header:"",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",body:"flex-1",footer:"flex flex-col gap-1.5"},variants:{direction:{top:{content:"mb-24 flex-col-reverse",handle:"mb-4"},right:{content:"flex-row rtl:flex-row-reverse",handle:"!ml-4"},bottom:{content:"mt-24 flex-col",handle:"mt-4"},left:{content:"flex-row-reverse rtl:flex-row",handle:"!mr-4"}},inset:{true:{content:"rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]"}},snapPoints:{true:""}},compoundVariants:[{direction:["top","bottom"],class:{content:"h-auto max-h-[96%]",handle:"!w-12 !h-1.5 mx-auto"}},{direction:["top","bottom"],snapPoints:!0,class:{content:"h-full"}},{direction:["right","left"],class:{content:"w-auto max-w-[calc(100%-2rem)]",handle:"!h-12 !w-1.5 mt-auto mb-auto"}},{direction:["right","left"],snapPoints:!0,class:{content:"w-full"}},{direction:"top",inset:!0,class:{content:"inset-x-4 top-4"}},{direction:"top",inset:!1,class:{content:"inset-x-0 top-0 rounded-b-lg"}},{direction:"bottom",inset:!0,class:{content:"inset-x-4 bottom-4"}},{direction:"bottom",inset:!1,class:{content:"inset-x-0 bottom-0 rounded-t-lg"}},{direction:"left",inset:!0,class:{content:"inset-y-4 left-4"}},{direction:"left",inset:!1,class:{content:"inset-y-0 left-0 rounded-r-lg"}},{direction:"right",inset:!0,class:{content:"inset-y-4 right-4"}},{direction:"right",inset:!1,class:{content:"inset-y-0 right-0 rounded-l-lg"}}]},ie={__name:"Drawer",props:{as:{type:null,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},inset:{type:Boolean,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},handle:{type:Boolean,required:!1,default:!0},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},nested:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},activeSnapPoint:{type:[Number,String,null],required:!1},closeThreshold:{type:Number,required:!1},shouldScaleBackground:{type:Boolean,required:!1},setBackgroundColorOnScale:{type:Boolean,required:!1},scrollLockTimeout:{type:Number,required:!1},fixed:{type:Boolean,required:!1},dismissible:{type:Boolean,required:!1,default:!0},modal:{type:Boolean,required:!1,default:!0},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},direction:{type:String,required:!1,default:"bottom"},noBodyStyles:{type:Boolean,required:!1},handleOnly:{type:Boolean,required:!1},preventScrollRestoration:{type:Boolean,required:!1},snapPoints:{type:Array,required:!1}},emits:["close:prevent","drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(B,{emit:v}){const u=B,p=v,o=V(),t=z("drawer",u),b=M(),w=L(j(t,"activeSnapPoint","closeThreshold","shouldScaleBackground","setBackgroundColorOnScale","scrollLockTimeout","fixed","dismissible","modal","open","defaultOpen","nested","direction","noBodyStyles","handleOnly","preventScrollRestoration","snapPoints"),p),m=E(S(()=>t.portal)),$=S(()=>t.content),O=D(()=>t.dismissible?{pointerDownOutside:K}:["interactOutside","escapeKeyDown"].reduce((k,N)=>(k[N]=T=>{T.preventDefault(),p("close:prevent")},k),{})),d=D(()=>R({extend:R(le),...b.ui?.drawer||{}})({direction:t.direction,inset:t.inset,snapPoints:t.snapPoints&&t.snapPoints.length>0}));return(l,k)=>(a(),s(G(e(t).nested?e(se):e(re)),P(C(e(w))),{default:n(()=>[o.default?(a(),s(e(U),{key:0,"as-child":"",class:i(e(t).class)},{default:n(()=>[c(l.$slots,"default")]),_:3},8,["class"])):r("",!0),y(e(W),P(C(e(m))),{default:n(()=>[y(e(A),null,{default:n(()=>[e(t).overlay?(a(),s(e(te),{key:0,"data-slot":"overlay",class:i(d.value.overlay({class:e(t).ui?.overlay}))},null,8,["class"])):r("",!0),y(e(oe),F({"data-slot":"content",class:d.value.content({class:[!o.default&&e(t).class,e(t).ui?.content]})},$.value,H(O.value)),{default:n(()=>[e(t).handle?(a(),s(e(ae),{key:0,"data-slot":"handle",class:i(d.value.handle({class:e(t).ui?.handle}))},null,8,["class"])):r("",!0),!e(t).title&&!o.title||!e(t).description&&!o.description||o.content?(a(),s(e(I),{key:1},{default:n(()=>[!e(t).title&&!o.title?(a(),s(e(x),{key:0})):o.content?(a(),s(e(x),{key:1},{default:n(()=>[c(l.$slots,"title",{},()=>[h(f(e(t).title),1)])]),_:3})):r("",!0),!e(t).description&&!o.description?(a(),s(e(_),{key:2})):o.content?(a(),s(e(_),{key:3},{default:n(()=>[c(l.$slots,"description",{},()=>[h(f(e(t).description),1)])]),_:3})):r("",!0)]),_:3})):r("",!0),c(l.$slots,"content",{},()=>[g("div",{"data-slot":"container",class:i(d.value.container({class:e(t).ui?.container}))},[o.header||e(t).title||o.title||e(t).description||o.description?(a(),q("div",{key:0,"data-slot":"header",class:i(d.value.header({class:e(t).ui?.header}))},[c(l.$slots,"header",{},()=>[e(t).title||o.title?(a(),s(e(x),{key:0,"data-slot":"title",class:i(d.value.title({class:e(t).ui?.title}))},{default:n(()=>[c(l.$slots,"title",{},()=>[h(f(e(t).title),1)])]),_:3},8,["class"])):r("",!0),e(t).description||o.description?(a(),s(e(_),{key:1,"data-slot":"description",class:i(d.value.description({class:e(t).ui?.description}))},{default:n(()=>[c(l.$slots,"description",{},()=>[h(f(e(t).description),1)])]),_:3},8,["class"])):r("",!0)])],2)):r("",!0),o.body?(a(),q("div",{key:1,"data-slot":"body",class:i(d.value.body({class:e(t).ui?.body}))},[c(l.$slots,"body")],2)):r("",!0),o.footer?(a(),q("div",{key:2,"data-slot":"footer",class:i(d.value.footer({class:e(t).ui?.footer}))},[c(l.$slots,"footer")],2)):r("",!0)],2)])]),_:3},16,["class"])]),_:3})]),_:3},16)]),_:3},16))}},de={"data-vaul-no-drag":"",class:"chat-record-drawer-content flex h-full w-[750px] flex-col bg-white dark:bg-page-dark",style:{"-webkit-app-region":"no-drag"}},ce={class:"text-lg font-semibold text-gray-900 dark:text-white"},be=Q({__name:"ChatRecordDrawer",setup(B){const{t:v}=X(),u=Y(),p=ee(!1);return Z(()=>{p.value=navigator.platform.toLowerCase().includes("win")}),(o,t)=>{const b=J,w=ie;return a(),s(w,{open:e(u).showChatRecordDrawer,"onUpdate:open":t[1]||(t[1]=m=>e(u).showChatRecordDrawer=m),direction:"right",handle:!1,"handle-only":"",ui:{content:"z-50"}},{content:n(()=>[g("div",de,[g("div",{class:i(["flex items-center justify-between border-b border-gray-200 px-4 dark:border-gray-800",p.value?"pt-10 pb-3":"py-3"])},[g("h3",ce,f(e(v)("records.drawer.title")),1),y(b,{icon:"i-heroicons-x-mark",color:"neutral",variant:"ghost",size:"sm",onClick:t[0]||(t[0]=m=>e(u).closeChatRecordDrawer())})],2),y(ne,{class:"min-h-0 flex-1","initial-query":e(u).chatRecordQuery,active:e(u).showChatRecordDrawer,mode:"drawer"},null,8,["initial-query","active"])])]),_:1},8,["open"])}}});export{be as default};
|