chatlab-cli 0.37.1 → 0.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chat-command-YAFRLHMQ.mjs → chat-command-G2EX7VHR.mjs} +24 -12
- package/dist/chat-command-G2EX7VHR.mjs.map +1 -0
- package/dist/{chunk-2PY4XCH3.mjs → chunk-E6LCCPIB.mjs} +2 -2
- package/dist/{chunk-N4SB6QZV.mjs → chunk-EFX66A2O.mjs} +2 -2
- package/dist/{chunk-UP6JIV3S.mjs → chunk-EK5QIJLZ.mjs} +16 -12
- package/dist/chunk-EK5QIJLZ.mjs.map +1 -0
- package/dist/{chunk-JWJREWVN.mjs → chunk-F4HVCFZL.mjs} +27 -3
- package/dist/chunk-F4HVCFZL.mjs.map +1 -0
- package/dist/{chunk-PDQV4RUA.mjs → chunk-FCUUAGGC.mjs} +2 -2
- package/dist/{chunk-GKCIRKOH.mjs → chunk-H46CLFWK.mjs} +4 -4
- package/dist/{chunk-OTYNMDDL.mjs → chunk-HBAQPF6X.mjs} +2118 -1907
- package/dist/chunk-HBAQPF6X.mjs.map +1 -0
- package/dist/{chunk-MMTEGUQA.mjs → chunk-HMVM7VCA.mjs} +3 -3
- package/dist/{chunk-73TJ2S7W.mjs → chunk-L6RJIVLS.mjs} +2 -2
- package/dist/{chunk-ARIBCH47.mjs → chunk-T5H56AZV.mjs} +16 -8
- package/dist/chunk-T5H56AZV.mjs.map +1 -0
- package/dist/{chunk-WDLO7OLX.mjs → chunk-XQ6Z2KNN.mjs} +2 -2
- package/dist/{chunk-FPVRSXQ4.mjs → chunk-YI3EQYEG.mjs} +12 -12
- package/dist/cli.mjs +9 -9
- package/dist/contacts-worker.mjs +2 -2
- package/dist/global-insight-worker.mjs +1 -1
- package/dist/{http-LPFPVTBC.mjs → http-5BRVWAJR.mjs} +12 -12
- package/dist/{import-T4WX2ZJL.mjs → import-IAECQDKC.mjs} +7 -7
- package/dist/index.mjs +12 -12
- package/dist/{mcp-SMF3NWIN.mjs → mcp-XXSQJBGU.mjs} +8 -8
- package/dist/people-relationships-worker.mjs +2 -2
- package/dist/semantic-index-worker.mjs +1 -1
- package/dist/{src-EGLLMTAU.mjs → src-4HLKMQ7S.mjs} +6 -6
- package/dist/{stream-import-2BXJTTCE.mjs → stream-import-PUG42I36.mjs} +7 -7
- package/dist/{worker-runtime-RDLSPXFT.mjs → worker-runtime-X5563TVT.mjs} +5 -5
- package/dist-cli-web/assets/{AISettingsTab-CEhrXlYR.js → AISettingsTab-m_r2fFEj.js} +1 -1
- package/dist-cli-web/assets/{AboutTab-Bbu0SsMM.js → AboutTab-J65UqIuk.js} +1 -1
- package/dist-cli-web/assets/{Alert-510jTN3l.js → Alert-qBIGn_CW.js} +1 -1
- package/dist-cli-web/assets/{ApiSettingsTab-Bi1GRMN4.js → ApiSettingsTab-CxWRJI9j.js} +1 -1
- package/dist-cli-web/assets/{BatchManageTab-DhnqMCSM.js → BatchManageTab-BINNVwm1.js} +1 -1
- package/dist-cli-web/assets/{BufferResource-CKZxnACp.js → BufferResource-C-jLPrHv.js} +1 -1
- package/dist-cli-web/assets/{CanvasRenderer-BeK5POBy.js → CanvasRenderer-kDLW8GSt.js} +1 -1
- package/dist-cli-web/assets/{CardDecoration-RuBA3N2j.js → CardDecoration-CnYxleQM.js} +1 -1
- package/dist-cli-web/assets/{ChatRecordDrawer-BY_-lIEj.js → ChatRecordDrawer-CMg3FEWH.js} +1 -1
- package/dist-cli-web/assets/{ChatRecordWorkspace-7prKd-Tq.js → ChatRecordWorkspace-AfFIMUbZ.js} +1 -1
- package/dist-cli-web/assets/{Checkbox-_eH64bb0.js → Checkbox-D-hAv15R.js} +1 -1
- package/dist-cli-web/assets/{DataDirCleanupNotice-BHaXwlfr.js → DataDirCleanupNotice-P80h2p4l.js} +1 -1
- package/dist-cli-web/assets/{DatePicker.vue_vue_type_script_setup_true_lang-D9Ul_GYz.js → DatePicker.vue_vue_type_script_setup_true_lang-CSp691Uv.js} +1 -1
- package/dist-cli-web/assets/{DebugToolsPanel-ByKItGrS.js → DebugToolsPanel-BK2VbKB0.js} +1 -1
- package/dist-cli-web/assets/{EChart.vue_vue_type_script_setup_true_lang-DubnuUXI.js → EChart.vue_vue_type_script_setup_true_lang-BcE0mE_N.js} +1 -1
- package/dist-cli-web/assets/{EChartBar.vue_vue_type_script_setup_true_lang-DKNCZuFm.js → EChartBar.vue_vue_type_script_setup_true_lang-BypaV5wc.js} +1 -1
- package/dist-cli-web/assets/{EChartLine.vue_vue_type_script_setup_true_lang-Fl7xAOSR.js → EChartLine.vue_vue_type_script_setup_true_lang-D8SyOfWC.js} +1 -1
- package/dist-cli-web/assets/{EChartWordcloud-C6XM4KOX.js → EChartWordcloud-0rihhg03.js} +1 -1
- package/dist-cli-web/assets/{FileDropZone.vue_vue_type_script_setup_true_lang-DYDdRSNE.js → FileDropZone.vue_vue_type_script_setup_true_lang-Dyuzh7Ex.js} +1 -1
- package/dist-cli-web/assets/{Filter-CByj_rCR.js → Filter-rD_jWpbO.js} +1 -1
- package/dist-cli-web/assets/{GlobalTaskBar-BdELjzrs.js → GlobalTaskBar-sXQuGvF-.js} +1 -1
- package/dist-cli-web/assets/{GroupRelationshipGalaxyView-CnzPEgUS.js → GroupRelationshipGalaxyView-BN1L9DFf.js} +1 -1
- package/dist-cli-web/assets/{Label-DCIcxkhU.js → Label-Ce4wl_Ph.js} +1 -1
- package/dist-cli-web/assets/{LoadingState.vue_vue_type_script_setup_true_lang-BBcCt_Qm.js → LoadingState.vue_vue_type_script_setup_true_lang-DmVfwvnD.js} +1 -1
- package/dist-cli-web/assets/{MessageExportModal-DNU16Bs8.js → MessageExportModal-C2IUNPhg.js} +1 -1
- package/dist-cli-web/assets/{PageHeader-CKeZjNNR.js → PageHeader-D5BcYKBs.js} +1 -1
- package/dist-cli-web/assets/{PageTabs.vue_vue_type_script_setup_true_lang-C8M3wNNH.js → PageTabs.vue_vue_type_script_setup_true_lang-DHly2-fe.js} +1 -1
- package/dist-cli-web/assets/{RelationshipGalaxyCanvas-CDhljGyJ.js → RelationshipGalaxyCanvas-CHPqtqQz.js} +3 -3
- package/dist-cli-web/assets/{RelationshipGalaxyThreeCanvas-BP8fsvvf.js → RelationshipGalaxyThreeCanvas-qR4S-9n7.js} +1 -1
- package/dist-cli-web/assets/{RenderTargetSystem-D76QrDT_.js → RenderTargetSystem-BaIFulUj.js} +1 -1
- package/dist-cli-web/assets/{RovingFocusItem-BJMUQ5DJ.js → RovingFocusItem-Bqgmzo42.js} +1 -1
- package/dist-cli-web/assets/{ScreenCaptureModal-DkX4z-M1.js → ScreenCaptureModal-sJqB_hrK.js} +1 -1
- package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-BPt98e6z.js +1 -0
- package/dist-cli-web/assets/{Select-B5oJc5y1.js → Select-BAnN4HMs.js} +1 -1
- package/dist-cli-web/assets/{SettingsModal-BO-QKQ2h.js → SettingsModal-C4ANMlJJ.js} +2 -2
- package/dist-cli-web/assets/{StorageTab-CPPXXaRm.js → StorageTab-BgNQliz4.js} +1 -1
- package/dist-cli-web/assets/{Switch-CDk3LZ4_.js → Switch-DddEvDJa.js} +1 -1
- package/dist-cli-web/assets/{Tabs-DqWTBV8x.js → Tabs-DwjL-ueH.js} +1 -1
- package/dist-cli-web/assets/{Tabs-BMq9wODW.js → Tabs-xVtuBuO0.js} +1 -1
- package/dist-cli-web/assets/{ThemeCard.vue_vue_type_script_setup_true_lang-D2outEOV.js → ThemeCard.vue_vue_type_script_setup_true_lang-CNCVa86b.js} +1 -1
- package/dist-cli-web/assets/{TimeSelect.vue_vue_type_script_setup_true_lang-BcflxP_U.js → TimeSelect.vue_vue_type_script_setup_true_lang-BehUIWki.js} +1 -1
- package/dist-cli-web/assets/{VisuallyHiddenInput-BAFpkxMI.js → VisuallyHiddenInput-ST6JNfSG.js} +1 -1
- package/dist-cli-web/assets/{WebGLRenderer-DjCPvR_O.js → WebGLRenderer-DRraqD4Y.js} +1 -1
- package/dist-cli-web/assets/{WebGPURenderer-C2B_u03z.js → WebGPURenderer-CnzaYARg.js} +1 -1
- package/dist-cli-web/assets/aiChat-CeJy-gG-.js +8 -0
- package/dist-cli-web/assets/{base-F6s0vTrr.js → base-BHbtUviQ.js} +1 -1
- package/dist-cli-web/assets/{browserAll-DiUAZg4L.js → browserAll-DYxkitnx.js} +1 -1
- package/dist-cli-web/assets/{chatMessages-Bd33SSXI.js → chatMessages-Dj1u-tFB.js} +3 -3
- package/dist-cli-web/assets/{cli-web-DoibEdj2.js → cli-web-BtH8nfjA.js} +1 -1
- package/dist-cli-web/assets/{fetch-BEaW1j5H.js → fetch-BJ82mWvv.js} +1 -1
- package/dist-cli-web/assets/{fetch-BeX69kpS.js → fetch-C1Tm66i9.js} +1 -1
- package/dist-cli-web/assets/{fetch-4nh1LaVF.js → fetch-CAEyoWQA.js} +1 -1
- package/dist-cli-web/assets/{fetch-7lUvXbhU.js → fetch-CGnWNSsG.js} +1 -1
- package/dist-cli-web/assets/{fetch-DKBBS9Op.js → fetch-D7hfFyoG.js} +1 -1
- package/dist-cli-web/assets/{fetch-CXM-cjDS.js → fetch-DNmRaRxX.js} +1 -1
- package/dist-cli-web/assets/{fetch-B_YFABxI.js → fetch-DogRrvT6.js} +1 -1
- package/dist-cli-web/assets/{fetch-DBpDMy29.js → fetch-JEEBqR_7.js} +1 -1
- package/dist-cli-web/assets/{fetch-CxVcHNid.js → fetch-T5Gi1TUZ.js} +1 -1
- package/dist-cli-web/assets/{fetch-epFXmPIQ.js → fetch-U9QyidNZ.js} +1 -1
- package/dist-cli-web/assets/{fetch-CXqeAbnY.js → fetch-ejEMWPM2.js} +1 -1
- package/dist-cli-web/assets/{fetch-CRocA-4C.js → fetch-emZXHmoE.js} +1 -1
- package/dist-cli-web/assets/{host-CtSqR_Zm.js → host-BUvwCvZR.js} +1 -1
- package/dist-cli-web/assets/{host-C4rU8pKA.js → host-VTWF81F5.js} +1 -1
- package/dist-cli-web/assets/{index-ekvsNmfe.js → index-B3MCGDwx.js} +1 -1
- package/dist-cli-web/assets/index-BI2Rb_L3.js +2 -0
- package/dist-cli-web/assets/{index-mbLXPIyC.js → index-BLYSew5C.js} +1 -1
- package/dist-cli-web/assets/index-Bs7gk1gf.css +1 -0
- package/dist-cli-web/assets/{index-BgelKQTW.css → index-C75W1B5J.css} +1 -1
- package/dist-cli-web/assets/{index-BvMAw3Zd.js → index-CVRBBnQw.js} +1 -1
- package/dist-cli-web/assets/index-Cza8BzZE.js +137 -0
- package/dist-cli-web/assets/{index-B1oj9KDv.js → index-D9C3dyV8.js} +4 -4
- package/dist-cli-web/assets/{index-_m1mf1jm.js → index-DDt7Tfda.js} +1 -1
- package/dist-cli-web/assets/{index-CuCQ1d9f.js → index-DQFcmWSa.js} +1 -1
- package/dist-cli-web/assets/{index-BFH1j_R9.js → index-DUBl6aBF.js} +1 -1
- package/dist-cli-web/assets/{index-mXe1LssU.js → index-DZK9Njvy.js} +1 -1
- package/dist-cli-web/assets/{index-4DVZ2g0M.js → index-HjrJ3DXO.js} +1 -1
- package/dist-cli-web/assets/index-KpnLSzzX.js +64 -0
- package/dist-cli-web/assets/{index-DlHuILT_.js → index-e6fOnhNS.js} +1 -1
- package/dist-cli-web/assets/{index-D8cHMqV-.js → index-iEQnKg2R.js} +2 -2
- package/dist-cli-web/assets/{people-page-header-BbYSSpsO.js → people-page-header-DWXwFJ8M.js} +1 -1
- package/dist-cli-web/assets/{prompt-C-ofJ7t_.js → prompt-Cepfb-5-.js} +1 -1
- package/dist-cli-web/assets/{semantic-index-config-builder-D3TYVYC-.js → semantic-index-config-builder-hTY6QyCe.js} +1 -1
- package/dist-cli-web/assets/service-BjE0YJaM.js +1 -0
- package/dist-cli-web/assets/service-DQxttlJp.js +1 -0
- package/dist-cli-web/assets/{service-CppETV4a.js → service-DwCmXFtI.js} +1 -1
- package/dist-cli-web/assets/useFormControl-CJyJY8AK.js +1 -0
- package/dist-cli-web/assets/{ActionToolsPanel.vue_vue_type_script_setup_true_lang-IB1yZxCE.js → useInsightTabAnalytics-CplGbsbe.js} +8 -8
- package/dist-cli-web/assets/{useTable-Clk7ecq-.js → useTable-Dmpbk7fZ.js} +1 -1
- package/dist-cli-web/assets/{useToast-B5LaA6c-.js → useToast-Bmgpd3sl.js} +1 -1
- package/dist-cli-web/assets/{webworkerAll-CyA4b4LT.js → webworkerAll-DkPWEyVL.js} +1 -1
- package/dist-cli-web/index.html +1 -1
- package/package.json +1 -1
- package/dist/chat-command-YAFRLHMQ.mjs.map +0 -1
- package/dist/chunk-ARIBCH47.mjs.map +0 -1
- package/dist/chunk-JWJREWVN.mjs.map +0 -1
- package/dist/chunk-OTYNMDDL.mjs.map +0 -1
- package/dist/chunk-UP6JIV3S.mjs.map +0 -1
- package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-qFhJO5B0.js +0 -1
- package/dist-cli-web/assets/aiChat--CR4g2M7.js +0 -8
- package/dist-cli-web/assets/index-CIIyg_o9.css +0 -1
- package/dist-cli-web/assets/index-CaYtkONV.js +0 -64
- package/dist-cli-web/assets/index-D3Hyjv4e.js +0 -137
- package/dist-cli-web/assets/index-R4LqAnx9.js +0 -2
- package/dist-cli-web/assets/service-BYOUkk7V.js +0 -1
- package/dist-cli-web/assets/service-tEx-5LUL.js +0 -1
- package/dist-cli-web/assets/useFormControl-CrWi_6Hn.js +0 -1
- /package/dist/{chunk-2PY4XCH3.mjs.map → chunk-E6LCCPIB.mjs.map} +0 -0
- /package/dist/{chunk-N4SB6QZV.mjs.map → chunk-EFX66A2O.mjs.map} +0 -0
- /package/dist/{chunk-PDQV4RUA.mjs.map → chunk-FCUUAGGC.mjs.map} +0 -0
- /package/dist/{chunk-GKCIRKOH.mjs.map → chunk-H46CLFWK.mjs.map} +0 -0
- /package/dist/{chunk-MMTEGUQA.mjs.map → chunk-HMVM7VCA.mjs.map} +0 -0
- /package/dist/{chunk-73TJ2S7W.mjs.map → chunk-L6RJIVLS.mjs.map} +0 -0
- /package/dist/{chunk-WDLO7OLX.mjs.map → chunk-XQ6Z2KNN.mjs.map} +0 -0
- /package/dist/{chunk-FPVRSXQ4.mjs.map → chunk-YI3EQYEG.mjs.map} +0 -0
- /package/dist/{http-LPFPVTBC.mjs.map → http-5BRVWAJR.mjs.map} +0 -0
- /package/dist/{import-T4WX2ZJL.mjs.map → import-IAECQDKC.mjs.map} +0 -0
- /package/dist/{mcp-SMF3NWIN.mjs.map → mcp-XXSQJBGU.mjs.map} +0 -0
- /package/dist/{src-EGLLMTAU.mjs.map → src-4HLKMQ7S.mjs.map} +0 -0
- /package/dist/{stream-import-2BXJTTCE.mjs.map → stream-import-PUG42I36.mjs.map} +0 -0
- /package/dist/{worker-runtime-RDLSPXFT.mjs.map → worker-runtime-X5563TVT.mjs.map} +0 -0
- /package/dist-cli-web/assets/{ActionToolsPanel-DDNXXH8v.css → useInsightTabAnalytics-DDNXXH8v.css} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as A,aO as P,bw as U,u as C,aP as Q,s as W,o as u,f,w as m,r as y,g as a,P as w,b as S,G as J,aS as X,x as Y,al as Z,z as k,O as aa,l as z,bn as ea,e as _,K as ta,bx as ia,by as sa,m as I,bz as ra,bA as na,aQ as la,aR as oa,ar as N,as as F,bB as da,a7 as M,n as h,au as j,c as B,p as R,bC as ua,aw as T,av as D,aT as ca,aU as ga,F as K,j as L,bD as q,a9 as O}from"./index-B1oj9KDv.js";import{R as va}from"./RovingFocusItem-BJMUQ5DJ.js";const[V,fa]=X("TabsRoot");var pa=A({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(c,{emit:l}){const g=c,e=l,{orientation:p,unmountOnHide:d,dir:t}=P(g),s=U(t);C();const r=Q(g,"modelValue",e,{defaultValue:g.defaultValue,passive:g.modelValue===void 0}),n=S(),b=J(new Set);return fa({modelValue:r,changeModelValue:o=>{r.value=o},orientation:p,dir:s,unmountOnHide:d,activationMode:g.activationMode,baseId:W(void 0,"reka-tabs"),tabsList:n,contentIds:b,registerContent:o=>{b.value=new Set([...b.value,o])},unregisterContent:o=>{const v=new Set(b.value);v.delete(o),b.value=v}}),(o,v)=>(u(),f(a(w),{dir:a(s),"data-orientation":a(p),"as-child":o.asChild,as:o.as},{default:m(()=>[y(o.$slots,"default",{modelValue:a(r)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),ba=pa;function G(c,l){return`${c}-trigger-${l}`}function H(c,l){return`${c}-content-${l}`}var ya=A({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c){const l=c,{forwardRef:g}=C(),e=V(),p=_(()=>G(e.baseId,l.value)),d=_(()=>H(e.baseId,l.value)),t=_(()=>l.value===e.modelValue.value),s=S(t.value);return Y(()=>{e.registerContent(l.value),requestAnimationFrame(()=>{s.value=!1})}),Z(()=>{e.unregisterContent(l.value)}),(r,n)=>(u(),f(a(ea),{present:r.forceMount||t.value,"force-mount":""},{default:m(({present:b})=>[k(a(w),{id:d.value,ref:a(g),"as-child":r.asChild,as:r.as,role:"tabpanel","data-state":t.value?"active":"inactive","data-orientation":a(e).orientation.value,"aria-labelledby":p.value,hidden:!b,tabindex:"0",style:aa({animationDuration:s.value?"0s":void 0})},{default:m(()=>[!a(e).unmountOnHide.value||b?y(r.$slots,"default",{key:0}):z("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),ma=ya,xa=A({__name:"TabsIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c,{expose:l}){const g=c,e=V();l({updateIndicatorStyle:s}),C();const p=ra(),d=S({size:null,position:null}),t=S([]);ta(()=>[e.modelValue.value,e?.dir.value],()=>{s()},{immediate:!0,flush:"post"}),ia(()=>{t.value=Array.from(e.tabsList.value?.querySelectorAll('[role="tab"]')||[])}),sa(_(()=>[e.tabsList.value,...t.value]),s);function s(){const r=e.tabsList.value?.querySelector('[role="tab"][data-state="active"]');r&&(e.orientation.value==="horizontal"?d.value={size:r.offsetWidth,position:r.offsetLeft}:d.value={size:r.offsetHeight,position:r.offsetTop})}return(r,n)=>a(p)&&typeof d.value.size=="number"?(u(),f(a(w),I({key:0},g,{style:{"--reka-tabs-indicator-size":`${d.value.size}px`,"--reka-tabs-indicator-position":`${d.value.position}px`}}),{default:m(()=>[y(r.$slots,"default")]),_:3},16,["style"])):z("v-if",!0)}}),ha=xa,za=A({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c){const l=c,{loop:g}=P(l),{forwardRef:e,currentElement:p}=C(),d=V();return d.tabsList=p,(t,s)=>(u(),f(a(na),{"as-child":"",orientation:a(d).orientation.value,dir:a(d).dir.value,loop:a(g)},{default:m(()=>[k(a(w),{ref:a(e),role:"tablist","as-child":t.asChild,as:t.as,"aria-orientation":a(d).orientation.value},{default:m(()=>[y(t.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),_a=za,qa=A({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(c){const l=c,{forwardRef:g}=C(),e=V(),p=_(()=>G(e.baseId,l.value)),d=_(()=>e.contentIds.value.has(l.value)?H(e.baseId,l.value):void 0),t=_(()=>l.value===e.modelValue.value);return(s,r)=>(u(),f(a(va),{"as-child":"",focusable:!s.disabled,active:t.value},{default:m(()=>[k(a(w),{id:p.value,ref:a(g),role:"tab",type:s.as==="button"?"button":void 0,as:s.as,"as-child":s.asChild,"aria-selected":t.value?"true":"false","aria-controls":d.value,"data-state":t.value?"active":"inactive",disabled:s.disabled,"data-disabled":s.disabled?"":void 0,"data-orientation":a(e).orientation.value,onMousedown:r[0]||(r[0]=oa(n=>{!s.disabled&&n.ctrlKey===!1?a(e).changeModelValue(s.value):n.preventDefault()},["left"])),onKeydown:r[1]||(r[1]=la(n=>a(e).changeModelValue(s.value),["enter","space"])),onFocus:r[2]||(r[2]=()=>{const n=a(e).activationMode!=="manual";!t.value&&!s.disabled&&n&&a(e).changeModelValue(s.value)})},{default:m(()=>[y(s.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),wa=qa;const Ia={slots:{base:"font-medium inline-flex items-center",label:"truncate",leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailingIcon:"shrink-0"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},size:{xs:{base:"text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},sm:{base:"text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},md:{base:"text-xs px-2 py-1 gap-1 rounded-md",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},lg:{base:"text-sm px-2 py-1 gap-1.5 rounded-md",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"text-base px-2.5 py-1 gap-1.5 rounded-md",leadingIcon:"size-6",leadingAvatarSize:"2xs",trailingIcon:"size-6"}},square:{true:""}},compoundVariants:[{color:"primary",variant:"solid",class:"bg-primary text-inverted"},{color:"secondary",variant:"solid",class:"bg-secondary text-inverted"},{color:"success",variant:"solid",class:"bg-success text-inverted"},{color:"info",variant:"solid",class:"bg-info text-inverted"},{color:"warning",variant:"solid",class:"bg-warning text-inverted"},{color:"error",variant:"solid",class:"bg-error text-inverted"},{color:"primary",variant:"outline",class:"text-primary ring ring-inset ring-primary/50"},{color:"secondary",variant:"outline",class:"text-secondary ring ring-inset ring-secondary/50"},{color:"success",variant:"outline",class:"text-success ring ring-inset ring-success/50"},{color:"info",variant:"outline",class:"text-info ring ring-inset ring-info/50"},{color:"warning",variant:"outline",class:"text-warning ring ring-inset ring-warning/50"},{color:"error",variant:"outline",class:"text-error ring ring-inset ring-error/50"},{color:"primary",variant:"soft",class:"bg-primary/10 text-primary"},{color:"secondary",variant:"soft",class:"bg-secondary/10 text-secondary"},{color:"success",variant:"soft",class:"bg-success/10 text-success"},{color:"info",variant:"soft",class:"bg-info/10 text-info"},{color:"warning",variant:"soft",class:"bg-warning/10 text-warning"},{color:"error",variant:"soft",class:"bg-error/10 text-error"},{color:"primary",variant:"subtle",class:"bg-primary/10 text-primary ring ring-inset ring-primary/25"},{color:"secondary",variant:"subtle",class:"bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"},{color:"success",variant:"subtle",class:"bg-success/10 text-success ring ring-inset ring-success/25"},{color:"info",variant:"subtle",class:"bg-info/10 text-info ring ring-inset ring-info/25"},{color:"warning",variant:"subtle",class:"bg-warning/10 text-warning ring ring-inset ring-warning/25"},{color:"error",variant:"subtle",class:"bg-error/10 text-error ring ring-inset ring-error/25"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default"},{color:"neutral",variant:"soft",class:"text-default bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated"},{size:"xs",square:!0,class:"p-0.5"},{size:"sm",square:!0,class:"p-1"},{size:"md",square:!0,class:"p-1"},{size:"lg",square:!0,class:"p-1"},{size:"xl",square:!0,class:"p-1"}],defaultVariants:{color:"primary",variant:"solid",size:"md"}},Sa={__name:"Badge",props:{as:{type:null,required:!1,default:"span"},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(c){const l=c,g=N(),e=F("badge",l),p=D(),{orientation:d,size:t}=da(l),{isLeading:s,isTrailing:r,leadingIconName:n,trailingIconName:b}=ua(e),o=_(()=>T({extend:T(Ia),...p.ui?.badge||{}})({color:e.color,variant:e.variant,size:t.value??e.size,square:e.square||!g.default&&!e.label,fieldGroup:d.value}));return(v,$)=>(u(),f(a(w),{as:a(e).as,"data-slot":"base",class:h(o.value.base({class:[a(e).ui?.base,a(e).class]}))},{default:m(()=>[y(v.$slots,"leading",{ui:o.value},()=>[a(s)&&a(n)?(u(),f(M,{key:0,name:a(n),"data-slot":"leadingIcon",class:h(o.value.leadingIcon({class:a(e).ui?.leadingIcon}))},null,8,["name","class"])):a(e).avatar?(u(),f(j,I({key:1,size:a(e).ui?.leadingAvatarSize||o.value.leadingAvatarSize()},a(e).avatar,{"data-slot":"leadingAvatar",class:o.value.leadingAvatar({class:a(e).ui?.leadingAvatar})}),null,16,["size","class"])):z("",!0)]),y(v.$slots,"default",{ui:o.value},()=>[a(e).label!==void 0&&a(e).label!==null?(u(),B("span",{key:0,"data-slot":"label",class:h(o.value.label({class:a(e).ui?.label}))},R(a(e).label),3)):z("",!0)]),y(v.$slots,"trailing",{ui:o.value},()=>[a(r)&&a(b)?(u(),f(M,{key:0,name:a(b),"data-slot":"trailingIcon",class:h(o.value.trailingIcon({class:a(e).ui?.trailingIcon}))},null,8,["name","class"])):z("",!0)])]),_:3},8,["as","class"]))}},ka={slots:{root:"flex items-center gap-2",list:"relative flex p-1 group",indicator:"absolute transition-[translate,width] duration-200",trigger:["group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",label:"truncate",trailingBadge:"shrink-0",trailingBadgeSize:"sm",content:"w-full rounded-md focus-visible:outline-3"},variants:{color:{primary:{content:"outline-primary/25"},secondary:{content:"outline-secondary/25"},success:{content:"outline-success/25"},info:{content:"outline-info/25"},warning:{content:"outline-warning/25"},error:{content:"outline-error/25"},neutral:{content:"outline-inverted/25"}},variant:{pill:{list:"bg-elevated rounded-lg",trigger:["grow","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate"],indicator:"rounded-md shadow-xs"},link:{list:"border-default",indicator:"rounded-full",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full"}},orientation:{horizontal:{root:"flex-col",list:"w-full",indicator:"left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",trigger:"justify-center"},vertical:{list:"flex-col",indicator:"top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"}},size:{xs:{trigger:"px-2 py-1 text-xs gap-1",leadingIcon:"size-4",leadingAvatarSize:"3xs"},sm:{trigger:"px-2.5 py-1.5 text-xs gap-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs"},md:{trigger:"px-3 py-1.5 text-sm gap-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs"},lg:{trigger:"px-3 py-2 text-sm gap-2",leadingIcon:"size-5",leadingAvatarSize:"2xs"},xl:{trigger:"px-3 py-2 text-base gap-2",leadingIcon:"size-6",leadingAvatarSize:"xs"}}},compoundVariants:[{orientation:"horizontal",variant:"pill",class:{indicator:"inset-y-1"}},{orientation:"horizontal",variant:"link",class:{list:"border-b -mb-px",indicator:"-bottom-px h-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px"}},{orientation:"vertical",variant:"pill",class:{indicator:"inset-x-1",list:"items-center",trigger:"w-full justify-center"}},{orientation:"vertical",variant:"link",class:{list:"border-s -ms-px",indicator:"-start-px w-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px"}},{color:"primary",variant:"pill",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary"]}},{color:"secondary",variant:"pill",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary"]}},{color:"success",variant:"pill",class:{indicator:"bg-success",trigger:["data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success"]}},{color:"info",variant:"pill",class:{indicator:"bg-info",trigger:["data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info"]}},{color:"warning",variant:"pill",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning"]}},{color:"error",variant:"pill",class:{indicator:"bg-error",trigger:["data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error"]}},{color:"neutral",variant:"pill",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted"]}},{color:"primary",variant:"link",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary"]}},{color:"secondary",variant:"link",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary"]}},{color:"success",variant:"link",class:{indicator:"bg-success",trigger:["data-[state=active]:text-success outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success"]}},{color:"info",variant:"link",class:{indicator:"bg-info",trigger:["data-[state=active]:text-info outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info"]}},{color:"warning",variant:"link",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning"]}},{color:"error",variant:"link",class:{indicator:"bg-error",trigger:["data-[state=active]:text-error outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error"]}},{color:"neutral",variant:"link",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted"]}}],defaultVariants:{color:"primary",variant:"pill",size:"md"}},Ba={__name:"Tabs",props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:"0"},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(c,{expose:l,emit:g}){const e=c,p=g,d=N(),t=F("tabs",e),s=D(),r=ca(ga(t,"as","unmountOnHide"),p),n=_(()=>T({extend:T(ka),...s.ui?.tabs||{}})({color:t.color,variant:t.variant,size:t.size,orientation:t.orientation})),b=S([]);function o(v,$){b.value[v]=$}return l({triggersRef:b}),(v,$)=>(u(),f(a(ba),I(a(r),{"model-value":a(t).modelValue,"default-value":a(t).defaultValue,orientation:a(t).orientation,"activation-mode":a(t).activationMode,"data-slot":"root",class:n.value.root({class:[a(t).ui?.root,a(t).class]})}),{default:m(()=>[k(a(_a),{"data-slot":"list",class:h(n.value.list({class:a(t).ui?.list}))},{default:m(()=>[k(a(ha),{"data-slot":"indicator",class:h(n.value.indicator({class:a(t).ui?.indicator}))},null,8,["class"]),y(v.$slots,"list-leading"),(u(!0),B(K,null,L(a(t).items,(i,x)=>(u(),f(a(wa),{key:a(q)(i,a(t).valueKey)??x,ref_for:!0,ref:E=>o(x,E),value:a(q)(i,a(t).valueKey)??String(x),disabled:i.disabled,"data-slot":"trigger",class:h(n.value.trigger({class:[a(t).ui?.trigger,i.ui?.trigger]}))},{default:m(()=>[y(v.$slots,"leading",{item:i,index:x,ui:n.value},()=>[i.icon?(u(),f(M,{key:0,name:i.icon,"data-slot":"leadingIcon",class:h(n.value.leadingIcon({class:[a(t).ui?.leadingIcon,i.ui?.leadingIcon]}))},null,8,["name","class"])):i.avatar?(u(),f(j,I({key:1,size:i.ui?.leadingAvatarSize||a(t).ui?.leadingAvatarSize||n.value.leadingAvatarSize()},{ref_for:!0},i.avatar,{"data-slot":"leadingAvatar",class:n.value.leadingAvatar({class:[a(t).ui?.leadingAvatar,i.ui?.leadingAvatar]})}),null,16,["size","class"])):z("",!0)]),a(q)(i,a(t).labelKey)||d.default?(u(),B("span",{key:0,"data-slot":"label",class:h(n.value.label({class:[a(t).ui?.label,i.ui?.label]}))},[y(v.$slots,"default",{item:i,index:x},()=>[O(R(a(q)(i,a(t).labelKey)),1)])],2)):z("",!0),y(v.$slots,"trailing",{item:i,index:x,ui:n.value},()=>[i.badge||i.badge===0?(u(),f(Sa,I({key:0,color:"neutral",variant:"outline",size:i.ui?.trailingBadgeSize||a(t).ui?.trailingBadgeSize||n.value.trailingBadgeSize()},{ref_for:!0},typeof i.badge=="string"||typeof i.badge=="number"?{label:i.badge}:i.badge,{"data-slot":"trailingBadge",class:n.value.trailingBadge({class:[a(t).ui?.trailingBadge,i.ui?.trailingBadge]})}),null,16,["size","class"])):z("",!0)])]),_:2},1032,["value","disabled","class"]))),128)),y(v.$slots,"list-trailing")]),_:3},8,["class"]),a(t).content?(u(!0),B(K,{key:0},L(a(t).items,(i,x)=>(u(),f(a(ma),{key:a(q)(i,a(t).valueKey)??x,value:a(q)(i,a(t).valueKey)??String(x),"data-slot":"content",class:h(n.value.content({class:[a(t).ui?.content,i.ui?.content,i.class]}))},{default:m(()=>[y(v.$slots,i.slot||"content",{item:i,index:x,ui:n.value},()=>[O(R(i.content),1)])]),_:2},1032,["value","class"]))),128)):z("",!0)]),_:3},16,["model-value","default-value","orientation","activation-mode","class"]))}};export{Ba as _,Sa as a};
|
|
1
|
+
import{d as A,aO as P,bw as U,u as C,aP as Q,s as W,o as u,f,w as m,r as y,g as a,P as w,b as S,G as J,aS as X,x as Y,al as Z,z as k,O as aa,l as z,bn as ea,e as _,K as ta,bx as ia,by as sa,m as I,bz as ra,bA as na,aQ as la,aR as oa,ar as N,as as F,bB as da,a7 as M,n as h,au as j,c as B,p as R,bC as ua,aw as T,av as D,aT as ca,aU as ga,F as K,j as L,bD as q,a9 as O}from"./index-D9C3dyV8.js";import{R as va}from"./RovingFocusItem-Bqgmzo42.js";const[V,fa]=X("TabsRoot");var pa=A({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(c,{emit:l}){const g=c,e=l,{orientation:p,unmountOnHide:d,dir:t}=P(g),s=U(t);C();const r=Q(g,"modelValue",e,{defaultValue:g.defaultValue,passive:g.modelValue===void 0}),n=S(),b=J(new Set);return fa({modelValue:r,changeModelValue:o=>{r.value=o},orientation:p,dir:s,unmountOnHide:d,activationMode:g.activationMode,baseId:W(void 0,"reka-tabs"),tabsList:n,contentIds:b,registerContent:o=>{b.value=new Set([...b.value,o])},unregisterContent:o=>{const v=new Set(b.value);v.delete(o),b.value=v}}),(o,v)=>(u(),f(a(w),{dir:a(s),"data-orientation":a(p),"as-child":o.asChild,as:o.as},{default:m(()=>[y(o.$slots,"default",{modelValue:a(r)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),ba=pa;function G(c,l){return`${c}-trigger-${l}`}function H(c,l){return`${c}-content-${l}`}var ya=A({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c){const l=c,{forwardRef:g}=C(),e=V(),p=_(()=>G(e.baseId,l.value)),d=_(()=>H(e.baseId,l.value)),t=_(()=>l.value===e.modelValue.value),s=S(t.value);return Y(()=>{e.registerContent(l.value),requestAnimationFrame(()=>{s.value=!1})}),Z(()=>{e.unregisterContent(l.value)}),(r,n)=>(u(),f(a(ea),{present:r.forceMount||t.value,"force-mount":""},{default:m(({present:b})=>[k(a(w),{id:d.value,ref:a(g),"as-child":r.asChild,as:r.as,role:"tabpanel","data-state":t.value?"active":"inactive","data-orientation":a(e).orientation.value,"aria-labelledby":p.value,hidden:!b,tabindex:"0",style:aa({animationDuration:s.value?"0s":void 0})},{default:m(()=>[!a(e).unmountOnHide.value||b?y(r.$slots,"default",{key:0}):z("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),ma=ya,xa=A({__name:"TabsIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c,{expose:l}){const g=c,e=V();l({updateIndicatorStyle:s}),C();const p=ra(),d=S({size:null,position:null}),t=S([]);ta(()=>[e.modelValue.value,e?.dir.value],()=>{s()},{immediate:!0,flush:"post"}),ia(()=>{t.value=Array.from(e.tabsList.value?.querySelectorAll('[role="tab"]')||[])}),sa(_(()=>[e.tabsList.value,...t.value]),s);function s(){const r=e.tabsList.value?.querySelector('[role="tab"][data-state="active"]');r&&(e.orientation.value==="horizontal"?d.value={size:r.offsetWidth,position:r.offsetLeft}:d.value={size:r.offsetHeight,position:r.offsetTop})}return(r,n)=>a(p)&&typeof d.value.size=="number"?(u(),f(a(w),I({key:0},g,{style:{"--reka-tabs-indicator-size":`${d.value.size}px`,"--reka-tabs-indicator-position":`${d.value.position}px`}}),{default:m(()=>[y(r.$slots,"default")]),_:3},16,["style"])):z("v-if",!0)}}),ha=xa,za=A({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(c){const l=c,{loop:g}=P(l),{forwardRef:e,currentElement:p}=C(),d=V();return d.tabsList=p,(t,s)=>(u(),f(a(na),{"as-child":"",orientation:a(d).orientation.value,dir:a(d).dir.value,loop:a(g)},{default:m(()=>[k(a(w),{ref:a(e),role:"tablist","as-child":t.asChild,as:t.as,"aria-orientation":a(d).orientation.value},{default:m(()=>[y(t.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),_a=za,qa=A({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(c){const l=c,{forwardRef:g}=C(),e=V(),p=_(()=>G(e.baseId,l.value)),d=_(()=>e.contentIds.value.has(l.value)?H(e.baseId,l.value):void 0),t=_(()=>l.value===e.modelValue.value);return(s,r)=>(u(),f(a(va),{"as-child":"",focusable:!s.disabled,active:t.value},{default:m(()=>[k(a(w),{id:p.value,ref:a(g),role:"tab",type:s.as==="button"?"button":void 0,as:s.as,"as-child":s.asChild,"aria-selected":t.value?"true":"false","aria-controls":d.value,"data-state":t.value?"active":"inactive",disabled:s.disabled,"data-disabled":s.disabled?"":void 0,"data-orientation":a(e).orientation.value,onMousedown:r[0]||(r[0]=oa(n=>{!s.disabled&&n.ctrlKey===!1?a(e).changeModelValue(s.value):n.preventDefault()},["left"])),onKeydown:r[1]||(r[1]=la(n=>a(e).changeModelValue(s.value),["enter","space"])),onFocus:r[2]||(r[2]=()=>{const n=a(e).activationMode!=="manual";!t.value&&!s.disabled&&n&&a(e).changeModelValue(s.value)})},{default:m(()=>[y(s.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),wa=qa;const Ia={slots:{base:"font-medium inline-flex items-center",label:"truncate",leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailingIcon:"shrink-0"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},size:{xs:{base:"text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},sm:{base:"text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},md:{base:"text-xs px-2 py-1 gap-1 rounded-md",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},lg:{base:"text-sm px-2 py-1 gap-1.5 rounded-md",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"text-base px-2.5 py-1 gap-1.5 rounded-md",leadingIcon:"size-6",leadingAvatarSize:"2xs",trailingIcon:"size-6"}},square:{true:""}},compoundVariants:[{color:"primary",variant:"solid",class:"bg-primary text-inverted"},{color:"secondary",variant:"solid",class:"bg-secondary text-inverted"},{color:"success",variant:"solid",class:"bg-success text-inverted"},{color:"info",variant:"solid",class:"bg-info text-inverted"},{color:"warning",variant:"solid",class:"bg-warning text-inverted"},{color:"error",variant:"solid",class:"bg-error text-inverted"},{color:"primary",variant:"outline",class:"text-primary ring ring-inset ring-primary/50"},{color:"secondary",variant:"outline",class:"text-secondary ring ring-inset ring-secondary/50"},{color:"success",variant:"outline",class:"text-success ring ring-inset ring-success/50"},{color:"info",variant:"outline",class:"text-info ring ring-inset ring-info/50"},{color:"warning",variant:"outline",class:"text-warning ring ring-inset ring-warning/50"},{color:"error",variant:"outline",class:"text-error ring ring-inset ring-error/50"},{color:"primary",variant:"soft",class:"bg-primary/10 text-primary"},{color:"secondary",variant:"soft",class:"bg-secondary/10 text-secondary"},{color:"success",variant:"soft",class:"bg-success/10 text-success"},{color:"info",variant:"soft",class:"bg-info/10 text-info"},{color:"warning",variant:"soft",class:"bg-warning/10 text-warning"},{color:"error",variant:"soft",class:"bg-error/10 text-error"},{color:"primary",variant:"subtle",class:"bg-primary/10 text-primary ring ring-inset ring-primary/25"},{color:"secondary",variant:"subtle",class:"bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"},{color:"success",variant:"subtle",class:"bg-success/10 text-success ring ring-inset ring-success/25"},{color:"info",variant:"subtle",class:"bg-info/10 text-info ring ring-inset ring-info/25"},{color:"warning",variant:"subtle",class:"bg-warning/10 text-warning ring ring-inset ring-warning/25"},{color:"error",variant:"subtle",class:"bg-error/10 text-error ring ring-inset ring-error/25"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default"},{color:"neutral",variant:"soft",class:"text-default bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated"},{size:"xs",square:!0,class:"p-0.5"},{size:"sm",square:!0,class:"p-1"},{size:"md",square:!0,class:"p-1"},{size:"lg",square:!0,class:"p-1"},{size:"xl",square:!0,class:"p-1"}],defaultVariants:{color:"primary",variant:"solid",size:"md"}},Sa={__name:"Badge",props:{as:{type:null,required:!1,default:"span"},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(c){const l=c,g=N(),e=F("badge",l),p=D(),{orientation:d,size:t}=da(l),{isLeading:s,isTrailing:r,leadingIconName:n,trailingIconName:b}=ua(e),o=_(()=>T({extend:T(Ia),...p.ui?.badge||{}})({color:e.color,variant:e.variant,size:t.value??e.size,square:e.square||!g.default&&!e.label,fieldGroup:d.value}));return(v,$)=>(u(),f(a(w),{as:a(e).as,"data-slot":"base",class:h(o.value.base({class:[a(e).ui?.base,a(e).class]}))},{default:m(()=>[y(v.$slots,"leading",{ui:o.value},()=>[a(s)&&a(n)?(u(),f(M,{key:0,name:a(n),"data-slot":"leadingIcon",class:h(o.value.leadingIcon({class:a(e).ui?.leadingIcon}))},null,8,["name","class"])):a(e).avatar?(u(),f(j,I({key:1,size:a(e).ui?.leadingAvatarSize||o.value.leadingAvatarSize()},a(e).avatar,{"data-slot":"leadingAvatar",class:o.value.leadingAvatar({class:a(e).ui?.leadingAvatar})}),null,16,["size","class"])):z("",!0)]),y(v.$slots,"default",{ui:o.value},()=>[a(e).label!==void 0&&a(e).label!==null?(u(),B("span",{key:0,"data-slot":"label",class:h(o.value.label({class:a(e).ui?.label}))},R(a(e).label),3)):z("",!0)]),y(v.$slots,"trailing",{ui:o.value},()=>[a(r)&&a(b)?(u(),f(M,{key:0,name:a(b),"data-slot":"trailingIcon",class:h(o.value.trailingIcon({class:a(e).ui?.trailingIcon}))},null,8,["name","class"])):z("",!0)])]),_:3},8,["as","class"]))}},ka={slots:{root:"flex items-center gap-2",list:"relative flex p-1 group",indicator:"absolute transition-[translate,width] duration-200",trigger:["group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",label:"truncate",trailingBadge:"shrink-0",trailingBadgeSize:"sm",content:"w-full rounded-md focus-visible:outline-3"},variants:{color:{primary:{content:"outline-primary/25"},secondary:{content:"outline-secondary/25"},success:{content:"outline-success/25"},info:{content:"outline-info/25"},warning:{content:"outline-warning/25"},error:{content:"outline-error/25"},neutral:{content:"outline-inverted/25"}},variant:{pill:{list:"bg-elevated rounded-lg",trigger:["grow","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate"],indicator:"rounded-md shadow-xs"},link:{list:"border-default",indicator:"rounded-full",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full"}},orientation:{horizontal:{root:"flex-col",list:"w-full",indicator:"left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",trigger:"justify-center"},vertical:{list:"flex-col",indicator:"top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"}},size:{xs:{trigger:"px-2 py-1 text-xs gap-1",leadingIcon:"size-4",leadingAvatarSize:"3xs"},sm:{trigger:"px-2.5 py-1.5 text-xs gap-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs"},md:{trigger:"px-3 py-1.5 text-sm gap-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs"},lg:{trigger:"px-3 py-2 text-sm gap-2",leadingIcon:"size-5",leadingAvatarSize:"2xs"},xl:{trigger:"px-3 py-2 text-base gap-2",leadingIcon:"size-6",leadingAvatarSize:"xs"}}},compoundVariants:[{orientation:"horizontal",variant:"pill",class:{indicator:"inset-y-1"}},{orientation:"horizontal",variant:"link",class:{list:"border-b -mb-px",indicator:"-bottom-px h-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px"}},{orientation:"vertical",variant:"pill",class:{indicator:"inset-x-1",list:"items-center",trigger:"w-full justify-center"}},{orientation:"vertical",variant:"link",class:{list:"border-s -ms-px",indicator:"-start-px w-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px"}},{color:"primary",variant:"pill",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary"]}},{color:"secondary",variant:"pill",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary"]}},{color:"success",variant:"pill",class:{indicator:"bg-success",trigger:["data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success"]}},{color:"info",variant:"pill",class:{indicator:"bg-info",trigger:["data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info"]}},{color:"warning",variant:"pill",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning"]}},{color:"error",variant:"pill",class:{indicator:"bg-error",trigger:["data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error"]}},{color:"neutral",variant:"pill",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted"]}},{color:"primary",variant:"link",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary"]}},{color:"secondary",variant:"link",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary"]}},{color:"success",variant:"link",class:{indicator:"bg-success",trigger:["data-[state=active]:text-success outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success"]}},{color:"info",variant:"link",class:{indicator:"bg-info",trigger:["data-[state=active]:text-info outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info"]}},{color:"warning",variant:"link",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning"]}},{color:"error",variant:"link",class:{indicator:"bg-error",trigger:["data-[state=active]:text-error outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error"]}},{color:"neutral",variant:"link",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted"]}}],defaultVariants:{color:"primary",variant:"pill",size:"md"}},Ba={__name:"Tabs",props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:"0"},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(c,{expose:l,emit:g}){const e=c,p=g,d=N(),t=F("tabs",e),s=D(),r=ca(ga(t,"as","unmountOnHide"),p),n=_(()=>T({extend:T(ka),...s.ui?.tabs||{}})({color:t.color,variant:t.variant,size:t.size,orientation:t.orientation})),b=S([]);function o(v,$){b.value[v]=$}return l({triggersRef:b}),(v,$)=>(u(),f(a(ba),I(a(r),{"model-value":a(t).modelValue,"default-value":a(t).defaultValue,orientation:a(t).orientation,"activation-mode":a(t).activationMode,"data-slot":"root",class:n.value.root({class:[a(t).ui?.root,a(t).class]})}),{default:m(()=>[k(a(_a),{"data-slot":"list",class:h(n.value.list({class:a(t).ui?.list}))},{default:m(()=>[k(a(ha),{"data-slot":"indicator",class:h(n.value.indicator({class:a(t).ui?.indicator}))},null,8,["class"]),y(v.$slots,"list-leading"),(u(!0),B(K,null,L(a(t).items,(i,x)=>(u(),f(a(wa),{key:a(q)(i,a(t).valueKey)??x,ref_for:!0,ref:E=>o(x,E),value:a(q)(i,a(t).valueKey)??String(x),disabled:i.disabled,"data-slot":"trigger",class:h(n.value.trigger({class:[a(t).ui?.trigger,i.ui?.trigger]}))},{default:m(()=>[y(v.$slots,"leading",{item:i,index:x,ui:n.value},()=>[i.icon?(u(),f(M,{key:0,name:i.icon,"data-slot":"leadingIcon",class:h(n.value.leadingIcon({class:[a(t).ui?.leadingIcon,i.ui?.leadingIcon]}))},null,8,["name","class"])):i.avatar?(u(),f(j,I({key:1,size:i.ui?.leadingAvatarSize||a(t).ui?.leadingAvatarSize||n.value.leadingAvatarSize()},{ref_for:!0},i.avatar,{"data-slot":"leadingAvatar",class:n.value.leadingAvatar({class:[a(t).ui?.leadingAvatar,i.ui?.leadingAvatar]})}),null,16,["size","class"])):z("",!0)]),a(q)(i,a(t).labelKey)||d.default?(u(),B("span",{key:0,"data-slot":"label",class:h(n.value.label({class:[a(t).ui?.label,i.ui?.label]}))},[y(v.$slots,"default",{item:i,index:x},()=>[O(R(a(q)(i,a(t).labelKey)),1)])],2)):z("",!0),y(v.$slots,"trailing",{item:i,index:x,ui:n.value},()=>[i.badge||i.badge===0?(u(),f(Sa,I({key:0,color:"neutral",variant:"outline",size:i.ui?.trailingBadgeSize||a(t).ui?.trailingBadgeSize||n.value.trailingBadgeSize()},{ref_for:!0},typeof i.badge=="string"||typeof i.badge=="number"?{label:i.badge}:i.badge,{"data-slot":"trailingBadge",class:n.value.trailingBadge({class:[a(t).ui?.trailingBadge,i.ui?.trailingBadge]})}),null,16,["size","class"])):z("",!0)])]),_:2},1032,["value","disabled","class"]))),128)),y(v.$slots,"list-trailing")]),_:3},8,["class"]),a(t).content?(u(!0),B(K,{key:0},L(a(t).items,(i,x)=>(u(),f(a(ma),{key:a(q)(i,a(t).valueKey)??x,value:a(q)(i,a(t).valueKey)??String(x),"data-slot":"content",class:h(n.value.content({class:[a(t).ui?.content,i.ui?.content,i.class]}))},{default:m(()=>[y(v.$slots,i.slot||"content",{item:i,index:x,ui:n.value},()=>[O(R(i.content),1)])]),_:2},1032,["value","class"]))),128)):z("",!0)]),_:3},16,["model-value","default-value","orientation","activation-mode","class"]))}};export{Ba as _,Sa as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as r,o as a,c as d,n,r as s}from"./index-
|
|
1
|
+
import{d as r,o as a,c as d,n,r as s}from"./index-D9C3dyV8.js";const i=r({__name:"ThemeCard",props:{shadow:{type:Boolean,default:!0}},setup(e){return(o,t)=>(a(),d("div",{class:n(["overflow-hidden rounded-2xl border border-gray-200/60 bg-card-bg transition-shadow duration-300 hover:shadow-lg motion-reduce:transition-none dark:border-white/5 dark:bg-card-dark",{"shadow-elevated":e.shadow}])},[s(o.$slots,"default")],2))}});export{i as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aI as D,d as ye,a6 as pe,x as be,al as Se,K as Ye,o as T,c as $,n as C,z as w,f as xe,a8 as De,a as F,p as Z,l as ee,b as f,e as d,L as Me}from"./index-
|
|
1
|
+
import{aI as D,d as ye,a6 as pe,x as be,al as Se,K as Ye,o as T,c as $,n as C,z as w,f as xe,a8 as De,a as F,p as Z,l as ee,b as f,e as d,L as Me}from"./index-D9C3dyV8.js";import{_ as he}from"./Select-BAnN4HMs.js";import{T as we}from"./Tabs-DwjL-ueH.js";import{_ as ae}from"./DatePicker.vue_vue_type_script_setup_true_lang-CSp691Uv.js";function te(o){const u=new Date(o*1e3),l=u.getFullYear(),r=String(u.getMonth()+1).padStart(2,"0"),i=String(u.getDate()).padStart(2,"0");return`${l}-${r}-${i}`}function Fe(o){const u=new Date(o*1e3),l=u.getFullYear(),r=String(u.getMonth()+1).padStart(2,"0"),i=String(u.getDate()).padStart(2,"0"),p=String(u.getHours()).padStart(2,"0"),v=String(u.getMinutes()).padStart(2,"0");return`${l}-${r}-${i} ${p}:${v}`}function Ee(o){return D.unix(o).format("YYYY-MM-DD HH:mm:ss")}function Qe(o,u){const l=te(o);if(u===null)return`${l} ~ 至今`;const r=te(u);return l===r?l:`${l} ~ ${r}`}function le(o,u,l="YYYY/MM/DD",r=" - "){const i=D.unix(o).format(l),p=D.unix(u).format(l);return i===p?i:`${i}${r}${p}`}const E=["recent","quarter","year","custom"],ne=[365,730,1825,0];function ze(o){if(!o)return[...E];const u=new Set(o),l=E.filter(r=>u.has(r));return l.length>0?l:[...E]}function qe(o){if(!o)return[...ne];const u=new Set(o),l=ne.filter(r=>u.has(r));return l.length>0?l:[365]}function Te(o,u){return[o??"",u?.availableYears.join(",")??"",u?.fullRange?.start??"",u?.fullRange?.end??""].join("|")}const ke={key:1,class:"flex items-center"},Re={key:2,class:"flex items-center"},Ve={key:3,class:"flex items-center gap-1"},Be=ye({__name:"TimeSelect",props:{sessionId:{},modelValue:{},visible:{type:Boolean,default:!0},initialState:{},rangeSource:{},allowedModes:{},allowedRecentDays:{},size:{default:"md"}},emits:["update:modelValue","update:fullRange","update:availableYears","initializationComplete"],setup(o,{emit:u}){const l=o,r=u,{t:i}=pe(),p=f(!1),v=f([]),c=f(null),k=d(()=>ze(l.allowedModes)),I=d(()=>qe(l.allowedRecentDays)),z=d(()=>l.size==="sm"?"xs":"sm"),Q=d(()=>l.size==="sm"?"text-xs":"text-sm"),b=f("recent"),S=f(365),g=f(0),m=f(0),y=f(1),Y=f(""),x=f(""),R=f(!1);let q=0;function V(a){const e=new Date(a*1e3);return{year:e.getFullYear(),quarter:Math.floor(e.getMonth()/3)+1}}function re(a,e){const t=(e-1)*3,s=new Date(a,t,1,0,0,0),n=new Date(a,t+3,0,23,59,59);return{startTs:Math.floor(s.getTime()/1e3),endTs:Math.floor(n.getTime()/1e3)}}function se(a){const e=new Date(a,0,1,0,0,0),t=new Date(a,11,31,23,59,59);return{startTs:Math.floor(e.getTime()/1e3),endTs:Math.floor(t.getTime()/1e3)}}const ue=d(()=>[{label:i("common.timeSelect.mode.recent"),value:"recent"},{label:i("common.timeSelect.mode.quarter"),value:"quarter"},{label:i("common.timeSelect.mode.year"),value:"year"},{label:i("common.timeSelect.mode.custom"),value:"custom"}].filter(a=>k.value.includes(a.value))),oe=d(()=>{const a=new Map([[365,i("common.timeSelect.recent.oneYear")],[730,i("common.timeSelect.recent.twoYears")],[1825,i("common.timeSelect.recent.fiveYears")],[0,i("common.timeSelect.recent.all")]]);return I.value.map(e=>({label:a.get(e)??String(e),value:e}))}),B=d(()=>c.value?V(c.value.start):{year:0,quarter:1}),O=d(()=>c.value?V(c.value.end):{year:0,quarter:1}),ie=d(()=>{const a=B.value;return m.value>a.year||m.value===a.year&&y.value>a.quarter}),ce=d(()=>{const a=O.value;return m.value<a.year||m.value===a.year&&y.value<a.quarter}),de=d(()=>v.value.length===0?!1:v.value.indexOf(g.value)<v.value.length-1),ve=d(()=>v.value.length===0?!1:v.value.indexOf(g.value)>0),U=d(()=>i("common.timeSelect.quarter.label",{year:m.value,quarter:y.value})),A=d(()=>i("common.timeSelect.year.label",{year:g.value}));function me(a){return{365:i("common.timeSelect.display.recent365"),730:i("common.timeSelect.display.recent730"),1825:i("common.timeSelect.display.recent1825")}[a]||""}function N(a){return I.value.includes(a)?a:I.value[0]??365}function fe(){if(!c.value)return null;const a={mode:b.value};switch(b.value){case"recent":{if(a.recentDays=S.value,S.value===0)return{startTs:c.value.start,endTs:c.value.end,displayLabel:le(c.value.start,c.value.end),isFullRange:!0,state:a};const e=c.value.end;return{startTs:Math.max(e-S.value*86400,c.value.start),endTs:e,displayLabel:me(S.value),isFullRange:!1,state:a}}case"quarter":return a.quarterYear=m.value,a.quarter=y.value,{...re(m.value,y.value),displayLabel:U.value,isFullRange:!1,state:a};case"year":return a.year=g.value,{...se(g.value),displayLabel:A.value,isFullRange:!1,state:a};case"custom":{if(a.customStart=Y.value,a.customEnd=x.value,!Y.value||!x.value)return null;let e=D(Y.value).startOf("day").unix(),t=D(x.value).endOf("day").unix();return e>t&&([e,t]=[t,e]),{startTs:e,endTs:t,displayLabel:le(e,t),isFullRange:!1,state:a}}}}function M(){const a=fe();a&&r("update:modelValue",a)}function P(a){let e=m.value,t=y.value+a;t>4&&(e++,t=1),t<1&&(e--,t=4);const s=B.value,n=O.value;e<s.year||e===s.year&&t<s.quarter||e>n.year||e===n.year&&t>n.quarter||(m.value=e,y.value=t,M())}function _(a){const e=v.value,s=e.indexOf(g.value)-a;s>=0&&s<e.length&&(g.value=e[s],M())}function ge(a){if(c.value)switch(a){case"recent":S.value=N(S.value);break;case"quarter":{const{year:e,quarter:t}=V(c.value.end);m.value=e,y.value=t;break}case"year":{g.value=v.value[0]||new Date(c.value.end*1e3).getFullYear();break}case"custom":{const e=c.value.end,t=Math.max(e-30*86400,c.value.start);Y.value=D.unix(t).format("YYYY-MM-DD"),x.value=D.unix(e).format("YYYY-MM-DD");break}}}const j=d({get:()=>b.value,set:a=>{b.value=a,R.value=!0,ge(a),R.value=!1,M()}}),H=d({get:()=>S.value,set:a=>{S.value=a,M()}}),K=d({get:()=>Y.value,set:a=>{Y.value=a,x.value&&M()}}),G=d({get:()=>x.value,set:a=>{x.value=a,Y.value&&M()}});async function J(){const a=++q;if(!l.rangeSource&&!l.sessionId){v.value=[],c.value=null,r("update:modelValue",null),r("update:fullRange",null),r("update:availableYears",[]),p.value=!0,r("initializationComplete",!1);return}let e=!1;try{let t,s;if(l.rangeSource)t=l.rangeSource.availableYears,s=l.rangeSource.fullRange;else{const h=Me();[t,s]=await Promise.all([h.getAvailableYears(l.sessionId),h.getTimeRange(l.sessionId)])}if(a!==q)return;v.value=t,c.value=s,e=s!==null,r("update:fullRange",s),r("update:availableYears",t);const n=l.initialState,W=n?.mode??k.value[0]??"recent",X=k.value.includes(W)?W:k.value[0]??"recent";switch(b.value=X,R.value=!0,X){case"recent":S.value=N(n?.recentDays??365);break;case"quarter":{if(n?.quarterYear&&n?.quarter)m.value=n.quarterYear,y.value=n.quarter;else if(s){const{year:h,quarter:L}=V(s.end);m.value=h,y.value=L}break}case"year":{n?.year&&t.includes(n.year)?g.value=n.year:g.value=t[0]||0;break}case"custom":{if(n?.customStart&&n?.customEnd)Y.value=n.customStart,x.value=n.customEnd;else if(s){const h=s.end,L=Math.max(h-30*86400,s.start);Y.value=D.unix(L).format("YYYY-MM-DD"),x.value=D.unix(h).format("YYYY-MM-DD")}break}}R.value=!1,e?M():r("update:modelValue",null)}catch(t){if(a!==q)return;console.error("TimeSelect 加载数据失败:",t),v.value=[],c.value=null,r("update:modelValue",null),r("update:fullRange",null),r("update:availableYears",[])}finally{a===q&&(p.value=!0,r("initializationComplete",e))}}return be(()=>{J()}),Se(()=>{q++}),Ye(()=>Te(l.sessionId,l.rangeSource),()=>{p.value=!1,J()}),(a,e)=>{const t=he,s=De;return p.value?(T(),$("div",{key:0,class:C(["flex items-center gap-2",{invisible:!o.visible}])},[w(t,{modelValue:j.value,"onUpdate:modelValue":e[0]||(e[0]=n=>j.value=n),items:ue.value,"value-key":"value",size:z.value,color:"neutral",variant:"soft",ui:{item:"py-1.5"},class:"h-8 w-[88px] shrink-0 rounded-lg bg-elevated focus-visible:ring-1 focus-visible:ring-gray-300/60 dark:focus-visible:ring-white/15"},null,8,["modelValue","items","size"]),b.value==="recent"?(T(),xe(we,{key:0,modelValue:H.value,"onUpdate:modelValue":e[1]||(e[1]=n=>H.value=n),items:oe.value,size:z.value,class:"min-w-0 shrink"},null,8,["modelValue","items","size"])):b.value==="quarter"?(T(),$("div",ke,[w(s,{icon:"i-heroicons-chevron-left",size:z.value,variant:"ghost",color:"neutral",disabled:!ie.value,onClick:e[2]||(e[2]=n=>P(-1))},null,8,["size","disabled"]),F("span",{class:C(["whitespace-nowrap px-0.5 font-medium text-gray-700 dark:text-gray-300",Q.value])},Z(U.value),3),w(s,{icon:"i-heroicons-chevron-right",size:z.value,variant:"ghost",color:"neutral",disabled:!ce.value,onClick:e[3]||(e[3]=n=>P(1))},null,8,["size","disabled"])])):b.value==="year"?(T(),$("div",Re,[w(s,{icon:"i-heroicons-chevron-left",size:z.value,variant:"ghost",color:"neutral",disabled:!de.value,onClick:e[4]||(e[4]=n=>_(-1))},null,8,["size","disabled"]),F("span",{class:C(["whitespace-nowrap px-0.5 font-medium text-gray-700 dark:text-gray-300",Q.value])},Z(A.value),3),w(s,{icon:"i-heroicons-chevron-right",size:z.value,variant:"ghost",color:"neutral",disabled:!ve.value,onClick:e[5]||(e[5]=n=>_(1))},null,8,["size","disabled"])])):b.value==="custom"?(T(),$("div",Ve,[w(ae,{modelValue:K.value,"onUpdate:modelValue":e[6]||(e[6]=n=>K.value=n),"width-class":"w-28",clearable:!1,size:o.size},null,8,["modelValue","size"]),e[8]||(e[8]=F("span",{class:"text-xs text-gray-400"},"-",-1)),w(ae,{modelValue:G.value,"onUpdate:modelValue":e[7]||(e[7]=n=>G.value=n),"width-class":"w-28",clearable:!1,size:o.size},null,8,["modelValue","size"])])):ee("",!0)],2)):ee("",!0)}}});export{Be as _,Ee as a,Qe as b,le as c,Fe as d,te as f};
|
package/dist-cli-web/assets/{VisuallyHiddenInput-BAFpkxMI.js → VisuallyHiddenInput-ST6JNfSG.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as m,K as g,o as l,f as o,m as p,af as h,ag as E,e as d,c as f,l as B,F as c,j as V}from"./index-
|
|
1
|
+
import{d as m,K as g,o as l,f as o,m as p,af as h,ag as E,e as d,c as f,l as B,F as c,j as V}from"./index-D9C3dyV8.js";var k=m({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,{primitiveElement:s,currentElement:n}=E(),t=d(()=>e.checked??e.value);return g(t,(a,r)=>{if(!n.value)return;const u=n.value,_=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(_,"value").set;if(v&&a!==r){const b=new Event("input",{bubbles:!0}),q=new Event("change",{bubbles:!0});v.call(u,a),u.dispatchEvent(b),u.dispatchEvent(q)}}),(a,r)=>(l(),o(h,p({ref_key:"primitiveElement",ref:s},{...e,...a.$attrs},{as:"input"}),null,16))}}),y=k,A=m({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,s=d(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),n=d(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((t,a)=>typeof t=="object"?Object.entries(t).map(([r,u])=>({name:`${e.name}[${a}][${r}]`,value:u})):{name:`${e.name}[${a}]`,value:t}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([t,a])=>({name:`${e.name}[${t}]`,value:a})):[]);return(t,a)=>(l(),f(c,null,[B(" We render single input if it's required "),s.value?(l(),o(y,p({key:t.name},{...e,...t.$attrs},{name:t.name,value:t.value}),null,16,["name","value"])):(l(!0),f(c,{key:1},V(n.value,r=>(l(),o(y,p({key:r.name},{ref_for:!0},{...e,...t.$attrs},{name:r.name,value:r.value}),null,16,["name","value"]))),128))],2112))}}),I=A;export{I as V};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as R,a as F,j as d,z as P,d as B,w as b,g as q,b as Ce,S as O,T as S,ak as Ne,L as Z,al as De,c as T,ab as X,q as y,K as C,N as M,r as g,M as J,am as Q,an as Ie,ao as ee,ap as Ge,aq as Ue,A as Fe,R as Pe}from"./RelationshipGalaxyCanvas-CDhljGyJ.js";import{e as Oe,G as Me,c as Le,b as we,U as He,B as te,d as N,f as re,g as Ve}from"./BufferResource-CKZxnACp.js";import{R as Xe,S as ke,d as We}from"./RenderTargetSystem-D76QrDT_.js";import"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-D8cHMqV-.js";import"./Tabs-BMq9wODW.js";import"./RovingFocusItem-BJMUQ5DJ.js";import"./useToast-B5LaA6c-.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-BBcCt_Qm.js";import"./people-page-header-BbYSSpsO.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-CByj_rCR.js";function je(){const{userAgent:t}=R.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}class ne{constructor(){this._tempState=F.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,r,n){const s=e.renderer,i=this._didUploadHash[n.uid];s.shader.bind(n,i),i||(this._didUploadHash[n.uid]=!0),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,n.glProgram)}execute(e,r){const n=e.renderer;this._tempState.blendMode=r.blendMode,n.state.set(this._tempState);const s=r.textures.textures;for(let i=0;i<r.textures.count;i++)n.texture.bind(s[i],i);n.geometry.draw(r.topology,r.size,r.start)}}ne.extension={type:[d.WebGLPipesAdaptor],name:"batch"};var A=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(A||{});class Ke{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1}}class se{constructor(e){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._managedBuffers=new P({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"})}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={}}contextChange(){this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,n=this.getGlBuffer(e);r.bindBuffer(n.type,n.buffer)}bindBufferBase(e,r){const{_gl:n}=this;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,n.bindBufferBase(n.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let n=0,s=this._nextBindBaseIndex;for(;n<2;){s>=this._maxBindings&&(s=this._minBaseLocation,n++);const i=this._boundBufferBases[s];if(i&&i._lastBindCallId===this._bindCallId){s++;continue}break}return r=s,this._nextBindBaseIndex=s+1,n>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,n,s){const{_gl:i}=this;n||(n=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,n*256,s||256)}updateBuffer(e){const{_gl:r}=this,n=this.getGlBuffer(e);if(e._updateID===n.updateID)return n;n.updateID=e._updateID,r.bindBuffer(n.type,n.buffer);const s=e.data,i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return s?n.byteLength>=s.byteLength?r.bufferSubData(n.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(n.byteLength=s.byteLength,r.bufferData(n.type,s,i)):(n.byteLength=e.descriptor.size,r.bufferData(n.type,n.byteLength,i)),n}destroyAll(e=!1){this._managedBuffers.removeAll(e)}onBufferUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];n&&(r||this._gl.deleteBuffer(n.buffer))}createGLBuffer(e){const{_gl:r}=this;let n=A.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?n=A.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(n=A.UNIFORM_BUFFER);const s=new Ke(r.createBuffer(),n);return e._gpuData[this._renderer.uid]=s,this._managedBuffers.add(e),s}resetState(){this._boundBufferBases=Object.create(null)}}se.extension={type:[d.WebGLSystem],name:"buffer"};const L=class ie{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...ie.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(b("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=R.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const n=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:n,premultipliedAlpha:s,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&b("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width<e.width||r.height<e.height)&&(r.width=Math.max(e.width,e.width),r.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof R.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let n;const s=this.canvas;if(e===2&&(n=s.getContext("webgl2",r)),!n&&(n=s.getContext("webgl",r),!n))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=n,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const n=e.getExtension("WEBGL_provoking_vertex");n&&n.provokingVertexWEBGL(n.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&b("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=this.supports,s=this.webGLVersion===2,i=this.extensions;n.uint32Indices=s||!!i.uint32ElementIndex,n.uniformBufferObject=s,n.vertexArrayObject=s||!!i.vertexArrayObject,n.srgbTextures=s||!!i.srgb,n.nonPowOf2wrapping=s,n.nonPowOf2mipmaps=s,n.msaa=s,n.uint32Indices||b("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};L.extension={type:[d.WebGLSystem],name:"context"};L.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let $e=L;var G=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(G||{}),w=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(w||{}),h=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(h||{});const k={uint8x2:h.UNSIGNED_BYTE,uint8x4:h.UNSIGNED_BYTE,sint8x2:h.BYTE,sint8x4:h.BYTE,unorm8x2:h.UNSIGNED_BYTE,unorm8x4:h.UNSIGNED_BYTE,snorm8x2:h.BYTE,snorm8x4:h.BYTE,uint16x2:h.UNSIGNED_SHORT,uint16x4:h.UNSIGNED_SHORT,sint16x2:h.SHORT,sint16x4:h.SHORT,unorm16x2:h.UNSIGNED_SHORT,unorm16x4:h.UNSIGNED_SHORT,snorm16x2:h.SHORT,snorm16x4:h.SHORT,float16x2:h.HALF_FLOAT,float16x4:h.HALF_FLOAT,float32:h.FLOAT,float32x2:h.FLOAT,float32x3:h.FLOAT,float32x4:h.FLOAT,uint32:h.UNSIGNED_INT,uint32x2:h.UNSIGNED_INT,uint32x3:h.UNSIGNED_INT,uint32x4:h.UNSIGNED_INT,sint32:h.INT,sint32x2:h.INT,sint32x3:h.INT,sint32x4:h.INT};function Ye(t){return k[t]??k.float32}const ze={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class qe{constructor(){this.vaoCache=Object.create(null)}destroy(){this.vaoCache=Object.create(null)}}class ae{constructor(e){this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new P({renderer:e,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"})}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");this.destroyAll(!0);const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=s=>r.bindVertexArrayOES(s),e.deleteVertexArray=s=>r.deleteVertexArrayOES(s));const n=this._renderer.context.extensions.vertexAttribDivisorANGLE;n&&(e.drawArraysInstanced=(s,i,a,c)=>{n.drawArraysInstancedANGLE(s,i,a,c)},e.drawElementsInstanced=(s,i,a,c,o)=>{n.drawElementsInstancedANGLE(s,i,a,c,o)},e.vertexAttribDivisor=(s,i)=>n.vertexAttribDivisorANGLE(s,i)),this._activeGeometry=null,this._activeVao=null}bind(e,r){const n=this.gl;this._activeGeometry=e;const s=this.getVao(e,r);this._activeVao!==s&&(this._activeVao=s,n.bindVertexArray(s)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let n=0;n<e.buffers.length;n++){const s=e.buffers[n];r.updateBuffer(s)}e._gcLastUsed=this._renderer.gc.now}checkCompatibility(e,r){const n=e.attributes,s=r._attributeData;for(const i in s)if(!n[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const n=e.attributes,s=r._attributeData,i=["g",e.uid];for(const a in n)s[a]&&i.push(a,s[a].location);return i.join("-")}getVao(e,r){return e._gpuData[this._renderer.uid]?.vaoCache[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,n=!0){const s=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);let c=e._gpuData[this._renderer.uid];c||(c=new qe,e._gpuData[this._renderer.uid]=c,this._managedGeometries.add(e));const o=c.vaoCache;let u=o[a];if(u)return o[r._key]=u,u;Oe(e,r._attributeData);const _=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let l=0;l<_.length;l++){const f=_[l];i.bind(f)}return this.activateVao(e,r),o[r._key]=u,o[a]=u,s.bindVertexArray(null),u}onGeometryUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];if(!n)return;const s=n.vaoCache;if(!r)for(const i in s)this._activeVao!==s[i]&&this.resetState(),this.gl.deleteVertexArray(s[i])}destroyAll(e=!1){this._managedGeometries.removeAll(e)}activateVao(e,r){const n=this._renderer.gl,s=this._renderer.buffer,i=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let a=null;for(const c in i){const o=i[c],u=o.buffer,_=s.getGlBuffer(u),l=r._attributeData[c];if(l){a!==_&&(s.bind(u),a=_);const f=l.location;n.enableVertexAttribArray(f);const m=q(o.format),p=Ye(o.format);if(l.format?.substring(1,4)==="int"?n.vertexAttribIPointer(f,m.size,p,o.stride,o.offset):n.vertexAttribPointer(f,m.size,p,m.normalised,o.stride,o.offset),o.instance)if(this.hasInstance){const E=o.divisor??1;n.vertexAttribDivisor(f,E)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,n,s){const{gl:i}=this._renderer,a=this._activeGeometry,c=ze[e||a.topology];if(s??(s=a.instanceCount),a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,u=o===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;s!==1?i.drawElementsInstanced(c,r||a.indexBuffer.data.length,u,(n||0)*o,s):i.drawElements(c,r||a.indexBuffer.data.length,u,(n||0)*o)}else s!==1?i.drawArraysInstanced(c,n||0,r||a.getSize(),s):i.drawArrays(c,n||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ae.extension={type:[d.WebGLSystem],name:"geometry"};const Ze=new Ne({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),H=class oe{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:n}={...oe.defaultOptions,...e};this.useBackBuffer=r,this._antialias=n,this._renderer.context.supports.msaa||(b("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=F.for2d();const s=new Ce({vertex:`
|
|
1
|
+
import{D as R,a as F,j as d,z as P,d as B,w as b,g as q,b as Ce,S as O,T as S,ak as Ne,L as Z,al as De,c as T,ab as X,q as y,K as C,N as M,r as g,M as J,am as Q,an as Ie,ao as ee,ap as Ge,aq as Ue,A as Fe,R as Pe}from"./RelationshipGalaxyCanvas-CHPqtqQz.js";import{e as Oe,G as Me,c as Le,b as we,U as He,B as te,d as N,f as re,g as Ve}from"./BufferResource-C-jLPrHv.js";import{R as Xe,S as ke,d as We}from"./RenderTargetSystem-BaIFulUj.js";import"./index-D9C3dyV8.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-iEQnKg2R.js";import"./Tabs-xVtuBuO0.js";import"./RovingFocusItem-Bqgmzo42.js";import"./useToast-Bmgpd3sl.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-DmVfwvnD.js";import"./people-page-header-DWXwFJ8M.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-rD_jWpbO.js";function je(){const{userAgent:t}=R.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}class ne{constructor(){this._tempState=F.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,r,n){const s=e.renderer,i=this._didUploadHash[n.uid];s.shader.bind(n,i),i||(this._didUploadHash[n.uid]=!0),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,n.glProgram)}execute(e,r){const n=e.renderer;this._tempState.blendMode=r.blendMode,n.state.set(this._tempState);const s=r.textures.textures;for(let i=0;i<r.textures.count;i++)n.texture.bind(s[i],i);n.geometry.draw(r.topology,r.size,r.start)}}ne.extension={type:[d.WebGLPipesAdaptor],name:"batch"};var A=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(A||{});class Ke{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1}}class se{constructor(e){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._managedBuffers=new P({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"})}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={}}contextChange(){this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,n=this.getGlBuffer(e);r.bindBuffer(n.type,n.buffer)}bindBufferBase(e,r){const{_gl:n}=this;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,n.bindBufferBase(n.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let n=0,s=this._nextBindBaseIndex;for(;n<2;){s>=this._maxBindings&&(s=this._minBaseLocation,n++);const i=this._boundBufferBases[s];if(i&&i._lastBindCallId===this._bindCallId){s++;continue}break}return r=s,this._nextBindBaseIndex=s+1,n>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,n,s){const{_gl:i}=this;n||(n=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,n*256,s||256)}updateBuffer(e){const{_gl:r}=this,n=this.getGlBuffer(e);if(e._updateID===n.updateID)return n;n.updateID=e._updateID,r.bindBuffer(n.type,n.buffer);const s=e.data,i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return s?n.byteLength>=s.byteLength?r.bufferSubData(n.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(n.byteLength=s.byteLength,r.bufferData(n.type,s,i)):(n.byteLength=e.descriptor.size,r.bufferData(n.type,n.byteLength,i)),n}destroyAll(e=!1){this._managedBuffers.removeAll(e)}onBufferUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];n&&(r||this._gl.deleteBuffer(n.buffer))}createGLBuffer(e){const{_gl:r}=this;let n=A.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?n=A.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(n=A.UNIFORM_BUFFER);const s=new Ke(r.createBuffer(),n);return e._gpuData[this._renderer.uid]=s,this._managedBuffers.add(e),s}resetState(){this._boundBufferBases=Object.create(null)}}se.extension={type:[d.WebGLSystem],name:"buffer"};const L=class ie{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...ie.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(b("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=R.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const n=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:n,premultipliedAlpha:s,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&b("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width<e.width||r.height<e.height)&&(r.width=Math.max(e.width,e.width),r.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof R.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let n;const s=this.canvas;if(e===2&&(n=s.getContext("webgl2",r)),!n&&(n=s.getContext("webgl",r),!n))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=n,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const n=e.getExtension("WEBGL_provoking_vertex");n&&n.provokingVertexWEBGL(n.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&b("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=this.supports,s=this.webGLVersion===2,i=this.extensions;n.uint32Indices=s||!!i.uint32ElementIndex,n.uniformBufferObject=s,n.vertexArrayObject=s||!!i.vertexArrayObject,n.srgbTextures=s||!!i.srgb,n.nonPowOf2wrapping=s,n.nonPowOf2mipmaps=s,n.msaa=s,n.uint32Indices||b("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};L.extension={type:[d.WebGLSystem],name:"context"};L.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let $e=L;var G=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(G||{}),w=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(w||{}),h=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(h||{});const k={uint8x2:h.UNSIGNED_BYTE,uint8x4:h.UNSIGNED_BYTE,sint8x2:h.BYTE,sint8x4:h.BYTE,unorm8x2:h.UNSIGNED_BYTE,unorm8x4:h.UNSIGNED_BYTE,snorm8x2:h.BYTE,snorm8x4:h.BYTE,uint16x2:h.UNSIGNED_SHORT,uint16x4:h.UNSIGNED_SHORT,sint16x2:h.SHORT,sint16x4:h.SHORT,unorm16x2:h.UNSIGNED_SHORT,unorm16x4:h.UNSIGNED_SHORT,snorm16x2:h.SHORT,snorm16x4:h.SHORT,float16x2:h.HALF_FLOAT,float16x4:h.HALF_FLOAT,float32:h.FLOAT,float32x2:h.FLOAT,float32x3:h.FLOAT,float32x4:h.FLOAT,uint32:h.UNSIGNED_INT,uint32x2:h.UNSIGNED_INT,uint32x3:h.UNSIGNED_INT,uint32x4:h.UNSIGNED_INT,sint32:h.INT,sint32x2:h.INT,sint32x3:h.INT,sint32x4:h.INT};function Ye(t){return k[t]??k.float32}const ze={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class qe{constructor(){this.vaoCache=Object.create(null)}destroy(){this.vaoCache=Object.create(null)}}class ae{constructor(e){this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new P({renderer:e,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"})}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");this.destroyAll(!0);const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=s=>r.bindVertexArrayOES(s),e.deleteVertexArray=s=>r.deleteVertexArrayOES(s));const n=this._renderer.context.extensions.vertexAttribDivisorANGLE;n&&(e.drawArraysInstanced=(s,i,a,c)=>{n.drawArraysInstancedANGLE(s,i,a,c)},e.drawElementsInstanced=(s,i,a,c,o)=>{n.drawElementsInstancedANGLE(s,i,a,c,o)},e.vertexAttribDivisor=(s,i)=>n.vertexAttribDivisorANGLE(s,i)),this._activeGeometry=null,this._activeVao=null}bind(e,r){const n=this.gl;this._activeGeometry=e;const s=this.getVao(e,r);this._activeVao!==s&&(this._activeVao=s,n.bindVertexArray(s)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let n=0;n<e.buffers.length;n++){const s=e.buffers[n];r.updateBuffer(s)}e._gcLastUsed=this._renderer.gc.now}checkCompatibility(e,r){const n=e.attributes,s=r._attributeData;for(const i in s)if(!n[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const n=e.attributes,s=r._attributeData,i=["g",e.uid];for(const a in n)s[a]&&i.push(a,s[a].location);return i.join("-")}getVao(e,r){return e._gpuData[this._renderer.uid]?.vaoCache[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,n=!0){const s=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);let c=e._gpuData[this._renderer.uid];c||(c=new qe,e._gpuData[this._renderer.uid]=c,this._managedGeometries.add(e));const o=c.vaoCache;let u=o[a];if(u)return o[r._key]=u,u;Oe(e,r._attributeData);const _=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let l=0;l<_.length;l++){const f=_[l];i.bind(f)}return this.activateVao(e,r),o[r._key]=u,o[a]=u,s.bindVertexArray(null),u}onGeometryUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];if(!n)return;const s=n.vaoCache;if(!r)for(const i in s)this._activeVao!==s[i]&&this.resetState(),this.gl.deleteVertexArray(s[i])}destroyAll(e=!1){this._managedGeometries.removeAll(e)}activateVao(e,r){const n=this._renderer.gl,s=this._renderer.buffer,i=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let a=null;for(const c in i){const o=i[c],u=o.buffer,_=s.getGlBuffer(u),l=r._attributeData[c];if(l){a!==_&&(s.bind(u),a=_);const f=l.location;n.enableVertexAttribArray(f);const m=q(o.format),p=Ye(o.format);if(l.format?.substring(1,4)==="int"?n.vertexAttribIPointer(f,m.size,p,o.stride,o.offset):n.vertexAttribPointer(f,m.size,p,m.normalised,o.stride,o.offset),o.instance)if(this.hasInstance){const E=o.divisor??1;n.vertexAttribDivisor(f,E)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,n,s){const{gl:i}=this._renderer,a=this._activeGeometry,c=ze[e||a.topology];if(s??(s=a.instanceCount),a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,u=o===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;s!==1?i.drawElementsInstanced(c,r||a.indexBuffer.data.length,u,(n||0)*o,s):i.drawElements(c,r||a.indexBuffer.data.length,u,(n||0)*o)}else s!==1?i.drawArraysInstanced(c,n||0,r||a.getSize(),s):i.drawArrays(c,n||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ae.extension={type:[d.WebGLSystem],name:"geometry"};const Ze=new Ne({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),H=class oe{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:n}={...oe.defaultOptions,...e};this.useBackBuffer=r,this._antialias=n,this._renderer.context.supports.msaa||(b("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=F.for2d();const s=new Ce({vertex:`
|
|
2
2
|
attribute vec2 aPosition;
|
|
3
3
|
out vec2 vUv;
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{y as L,a as D,j as l,z as k,e as pe,H as le,D as T,c as C,d as B,B as fe,I as z,J as w,w as v,K as y,q as ge,L as me,N as O,O as R,r as G,M as F,Q as I,V as _e,W,X as be,S as H,T as E,A as xe,R as ye}from"./RelationshipGalaxyCanvas-CDhljGyJ.js";import{c as Ge,u as Pe,U as Se,B as Te,G as Be,e as Ce,l as ve,a as Ue,t as Me}from"./BufferResource-CKZxnACp.js";import{R as we,S as Re,d as Ee}from"./RenderTargetSystem-D76QrDT_.js";import"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-D8cHMqV-.js";import"./Tabs-BMq9wODW.js";import"./RovingFocusItem-BJMUQ5DJ.js";import"./useToast-B5LaA6c-.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-BBcCt_Qm.js";import"./people-page-header-BbYSSpsO.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-CByj_rCR.js";const P=D.for2d();class N{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),P.blendMode="normal",s.pipeline.getPipeline(t,n,P);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=L(u.textures,u.count,s.limits.maxBatchableTextures)}P.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,P,t.topology);t.bindGroup._touch(s.gc.now,s.tick),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}N.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class V{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const g in i){const p=e.resources[g]??e.resources[i[g]];let h;if(p._resourceType==="uniformGroup"){const d=p;o.ubo.updateUniformGroup(d);const f=d.buffer;h={buffer:o.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(p._resourceType==="buffer"){const d=p;h={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(p._resourceType==="bufferResource"){const d=p;h={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(p._resourceType==="textureSampler"){const d=p;h=o.texture.getGpuSampler(d)}else if(p._resourceType==="textureSource"){const d=p;h=o.texture.getTextureView(d)}n.push({binding:i[g],resource:h})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){this._hash=null,this._renderer=null}}V.extension={type:[l.WebGPUSystem],name:"bindGroup"};class Ae{constructor(e){this.gpuBuffer=e}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null}}class j{constructor(e){this._renderer=e,this._managedBuffers=new k({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"})}contextChange(e){this._gpu=e}getGPUBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(e)}updateBuffer(e){const t=this.getGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){this._managedBuffers.removeAll()}onBufferUnload(e){e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this)}createGPUBuffer(e){const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e._resourceId=pe("resource"),e.data&&(le(e.data.buffer,t.getMappedRange(),e.data.byteOffset,e.data.byteLength),t.unmap()),e._gpuData[this._renderer.uid]=new Ae(t),this._managedBuffers.add(e)&&(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this)),t}onBufferChange(e){this._managedBuffers.remove(e),e._updateID=0,this.createGPUBuffer(e)}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null}}j.extension={type:[l.WebGPUSystem],name:"buffer"};class Le{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this.data=null}}class K{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}K.extension={type:[l.WebGPUSystem],name:"colorMask"};class U{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):this._createDeviceAndAdaptor(e)).then(t=>{this.gpu=t,this.extensions={transientAttachment:typeof GPUTextureUsage.TRANSIENT_ATTACHMENT=="number"},this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await T.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this.extensions=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class q{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.gc.now,this._renderer.tick);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(parseInt(s,10),e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u??t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u??t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1],this._renderer.renderTarget.mipLevel,this._renderer.renderTarget.layer);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}q.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class Y{constructor(e){this._renderer=e}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}Y.extension={type:[l.WebGPUSystem],name:"limits"};class ${constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:C.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}$.extension={type:[l.WebGPUSystem],name:"stencil"};const S={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function De(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=S[s.data.type].size;const n=S[s.data.type].align;if(!S[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function ke(a,e){const{size:t,align:r}=S[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
|
|
1
|
+
import{y as L,a as D,j as l,z as k,e as pe,H as le,D as T,c as C,d as B,B as fe,I as z,J as w,w as v,K as y,q as ge,L as me,N as O,O as R,r as G,M as F,Q as I,V as _e,W,X as be,S as H,T as E,A as xe,R as ye}from"./RelationshipGalaxyCanvas-CHPqtqQz.js";import{c as Ge,u as Pe,U as Se,B as Te,G as Be,e as Ce,l as ve,a as Ue,t as Me}from"./BufferResource-C-jLPrHv.js";import{R as we,S as Re,d as Ee}from"./RenderTargetSystem-BaIFulUj.js";import"./index-D9C3dyV8.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-iEQnKg2R.js";import"./Tabs-xVtuBuO0.js";import"./RovingFocusItem-Bqgmzo42.js";import"./useToast-Bmgpd3sl.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-DmVfwvnD.js";import"./people-page-header-DWXwFJ8M.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-rD_jWpbO.js";const P=D.for2d();class N{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),P.blendMode="normal",s.pipeline.getPipeline(t,n,P);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=L(u.textures,u.count,s.limits.maxBatchableTextures)}P.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,P,t.topology);t.bindGroup._touch(s.gc.now,s.tick),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}N.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class V{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const g in i){const p=e.resources[g]??e.resources[i[g]];let h;if(p._resourceType==="uniformGroup"){const d=p;o.ubo.updateUniformGroup(d);const f=d.buffer;h={buffer:o.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(p._resourceType==="buffer"){const d=p;h={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(p._resourceType==="bufferResource"){const d=p;h={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(p._resourceType==="textureSampler"){const d=p;h=o.texture.getGpuSampler(d)}else if(p._resourceType==="textureSource"){const d=p;h=o.texture.getTextureView(d)}n.push({binding:i[g],resource:h})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){this._hash=null,this._renderer=null}}V.extension={type:[l.WebGPUSystem],name:"bindGroup"};class Ae{constructor(e){this.gpuBuffer=e}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null}}class j{constructor(e){this._renderer=e,this._managedBuffers=new k({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"})}contextChange(e){this._gpu=e}getGPUBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(e)}updateBuffer(e){const t=this.getGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){this._managedBuffers.removeAll()}onBufferUnload(e){e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this)}createGPUBuffer(e){const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e._resourceId=pe("resource"),e.data&&(le(e.data.buffer,t.getMappedRange(),e.data.byteOffset,e.data.byteLength),t.unmap()),e._gpuData[this._renderer.uid]=new Ae(t),this._managedBuffers.add(e)&&(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this)),t}onBufferChange(e){this._managedBuffers.remove(e),e._updateID=0,this.createGPUBuffer(e)}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null}}j.extension={type:[l.WebGPUSystem],name:"buffer"};class Le{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this.data=null}}class K{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}K.extension={type:[l.WebGPUSystem],name:"colorMask"};class U{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):this._createDeviceAndAdaptor(e)).then(t=>{this.gpu=t,this.extensions={transientAttachment:typeof GPUTextureUsage.TRANSIENT_ATTACHMENT=="number"},this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await T.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this.extensions=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class q{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.gc.now,this._renderer.tick);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(parseInt(s,10),e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u??t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u??t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1],this._renderer.renderTarget.mipLevel,this._renderer.renderTarget.layer);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}q.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class Y{constructor(e){this._renderer=e}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}Y.extension={type:[l.WebGPUSystem],name:"limits"};class ${constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:C.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}$.extension={type:[l.WebGPUSystem],name:"stencil"};const S={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function De(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=S[s.data.type].size;const n=S[s.data.type].align;if(!S[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function ke(a,e){const{size:t,align:r}=S[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
|
|
2
2
|
v = uv.${a.data.name};
|
|
3
3
|
${e!==0?`offset += ${e};`:""}
|
|
4
4
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D9C3dyV8.js","assets/vendor-snapdom--nZvo8Sg.js","assets/index-BZpR015e.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as Lt,h as mt,b as W,e as ae,aB as nt,aG as tt,bP as ot,bQ as Jt,Z as Vt,bt as Gt,bR as ht,ap as Qt,ab as Yt,bS as Zt,aA as Xt,L as St,aF as me,bT as vt,a5 as Kt}from"./index-D9C3dyV8.js";import{u as es}from"./prompt-Cepfb-5-.js";import{C as Ft}from"./chatlabSiteLocale-CrCNb8QP.js";const Je="chart_runtime",ts=4e3,ss=`
|
|
3
|
+
…[truncated]`;function Ct(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function At(e){return!Ct(e)||!Array.isArray(e.content)?"":e.content.map(s=>Ct(s)&&s.type==="text"&&typeof s.text=="string"?s.text:"").filter(s=>s.length>0).join(`
|
|
4
|
+
`)}function bt(e,s=ts){return e.length<=s?e:e.slice(0,s)+ss}function pe(){return Lt("assistant-crud")}function Se(){return Lt("skill-crud")}const wt=Ft,ns={"zh-CN":"cn","zh-TW":"cn","en-US":"en","ja-JP":"ja"},qt=mt("assistant",()=>{const e=W([]),s=W(null),a=W(!1),c=new Set;let l=null;const p=W([]),C=W([]),A=W(!1),b=W(null),x=W("group"),q=W("zh-CN"),Y=ae(()=>s.value?e.value.find(h=>h.id===s.value)??null:null),D=ae(()=>e.value.filter(h=>{const k=!h.applicableChatTypes?.length||h.applicableChatTypes.includes(x.value),w=!h.supportedLocales?.length||h.supportedLocales.some(j=>q.value.startsWith(j));return k&&w})),z=4,ee=ae(()=>D.value.slice(0,z)),ne=ae(()=>D.value.slice(z)),$=ae(()=>D.value.length>z),O=ae(()=>{const h=new Set(e.value.map(k=>k.id));return C.value.map(k=>({...k,imported:h.has(k.id)}))});function Z(h,k){x.value=h,q.value=k}async function te(){try{const h=pe();e.value=await h.getAll(),a.value=!0}catch(h){console.error("[AssistantStore] Failed to load assistants:",h)}}async function Oe(){try{p.value=await pe().getBuiltinToolCatalog()}catch(h){console.error("[AssistantStore] Failed to load builtin tool catalog:",h)}}async function ye(h){const k=ns[h||q.value]??"en",w=`${wt}/${k}/assistant.json`;A.value=!0,b.value=null;try{const j=await nt().fetchRemoteConfig(w);if(!j.success||!j.data){b.value=j.error||"Failed to fetch cloud catalog",C.value=[];return}const De=j.data;if(!Array.isArray(De)){b.value="Invalid catalog format",C.value=[];return}C.value=De.filter(Me=>Me.id&&Me.name&&Me.path)}catch(j){b.value=String(j),C.value=[]}finally{A.value=!1}}async function Be(h){const k=`${wt}${h.path}`;try{const w=await nt().fetchRemoteConfig(k);if(!w.success||typeof w.data!="string")return{success:!1,error:w.error||"Failed to fetch assistant content"};const j=await pe().importFromMd(w.data);return j.success&&await te(),j}catch(w){return{success:!1,error:String(w)}}}function ve(h){return e.value.some(k=>k.id===h)}function V(h){s.value=h}function $e(){s.value=null}async function ze(h){try{return await pe().getConfig(h)}catch(k){return console.error("[AssistantStore] Failed to get config:",k),null}}async function ie(h,k){try{const w=await pe().update(h,k);return w.success&&await te(),w}catch(w){return{success:!1,error:String(w)}}}async function _e(h){try{const k=await pe().reset(h);return k.success&&await te(),k}catch(k){return{success:!1,error:String(k)}}}async function I(h){const k=tt(h);if(c.has(k))return null;c.add(k);try{const w=await pe().getUpgradeInfo(k);if(!w)return null;try{if(l||(l={...(await ot().getPreferences()).assistantUpgradeSkippedVersions}),w.latestVersion!==null&&l[w.builtinId]===w.latestVersion)return null}catch(j){console.error("[AssistantStore] Failed to load skipped assistant upgrades:",j)}return w}catch(w){return c.delete(k),console.error("[AssistantStore] Failed to check assistant upgrade:",w),null}}async function T(h){if(h.latestVersion===null)return{success:!1,error:"Assistant template version is unavailable"};try{l||(l={...(await ot().getPreferences()).assistantUpgradeSkippedVersions});const k={...l,[h.builtinId]:h.latestVersion},w=await ot().savePreferences({assistantUpgradeSkippedVersions:k});return w.success&&(l=k),w}catch(k){return{success:!1,error:String(k)}}}async function M(h,k){try{const w=await pe().upgradeWithBackup(h.assistantId,k);return w.success&&await te(),w}catch(w){return{success:!1,error:String(w)}}}async function le(h){try{const k=await pe().create(h);return k.success&&await te(),k}catch(k){return{success:!1,error:String(k)}}}async function Re(h){try{const k=pe(),w=await k.getConfig(h);if(!w)return{success:!1,error:"Assistant not found"};const{id:j,builtinId:De,...Me}=w,Qe=await k.create({...Me,name:`${w.name}${Jt.global.t("ai.assistant.duplicateSuffix")}`});return Qe.success&&await te(),Qe}catch(k){return{success:!1,error:String(k)}}}async function Ge(h){try{const k=await pe().delete(h);return k.success&&await te(),k}catch(k){return{success:!1,error:String(k)}}}return{assistants:e,selectedAssistantId:s,selectedAssistant:Y,isLoaded:a,builtinToolCatalog:p,cloudCatalog:C,cloudLoading:A,cloudError:b,cloudCatalogWithStatus:O,currentChatType:x,currentLocale:q,filteredAssistants:D,defaultAssistants:ee,moreAssistants:ne,hasMoreAssistants:$,loadAssistants:te,loadBuiltinToolCatalog:Oe,fetchCloudCatalog:ye,importFromCloud:Be,isCloudItemImported:ve,selectAssistant:V,clearSelection:$e,setFilterContext:Z,getAssistantConfig:ze,updateAssistant:ie,createAssistant:le,duplicateAssistant:Re,resetAssistant:_e,checkDefaultAssistantUpgrade:I,skipAssistantUpgrade:T,upgradeAssistantWithBackup:M,deleteAssistant:Ge}}),Bt=Ft,rs={"zh-CN":"cn","zh-TW":"cn","en-US":"en","ja-JP":"ja"},os=mt("skill",()=>{const e=W([]),s=W(null),a=W(!1),c=W([]),l=W([]),p=W(!1),C=W(null),A=W("group"),b=W("zh-CN");function x(){const I=b.value.startsWith("zh");return{id:Je,name:I?"绘图助手":"Chart Assistant",description:I?"按本轮问题生成灵活的聊天数据图表":"Generate flexible charts for this chat question",tags:[I?"图表":"chart"],chatScope:"all",tools:["render_chart","get_schema"],builtinId:Je}}const q=ae(()=>s.value?s.value===Je?x():e.value.find(I=>I.id===s.value)??null:null),Y=ae(()=>x()),D=ae(()=>e.value.filter(I=>I.chatScope==="all"||I.chatScope===A.value)),z=ae(()=>{const T=qt().selectedAssistant,M=[Y.value,...D.value];return T?M.filter(le=>(le.tools.length,!0)):M}),ee=ae(()=>{const I={};for(const T of z.value){const M=T.tags[0]||"other";I[M]||(I[M]=[]),I[M].push(T)}return I}),ne=ae(()=>{const I=new Set(e.value.map(T=>T.id));return l.value.map(T=>({...T,imported:I.has(T.id)}))});function $(I,T){A.value=I,T&&(b.value=T)}async function O(){try{e.value=await Se().getAll(),a.value=!0}catch(I){console.error("[SkillStore] Failed to load skills:",I)}}async function Z(){try{c.value=await Se().getBuiltinCatalog()}catch(I){console.error("[SkillStore] Failed to load builtin catalog:",I)}}async function te(){const I=rs[b.value]??"en",T=`${Bt}/${I}/skill.json`;p.value=!0,C.value=null;try{const M=await nt().fetchRemoteConfig(T);if(!M.success||!M.data){C.value=M.error||"Failed to fetch cloud catalog",l.value=[];return}const le=M.data;if(!Array.isArray(le)){C.value="Invalid catalog format",l.value=[];return}l.value=le.filter(Re=>Re.id&&Re.name&&Re.path)}catch(M){C.value=String(M),l.value=[]}finally{p.value=!1}}async function Oe(I){const T=`${Bt}${I.path}`;try{const M=await nt().fetchRemoteConfig(T);if(!M.success||typeof M.data!="string")return{success:!1,error:M.error||"Failed to fetch skill content"};const le=await Se().importFromMd(M.data);return le.success&&await O(),le}catch(M){return{success:!1,error:String(M)}}}function ye(I){return e.value.some(T=>T.id===I)}function Be(I){s.value=I}async function ve(I){if(I===Je)return{...x(),prompt:"",builtinId:Je};try{return await Se().getConfig(I)}catch(T){return console.error("[SkillStore] Failed to get skill config:",T),null}}async function V(I,T){try{const M=await Se().update(I,T);return M.success&&await O(),M}catch(M){return{success:!1,error:String(M)}}}async function $e(I){try{const T=await Se().create(I);return T.success&&await O(),T}catch(T){return{success:!1,error:String(T)}}}async function ze(I){try{const T=await Se().delete(I);return T.success&&(s.value===I&&(s.value=null),await O()),T}catch(T){return{success:!1,error:String(T)}}}async function ie(I){try{const T=await Se().importBuiltin(I);return T.success&&(await O(),await Z()),T}catch(T){return{success:!1,error:String(T)}}}async function _e(I){try{const T=await Se().reimport(I);return T.success&&(await O(),await Z()),T}catch(T){return{success:!1,error:String(T)}}}return{skills:e,activeSkillId:s,builtinCatalog:c,isLoaded:a,currentChatType:A,currentLocale:b,activeSkill:q,scopedSkills:D,compatibleSkills:z,groupedSkills:ee,cloudCatalog:l,cloudLoading:p,cloudError:C,cloudCatalogWithStatus:ne,setFilterContext:$,loadSkills:O,loadBuiltinCatalog:Z,fetchCloudCatalog:te,importFromCloud:Oe,isCloudItemImported:ye,activateSkill:Be,getSkillConfig:ve,updateSkill:V,createSkill:$e,deleteSkill:ze,importSkill:ie,reimportSkill:_e}});async function Ot(e){const{url:s,method:a="POST",headers:c={},body:l,signal:p,onEvent:C}=e,A=await Vt(s,{method:a,headers:{"Content-Type":"application/json",...c},body:l!=null?JSON.stringify(l):void 0,signal:p});if(!A.ok){const D=await A.text().catch(()=>"");throw new Error(`SSE request failed: HTTP ${A.status} ${D}`)}if(!A.body)throw new Error("SSE response has no body");const b=A.body.getReader(),x=new TextDecoder;let q="",Y="";for(;;){const{done:D,value:z}=await b.read();if(D)break;q+=x.decode(z,{stream:!0});const ee=q.split(`
|
|
5
|
+
`);q=ee.pop()||"";for(const ne of ee)ne.startsWith("event: ")?Y=ne.slice(7).trim():ne.startsWith("data: ")&&(C({event:Y,data:ne.slice(6)}),Y="")}q.trim()&&q.startsWith("data: ")&&C({event:Y,data:q.slice(6)})}function Ps(){return{async chatStream(e,s,a){let c;try{return await Ot({url:"/_web/ai/llm/chat-stream",body:{messages:e,options:s},onEvent:({data:l})=>{try{const p=JSON.parse(l);p.finishReason==="error"&&p.error&&(c=p.error),a?.(p)}catch{}}}),c?{success:!1,error:c}:{success:!0}}catch(l){const p=l instanceof Error?l.message:String(l);return{success:!1,error:c??p}}}}}const qe=new Map;function at(){return{runStream(e,s){const a=Date.now();ht("ai_request_started");const c=new AbortController,l=`local_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;qe.set(l,{serverId:"",abortController:c});const C=new Promise(A=>{let b="";const x=[];let q=0,Y,D=!1,z;Ot({url:"/_web/ai/agent/stream",body:e,signal:c.signal,onEvent:({event:ee,data:ne})=>{try{const $=JSON.parse(ne);if(ee==="meta"){const Z=qe.get(l);Z&&(Z.serverId=$.requestId??"");return}const O=$;switch(s?.(O),O.type){case"content":O.content&&(b+=O.content);break;case"tool_start":O.toolName&&x.push(O.toolName);break;case"status":O.status&&(q=O.status.round);break;case"done":O.usage&&(Y=O.usage);break;case"error":D=!0,z=O.error;break}}catch{}}}).then(()=>{qe.delete(l),A({success:!D,result:{content:b,toolsUsed:x,toolRounds:q,totalUsage:Y},...D&&z?{error:z}:{}})}).catch(ee=>{qe.delete(l),c.signal.aborted?A({success:!1,result:{content:b,toolsUsed:x,toolRounds:q,aborted:!0}}):A({success:!1,error:{name:"FetchError",message:ee.message??String(ee),stack:null}})})}).then(A=>(ht("ai_request_completed",{success:A.success,duration_ms:Date.now()-a,...A.success?{}:{failure_reason:A.result?.aborted?"aborted":A.error?.name==="FetchError"?"network":"unknown"}}),A));return{requestId:l,promise:C}},async abort(e){const s=qe.get(e);if(!s)return{success:!1,error:"Request not found"};if(s.abortController.abort(),s.serverId)try{const{post:a}=await Gt(async()=>{const{post:c}=await import("./index-D9C3dyV8.js").then(l=>l.dW);return{post:c}},__vite__mapDeps([0,1,2]));await a("/ai/agent/abort",{requestId:s.serverId})}catch{}return qe.delete(e),{success:!0}}}}function as(e){return e.desensitize&&!e.desensitizeRules.some(s=>s.builtin)}function is(e){if(e.dataCleaning||e.mergeConsecutive||e.blacklistKeywords.length>0||e.denoise||e.desensitize||e.anonymizeNames)return{dataCleaning:e.dataCleaning,mergeConsecutive:e.mergeConsecutive,mergeWindowSeconds:e.mergeWindowSeconds,blacklistKeywords:[...e.blacklistKeywords],denoise:e.denoise,desensitize:e.desensitize,desensitizeRules:e.desensitizeRules.map(a=>({...a,locales:[...a.locales]})),anonymizeNames:e.anonymizeNames}}function ge(e){return e==="render_chart"}function ls(e,s,a){if(!e||!ge(e))return null;const c=e;return{type:"tool",tool:{name:c,displayName:c,status:"running",params:s,toolCallId:a,transient:!0}}}function kt(e,s,a){if(!se(e))return!1;const c=e;return c.type!=="tool"||!c.tool||c.tool.transient!==!0||c.tool.name!==s||a&&c.tool.toolCallId!==a?!1:ge(String(c.tool.name))}function cs(e,s,a){let c=!1;const l=[...e];for(let p=l.length-1;p>=0;p--)if(kt(l[p],s,a)){l.splice(p,1),c=!0;break}return c?l:[...e]}function se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rt(e){return se(e)&&e.version===1&&se(e.spec)&&se(e.dataset)}function dt(e){if(!se(e))return[];const s=se(e.details)?e.details:e,a=[];if(Rt(s.chart)&&a.push(s.chart),Array.isArray(s.charts))for(const c of s.charts)Rt(c)&&a.push(c);return a}function $t(e){return{...e,dataset:{...e.dataset,rows:[]}}}function zt(e){return e.map(s=>({type:"chart",chart:$t(s)}))}function ft(e){return Array.isArray(e)?`[${e.map(ft).join(",")}]`:se(e)?`{${Object.keys(e).sort().map(s=>`${JSON.stringify(s)}:${ft(e[s])}`).join(",")}}`:JSON.stringify(e)}function Mt(e){const s=$t(e);return ft({spec:s.spec,columns:s.dataset.columns,data:s.data,rowCount:s.rowCount,truncated:s.truncated})}function us(e,s){const a=Mt(s);return e.some(c=>{if(!se(c))return!1;const l=c;return l.type==="chart"&&l.chart?Mt(l.chart)===a:!1})}function ds(e,s,a,c){const l=[...e];let p=-1;for(let x=l.length-1;x>=0;x--)if(kt(l[x],s,a)){p=x;break}const C=p>=0?l.filter((x,q)=>q!==p):l,A=c.filter(x=>!us(C,x)),b=zt(A);return p>=0?(l.splice(p,1,...b),l):[...l,...b]}function fs(e,s,a,c,l){if(c.length>0)return ds(e,s,a,c);if(l){let C=!1;const A=e.map(b=>{if(!kt(b,s,a))return b;C=!0;const x={...b.tool};return delete x.transient,{...b,tool:{...x,status:"error",result:l.error.message,displayResult:l.error.message,isError:!0}}});return C?A:[...e,l]}return cs(e,s,a)}function xs(e,s,a){const c=e[s];return!se(c)||c.type!=="error"||!se(c.error)||c.error.name!=="ChartRenderError"?!1:a?.isStreaming?!0:e.slice(s+1).some(l=>se(l)&&l.type==="chart")}function ps(e){return se(e)?typeof e.error=="string"?e.error:se(e.error)&&typeof e.error.message=="string"?e.error.message:Array.isArray(e.content)?e.content.map(s=>se(s)&&s.type==="text"&&typeof s.text=="string"?s.text:"").join(`
|
|
6
|
+
`).trim():null:null}function Pt(e,s){if(!ge(e)||dt(s).length>0)return null;const a=ps(s);if(!a)return null;const l=/^Error:\s*(.+)$/is.exec(a)?.[1]?.trim();return!l||/^Call get_schema before render_chart\b/i.test(l)?null:{type:"error",error:{name:"ChartRenderError",message:l,stack:null}}}function st(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function it(e){return st(e)&&e.version===1&&typeof e.query=="string"&&Array.isArray(e.groups)}function xt(e){if(!st(e))return null;const s=st(e.details)?e.details:null;if(s&&it(s.evidence))return s.evidence;const a=st(e.data)?e.data:null;return a&&it(a.evidence)?a.evidence:it(e.evidence)?e.evidence:null}function gs(e){return{type:"evidence",evidence:e}}function Ve(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lt(e){return Ve(e)?e.version===1&&typeof e.query=="string"&&Array.isArray(e.sources)&&Ve(e.coverage):!1}function ms(e){if(!Ve(e))return null;const s=Ve(e.details)?e.details:null;if(s&<(s.crossChatEvidence))return s.crossChatEvidence;const a=Ve(e.data)?e.data:null;return a&<(a.crossChatEvidence)?a.crossChatEvidence:lt(e.crossChatEvidence)?e.crossChatEvidence:null}function ks(e){return{type:"cross_chat_evidence",evidence:e}}function Et(e){return JSON.parse(JSON.stringify(e))}function yt(e){return JSON.parse(JSON.stringify(e))}function Wt(e){return e?.type==="plan_draft"&&typeof e.text=="string"}function ys(e,s){const a=e.map(yt),c=a[a.length-1];return Wt(c)?c.text+=s:a.push({type:"plan_draft",version:1,status:"streaming",text:s}),a}function Is(e,s){const a=e.map(yt);for(let c=a.length-1;c>=0;c--){const l=a[c];if(Wt(l)){const p=l.text.trim();return a[c]={...Et(s),...p?{displayText:p}:{}},a}}return a.push(Et(s)),a}function Ts(e){return e.filter(s=>s.type!=="plan_draft").map(yt)}function hs(e){if(e)for(let s=e.length-1;s>=0;s-=1){const a=e[s];if(a.type==="text"&&a.processDurationMs!==void 0)return a.processDurationMs}}function ct(e,s){if(!e)return;const a=e.findLastIndex(c=>c.type==="text");return a<0?e:e.map((c,l)=>l===a&&c.type==="text"?{...c,processDurationMs:s}:c)}function Nt(e){if(!e)return;const s=JSON.parse(JSON.stringify(e));for(const a of s)a.type==="tool"&&delete a.tool.displayResult;return s}function ut(e){return e.toolCallId?`id:${e.toolCallId}`:`name:${e.name}`}function _t(){const e=new Map;let s=null;const a=()=>{if(s){const l=e.get(s);if(l)return l}const c=Array.from(e.entries()).at(-1);return s=c?.[0]??null,c?.[1]??null};return{start(c){const l=ut(c),p={name:c.name,displayName:c.name,status:"running",toolCallId:c.toolCallId};return e.set(l,p),s=l,p},update(c){const l=ut(c),p=e.get(l);if(!p)return a();const C={...p,progress:c.progress};return e.set(l,C),s=l,C},finish(c){const l=ut(c),p=e.get(l);e.delete(l),s===l&&(s=null);const C=a();return C||(p?{...p,status:c.status}:null)},current(){return a()},clear(){e.clear(),s=null}}}function Ss(e,s){if(!e.isStreaming)return null;const a=e.contentBlocks?[...e.contentBlocks]:[];let c=e.content,l=!1;for(const p of s){const C=a[a.length-1];if(p.type==="content"){if(p.content.trim().length===0&&C?.type!=="text")continue;C?.type==="text"?C.text=(C.text||"")+p.content:a.push({type:"text",text:p.content}),c+=p.content,l=!0;continue}const A=p.thinkTag||"think";C?.type==="think"&&C.tag===A?(C.text=(C.text||"")+p.content,l=!0):p.content.trim().length>0&&(a.push({type:"think",tag:A,text:p.content}),l=!0)}return l?{content:c,contentBlocks:a}:{content:e.content,contentBlocks:e.contentBlocks||[]}}function vs(){return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?{request:e=>requestAnimationFrame(e),cancel:e=>cancelAnimationFrame(e)}:{request:e=>setTimeout(e,16),cancel:e=>clearTimeout(e)}}function Cs(e,s=vs()){let a=null,c=[];function l(){if(a!==null&&(s.cancel(a),a=null),c.length===0)return;const A=c;c=[],e(A)}function p(A){const b=c[c.length-1];b?.type==="content"&&A.type==="content"||b?.type==="think"&&A.type==="think"&&b.thinkTag===A.thinkTag?b.content+=A.content:c.push({...A}),a===null&&(a=s.request(()=>{a=null,l()}))}function C(){a!==null&&(s.cancel(a),a=null),c=[]}return{push:p,flush:l,cancel:C}}const ke="__draft__";function As(e){return e?`${e.startTs}_${e.endTs}`:"all"}function bs(e){return e.kind==="global"?"global":`${e.sessionId}:${e.chatType}:${As(e.timeFilter)}`}function pt(){return{promptTokens:0,completionTokens:0,totalTokens:0,cacheReadTokens:0,cacheWriteTokens:0}}function Dt(e){return{promptTokens:e.promptTokens??0,completionTokens:e.completionTokens??0,totalTokens:e.totalTokens??0,cacheReadTokens:e.cacheReadTokens??0,cacheWriteTokens:e.cacheWriteTokens??0}}function Ke(e){if(e&&typeof e=="object"){const s=e;return{name:typeof s.name=="string"?s.name:null,message:typeof s.message=="string"?s.message:"未知错误",stack:typeof s.stack=="string"?s.stack:null,statusCode:typeof s.statusCode=="number"?s.statusCode:null,url:typeof s.url=="string"?s.url:null,responseBody:typeof s.responseBody=="string"?s.responseBody:null,responseHeaders:s.responseHeaders&&typeof s.responseHeaders=="object"?s.responseHeaders:null,requestBody:typeof s.requestBody=="string"?s.requestBody:null,cause:typeof s.cause=="string"?s.cause:null,provider:typeof s.provider=="string"?s.provider:null,friendlyMessage:typeof s.friendlyMessage=="string"?s.friendlyMessage:null}}return{name:null,message:e?String(e):"未知错误",stack:null}}function et(e){const s=e.contentBlocks;return{id:e.id,role:e.role,content:e.content,timestamp:e.timestamp*1e3,parentId:e.parentId,contentBlocks:s,processDurationMs:hs(s),entityRefs:e.entityRefs}}function gt(e=null){return{messages:[],sourceMessages:[],currentKeywords:[],assistantId:e,loaded:!1}}function ws(e){const s=gt(null);return{kind:e.kind??"session",sessionId:e.sessionId,sessionName:e.sessionName,chatType:e.chatType,locale:e.locale,timeFilter:e.timeFilter,selectedAssistantId:null,messages:s.messages,sourceMessages:s.sourceMessages,currentKeywords:s.currentKeywords,isLoadingSource:!1,isAIThinking:!1,currentAIChatId:null,currentToolStatus:null,toolsUsedInCurrentRound:[],sessionTokenUsage:pt(),agentStatus:null,ownerInfo:void 0,ownerInfoInitialized:!1,isAborted:!1,currentRequestId:"",currentAgentRequestId:"",aiChatBuffers:{[ke]:s}}}function Ut(e){return e.currentAIChatId??ke}const Es=mt("aiChatRuntime",()=>{const e=W({}),s=W(null),a=es(),c=Qt(),l=Yt(),p=qt(),C=os(),A=Zt(),{aiGlobalSettings:b}=Xt(a);let x=null;const q=new Map;function Y(n){const t=(q.get(n)??0)+1;return q.set(n,t),t}function D(n,t){return q.get(n)===t}function z(n){return`${n}_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function ee(n){const t=bs(n),i=e.value[t];if(i)return i.sessionName=n.sessionName,i.chatType=n.chatType,i.locale=n.locale,i.timeFilter=n.timeFilter,{chatKey:t,state:i};const r=ws(n);e.value[t]=r;const u=e.value[t];return Be(t),{chatKey:t,state:u}}function ne(n){return ee({kind:"global",sessionId:"",sessionName:"Global AI analysis",chatType:"group",locale:n})}function $(n){return e.value[n]??null}function O(){return s.value?$(s.value.chatKey):null}function Z(n,t,i=null){return n.aiChatBuffers[t]||(n.aiChatBuffers[t]=gt(i)),n.aiChatBuffers[t]}function te(n,t){const i=n.currentAIChatId??ke,r=n.aiChatBuffers[i];r&&(r.sessionTokenUsage={...n.sessionTokenUsage});const u=Z(n,t);n.currentAIChatId=t===ke?null:t,n.messages=u.messages,n.sourceMessages=u.sourceMessages,n.currentKeywords=u.currentKeywords,n.selectedAssistantId=u.assistantId,n.sessionTokenUsage=u.sessionTokenUsage?{...u.sessionTokenUsage}:pt(),n.agentStatus=null}function Oe(n,t,i){const r=Z(n,t);return n.aiChatBuffers[i]=r,t!==i&&delete n.aiChatBuffers[t],n.currentAIChatId===null&&t===ke&&(n.currentAIChatId=i),r}function ye(n){const t=$(n);t&&(t.selectedAssistantId?p.selectAssistant(t.selectedAssistantId):p.clearSelection())}async function Be(n){const t=$(n);if(!t||t.kind==="global")return;const r=c.sessions.find(u=>u.id===t.sessionId)?.ownerId;if(!r){t.ownerInfo=void 0,t.ownerInfoInitialized=!0;return}if(!(t.ownerInfoInitialized&&t.ownerInfo?.platformId===r))try{const B=(await St().getMembers(t.sessionId)).find(f=>f.platformId===r);t.ownerInfo=B?{platformId:r,displayName:B.groupNickname||B.accountName||r}:{platformId:r,displayName:r},t.ownerInfoInitialized=!0}catch(u){console.error("[AI] 获取 Owner 信息失败:",u),t.ownerInfo=void 0,t.ownerInfoInitialized=!0}}function ve(n,t,i,r=null){const u=$(n);u&&(s.value={requestId:i,kind:u.kind,chatKey:n,sessionId:u.sessionId,sessionName:u.sessionName,chatType:u.chatType,aiChatId:r,questionPreview:t.trim().slice(0,80),startedAt:Date.now()})}function V(n,t){s.value&&s.value.chatKey===n&&(t&&s.value.requestId!==t||(s.value=null))}function $e(n,t){s.value&&s.value.chatKey===n&&(s.value.aiChatId=t)}function ze(n){return{phase:"preparing",round:0,toolsUsed:n.toolsUsedInCurrentRound.length,contextTokens:0,totalUsage:{...n.sessionTokenUsage},updatedAt:Date.now()}}function ie(n,t,i){const r=n.agentStatus?{...n.agentStatus}:ze(n);n.agentStatus={...r,...i,phase:t,updatedAt:Date.now()}}function _e(n,t){const i=$(n);if(!i||i.isAIThinking)return!1;const r=Z(i,Ut(i),t);return r.assistantId=t,i.selectedAssistantId=t,p.selectAssistant(t),!0}async function I(n,t,i){const r=$(n);if(!r||!D(n,i))return!1;try{const u=await me().getAIChat(t);if(!D(n,i))return!1;const B=u?.kind===r.kind&&(r.kind==="global"||u.sessionId===r.sessionId);if(!u||!B)return!1;const f=Z(r,t,u.assistantId);if(!f.loaded){const[y,v]=await Promise.all([me().getMessages(t),me().getAIChatTokenUsage(t)]);if(!D(n,i))return!1;f.messages.splice(0,f.messages.length,...y.map(R=>et(R))),f.sourceMessages.splice(0,f.sourceMessages.length),f.currentKeywords.splice(0,f.currentKeywords.length),f.sessionTokenUsage=Dt(v),f.loaded=!0}return D(n,i)?(f.assistantId=u.assistantId,te(r,t),ye(n),!0):!1}catch(u){return D(n,i)&&console.error("[AI] 加载对话历史失败:",u),!1}}async function T(n,t){return $(n)?I(n,t,Y(n)):!1}function M(n,t){const i=$(n);if(!i)return!1;const r=t??ke;return i.aiChatBuffers[r]?(Y(n),te(i,r),ye(n),!0):!1}function le(){if(!s.value)return!1;const n=s.value,t=M(n.chatKey,n.aiChatId);return x=t&&n.kind==="session"?n.chatKey:null,t}async function Re(n,t){const i=x===n;if(x=null,i)return;const r=$(n);if(!r||r.isAIThinking)return;const u=Y(n);if(!(!p.isLoaded&&(await p.loadAssistants(),!D(n,u)))&&!(t&&(await I(n,t,u)||!D(n,u)))){try{const B=(await me().getAIChats(r.sessionId))[0];if(!D(n,u)||B&&B.id!==t&&(await I(n,B.id,u)||!D(n,u)))return}catch(B){if(!D(n,u))return;console.error("[AI] Failed to load the latest conversation:",B)}if(D(n,u)){if(!r.selectedAssistantId){const B=tt(r.locale);_e(n,B)}Ge(n)}}}function Ge(n,t){const i=$(n);if(!i||i.isAIThinking)return!1;Y(n);const r=gt(i.selectedAssistantId);return i.aiChatBuffers[ke]=r,te(i,ke),i.currentToolStatus=null,i.toolsUsedInCurrentRound=[],i.isLoadingSource=!1,i.sessionTokenUsage=pt(),i.agentStatus=null,i.isAborted=!1,i.currentRequestId="",i.currentAgentRequestId="",t&&r.messages.push({id:z("welcome"),role:"assistant",content:t,timestamp:Date.now()}),!0}function h(n,t){let i;const r=m=>{const S=t();n.messages[S]={...n.messages[S],...m}},u=(m,S,g)=>{const U=t(),P=n.messages[U].contentBlocks||[],K=S||"think",H=P[P.length-1];let L=H;if(H&&H.type==="think"&&H.tag===K)H.text+=m;else if(m.trim().length>0)L={type:"think",tag:K,text:m},P.push(L);else if(g!==void 0)for(let J=P.length-1;J>=0;J--){const Ce=P[J];if(Ce.type==="think"&&Ce.tag===K){L=Ce;break}}g!==void 0&&L&&L.type==="think"&&(L.durationMs=g),r({contentBlocks:[...P]})},B=Cs(m=>{const S=t(),g=n.messages[S],U=Ss(g,m);U&&r({content:U.content,contentBlocks:U.contentBlocks})}),f=()=>B.flush(),y=()=>B.cancel(),v=m=>{f(),r(m)};return{updateAIMessage:v,appendTextToBlocks:m=>{m&&(m.trim().length>0&&i===void 0&&(i=Date.now()),B.push({type:"content",content:m}))},appendThinkToBlocks:(m,S,g)=>{!m&&g===void 0||(m&&B.push({type:"think",content:m,thinkTag:S}),g!==void 0&&(f(),u("",S,g)))},appendChartsToBlocks:m=>{if(m.length===0)return;f();const S=t(),g=n.messages[S].contentBlocks||[];g.push(...zt(m)),v({contentBlocks:[...g]})},appendEvidenceToBlocks:m=>{f();const S=t(),g=n.messages[S].contentBlocks||[];g.push(gs(m)),v({contentBlocks:[...g]})},appendCrossChatEvidenceToBlocks:m=>{f();const S=t(),g=n.messages[S].contentBlocks||[];g.push(ks(m)),v({contentBlocks:[...g]})},appendPlanDraftToBlocks:m=>{if(!m)return;f();const S=t(),g=n.messages[S].contentBlocks||[];v({contentBlocks:[...ys(g,m)]})},appendPlanToBlocks:m=>{f();const S=t(),g=n.messages[S].contentBlocks||[];v({contentBlocks:[...Is(g,m)]})},removePlanDraftsFromBlocks:()=>{f();const m=t(),S=n.messages[m].contentBlocks||[];v({contentBlocks:[...Ts(S)]})},updatePlanBlockStatus:m=>{f();const S=t(),g=n.messages[S].contentBlocks||[];for(let U=g.length-1;U>=0;U--){const P=g[U];if(P.type==="plan"){P.status=m;break}}v({contentBlocks:[...g]})},appendErrorToBlocks:m=>{f();const S=t(),g=n.messages[S].contentBlocks||[];g.push({type:"error",error:m}),v({contentBlocks:[...g]})},addToolBlock:(m,S,g)=>{f();const U=t(),P=n.messages[U].contentBlocks||[];P.push({type:"tool",tool:{name:m,displayName:m,status:"running",params:S,toolCallId:g}}),v({contentBlocks:[...P]})},addRenderOnlyToolPendingBlock:(m,S,g)=>{const U=ls(m,S,g);if(!U)return;f();const P=t(),K=n.messages[P].contentBlocks||[];K.push(U),v({contentBlocks:[...K]})},updateRenderOnlyToolResult:(m,S,g,U)=>{f();const P=t(),K=n.messages[P].contentBlocks||[];v({contentBlocks:fs(K,m,S,g,U)})},updateToolBlockStatus:(m,S,g)=>{f();const U=t(),P=n.messages[U].contentBlocks||[],K=L=>L.type==="tool"&&L.tool.status==="running";let H;if(g?.toolCallId)for(let L=P.length-1;L>=0;L--){const J=P[L];if(K(J)&&J.tool.toolCallId===g.toolCallId){H=J;break}}if(!H)for(let L=P.length-1;L>=0;L--){const J=P[L];if(K(J)&&J.tool.name===m){H=J;break}}H&&(H.tool.status=S,g?.result!==void 0&&(H.tool.result=g.result),g?.displayResult!==void 0&&(H.tool.displayResult=g.displayResult),g?.isError!==void 0&&(H.tool.isError=g.isError)),v({contentBlocks:[...P]})},completeTurn:m=>{f();const S=i;if(i=void 0,m||S===void 0)return;const g=t(),U=n.messages[g];if(!U||U.processDurationMs!==void 0)return;const P=Math.max(0,S-U.timestamp);r({processDurationMs:P,contentBlocks:ct(U.contentBlocks,P)})},settleProcessDuration:()=>{f();const m=t(),S=n.messages[m];if(!S||S.processDurationMs!==void 0)return;const g=Math.max(0,Date.now()-S.timestamp);r({processDurationMs:g,contentBlocks:ct(S.contentBlocks,g)})},flushPendingText:f,discardPendingText:y}}async function k(n,t,i){const r=$(n);if(!r)return{success:!1,reason:"error"};if(!t.trim())return{success:!1,reason:"empty"};if(r.isAIThinking||s.value)return{success:!1,reason:"busy",activeTask:s.value};const u=z("req"),B=Ut(r);let f=B===ke?null:B;const y=Z(r,B,r.selectedAssistantId);let v,R;const G=new Set;let Q=null;y.assistantId=r.selectedAssistantId,y.loaded=!0,ve(n,t,u,f),ye(n),r.kind==="session"&&Be(n);const ce=r.kind==="session"?C.activeSkillId:null,Ie=r.kind==="session"?C.activeSkill?.name:null,Ue=b.value.enableAutoSkill??!0,Ye=Ue?b.value.chartAutoMode??"suggest":"explicit",We=(i?.mentionedMembers??[]).map(E=>({memberId:E.memberId,platformId:E.platformId,displayName:E.displayName,aliases:[...E.aliases],mentionText:E.mentionText})),X=(i?.entityRefs??[]).map(E=>({...E}));r.isAIThinking=!0,r.isLoadingSource=!0,r.currentToolStatus=null,r.toolsUsedInCurrentRound=[],r.agentStatus=null,r.isAborted=!1,r.currentRequestId=u,r.currentAgentRequestId="";try{const E=await vt().hasConfig();if(r.isAborted)return V(n,u),{success:!1,reason:"aborted"};if(r.currentRequestId!==u)return V(n,u),{success:!1,reason:"busy",activeTask:s.value};if(!E)return y.messages.push({id:z("error"),role:"assistant",content:"⚠️ 请先配置 AI 服务。点击左下角「设置」按钮前往「模型配置Tab」进行配置。",timestamp:Date.now()}),V(n,u),{success:!1,reason:"no_config"};const N={id:z("user"),role:"user",content:t,timestamp:Date.now(),toolCalls:[],entityRefs:X};v=N,y.messages.push(N);const Pe={id:z("ai"),role:"assistant",content:"",timestamp:Date.now(),isStreaming:!0,contentBlocks:[]};ce&&Ie&&Pe.contentBlocks.push({type:"skill",skillId:ce,skillName:Ie}),y.messages.push(Pe);try{i?.onAccepted?.()}catch(o){console.error("[AI] Failed to acknowledge accepted user message:",o)}let _=y.messages.length-1,ue=!1;const re=_t(),{updateAIMessage:Te,appendTextToBlocks:m,appendThinkToBlocks:S,appendChartsToBlocks:g,appendEvidenceToBlocks:U,appendCrossChatEvidenceToBlocks:P,appendPlanDraftToBlocks:K,appendPlanToBlocks:H,removePlanDraftsFromBlocks:L,updatePlanBlockStatus:J,appendErrorToBlocks:Ce,addToolBlock:je,addRenderOnlyToolPendingBlock:rt,updateRenderOnlyToolResult:de,updateToolBlockStatus:xe,completeTurn:Ze,settleProcessDuration:Ae,flushPendingText:Le}=h(y,()=>_),be=async()=>{m(`
|
|
7
|
+
|
|
8
|
+
_(已停止生成)_`),Ae(),L(),J("skipped");for(const F of y.messages[_].contentBlocks||[])F.type==="tool"&&F.tool.status==="running"&&(F.tool.status="error");Te({isStreaming:!1});const o=await w(f,N,y.messages[_],R,[...G],Q);return o?(Object.assign(N,o.userMessage),y.messages[_]={...y.messages[_],...o.assistantMessage,isStreaming:!1},{success:!1,reason:"aborted"}):{success:!1,reason:"error"}},he=y.assistantId??tt(r.locale);if(!f){const o=t.slice(0,50)+(t.length>50?"...":""),F=r.kind==="global"?await me().createGlobalAIChat(o,he):await me().createAIChat(r.sessionId,o,he);if(r.isAborted)return Ae(),Te({isStreaming:!1}),V(n,u),{success:!1,reason:"aborted"};if(r.currentRequestId!==u)return Ae(),Te({isStreaming:!1}),V(n,u),{success:!1,reason:"busy",activeTask:s.value};f=F.id,Oe(r,ke,F.id),y.assistantId=he,$e(n,F.id)}const Ee={sessionId:r.sessionId,aiChatId:f,timeFilter:r.timeFilter?{startTs:r.timeFilter.startTs,endTs:r.timeFilter.endTs}:void 0,maxMessagesLimit:b.value.maxMessagesPerRequest,ownerInfo:r.ownerInfo?{platformId:r.ownerInfo.platformId,displayName:r.ownerInfo.displayName}:void 0,mentionedMembers:We.length>0?We:void 0,preprocessConfig:await j(),searchContextBefore:b.value.searchContextBefore,searchContextAfter:b.value.searchContextAfter};if(r.isAborted)return await be();const{requestId:oe,promise:Xe}=at().runStream({userMessage:t,chatKind:r.kind,sessionId:r.kind==="session"?r.sessionId:void 0,entityRefs:r.kind==="global"&&X.length>0?X:void 0,aiChatId:f,timeFilter:Ee.timeFilter,maxMessagesLimit:Ee.maxMessagesLimit,ownerInfo:r.kind==="session"?Ee.ownerInfo:void 0,mentionedMembers:r.kind==="session"?Ee.mentionedMembers:void 0,preprocessConfig:Ee.preprocessConfig,chatType:r.chatType,locale:r.locale,assistantId:he,skillId:r.kind==="session"?ce:void 0,enableAutoSkill:r.kind==="session"&&!ce?Ue:void 0,chartAutoMode:r.kind==="session"&&!ce?Ye:void 0,thinkingLevel:(()=>{const o=A.defaultAssistant;if(!(!o?.configId||!o?.modelId))return a.getThinkingLevel(o.configId,o.modelId)})()},o=>{if(!(r.isAborted||u!==r.currentRequestId))switch(o.type){case"content":o.content&&(r.currentToolStatus=re.current(),m(o.content));break;case"think":o.content?S(o.content,o.thinkTag):o.thinkDurationMs!==void 0&&S("",o.thinkTag,o.thinkDurationMs);break;case"tool_start":if(o.toolName){const F=o.toolParams;r.currentToolStatus=re.start({name:o.toolName,toolCallId:o.toolCallId}),r.toolsUsedInCurrentRound.push(o.toolName),ge(o.toolName)?rt(o.toolName,F,o.toolCallId):je(o.toolName,F,o.toolCallId)}break;case"tool_update":Le(),o.toolName&&o.toolProgress&&(r.currentToolStatus=re.update({name:o.toolName,toolCallId:o.toolCallId,progress:o.toolProgress}));break;case"tool_result":if(o.toolName){const F=dt(o.toolResult),d=Pt(o.toolName,o.toolResult);ge(o.toolName)?de(o.toolName,o.toolCallId,F,d):g(F);const fe=xt(o.toolResult);fe&&U(fe);const Ne=ms(o.toolResult);Ne&&P(Ne),d&&(ge(o.toolName)||Ce(d.error));const Fe=d!==null||o.toolIsError===!0;if(r.currentToolStatus?.name===o.toolName&&(r.currentToolStatus={...r.currentToolStatus,status:Fe?"error":"done"}),!ge(o.toolName)){const He=At(o.toolResult);xe(o.toolName,Fe?"error":"done",{toolCallId:o.toolCallId,result:bt(He),displayResult:He,isError:o.toolIsError})}r.currentToolStatus=re.finish({name:o.toolName,toolCallId:o.toolCallId,status:Fe?"error":"done"})}r.isLoadingSource=!1;break;case"plan_delta":o.planDelta&&K(o.planDelta);break;case"memory_change":o.memoryId&&G.add(o.memoryId),o.provenanceToken&&(Q=o.provenanceToken);break;case"plan":o.plan&&(H(o.plan),J("executing"));break;case"plan_skipped":L();break;case"turn_end":Ze(!!o.hadToolCalls);break;case"status":Le(),o.status&&(!r.agentStatus||o.status.updatedAt>=r.agentStatus.updatedAt)&&(r.agentStatus=o.status);break;case"compression_done":if(Le(),o.compressionResult){const F={id:`summary-${Date.now()}`,role:"summary",content:o.compressionResult.summaryContent,timestamp:o.compressionResult.timestamp},d=Math.max(0,y.messages.length-2);y.messages.splice(d,0,F),_++}break;case"done":Ae(),re.clear(),r.currentToolStatus=null,ue||J("done"),o.usage&&(R={...o.usage},r.sessionTokenUsage={promptTokens:r.sessionTokenUsage.promptTokens+o.usage.promptTokens,completionTokens:r.sessionTokenUsage.completionTokens+o.usage.completionTokens,totalTokens:r.sessionTokenUsage.totalTokens+o.usage.totalTokens,cacheReadTokens:r.sessionTokenUsage.cacheReadTokens+o.usage.cacheReadTokens,cacheWriteTokens:r.sessionTokenUsage.cacheWriteTokens+o.usage.cacheWriteTokens}),ie(r,ue?"error":"completed",o.usage?{totalUsage:o.usage}:void 0);break;case"error":if(Ae(),L(),J("skipped"),r.currentToolStatus&&(r.currentToolStatus={...r.currentToolStatus,status:"error"},xe(r.currentToolStatus.name,"error",{toolCallId:r.currentToolStatus.toolCallId})),re.clear(),!ue){ue=!0;const F=y.messages[_].contentBlocks||[];F.push({type:"error",error:Ke(o.error)}),Te({contentBlocks:[...F],isStreaming:!1})}ie(r,"error");break}});r.currentAgentRequestId=oe,ve(n,t,oe,f);const we=await Xe;if(r.isAborted)return await be();if(Le(),u!==r.currentRequestId)return V(n,oe),{success:!1,reason:"busy",activeTask:s.value};if(we.success&&we.result){y.messages[_]={...y.messages[_],dataSource:{toolsUsed:we.result.toolsUsed,toolRounds:we.result.toolRounds},isStreaming:!1};const o=await w(f,N,y.messages[_],R,[...G],Q);if(!o)return{success:!1,reason:"error"};Object.assign(N,o.userMessage),y.messages[_]={...y.messages[_],...o.assistantMessage,isStreaming:!1}}else if(ue){const o=await w(f,N,y.messages[_],R,[...G],Q);if(!o)return{success:!1,reason:"error"};Object.assign(N,o.userMessage),y.messages[_]={...y.messages[_],...o.assistantMessage,isStreaming:!1}}else{ie(r,"error");const o=y.messages[_].contentBlocks||[];o.push({type:"error",error:Ke(we.error)}),y.messages[_]={...y.messages[_],contentBlocks:[...o],isStreaming:!1};const F=await w(f,N,y.messages[_],R,[...G],Q);if(!F)return{success:!1,reason:"error"};Object.assign(N,F.userMessage),y.messages[_]={...y.messages[_],...F.assistantMessage,isStreaming:!1}}return we.success?{success:!0}:{success:!1,reason:"error"}}catch(E){console.error("[AI] 处理失败:",E),r.agentStatus=null;const N=y.messages[y.messages.length-1];if(N&&N.role==="assistant"){const Pe={name:E instanceof Error?E.name:null,message:E instanceof Error?E.message:String(E),stack:E instanceof Error?E.stack??null:null},_=N.contentBlocks||[];_.push({type:"error",error:Pe}),N.contentBlocks=[..._];const ue=N.processDurationMs??Math.max(0,Date.now()-N.timestamp);N.processDurationMs=ue,N.contentBlocks=ct(N.contentBlocks,ue),N.isStreaming=!1;const re=v||y.messages.findLast(Te=>Te.role==="user");re&&await w(f,re,N,R,[...G],Q)}return{success:!1,reason:"error"}}finally{r.isAIThinking=!1,r.isLoadingSource=!1,r.currentToolStatus=null,r.isAborted=!1,r.currentRequestId="",r.currentAgentRequestId="",V(n)}}async function w(n,t,i,r,u=[],B=null){try{if(!n)return null;const f=Nt(i.contentBlocks),{userMessage:y,assistantMessage:v}=await me().addMessagePair(n,{content:t.content,entityRefs:t.entityRefs},{content:i.content,contentBlocks:f,tokenUsage:r});if(u.length>0)try{if(!B)throw new Error("Memory provenance token is missing");await me().linkAIMemorySources({provenanceToken:B,aiChatId:n,userMessageId:y.id,assistantMessageId:v.id,memoryIds:u})}catch(R){Kt("AI memory source linking failed",R instanceof Error?R.stack:void 0)}return{userMessage:et(y),assistantMessage:et(v)}}catch(f){return console.error("[AI] 保存对话失败:",f),null}}async function j(){const n=l.aiPreprocessConfig;return as(n)&&await l.ensureDesensitizeRules(),is(l.aiPreprocessConfig)}function De(n){return n.trim().replace(/^[\s"'“”‘’([{<]+|[\s"'“”‘’)\]}>.,!?;:,。!?;:、]+$/g,"").toLocaleLowerCase()}async function Me(n,t){const i=new Set;for(const r of t.matchAll(/@([^\s@]+)/g)){const u=De(r[1]??"");u&&i.add(u)}if(i.size===0)return[];try{const r=await St().getMembers(n.sessionId),u=new Map;r.forEach(v=>{const R=v.groupNickname||v.accountName||v.platformId;u.set(R,(u.get(R)??0)+1)});const B=r.map(v=>{const R=v.groupNickname||v.accountName||v.platformId,G=(u.get(R)??0)>1?`${R}·${v.platformId}`:R,Q=[...v.aliases],ce=[R,v.groupNickname||"",v.accountName||"",v.platformId,G,...Q].map(De).filter(Boolean);return{memberId:v.id,platformId:v.platformId,displayName:R,aliases:Q,mentionText:`@${G}`,lookupValues:ce}}),f=[],y=new Set;for(const v of i){const R=B.find(G=>!y.has(G.memberId)&&G.lookupValues.includes(v));R&&(y.add(R.memberId),f.push({memberId:R.memberId,platformId:R.platformId,displayName:R.displayName,aliases:R.aliases,mentionText:R.mentionText}))}return f}catch(r){return console.error("[AI] Failed to resolve mentioned members for edited message:",r),[]}}async function Qe(n,t,i){const r=$(n),u=i.trim();if(!r||!r.currentAIChatId)return{success:!1,reason:"error"};if(!u)return{success:!1,reason:"empty"};if(r.isAIThinking||s.value)return{success:!1,reason:"busy",activeTask:s.value};const B=Z(r,r.currentAIChatId,r.selectedAssistantId),f=B.messages.findIndex(Q=>Q.id===t),y=B.messages[f];if(!y||y.role!=="user"||y.isStreaming)return{success:!1,reason:"error"};if(y.content.trim()===u)return{success:!1,reason:"empty"};const v=B.messages.findLastIndex(Q=>Q.role==="user"),R=B.messages.slice(f+1);return f===v&&(R.length===0||R.length===1&&R[0]?.role==="assistant")?jt(n,r,B,f,y,u):{success:!1,reason:"error"}}async function jt(n,t,i,r,u,B){const f=z("req");let y,v=!1;const R=_t();ve(n,B,f,t.currentAIChatId),ye(n),Be(n),t.isAIThinking=!0,t.isLoadingSource=!0,t.currentToolStatus=null,t.toolsUsedInCurrentRound=[],t.agentStatus=null,t.isAborted=!1,t.currentRequestId=f,t.currentAgentRequestId="";const G=i.messages[r+1],Q=G?.role==="assistant",ce={id:z("ai"),role:"assistant",content:"",timestamp:Date.now(),isStreaming:!0,contentBlocks:[]},Ie=C.activeSkillId,Ue=C.activeSkill?.name;Ie&&Ue&&ce.contentBlocks.push({type:"skill",skillId:Ie,skillName:Ue});const Ye={...u,content:B},We=Q?2:1;i.messages.splice(r,We,Ye,ce);const X=r+1,E=()=>{i.messages.splice(r,i.messages.length-r,u),Q&&i.messages.splice(r+1,0,G)},{updateAIMessage:N,appendTextToBlocks:Pe,appendThinkToBlocks:_,appendChartsToBlocks:ue,appendEvidenceToBlocks:re,appendPlanDraftToBlocks:Te,appendPlanToBlocks:m,removePlanDraftsFromBlocks:S,updatePlanBlockStatus:g,appendErrorToBlocks:U,addToolBlock:P,addRenderOnlyToolPendingBlock:K,updateRenderOnlyToolResult:H,updateToolBlockStatus:L,completeTurn:J,settleProcessDuration:Ce,flushPendingText:je,discardPendingText:rt}=h(i,()=>X);try{if(!await vt().hasConfig())return E(),V(n,f),{success:!1,reason:"no_config"};const xe=i.assistantId??tt(t.locale),Ze=await Me(t,B);if(t.isAborted)return E(),V(n,f),{success:!1,reason:"aborted"};if(f!==t.currentRequestId)return E(),V(n,f),{success:!1,reason:"busy",activeTask:s.value};const Ae=b.value.enableAutoSkill??!0,Le=Ae?b.value.chartAutoMode??"suggest":"explicit",be={sessionId:t.sessionId,aiChatId:t.currentAIChatId,historyLeafMessageId:u.parentId??null,timeFilter:t.timeFilter?{startTs:t.timeFilter.startTs,endTs:t.timeFilter.endTs}:void 0,maxMessagesLimit:b.value.maxMessagesPerRequest,ownerInfo:t.ownerInfo?{platformId:t.ownerInfo.platformId,displayName:t.ownerInfo.displayName}:void 0,mentionedMembers:Ze.length>0?Ze:void 0,preprocessConfig:await j(),searchContextBefore:b.value.searchContextBefore,searchContextAfter:b.value.searchContextAfter};if(t.isAborted)return E(),{success:!1,reason:"aborted"};const{requestId:he,promise:Ee}=at().runStream({userMessage:B,sessionId:t.sessionId,aiChatId:t.currentAIChatId,historyLeafMessageId:u.parentId??null,timeFilter:be.timeFilter,maxMessagesLimit:be.maxMessagesLimit,ownerInfo:be.ownerInfo,mentionedMembers:be.mentionedMembers,preprocessConfig:be.preprocessConfig,chatType:t.chatType,locale:t.locale,assistantId:xe,skillId:Ie,enableAutoSkill:Ie?void 0:Ae,chartAutoMode:Ie?void 0:Le,thinkingLevel:(()=>{const d=A.defaultAssistant;if(!(!d?.configId||!d?.modelId))return a.getThinkingLevel(d.configId,d.modelId)})()},d=>{if(!(t.isAborted||f!==t.currentRequestId))switch(d.type){case"content":t.currentToolStatus=R.current(),Pe(d.content||"");break;case"think":d.content?_(d.content,d.thinkTag):d.thinkDurationMs!==void 0&&_("",d.thinkTag,d.thinkDurationMs);break;case"tool_start":if(d.toolName){const fe=d.toolParams;t.currentToolStatus=R.start({name:d.toolName,toolCallId:d.toolCallId}),t.toolsUsedInCurrentRound.push(d.toolName),ge(d.toolName)?K(d.toolName,fe,d.toolCallId):P(d.toolName,fe,d.toolCallId)}break;case"tool_update":je(),d.toolName&&d.toolProgress&&(t.currentToolStatus=R.update({name:d.toolName,toolCallId:d.toolCallId,progress:d.toolProgress}));break;case"tool_result":if(d.toolName){const fe=dt(d.toolResult),Ne=Pt(d.toolName,d.toolResult),Fe=Ne!==null||d.toolIsError===!0;ge(d.toolName)?H(d.toolName,d.toolCallId,fe,Ne):ue(fe);const He=xt(d.toolResult);if(He&&re(He),Ne&&(ge(d.toolName)||U(Ne.error)),!ge(d.toolName)){const Tt=At(d.toolResult);L(d.toolName,Fe?"error":"done",{toolCallId:d.toolCallId,result:bt(Tt),displayResult:Tt,isError:d.toolIsError})}t.currentToolStatus=R.finish({name:d.toolName,toolCallId:d.toolCallId,status:Fe?"error":"done"})}t.isLoadingSource=!1;break;case"plan_delta":d.planDelta&&Te(d.planDelta);break;case"plan":d.plan&&(m(d.plan),g("executing"));break;case"plan_skipped":S();break;case"turn_end":J(!!d.hadToolCalls);break;case"status":je(),d.status&&(!t.agentStatus||d.status.updatedAt>=t.agentStatus.updatedAt)&&(t.agentStatus=d.status);break;case"done":Ce(),R.clear(),t.currentToolStatus=null,v||g("done"),d.usage&&(y={...d.usage}),ie(t,v?"error":"completed",d.usage?{totalUsage:d.usage}:void 0);break;case"error":{Ce(),S(),g("skipped"),v=!0,t.currentToolStatus&&L(t.currentToolStatus.name,"error",{toolCallId:t.currentToolStatus.toolCallId}),R.clear();const fe=i.messages[X].contentBlocks||[];fe.push({type:"error",error:Ke(d.error)}),N({contentBlocks:[...fe],isStreaming:!1}),ie(t,"error");break}}});t.currentAgentRequestId=he,ve(n,B,he,t.currentAIChatId);const oe=await Ee;if(t.isAborted)return rt(),E(),V(n,he),{success:!1,reason:"aborted"};if(je(),f!==t.currentRequestId)return E(),V(n,he),{success:!1,reason:"busy",activeTask:s.value};const Xe=oe.error?.name==="OutputLimitError";if((oe.success||Xe)&&oe.result)N({dataSource:{toolsUsed:oe.result.toolsUsed,toolRounds:oe.result.toolRounds},isStreaming:!1});else if(!v){ie(t,"error");const d=i.messages[X].contentBlocks||[];d.push({type:"error",error:Ke(oe.error)}),N({contentBlocks:[...d],isStreaming:!1})}if(!oe.success&&!Xe)return E(),{success:!1,reason:"error"};const we=Nt(i.messages[X].contentBlocks),o=await me().replaceLatestMessageRound(t.currentAIChatId,{userMessageId:u.id,userContent:B,assistantMessage:{content:i.messages[X].content,contentBlocks:we,tokenUsage:y}}),F=i.messages[X].processDurationMs;return i.messages[X]={...et(o),dataSource:i.messages[X].dataSource,processDurationMs:F,isStreaming:!1},i.messages[r]={...i.messages[r],content:B},i.sessionTokenUsage=Dt(await me().getAIChatTokenUsage(t.currentAIChatId)),t.sessionTokenUsage={...i.sessionTokenUsage},oe.success?{success:!0}:{success:!1,reason:"error"}}catch(de){if(t.isAborted)return E(),{success:!1,reason:"aborted"};console.error("[AI] edit and regenerate failed:",de);const xe=i.messages[X]?.contentBlocks||[];return xe.push({type:"error",error:{name:de instanceof Error?de.name:null,message:de instanceof Error?de.message:String(de),stack:de instanceof Error?de.stack??null:null}}),i.messages[X]&&N({contentBlocks:[...xe],isStreaming:!1}),{success:!1,reason:"error"}}finally{t.isAIThinking=!1,t.isLoadingSource=!1,t.currentToolStatus=null,t.isAborted=!1,t.currentRequestId="",t.currentAgentRequestId="",V(n)}}async function It(n){const t=$(n);if(!t||!t.isAIThinking)return!1;if(t.isAborted=!0,t.isAIThinking=!1,t.isLoadingSource=!1,t.currentToolStatus=null,ie(t,"aborted"),t.currentAgentRequestId)try{await at().abort(t.currentAgentRequestId)}catch(i){console.error("[AI] 中止 Agent 请求失败:",i)}return!0}async function Ht(){return s.value?It(s.value.chatKey):!1}return{sessionStates:e,activeTask:s,ensureSessionState:ee,ensureGlobalState:ne,getSessionState:$,getActiveTaskState:O,applySessionAssistantSelection:ye,selectAssistantForSession:_e,loadAIChat:T,focusAIChat:M,focusActiveTaskAIChat:le,resetToSelectorOnEnter:Re,startNewAIChat:Ge,sendMessage:k,editMessageAndRegenerate:Qe,stopGeneration:It,stopActiveTask:Ht}});export{os as a,Ps as b,qt as c,xs as s,Es as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as e}from"./index-
|
|
1
|
+
import{M as e}from"./index-D9C3dyV8.js";const r={[e.TEXT]:"text",[e.IMAGE]:"image",[e.VOICE]:"voice",[e.VIDEO]:"video",[e.FILE]:"file",[e.EMOJI]:"emoji",[e.LINK]:"link",[e.LOCATION]:"location",[e.RED_PACKET]:"redPacket",[e.TRANSFER]:"transfer",[e.POKE]:"poke",[e.CALL]:"call",[e.SHARE]:"share",[e.REPLY]:"reply",[e.FORWARD]:"forward",[e.CONTACT]:"contact",[e.SYSTEM]:"system",[e.RECALL]:"recall",[e.OTHER]:"other"};function n(a,o){const E=r[a];return o&&E?o(`common.messageType.${E}`):o?o("common.messageType.unknown"):"未知"}export{n as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as M,U as Z,P as f,v as te,j as y,E as ie,w as g,r as P,x as V}from"./RelationshipGalaxyCanvas-CDhljGyJ.js";import"./webworkerAll-CyA4b4LT.js";import"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-D8cHMqV-.js";import"./Tabs-BMq9wODW.js";import"./RovingFocusItem-BJMUQ5DJ.js";import"./useToast-B5LaA6c-.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-BBcCt_Qm.js";import"./people-page-header-BbYSSpsO.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-CByj_rCR.js";class q{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,n=this._canvas.height,s=t.width/i*this._renderer.resolution,o=t.height/n*this._renderer.resolution,r=t.left,l=t.top,d=`translate(${r}px, ${l}px) scale(${s}, ${o})`;d!==this._lastTransform&&(this._domElement.style.transform=d,this._lastTransform=d)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const i=this.canvas.width,n=this.canvas.height,s=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||M.shared.add(this.updateTranslation,this,Z.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&M.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class w{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=w.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new f,this.page=new f,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,B=/iPod/i,C=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,v=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,K=/BlackBerry/i,Y=/BB10/i,H=/Opera Mini/i,F=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i,$=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ne(a){return function(e){return e.test(a)}}function j(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ne(t),s={apple:{phone:n(I)&&!n(v),ipod:n(B),tablet:!n(I)&&(n(C)||$(e))&&!n(v),universal:n(U),device:(n(I)||n(B)||n(C)||n(U)||$(e))&&!n(v)},amazon:{phone:n(b),tablet:!n(b)&&n(O),device:n(b)||n(O)},android:{phone:!n(v)&&n(b)||!n(v)&&n(k),tablet:!n(v)&&!n(b)&&!n(k)&&(n(O)||n(R)),device:!n(v)&&(n(b)||n(O)||n(k)||n(R))||n(/\bokhttp\b/i)},windows:{phone:n(v),tablet:n(X),device:n(v)||n(X)},other:{blackberry:n(K),blackberry10:n(Y),opera:n(H),firefox:n(N),chrome:n(F),device:n(K)||n(Y)||n(H)||n(N)||n(F)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const se=j.default??j,oe=se(globalThis.navigator),re=9,G=100,ae=0,le=0,W=2,z=1,he=-1e3,ce=-1e3,de=2,L=class J{constructor(e,t=oe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${he}px`,e.style.left=`${ce}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${ae}px`,this._div.style.left=`${le}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=W.toString(),this._canvasObserver=new q({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){const i={accessibilityOptions:{...J.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i))}for(let i=this._children.length-1;i>=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,te(this._children,i,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){const n=this._children[i];if(!n._accessibleActive||!n._accessibleDiv)continue;const s=n._accessibleDiv,o=n.hitArea||n.getBounds().rectangle;if(n.hitArea){const r=n.worldTransform;s.style.left=`${r.tx+o.x*r.a}px`,s.style.top=`${r.ty+o.y*r.d}px`,s.style.width=`${o.width*r.a}px`,s.style.height=`${o.height*r.d}px`}else this._capHitArea(o),s.style.left=`${o.x}px`,s.style.top=`${o.y}px`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
|
|
1
|
+
import{t as M,U as Z,P as f,v as te,j as y,E as ie,w as g,r as P,x as V}from"./RelationshipGalaxyCanvas-CHPqtqQz.js";import"./webworkerAll-DkPWEyVL.js";import"./index-D9C3dyV8.js";import"./vendor-snapdom--nZvo8Sg.js";import"./index-iEQnKg2R.js";import"./Tabs-xVtuBuO0.js";import"./RovingFocusItem-Bqgmzo42.js";import"./useToast-Bmgpd3sl.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-DmVfwvnD.js";import"./people-page-header-DWXwFJ8M.js";import"./relationship-galaxy-connections-Cg4G5yYE.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-rD_jWpbO.js";class q{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,n=this._canvas.height,s=t.width/i*this._renderer.resolution,o=t.height/n*this._renderer.resolution,r=t.left,l=t.top,d=`translate(${r}px, ${l}px) scale(${s}, ${o})`;d!==this._lastTransform&&(this._domElement.style.transform=d,this._lastTransform=d)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const i=this.canvas.width,n=this.canvas.height,s=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||M.shared.add(this.updateTranslation,this,Z.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&M.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class w{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=w.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new f,this.page=new f,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,B=/iPod/i,C=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,v=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,K=/BlackBerry/i,Y=/BB10/i,H=/Opera Mini/i,F=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i,$=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ne(a){return function(e){return e.test(a)}}function j(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ne(t),s={apple:{phone:n(I)&&!n(v),ipod:n(B),tablet:!n(I)&&(n(C)||$(e))&&!n(v),universal:n(U),device:(n(I)||n(B)||n(C)||n(U)||$(e))&&!n(v)},amazon:{phone:n(b),tablet:!n(b)&&n(O),device:n(b)||n(O)},android:{phone:!n(v)&&n(b)||!n(v)&&n(k),tablet:!n(v)&&!n(b)&&!n(k)&&(n(O)||n(R)),device:!n(v)&&(n(b)||n(O)||n(k)||n(R))||n(/\bokhttp\b/i)},windows:{phone:n(v),tablet:n(X),device:n(v)||n(X)},other:{blackberry:n(K),blackberry10:n(Y),opera:n(H),firefox:n(N),chrome:n(F),device:n(K)||n(Y)||n(H)||n(N)||n(F)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const se=j.default??j,oe=se(globalThis.navigator),re=9,G=100,ae=0,le=0,W=2,z=1,he=-1e3,ce=-1e3,de=2,L=class J{constructor(e,t=oe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${he}px`,e.style.left=`${ce}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${ae}px`,this._div.style.left=`${le}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=W.toString(),this._canvasObserver=new q({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){const i={accessibilityOptions:{...J.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i))}for(let i=this._children.length-1;i>=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,te(this._children,i,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){const n=this._children[i];if(!n._accessibleActive||!n._accessibleDiv)continue;const s=n._accessibleDiv,o=n.hitArea||n.getBounds().rectangle;if(n.hitArea){const r=n.worldTransform;s.style.left=`${r.tx+o.x*r.a}px`,s.style.top=`${r.ty+o.y*r.d}px`,s.style.width=`${o.width*r.a}px`,s.style.height=`${o.height*r.d}px`}else this._capHitArea(o),s.style.left=`${o.x}px`,s.style.top=`${o.y}px`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
|
|
2
2
|
color: transparent;
|
|
3
3
|
pointer-events: none;
|
|
4
4
|
padding: 0;
|