comp-hub 0.28.6 → 0.28.7
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/index.js +2 -2
- package/dist/website/container/assets/index-B6KfxMpe.css +1 -0
- package/dist/website/container/assets/{index-C4rP9NOf.js → index-DlqRVovH.js} +7 -7
- package/dist/website/container/index.html +2 -2
- package/dist/website/item/assets/{index-xGYf6R_n.css → index-BIgTOfbh.css} +1 -1
- package/dist/website/item/assets/{index-YY_elpPJ.js → index-DOKUHdnc.js} +15 -15
- package/dist/website/item/index.html +2 -2
- package/dist/website/main/assets/{CanvasAnimation.vue_vue_type_script_setup_true_lang-CllQrgJy.js → CanvasAnimation.vue_vue_type_script_setup_true_lang-CDdsQZ0-.js} +1 -1
- package/dist/website/main/assets/{index-Du5qihI4.js → index-0jUB6F-4.js} +1 -1
- package/dist/website/main/assets/{index-B9ln289Q.js → index-5EYT6f8p.js} +1 -1
- package/dist/website/main/assets/{index-CJBbqPIC.js → index-B-JCIDk_.js} +1 -1
- package/dist/website/main/assets/index-B329MLgw.js +2 -0
- package/dist/website/main/assets/index-B6QLWqnu.js +1 -0
- package/dist/website/main/assets/{index-Dgyjv57X.js → index-B8k-Kh_A.js} +1 -1
- package/dist/website/main/assets/{index-5NbrFL1v.js → index-B9hCLAJk.js} +1 -1
- package/dist/website/main/assets/{index-OQIUhz5k.js → index-BFKzKjpl.js} +1 -1
- package/dist/website/main/assets/{index-B5P6DgaP.js → index-BRZurz58.js} +1 -1
- package/dist/website/main/assets/{index-DNzk9GC4.js → index-BrArZ42r.js} +1 -1
- package/dist/website/main/assets/{index-5AGG9ot8.js → index-BwgMUal7.js} +1 -1
- package/dist/website/main/assets/index-CAsY0Xb9.js +1 -0
- package/dist/website/main/assets/index-CWJKxZCd.js +1 -0
- package/dist/website/main/assets/{index-C5FOjHtG.js → index-CY6_9tAe.js} +1 -1
- package/dist/website/main/assets/{index-CBkRhssK.js → index-CadXipX3.js} +2 -2
- package/dist/website/main/assets/index-CbfSiY9U.js +1 -0
- package/dist/website/main/assets/{index-ClGXZTwx.js → index-CdzjeO0x.js} +1 -1
- package/dist/website/main/assets/index-CiSJMy_Y.js +1 -0
- package/dist/website/main/assets/{index-CRPDDq-V.js → index-D88CvPWT.js} +3 -3
- package/dist/website/main/assets/index-DEGdQmAx.js +1 -0
- package/dist/website/main/assets/index-DOd1x8nw.js +1 -0
- package/dist/website/main/assets/index-DPdwbYvx.js +1 -0
- package/dist/website/main/assets/{index-DdlcdFg6.js → index-DquKS0_n.js} +1 -1
- package/dist/website/main/assets/{index-DnoK5_sf.js → index-DrbX7elo.js} +1 -1
- package/dist/website/main/assets/{index-C9Y3CNRO.js → index-EDA2t2OE.js} +1 -1
- package/dist/website/main/assets/{index-CeYUbWQf.js → index-HkZs-IVV.js} +1 -1
- package/dist/website/main/assets/{index-pnMxQIk7.js → index-IVEhJl2W.js} +1 -1
- package/dist/website/main/assets/{index-Bix1nJzT.js → index-U6TRHk8E.js} +1 -1
- package/dist/website/main/assets/{index-D8JLLNls.js → index-ZoaJ6v2i.js} +1 -1
- package/dist/website/main/assets/{index-D206deyl.js → index-pjvH5dVi.js} +1 -1
- package/dist/website/main/assets/{index-BboFkG3x.css → index-qOVjc392.css} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-CsP7DU8L.js → index.vue_vue_type_script_setup_true_lang-BAM6bQ14.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-Cl-Fl4oU.js → index.vue_vue_type_script_setup_true_lang-BWF3Tgxf.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-piiSvWkd.js → index.vue_vue_type_script_setup_true_lang-BXNbK11E.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-BcUGs_WV.js → index.vue_vue_type_script_setup_true_lang-CmmAEEXC.js} +2 -2
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-C2f6_gwm.js → index.vue_vue_type_script_setup_true_lang-D9A1RF52.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-BOye9Q0l.js → index.vue_vue_type_script_setup_true_lang-DTC1Qz-g.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-HhqETZCz.js → index.vue_vue_type_style_index_0_lang-8e70e_fM.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-_EGM5AW2.js → index.vue_vue_type_style_index_0_lang-BZ1LzI3x.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-lii4Mw4k.js → index.vue_vue_type_style_index_0_lang-BipgSalp.js} +1 -1
- package/dist/website/main/assets/useCompEditStore-D7YXYpD3.css +1 -0
- package/dist/website/main/assets/{useCompEditStore-De0RvlRq.js → useCompEditStore-DhXxYAqN.js} +1 -1
- package/dist/website/main/assets/{useKeyword-DPx3R5YX.js → useKeyword-CjhhChz4.js} +1 -1
- package/dist/website/main/assets/{useMessage-8Gi-vx-A.js → useMessage-Cbhfk7Nk.js} +1 -1
- package/dist/website/main/assets/{useVscodeOpen--nBM6CZ-.js → useVscodeOpen-BBdyQ3W2.js} +1 -1
- package/dist/website/main/index.html +2 -2
- package/package.json +1 -1
- package/dist/website/container/assets/index-DyP-WX-l.css +0 -1
- package/dist/website/main/assets/index-30_1ggVR.js +0 -1
- package/dist/website/main/assets/index-B94DbVvF.js +0 -1
- package/dist/website/main/assets/index-Bt7T-LaE.js +0 -1
- package/dist/website/main/assets/index-CS5py2lv.js +0 -1
- package/dist/website/main/assets/index-CYEfOQSg.js +0 -2
- package/dist/website/main/assets/index-DMKeTfl9.js +0 -1
- package/dist/website/main/assets/index-DkvChnew.js +0 -1
- package/dist/website/main/assets/index-OKDkiqud.js +0 -1
- package/dist/website/main/assets/index-zrOq4KJF.js +0 -1
- package/dist/website/main/assets/useCompEditStore-CTeLLTZM.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as i}from"./vendor-ui-CGT0cG1n.js";import{r as l}from"./index-
|
|
1
|
+
import{c as i}from"./vendor-ui-CGT0cG1n.js";import{r as l}from"./index-D88CvPWT.js";import{u}from"./useCacheOssStore-OAoLDVbw.js";import{v as f,ay as m,aM as d,aN as h,ab as p,j as x,X as g,ax as v,af as _}from"./vendor-core-BKehvho7.js";function B(n){const t=document.createElement("canvas"),e=t.getContext("2d");if(!e)return"";t.width=100,t.height=100,e.fillStyle="#fff",e.font="60px serif";const r=e.measureText(n),a=r.width,s=r.actualBoundingBoxAscent+r.actualBoundingBoxDescent,o=(t.width-a)/2,c=(t.height+s)/2-r.actualBoundingBoxDescent;return e.fillText(n,o,c),t.toDataURL()}const S=f({__name:"index",props:{src:{type:String,default:""},text:{type:String,default:""}},setup(n){const t=n,e=u(),r=m(),a=_("");return d(()=>t.text,s=>{!s||t.src||(a.value=B(s))},{immediate:!0}),h(async()=>{if(!t.src)return;const s=e.getCacheUrl(t.src);if(s){a.value=s;return}const o=await l.v1Oss.osscontrollerFilesignurl({objectId:t.src}),{signUrl:c}=o.data;a.value=c,e.setCacheUrl(t.src,c)}),(s,o)=>{const c=i;return p(),x(c,g({class:"border border-gray-400"},v(r),{src:a.value}),null,16,["src"])}}});export{S as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as s}from"./index-
|
|
1
|
+
import{J as s}from"./index-D88CvPWT.js";import{v as t,ai as n}from"./vendor-core-BKehvho7.js";const c=t({__name:"index",setup(i){const o=s();function r(){const e=o.isRealUserLogin();return e||o.logoutDialog(),e}return(e,a)=>n(e.$slots,"default",{isLogin:r})}});export{c as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as w,J as L,m as C}from"./index-
|
|
1
|
+
import{z as w,J as L,m as C}from"./index-D88CvPWT.js";import{c as O}from"./index-B9hCLAJk.js";import{aD as G}from"./vendor-ui-CGT0cG1n.js";import{v as b,aA as k,aF as M,aM as P,ab as W,l as D,i as F,ax as h,g as m}from"./vendor-core-BKehvho7.js";import{c as B,b as N,I as a,a as l,e as y}from"./useMessage-Cbhfk7Nk.js";const R={class:"size-full"},x=["src"],V=b({__name:"index",props:{compType:{},version:{},compAttrs:{},iuid:{},bgColor:{}},setup(f){const s=f,{locale:_}=k(),d=w(),T=L(),r=B(!1,window.__GLOBAL_CONFIG__.subPort),{instanceUid:g,messageListener:E,sendMessageToTargetIframe:n}=y(),{addListener:i}=E(),{createIframeParams:I}=N(),S=G().value,c=M("iframe"),A=(()=>{const e={topOrigin:window.location.origin,userId:T.userId??"",instanceUid:[g.value,s.iuid].join(",")??"",compId:s.compAttrs?._id??"",isSfc:!0},t={params:I(e),isDark:S.toString()},o=new URLSearchParams(t).toString();return`${r}/${C.WEBSITE_PATH_ITEM}/${s.compType}?${o}`})();async function p(){const e=c.value?.contentWindow;if(e){const t=O(s.compAttrs?._id)(),o=t.depEntryNameToFile[s.version],u=t.versionToFileAccessPath[s.version],v={item:s.compAttrs,depEntryNameToFile:o,versionToFileAccessPath:u};n(e,a.ITEM_INIT_SET,v,r)}}return i(a.ITEM_INIT_GET,()=>{p()}),i(a.SETTING_DATA_LEAF_GET,l(m(()=>d.deps),()=>{const e=c.value?.contentWindow;e&&n(e,a.SETTING_DATA_LEAF_SET,d.deps,r)}).triggerCallback),i(a.LOCALE_GET,()=>{const{stopWatch:e,triggerCallback:t}=l(m(()=>_.value),()=>{const o=c.value?.contentWindow;o?n(o,a.LOCALE_SET,_.value,r):e()});t()}),i(a.BG_COLOR_GET,l(m(()=>s.bgColor??""),()=>{const e=c.value?.contentWindow;e&&n(e,a.BG_COLOR_SET,s.bgColor??"",r)}).triggerCallback),P([()=>s.version,()=>s.compAttrs],async([e,t])=>{e&&t&&p()}),(e,t)=>(W(),D("div",R,[F("iframe",{ref:"iframe",class:"size-full",src:h(A),frameborder:"0"},null,8,x)]))}});export{V as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{v as se,aA as x,ab as ne,j as Oe,aO as H,i as G,r as U,ax as y,ap as te,q as ye,u as Me,af as P,w as ce,H as R,aF as oe,aM as Ne,l as Ae,$ as Pe,g as O}from"./vendor-core-BKehvho7.js";import{p as z,c as M}from"./index-5NbrFL1v.js";import{_ as Re,z as Y,r as v,m as L,J as ie,u as V,i as A,V as Fe,N as ke}from"./index-CRPDDq-V.js";import{c as B}from"./useCompMetaLocalStore-BKTMp_k8.js";import{D as Ge,K as b,F as q,J,aD as Be}from"./vendor-ui-CGT0cG1n.js";import{u as Ve}from"./useCacheOssStore-OAoLDVbw.js";import{u as re}from"./useVscodeOpen--nBM6CZ-.js";import{u as be}from"./useTeamHeaders-DxHN7-t0.js";/* empty css */import{_ as xe}from"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import{_ as We}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import{u as $e,c as He,b as Ue,d as Ye,a as N,e as Ke}from"./useMessage-8Gi-vx-A.js";const je={class:"flex justify-between items-center"},ze={class:"h-[65vh]"},qe=se({__name:"index",setup(f,{expose:e}){const{t:a}=x(),n=Me(()=>Re(()=>import("./index-CeYUbWQf.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),{openCompPathInVscode:p}=re(),{cwd:m}=window.__GLOBAL_CONFIG__,l=P(!1),c=P(null),s=P(m);function r(){p(s.value,"./package.json")}const d=E=>{l.value=!0,c.value=E},C=()=>{l.value=!1,c.value=null},_=E=>{c.value&&c.value(E)};return e({open:d,close:C}),(E,g)=>{const F=Ge;return ne(),Oe(y(xe),{modelValue:l.value,"onUpdate:modelValue":g[0]||(g[0]=S=>l.value=S),width:"50%","show-close":""},{header:H(()=>[G("div",je,[G("span",null,[G("span",null,te(y(a)("file.projectPath"))+":",1),U(F,{href:"javascript:void(0)",type:"primary",underline:"always",title:s.value,class:"truncate",onClick:r},{default:H(()=>[ye(te(s.value),1)]),_:1},8,["title"])])])]),default:H(()=>[G("div",ze,[U(y(n),{onSelect:_})])]),_:1},8,["modelValue"])}}}),Ct=(f,e)=>ce(`compListStore_${f}`,{state:()=>({scopeId:f,list:[],localList:[],loading:!1,listType:e??L.COMP_LIST_TYPE_REMOTE}),getters:{isEmpty:a=>a.list.length===0,isRemote:a=>a.listType===L.COMP_LIST_TYPE_REMOTE,isLocal:a=>a.listType===L.COMP_LIST_TYPE_LOCAL},actions:{setLocalList(a){this.$patch(n=>{n.localList=a})},setLoading(a){this.$patch(n=>{n.loading=a})},setList(a){this.$patch(n=>{n.list=a})},delCompListById(a){this.$patch(n=>{n.list=n.list.filter(p=>p._id!==a)})},updateCompListItemById(a,n){this.$patch(p=>{p.list=p.list.map(m=>{if(m._id===a){const l={...m,...n};return M(a)().setDetail(l.version,l),l}return m})})},async getListDeps(a){const n=Y(),l=a.map(r=>r.dep).map(r=>z(r,n.deps)).reduce((r,d)=>[...r,...d],[]).map(r=>r.name),c=await v.v1Module.modulecontrollerPrebuild({deps:[...new Set(l)]}),{entryNameToFile:s={}}=c.data;return s},async initCompMetas(a){const n=Y(),p=await v.v1Comp.compcontrollerLocalcompsbyids({compIds:a.map(c=>c._id)}),{compInfos:m=[]}=p.data,l=await this.getListDeps(a);a.forEach(c=>{const r=z(c.dep,n.deps).reduce((_,E)=>(l[E.name]&&(_[E.name]=l[E.name]),_),{}),d=M(c._id)();d.setLatestVersion(c.version),d.setDetail(c.version,c);const C=m.filter(_=>_.id===c._id);d.setLocalCompInfo(C),d.setDepEntryNameToFile(c.version,r)})},async initCompMetasLocal(a){a.forEach(n=>{B(n._id)().setDetail(n)})},async renderList(a){a.length&&(this.isRemote?await this.initCompMetas(a):await this.initCompMetasLocal(a)),this.setList(a)}}});async function ae(f){const e=Y();async function a(r){const{objectId:d,version:C,files:_}=r,E={objectId:d,version:C,files:_.map(S=>S.path)},g=await v.v1Comp.compcontrollerCompfilesosssignedurl(E),{signedUrls:F}=g.data;return F}async function n(r){const{dep:d}=r,C=z(d,e.deps).map(g=>g.name),_=await v.v1Module.modulecontrollerPrebuild({deps:C}),{entryNameToFile:E={}}=_.data;return E}const{version:p,_id:m}=f,l=M(m)();let c=null,s=null;l.versionToFileAccessPath[p]||(c=await a(f),l.setVersionToFileAccessPath(p,c)),l.depEntryNameToFile[p]||(s=await n(f),l.setDepEntryNameToFile(p,s))}const le=()=>{const f=ie();function e(){const a=f.isRealUserLogin();return a||f.logoutDialog(),a}return{isLogin:e}};function Je(){const{isLogin:f}=le(),e=R(L.PROVIDE_KEY_CALLBACKS),a=R(L.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=x();async function p(m){if(!f()||!a.isRemote)return;const{id:l,isCollect:c}=m,s=a.list.find(d=>d._id===l);if(!s||!c&&await b.confirm(n("comp.uncollectConfirm",{name:s.name}),n("comp.uncollect"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const r=q.service({fullscreen:!0});V.v1Comp.compcontrollerCollect({compId:s._id,isCollect:c}).then(()=>{J.success(s.isCollect?n("message.success.uncollect"):n("message.success.collect")),window?.umami?.track(A.COMP_COLLECT_TOGGLE,{compId:s._id,name:s.name,action:c?"collect":"uncollect"});const d={...s,isCollect:c};c?a.updateCompListItemById(s._id,{...d,collectCount:s.collectCount+1}):(a.updateCompListItemById(s._id,{...d,collectCount:s.collectCount-1}),e.get(L.COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT)?.(s._id))}).finally(()=>{r.close()})}return{onCollect:p}}const Xe=(f="")=>{if(!f)throw new Error("createTeamHomeStore scopeId is required");return ce(`teamHome_${f}`,{state:()=>({teamDetail:{},loading:!1,selectedRows:[],selectedRowsToLeafNodeMap:{},dataSourceCopy:[],canSaveCopy:!1}),getters:{teamName:e=>e.teamDetail.name,creator:e=>({nickname:e.teamDetail?.creatorId?.nickname||e.teamDetail?.creatorId?.account||"",avatar:e.teamDetail?.creatorId?.avatar||""}),creatorNickname:e=>e.teamDetail?.creatorNickname||"",memberCount:e=>e.teamDetail?.memberCount||0,compCount:e=>e.teamDetail?.compCount||0,totalDownloadCount:e=>e.teamDetail?.totalDownloadCount||0,isCreator:e=>e.teamDetail.isCreator,isMember:e=>e.teamDetail.isMember,isOutMember:e=>!e.teamDetail.isCreator&&!e.teamDetail.isMember,description:e=>e.teamDetail.description||"",isPublic:e=>e.teamDetail.isPublic,isApplyNeedAudit:e=>e.teamDetail.isApplyNeedAudit,isAllowCompAuthorDelete:e=>e.teamDetail.isAllowCompAuthorDelete,isShowRepeatComp:e=>e.teamDetail.isShowRepeatComp,code:e=>e.teamDetail.code||"",menuGroup:e=>e.teamDetail.menuGroup||[]},actions:{setCanSaveCopy(e){this.$patch(a=>{a.canSaveCopy=e})},setLoading(e){this.$patch(a=>{a.loading=e})},setTeamDetail(e){this.$patch(a=>{a.teamDetail=e})},setSelectedRows(e){this.$patch(a=>{a.selectedRows=e})},setDataSourceCopy(e){this.$patch(a=>{a.dataSourceCopy=e})},setSelectedRowsToLeafNodeMap(e){this.$patch(a=>{a.selectedRowsToLeafNodeMap=e})},addSelectedRowsToLeafNodeMap(e){this.$patch(a=>{a.selectedRowsToLeafNodeMap={...a.selectedRowsToLeafNodeMap,...e}})},delSelectedRowsToLeafNodeMap(e){this.$patch(a=>{const n={...a.selectedRowsToLeafNodeMap};e.forEach(p=>{delete n[p]}),a.selectedRowsToLeafNodeMap=n})},getSelectedGroupLeafNodes(e=""){return e?Fe.getTreeAllChildren(this.menuGroup,e).filter(n=>n.children?.length===0).map(n=>n.id):[]}}})};function Qe(){const{isLogin:f}=le(),e=R(L.PROVIDE_KEY_CALLBACKS),a=R(L.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=x(),{headers:p,teamId:m}=be();async function l(c){const s=q.service({fullscreen:!0});try{if(!f())return;const r=a.list.find(C=>C._id===c);if(!r){console.error("组件不存在");return}if(!r.name){console.error("组件名称不能为空");return}if(await b.confirm(n("comp.deleteConfirm",{name:r.name}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;if(m){const C=Xe(m)();await V.v1Team.teamcontrollerRemovemyteamcomp({compIds:[c]},{headers:p}).then(()=>{a.delCompListById(c),C.setTeamDetail({...C.teamDetail,compCount:C.teamDetail.compCount-1}),e.get(L.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(c)})}else await V.v1Comp.compcontrollerDeletemycomp({compId:c}).then(()=>{a.delCompListById(c),e.get(L.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(c)});J.success(n("message.success.delete")),window?.umami?.track(A.COMP_DELETE,{compId:c,compName:r.name,teamId:m||void 0})}finally{s.close()}}return{onDelete:l}}function Ze(f){const e=P(),a=R(L.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=x();async function p(l){if(!a.isRemote)return;const c=q.service({lock:!0,text:n("comp.downloading")});try{if(await b.confirm(n("comp.downloadPathConfirm",{path:l.path}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const r=a.list.find(_=>_._id===e.value?.id);if(!r)return;const d=await v.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:l.path,compName:r.name??"",version:e.value?.version??""}),{isRepeat:C=!1}=d.data;if(C){if(await b.confirm(n("comp.downloadCoverConfirm",{name:r.name??""}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm"){c.close();return}await v.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:l.path,compName:r.name??"",isCover:!0,version:e.value?.version??""})}J.success(n("message.success.download")),window?.umami?.track(A.COMP_DOWNLOAD_SUCCESS,{compId:r._id,compName:r.name,savePath:l.path,version:e.value?.version,isCover:C}),a.updateCompListItemById(r._id,{totalDownloadCount:r.totalDownloadCount+1}),await m(r._id),f?.()}catch(s){window?.umami?.track(A.COMP_DOWNLOAD_FAILED,{compId:e.value?.id,error:String(s)})}finally{c.close()}}async function m(l){const c=M(l)(),s=await v.v1Comp.compcontrollerLocalcompsbyids({compIds:[l]}),{compInfos:r=[]}=s.data,d=r.filter(C=>C.id===l);c.setLocalCompInfo(d)}return{currDownloadCompItem:e,affirmDownload:p}}const et=["src"],Tt=se({__name:"index",props:{compType:{},iuid:{default:-1}},emits:["preview","previewLocal","update"],setup(f,{expose:e,emit:a}){const n=f,p=a,m=R(L.PROVIDE_KEY_COMP_LIST_STORE),{t:l,locale:c}=x(),{IFRAME_POST_MESSAGE_TYPE:s}=Ye,r=Y(),d=ie(),C=Ve(),_=$e(!1,window.__GLOBAL_CONFIG__.subPort),E=He(!1,window.__GLOBAL_CONFIG__.subPort),{instanceUid:g,messageListener:F,sendMessageToTargetIframe:S}=Ke(),{createIframeParams:me}=Ue(),{addListener:T}=F(),{openCompPathInVscode:pe,handlePath:de}=re(),{onCollect:ue}=Je(),{onDelete:_e}=Qe(),{currDownloadCompItem:fe,affirmDownload:X}=Ze(()=>Q.value?.close()),K=Be(),Ce=K.value,W=oe("iframe"),Q=oe("dialogVueFinder"),j=P(0),Z=P({}),Te=O(()=>j.value?{height:`${j.value+10}px`}:{}),Ee=(()=>{const t={topOrigin:window.location.origin,compType:n.compType,userId:d.userId??"",instanceUid:[g.value,n.iuid].filter(Boolean).join(",")??""},o=new URLSearchParams({params:me(t),isDark:Ce.toString()}).toString();return`${_}/${L.WEBSITE_PATH_CONTAINER}/${n.compType}/?${o}`})();function D(t,o,i){const u=W.value?.contentWindow;return u?(S(u,t,o,i),!0):!1}function Ie(t,o,i){const u=W.value?.contentWindow;if(!u)return;const I=u.length??0;for(let h=0;h<I;h++){const w=u[h];w&&S(w,t,o,i)}}function k(t){try{const o=W.value?.contentWindow;if(o)return o[t]}catch(o){console.log("findIframeByCompId error",o.message)}return null}function Le(t,o){if(o){const i=k(o);i&&t(i)}else t(W.value?.contentWindow)}async function he(t){if(!m.isLocal)return;const o=m.list.find($=>$._id===t);if(!o)return;const i=B(t)(),{data:u}=await v.v1Comp.compcontrollerDep({compPath:o.path}),{thirdParty:I}=u;i.setDep(I);const h=I.map($=>$.name),w=await v.v1Module.modulecontrollerPrebuild({deps:h}),{entryNameToFile:ee={}}=w.data;i.setDepToFile(ee)}async function we(t){const o=m.list.find(i=>i._id===t);if(o){const i=k(t);if(i&&m.isRemote){await ae(o);const u=M(o._id)(),I=u.depEntryNameToFile[o.version],h=u.versionToFileAccessPath[o.version],w={item:o,depEntryNameToFile:I,versionToFileAccessPath:h};S(i,s.ITEM_INIT_SET,w,E)}}}async function Se(t){const o=m.list.find(i=>i._id===t);if(o){const i=k(t);if(i){await he(t);const u=B(t)(),{dep:I,depToFile:h}=u,w={item:o,dep:I,depToFile:h};S(i,s.ITEM_INIT_SET_LOCAL,w,E)}}}function ve(t){t.forEach(o=>{const i=k(o._id);i&&m.isRemote&&ae(o).then(()=>{const u=M(o._id)(),I=u.depEntryNameToFile[o.version],h=u.versionToFileAccessPath[o.version],w={item:o,depEntryNameToFile:I,versionToFileAccessPath:h};S(i,s.ITEM_INIT_SET,w,E)})})}return T(s.LIST_INIT_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>m.list),()=>{D(s.LIST_INIT,m.list,_)||t()});o()}),T(s.SETTING_DATA_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>r.deps),()=>{D(s.SETTING_DATA_SET,r.deps,_)||t()});o()}),T(s.SETTING_DATA_LEAF_GET,t=>{const{stopWatch:o,triggerCallback:i}=N(O(()=>r.deps),()=>{const u=k(t);u?S(u,s.SETTING_DATA_LEAF_SET,r.deps,E):o()});i()}),T(s.ITEM_SITE_PATH_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>m.list),()=>{const i=m.list.map(u=>{const I=B(u._id)();return{compId:u._id,fullPath:de(I.detail.fullPath,1)}});D(s.ITEM_SITE_PATH_SET,i,_)||t()});o()}),T(s.LOCALE_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>c.value),()=>{D(s.LOCALE_SET,c.value,E)||t()});o()}),T(s.THEME_CHANGE_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>K.value),()=>{const i={isDark:K.value};if(!D(s.THEME_CHANGE_SET,i,_)){t();return}Ie(s.THEME_CHANGE_SET,i,E)});o()}),T(s.ACTION_COLLECT,ue),T(s.ACTION_DELETE,_e),T(s.ACTION_DOWNLOAD,async t=>{const{version:o}=t;fe.value=t,await b.confirm(l("comp.downloadVersionConfirm",{version:o}),l("common.info"),{confirmButtonText:l("common.confirm"),cancelButtonText:l("common.cancel"),type:"warning"}).catch(()=>{})==="confirm"&&Q.value?.open(X)}),T(s.ACTION_PREVIEW,t=>{window?.umami?.track(A.COMP_PREVIEW,{compId:t}),p("preview",t)}),T(s.ACTION_PREVIEW_LOCAL,t=>{p("previewLocal",t)}),T(s.ACTION_UPDATE,t=>{window?.umami?.track(A.COMP_UPDATE,{compId:t}),p("update",t)}),T(s.UPDATE_IFRAME_HEIGHT,t=>{j.value=t}),T(s.ITEM_INIT_GET,t=>{we(t)}),T(s.ITEM_INIT_GET_LOCAL,t=>{Se(t)}),T(s.ITEM_VERSION_CHANGE,async t=>{const{compId:o,version:i}=t;window?.umami?.track(A.COMP_VERSION_CHANGE,{compId:o,version:i});const I=M(o)().detail[i];if(I){const{totalDownloadCount:tt,collectCount:ot,isCollect:at,...De}=I;m.updateCompListItemById(o,{...De,_id:o});return}const{data:h}=await V.v1Comp.compcontrollerCompdetail({compId:o,version:i}),{totalDownloadCount:w,collectCount:ee,isCollect:$,...ge}=h;m.updateCompListItemById(o,{...ge,_id:o})}),T(s.ITEM_VERSION_LIST_GET,async t=>{let o=Z.value[t];o||(o=(await V.v1Comp.compcontrollerVersions({compId:t})).data.rows??[],Z.value[t]=o),D(s.ITEM_VERSION_LIST_SET,{compId:t,versionList:o},_)}),T(s.LOCAL_EXIST_GET,t=>{const o=M(t)(),{stopWatch:i,triggerCallback:u}=N(O(()=>o.isLocalExist),I=>{D(s.LOCAL_EXIST_SET,{compId:I,exist:o.isLocalExist},_)||i()});u(t)}),T(s.ACTION_OPEN_VSCODE_LOCAL,t=>{const i=B(t)().detail.fullPath;pe(i,`./${L.COMP_CONFIG_FILENAME}`)}),T(s.OSS_FILE_SIGN_URL_GET,async({objectId:t})=>{let o=C.getCacheUrl(t);o||(o=(await v.v1Oss.osscontrollerFilesignurl({objectId:t})).data.signUrl,C.setCacheUrl(t,o)),D(s.OSS_FILE_SIGN_URL_SET,{objectId:t,signUrl:o},_)}),Ne(()=>m.list,(t,o)=>{const{modifiedItems:i}=ke.findChangedArrayItems(t,o);ve(i)},{deep:!0}),e({sendMessageToTargetIframeByCompId:Le}),(t,o)=>(ne(),Ae("div",{style:Pe(Te.value),class:"min-h-[390px]"},[U(y(We),{isEmpty:y(m).isEmpty,loading:y(m).loading,class:"size-full"},{default:H(()=>[G("iframe",{ref:"iframe",class:"size-full min-h-[390px]",src:y(Ee),frameborder:"0"},null,8,et)]),_:1},8,["isEmpty","loading"]),U(qe,{ref:"dialogVueFinder",onDownload:y(X)},null,8,["onDownload"])],4))}});export{qe as _,Tt as a,Xe as b,Ct as c};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-HkZs-IVV.js","./vendor-ui-CGT0cG1n.js","./vendor-core-BKehvho7.js","./index-D88CvPWT.js","./index-qOVjc392.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{v as se,aA as x,ab as ne,j as Oe,aO as H,i as G,r as U,ax as y,ap as te,q as ye,u as Me,af as P,w as ce,H as R,aF as oe,aM as Ne,l as Ae,$ as Pe,g as O}from"./vendor-core-BKehvho7.js";import{p as z,c as M}from"./index-B9hCLAJk.js";import{_ as Re,z as Y,r as g,m as L,J as ie,u as V,i as A,V as Fe,N as ke}from"./index-D88CvPWT.js";import{c as B}from"./useCompMetaLocalStore-BKTMp_k8.js";import{D as Ge,K as b,F as q,J,aD as Be}from"./vendor-ui-CGT0cG1n.js";import{u as Ve}from"./useCacheOssStore-OAoLDVbw.js";import{u as re}from"./useVscodeOpen-BBdyQ3W2.js";import{u as be}from"./useTeamHeaders-DxHN7-t0.js";/* empty css */import{_ as xe}from"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import{_ as We}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import{u as $e,c as He,b as Ue,d as Ye,a as N,e as Ke}from"./useMessage-Cbhfk7Nk.js";const je={class:"flex justify-between items-center"},ze={class:"h-[65vh]"},qe=se({__name:"index",setup(f,{expose:e}){const{t:a}=x(),n=Me(()=>Re(()=>import("./index-HkZs-IVV.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),{openCompPathInVscode:p}=re(),{cwd:l}=window.__GLOBAL_CONFIG__,m=P(!1),c=P(null),s=P(l);function r(){p(s.value,"./package.json")}const d=E=>{m.value=!0,c.value=E},C=()=>{m.value=!1,c.value=null},_=E=>{c.value&&c.value(E)};return e({open:d,close:C}),(E,v)=>{const F=Ge;return ne(),Oe(y(xe),{modelValue:m.value,"onUpdate:modelValue":v[0]||(v[0]=w=>m.value=w),width:"50%","show-close":""},{header:H(()=>[G("div",je,[G("span",null,[G("span",null,te(y(a)("file.projectPath"))+":",1),U(F,{href:"javascript:void(0)",type:"primary",underline:"always",title:s.value,class:"truncate",onClick:r},{default:H(()=>[ye(te(s.value),1)]),_:1},8,["title"])])])]),default:H(()=>[G("div",ze,[U(y(n),{onSelect:_})])]),_:1},8,["modelValue"])}}}),Ct=(f,e)=>ce(`compListStore_${f}`,{state:()=>({scopeId:f,list:[],localList:[],loading:!1,listType:e??L.COMP_LIST_TYPE_REMOTE}),getters:{isEmpty:a=>a.list.length===0,isRemote:a=>a.listType===L.COMP_LIST_TYPE_REMOTE,isLocal:a=>a.listType===L.COMP_LIST_TYPE_LOCAL},actions:{setLocalList(a){this.$patch(n=>{n.localList=a})},setLoading(a){this.$patch(n=>{n.loading=a})},setList(a){this.$patch(n=>{n.list=a})},delCompListById(a){this.$patch(n=>{n.list=n.list.filter(p=>p._id!==a)})},updateCompListItemById(a,n){this.$patch(p=>{p.list=p.list.map(l=>{if(l._id===a){const m={...l,...n};return M(a)().setDetail(m.version,m),m}return l})})},async getListDeps(a){const n=Y(),m=a.map(r=>r.dep).map(r=>z(r,n.deps)).reduce((r,d)=>[...r,...d],[]).map(r=>r.name),c=await g.v1Module.modulecontrollerPrebuild({deps:[...new Set(m)]}),{entryNameToFile:s={}}=c.data;return s},async initCompMetas(a){const n=Y(),p=await g.v1Comp.compcontrollerLocalcompsbyids({compIds:a.map(c=>c._id)}),{compInfos:l=[]}=p.data,m=await this.getListDeps(a);a.forEach(c=>{const r=z(c.dep,n.deps).reduce((_,E)=>(m[E.name]&&(_[E.name]=m[E.name]),_),{}),d=M(c._id)();d.setLatestVersion(c.version),d.setDetail(c.version,c);const C=l.filter(_=>_.id===c._id);d.setLocalCompInfo(C),d.setDepEntryNameToFile(c.version,r)})},async initCompMetasLocal(a){a.forEach(n=>{B(n._id)().setDetail(n)})},async renderList(a){a.length&&(this.isRemote?await this.initCompMetas(a):await this.initCompMetasLocal(a)),this.setList(a)}}});async function ae(f){const e=Y();async function a(r){const{objectId:d,version:C,files:_}=r,E={objectId:d,version:C,files:_.map(w=>w.path)},v=await g.v1Comp.compcontrollerCompfilesosssignedurl(E),{signedUrls:F}=v.data;return F}async function n(r){const{dep:d}=r,C=z(d,e.deps).map(v=>v.name),_=await g.v1Module.modulecontrollerPrebuild({deps:C}),{entryNameToFile:E={}}=_.data;return E}const{version:p,_id:l}=f,m=M(l)();let c=null,s=null;m.versionToFileAccessPath[p]||(c=await a(f),m.setVersionToFileAccessPath(p,c)),m.depEntryNameToFile[p]||(s=await n(f),m.setDepEntryNameToFile(p,s))}const le=()=>{const f=ie();function e(){const a=f.isRealUserLogin();return a||f.logoutDialog(),a}return{isLogin:e}};function Je(){const{isLogin:f}=le(),e=R(L.PROVIDE_KEY_CALLBACKS),a=R(L.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=x();async function p(l){if(!f()||!a.isRemote)return;const{id:m,isCollect:c}=l,s=a.list.find(d=>d._id===m);if(!s||!c&&await b.confirm(n("comp.uncollectConfirm",{name:s.name}),n("comp.uncollect"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const r=q.service({fullscreen:!0});V.v1Comp.compcontrollerCollect({compId:s._id,isCollect:c}).then(()=>{J.success(s.isCollect?n("message.success.uncollect"):n("message.success.collect")),window?.umami?.track(A.COMP_COLLECT_TOGGLE,{compId:s._id,name:s.name,action:c?"collect":"uncollect"});const d={...s,isCollect:c};c?a.updateCompListItemById(s._id,{...d,collectCount:s.collectCount+1}):(a.updateCompListItemById(s._id,{...d,collectCount:s.collectCount-1}),e.get(L.COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT)?.(s._id))}).finally(()=>{r.close()})}return{onCollect:p}}const Xe=(f="")=>{if(!f)throw new Error("createTeamHomeStore scopeId is required");return ce(`teamHome_${f}`,{state:()=>({teamDetail:{},loading:!1,selectedRows:[],selectedRowsToLeafNodeMap:{},dataSourceCopy:[],canSaveCopy:!1}),getters:{teamName:e=>e.teamDetail.name,creator:e=>({nickname:e.teamDetail?.creatorId?.nickname||e.teamDetail?.creatorId?.account||"",avatar:e.teamDetail?.creatorId?.avatar||""}),creatorNickname:e=>e.teamDetail?.creatorNickname||"",memberCount:e=>e.teamDetail?.memberCount||0,compCount:e=>e.teamDetail?.compCount||0,totalDownloadCount:e=>e.teamDetail?.totalDownloadCount||0,isCreator:e=>e.teamDetail.isCreator,isMember:e=>e.teamDetail.isMember,isOutMember:e=>!e.teamDetail.isCreator&&!e.teamDetail.isMember,description:e=>e.teamDetail.description||"",isPublic:e=>e.teamDetail.isPublic,isApplyNeedAudit:e=>e.teamDetail.isApplyNeedAudit,isAllowCompAuthorDelete:e=>e.teamDetail.isAllowCompAuthorDelete,isShowRepeatComp:e=>e.teamDetail.isShowRepeatComp,code:e=>e.teamDetail.code||"",menuGroup:e=>e.teamDetail.menuGroup||[]},actions:{setCanSaveCopy(e){this.$patch(a=>{a.canSaveCopy=e})},setLoading(e){this.$patch(a=>{a.loading=e})},setTeamDetail(e){this.$patch(a=>{a.teamDetail=e})},setSelectedRows(e){this.$patch(a=>{a.selectedRows=e})},setDataSourceCopy(e){this.$patch(a=>{a.dataSourceCopy=e})},setSelectedRowsToLeafNodeMap(e){this.$patch(a=>{a.selectedRowsToLeafNodeMap=e})},addSelectedRowsToLeafNodeMap(e){this.$patch(a=>{a.selectedRowsToLeafNodeMap={...a.selectedRowsToLeafNodeMap,...e}})},delSelectedRowsToLeafNodeMap(e){this.$patch(a=>{const n={...a.selectedRowsToLeafNodeMap};e.forEach(p=>{delete n[p]}),a.selectedRowsToLeafNodeMap=n})},getSelectedGroupLeafNodes(e=""){return e?Fe.getTreeAllChildren(this.menuGroup,e).filter(n=>n.children?.length===0).map(n=>n.id):[]}}})};function Qe(){const{isLogin:f}=le(),e=R(L.PROVIDE_KEY_CALLBACKS),a=R(L.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=x(),{headers:p,teamId:l}=be();async function m(c){const s=q.service({fullscreen:!0});try{if(!f())return;const r=a.list.find(C=>C._id===c);if(!r){console.error("组件不存在");return}if(!r.name){console.error("组件名称不能为空");return}if(await b.confirm(n("comp.deleteConfirm",{name:r.name}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;if(l){const C=Xe(l)();await V.v1Team.teamcontrollerRemovemyteamcomp({compIds:[c]},{headers:p}).then(()=>{a.delCompListById(c),C.setTeamDetail({...C.teamDetail,compCount:C.teamDetail.compCount-1}),e.get(L.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(c)})}else await V.v1Comp.compcontrollerDeletemycomp({compId:c}).then(()=>{a.delCompListById(c),e.get(L.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(c)});J.success(n("message.success.delete")),window?.umami?.track(A.COMP_DELETE,{compId:c,compName:r.name,teamId:l||void 0})}finally{s.close()}}return{onDelete:m}}function Ze(f){const e=P(),a=R(L.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=x();async function p(m){if(!a.isRemote)return;const c=q.service({lock:!0,text:n("comp.downloading")});try{if(await b.confirm(n("comp.downloadPathConfirm",{path:m.path}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const r=a.list.find(_=>_._id===e.value?.id);if(!r)return;const d=await g.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:m.path,compName:r.name??"",version:e.value?.version??""}),{isRepeat:C=!1}=d.data;if(C){if(await b.confirm(n("comp.downloadCoverConfirm",{name:r.name??""}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm"){c.close();return}await g.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:m.path,compName:r.name??"",isCover:!0,version:e.value?.version??""})}J.success(n("message.success.download")),window?.umami?.track(A.COMP_DOWNLOAD_SUCCESS,{compId:r._id,compName:r.name,savePath:m.path,version:e.value?.version,isCover:C}),a.updateCompListItemById(r._id,{totalDownloadCount:r.totalDownloadCount+1}),await l(r._id),f?.()}catch(s){window?.umami?.track(A.COMP_DOWNLOAD_FAILED,{compId:e.value?.id,error:String(s)})}finally{c.close()}}async function l(m){const c=M(m)(),s=await g.v1Comp.compcontrollerLocalcompsbyids({compIds:[m]}),{compInfos:r=[]}=s.data,d=r.filter(C=>C.id===m);c.setLocalCompInfo(d)}return{currDownloadCompItem:e,affirmDownload:p}}const et=["src"],Tt=se({__name:"index",props:{compType:{},iuid:{default:-1}},emits:["preview","previewLocal","update"],setup(f,{expose:e,emit:a}){const n=f,p=a,l=R(L.PROVIDE_KEY_COMP_LIST_STORE),{t:m,locale:c}=x(),{IFRAME_POST_MESSAGE_TYPE:s}=Ye,r=Y(),d=ie(),C=Ve(),_=$e(!1,window.__GLOBAL_CONFIG__.subPort),E=He(!1,window.__GLOBAL_CONFIG__.subPort),{instanceUid:v,messageListener:F,sendMessageToTargetIframe:w}=Ke(),{createIframeParams:me}=Ue(),{addListener:T}=F(),{openCompPathInVscode:pe,handlePath:de}=re(),{onCollect:ue}=Je(),{onDelete:_e}=Qe(),{currDownloadCompItem:fe,affirmDownload:X}=Ze(()=>Q.value?.close()),K=Be(),Ce=K.value,W=oe("iframe"),Q=oe("dialogVueFinder"),j=P(0),Z=P({}),Te=O(()=>j.value?{height:`${j.value+10}px`}:{}),Ee=(()=>{const t={topOrigin:window.location.origin,compType:n.compType,userId:d.userId??"",instanceUid:[v.value,n.iuid].filter(Boolean).join(",")??""},o=new URLSearchParams({params:me(t),isDark:Ce.toString()}).toString();return`${_}/${L.WEBSITE_PATH_CONTAINER}/${n.compType}/?${o}`})();function D(t,o,i){const u=W.value?.contentWindow;return u?(w(u,t,o,i),!0):!1}function Ie(t,o,i){const u=W.value?.contentWindow;if(!u)return;const I=u.length??0;for(let h=0;h<I;h++){const S=u[h];S&&w(S,t,o,i)}}function k(t){try{const o=W.value?.contentWindow;if(o)return o[t]}catch(o){console.log("findIframeByCompId error",o.message)}return null}function Le(t,o){if(o){const i=k(o);i&&t(i)}else t(W.value?.contentWindow)}async function he(t){if(!l.isLocal)return;const o=l.list.find($=>$._id===t);if(!o)return;const i=B(t)(),{data:u}=await g.v1Comp.compcontrollerDep({compPath:o.path}),{thirdParty:I}=u;i.setDep(I);const h=I.map($=>$.name),S=await g.v1Module.modulecontrollerPrebuild({deps:h}),{entryNameToFile:ee={}}=S.data;i.setDepToFile(ee)}async function Se(t){const o=l.list.find(i=>i._id===t);if(o){const i=k(t);if(i&&l.isRemote){await ae(o);const u=M(o._id)(),I=u.depEntryNameToFile[o.version],h=u.versionToFileAccessPath[o.version],S={item:o,depEntryNameToFile:I,versionToFileAccessPath:h};w(i,s.ITEM_INIT_SET,S,E)}}}async function we(t){const o=l.list.find(i=>i._id===t);if(o){const i=k(t);if(i){await he(t);const u=B(t)(),{dep:I,depToFile:h}=u,S={item:o,dep:I,depToFile:h};w(i,s.ITEM_INIT_SET_LOCAL,S,E)}}}function ge(t){t.forEach(o=>{const i=k(o._id);i&&l.isRemote&&ae(o).then(()=>{const u=M(o._id)(),I=u.depEntryNameToFile[o.version],h=u.versionToFileAccessPath[o.version],S={item:o,depEntryNameToFile:I,versionToFileAccessPath:h};w(i,s.ITEM_INIT_SET,S,E)})})}return T(s.LIST_INIT_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>l.list),()=>{D(s.LIST_INIT,l.list,_)||t()});o()}),T(s.SETTING_DATA_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>r.deps),()=>{D(s.SETTING_DATA_SET,r.deps,_)||t()});o()}),T(s.SETTING_DATA_LEAF_GET,t=>{const{stopWatch:o,triggerCallback:i}=N(O(()=>r.deps),()=>{const u=k(t);u?w(u,s.SETTING_DATA_LEAF_SET,r.deps,E):o()});i()}),T(s.ITEM_SITE_PATH_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>l.list),()=>{const i=l.list.map(u=>{const I=B(u._id)();return{compId:u._id,fullPath:de(I.detail.fullPath,1)}});D(s.ITEM_SITE_PATH_SET,i,_)||t()});o()}),T(s.LOCALE_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>c.value),()=>{D(s.LOCALE_SET,c.value,E)||t()});o()}),T(s.THEME_CHANGE_GET,()=>{const{stopWatch:t,triggerCallback:o}=N(O(()=>K.value),()=>{const i={isDark:K.value};if(!D(s.THEME_CHANGE_SET,i,_)){t();return}Ie(s.THEME_CHANGE_SET,i,E)});o()}),T(s.ACTION_COLLECT,ue),T(s.ACTION_DELETE,_e),T(s.ACTION_DOWNLOAD,async t=>{const{version:o}=t;fe.value=t,await b.confirm(m("comp.downloadVersionConfirm",{version:o}),m("common.info"),{confirmButtonText:m("common.confirm"),cancelButtonText:m("common.cancel"),type:"warning"}).catch(()=>{})==="confirm"&&Q.value?.open(X)}),T(s.ACTION_PREVIEW,t=>{window?.umami?.track(A.COMP_PREVIEW,{compId:t}),p("preview",t)}),T(s.ACTION_PREVIEW_LOCAL,t=>{p("previewLocal",t)}),T(s.ACTION_UPDATE,t=>{window?.umami?.track(A.COMP_UPDATE,{compId:t}),p("update",t)}),T(s.UPDATE_IFRAME_HEIGHT,t=>{j.value=t}),T(s.ITEM_INIT_GET,t=>{Se(t)}),T(s.ITEM_INIT_GET_LOCAL,t=>{we(t)}),T(s.ITEM_VERSION_CHANGE,async t=>{const{compId:o,version:i}=t;window?.umami?.track(A.COMP_VERSION_CHANGE,{compId:o,version:i});const I=M(o)().detail[i];if(I){const{totalDownloadCount:tt,collectCount:ot,isCollect:at,...De}=I;l.updateCompListItemById(o,{...De,_id:o});return}const{data:h}=await V.v1Comp.compcontrollerCompdetail({compId:o,version:i}),{totalDownloadCount:S,collectCount:ee,isCollect:$,...ve}=h;l.updateCompListItemById(o,{...ve,_id:o})}),T(s.ITEM_VERSION_LIST_GET,async t=>{let o=Z.value[t];o||(o=(await V.v1Comp.compcontrollerVersions({compId:t})).data.rows??[],Z.value[t]=o),D(s.ITEM_VERSION_LIST_SET,{compId:t,versionList:o},_)}),T(s.LOCAL_EXIST_GET,t=>{const o=M(t)(),{stopWatch:i,triggerCallback:u}=N(O(()=>o.isLocalExist),I=>{D(s.LOCAL_EXIST_SET,{compId:I,exist:o.isLocalExist},_)||i()});u(t)}),T(s.ACTION_OPEN_VSCODE_LOCAL,t=>{const i=B(t)().detail.fullPath;pe(i,`./${L.COMP_CONFIG_FILENAME}`)}),T(s.OSS_FILE_SIGN_URL_GET,async({objectId:t})=>{let o=C.getCacheUrl(t);o||(o=(await g.v1Oss.osscontrollerFilesignurl({objectId:t})).data.signUrl,C.setCacheUrl(t,o)),D(s.OSS_FILE_SIGN_URL_SET,{objectId:t,signUrl:o},_)}),T(s.LOADING_SET,t=>{l.setLoading(t)}),Ne(()=>l.list,(t,o)=>{if(t.length===0){l.setLoading(!1);return}const{modifiedItems:i}=ke.findChangedArrayItems(t,o);ge(i)},{deep:!0}),e({sendMessageToTargetIframeByCompId:Le}),(t,o)=>(ne(),Ae("div",{style:Pe(Te.value),class:"min-h-[390px]"},[U(y(We),{isEmpty:y(l).isEmpty,loading:y(l).loading,class:"size-full"},{default:H(()=>[G("iframe",{ref:"iframe",class:"size-full min-h-[390px]",src:y(Ee),frameborder:"0"},null,8,et)]),_:1},8,["isEmpty","loading"]),U(qe,{ref:"dialogVueFinder",onDownload:y(X)},null,8,["onDownload"])],4))}});export{qe as _,Tt as a,Xe as b,Ct as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as x,k as D,m as C,u as B}from"./index-
|
|
1
|
+
import{I as x,k as D,m as C,u as B}from"./index-D88CvPWT.js";import{e as I,f as g,aG as $,r as L}from"./vendor-ui-CGT0cG1n.js";import{v as S,aA as z,ab as o,j as l,aO as c,l as R,ai as w,k as _,i as y,ap as h,ax as a,r as v,Z as M,af as k,aC as A,aD as O,ac as T,a7 as N,a9 as V,aF as P,p as K,q as b,g as j}from"./vendor-core-BKehvho7.js";/* empty css */import{_ as F}from"./index.vue_vue_type_style_index_0_lang-BZ1LzI3x.js";import{u as E}from"./useTeamHeaders-DxHN7-t0.js";import{c as H,a as U}from"./index.vue_vue_type_script_setup_true_lang-CmmAEEXC.js";const Y={class:"flex items-center justify-between px-3 py-2 select-none"},q={class:"text-sm font-medium"},G={class:"flex gap-[6px]"},Z={key:0,class:"flex-1 p-2 overflow-auto"},J=S({__name:"BasePane",props:{title:{type:String,default:""},actions:{type:Array,default:()=>["close","maximize","minimize"]}},emits:["close","maximize","minimize"],setup(t,{emit:i}){const{t:p}=z(),m=t,n=i,e=k(!1),d=k(!1);function f(){n("close")}function u(){e.value=!e.value,n("maximize",e.value)}function s(r){return m.actions.includes(r)}return(r,ee)=>(o(),l(a(g),{"body-class":"pane-body","header-class":"pane-header",class:M(["pane-card w-full h-full",{"pane-maximized":e.value}])},{header:c(()=>[y("div",Y,[y("div",q,h(t.title),1),y("div",G,[w(r.$slots,"beforeActions",{},void 0,!0),s("close")?(o(),l(a(I),{key:0,type:"primary",circle:"",onClick:f},{default:c(()=>[v(a(x),{icon:"material-symbols:close"})]),_:1})):_("",!0),s("maximize")?(o(),l(a(I),{key:1,type:"primary",circle:"",title:a(p)("common.maximizeRestore"),onClick:u},{default:c(()=>[e.value?(o(),l(a(x),{key:1,icon:"material-symbols:fullscreen-exit"})):(o(),l(a(x),{key:0,icon:"material-symbols:fullscreen"}))]),_:1},8,["title"])):_("",!0)])])]),default:c(()=>[d.value?_("",!0):(o(),R("div",Z,[w(r.$slots,"default",{isMaximized:e.value},void 0,!0)]))]),_:3},8,["class"]))}}),re=D(J,[["__scopeId","data-v-5116a325"]]),Q={class:"min-h-[400px]"},W=S({__name:"index",setup(t){const i=A(),p=O(),{compId:m}=i.params,{headers:n}=E(),e=H(i.path)();T(C.PROVIDE_KEY_COMP_LIST_STORE,e);const d=new Map;T(C.PROVIDE_KEY_CALLBACKS,d);const f=async()=>{if(e.setLoading(!0),!m)return;const s=await B.v1Comp.compcontrollerSimilarcomps({compId:m},{headers:n}),{rows:r}=s.data||{};await e.renderList(r),e.setLoading(!1)};function u(s){p.push({path:`/preview/${s}`})}return N(()=>{f()}),V(()=>{e.$reset()}),(s,r)=>(o(),R("div",Q,[v(U,{compType:a(C).IFRAME_ROUTES.CONTAINER.SIMILAR,onPreview:u},null,8,["compType"])]))}}),X={ref:"similarComp",class:"mt-[10px] overflow-hidden"},le=S({__name:"index",props:{mdSrc:{type:String,default:""},compDesc:{type:String,default:""},scrollContainer:{type:String,default:""},stickyTopDistance:{type:Number,default:45},showSimilarComp:{type:Boolean,default:!0}},setup(t){const{t:i}=z(),{teamId:p}=E(),m=j(()=>i(p?"team.similarCompInTeam":"team.similarComp")),n=k(!1),e=P("similarComp");return $(e,([d])=>{n.value||(n.value=d?.isIntersecting||!1)}),(d,f)=>{const u=L,s=g;return o(),l(F,{showToc:!0,src:t.mdSrc,scrollContainer:t.scrollContainer,stickyTopDistance:t.stickyTopDistance},K({empty:c(()=>[b(h(t.compDesc||a(i)("common.noReadme")),1)]),_:2},[t.showSimilarComp?{name:"footer",fn:c(()=>[y("div",X,[v(u,{"content-position":"center"},{default:c(()=>[b(h(m.value),1)]),_:1}),v(s,{"body-class":"!p-1",class:"mt-[10px]"},{default:c(()=>[n.value?(o(),l(W,{key:0})):_("",!0)]),_:1})],512)]),key:"0"}:void 0]),1032,["src","scrollContainer","stickyTopDistance"])}}});export{re as B,le as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as h,z as C,m as u}from"./index-
|
|
1
|
+
import{J as h,z as C,m as u}from"./index-D88CvPWT.js";import{c as _}from"./useCompMetaLocalStore-BKTMp_k8.js";import{aD as w}from"./vendor-ui-CGT0cG1n.js";import{u as D}from"./useVscodeOpen-BBdyQ3W2.js";import{v as N,aF as k,aM as G,ab as v,l as F,i as W,ax as b,g as f}from"./vendor-core-BKehvho7.js";import{c as B,b as $,I as s,a as T,e as x}from"./useMessage-Cbhfk7Nk.js";const R={class:"size-full"},U=["src"],q=N({__name:"index",props:{compType:{},version:{},compAttrs:{},iuid:{}},setup(I){const o=I,E=h(),p=C(),r=B(!1,window.__GLOBAL_CONFIG__.subPort),{instanceUid:S,messageListener:A,sendMessageToTargetIframe:m}=x(),{addListener:n}=A(),{createIframeParams:g}=$(),{openCompPathInVscode:L,handlePath:P}=D(),M=w().value,l=k("iframe"),O=(()=>{const e={topOrigin:window.location.origin,userId:E.userId??"",instanceUid:[S.value,o.iuid].join(",")??"",compId:o.compAttrs?._id??"",isSfc:!0},t={params:g(e),isDark:M.toString()},a=new URLSearchParams(t).toString();return`${r}/${u.WEBSITE_PATH_ITEM}/${o.compType}?${a}`})();async function d(){const e=l.value?.contentWindow;if(e){const t=_(o.compAttrs?._id)(),{dep:a,depToFile:c}=t,i={item:o.compAttrs,dep:a,depToFile:c};m(e,s.ITEM_INIT_SET_LOCAL,i,r)}}return n(s.ITEM_INIT_GET_LOCAL,()=>{d()}),n(s.ITEM_SITE_PATH_GET,e=>{const t=_(e)(),{stopWatch:a,triggerCallback:c}=T(f(()=>t.detail.fullPath),()=>{const i=l.value?.contentWindow;i?m(i,s.ITEM_SITE_PATH_SET,P(t.detail.fullPath,1),r):a()});c(e)}),n(s.ACTION_OPEN_VSCODE_LOCAL,e=>{const a=_(e)().detail.fullPath;L(a,`./${u.COMP_CONFIG_FILENAME}`)}),n(s.SETTING_DATA_LEAF_GET,T(f(()=>p.deps),()=>{const e=l.value?.contentWindow;e&&m(e,s.SETTING_DATA_LEAF_SET,p.deps,r)}).triggerCallback),G(()=>o.compAttrs,e=>{e&&d()}),(e,t)=>(v(),F("div",R,[W("iframe",{ref:"iframe",class:"size-full",src:b(O),frameborder:"0"},null,8,U)]))}});export{q as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ye,af as L,v as Xe,aA as Je,aF as de,aM as Qe,a7 as je,a0 as Ge,a6 as Ze,a9 as et,ab as tt,l as st,i as nt}from"./vendor-core-BKehvho7.js";import{c as rt,r as it,a as ot,b as at}from"./vendor-xterm-DbWxaMay.js";import{s as ct,h as ht}from"./index-CRPDDq-V.js";import{aE as ut,aH as lt}from"./vendor-ui-CGT0cG1n.js";var ft=rt(),dt=it(),pt=ot();const C=Object.create(null);C.open="0";C.close="1";C.ping="2";C.pong="3";C.message="4";C.upgrade="5";C.noop="6";const P=Object.create(null);Object.keys(C).forEach(r=>{P[C[r]]=r});const X={type:"error",data:"parser error"},we=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ee=typeof ArrayBuffer=="function",be=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,ee=({type:r,data:e},t,n)=>we&&e instanceof Blob?t?n(e):pe(e,n):Ee&&(e instanceof ArrayBuffer||be(e))?t?n(e):pe(new Blob([e]),n):n(C[r]+(e||"")),pe=(r,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(r)};function xe(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let W;function xt(r,e){if(we&&r.data instanceof Blob)return r.data.arrayBuffer().then(xe).then(e);if(Ee&&(r.data instanceof ArrayBuffer||be(r.data)))return e(xe(r.data));ee(r,!1,t=>{W||(W=new TextEncoder),e(W.encode(t))})}const me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<me.length;r++)S[me.charCodeAt(r)]=r;const mt=r=>{let e=r.length*.75,t=r.length,n,i=0,o,s,h,c;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);const f=new ArrayBuffer(e),d=new Uint8Array(f);for(n=0;n<t;n+=4)o=S[r.charCodeAt(n)],s=S[r.charCodeAt(n+1)],h=S[r.charCodeAt(n+2)],c=S[r.charCodeAt(n+3)],d[i++]=o<<2|s>>4,d[i++]=(s&15)<<4|h>>2,d[i++]=(h&3)<<6|c&63;return f},yt=typeof ArrayBuffer=="function",te=(r,e)=>{if(typeof r!="string")return{type:"message",data:ve(r,e)};const t=r.charAt(0);return t==="b"?{type:"message",data:gt(r.substring(1),e)}:P[t]?r.length>1?{type:P[t],data:r.substring(1)}:{type:P[t]}:X},gt=(r,e)=>{if(yt){const t=mt(r);return ve(t,e)}else return{base64:!0,data:r}},ve=(r,e)=>e==="blob"?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer,Ae="",_t=(r,e)=>{const t=r.length,n=new Array(t);let i=0;r.forEach((o,s)=>{ee(o,!1,h=>{n[s]=h,++i===t&&e(n.join(Ae))})})},wt=(r,e)=>{const t=r.split(Ae),n=[];for(let i=0;i<t.length;i++){const o=te(t[i],e);if(n.push(o),o.type==="error")break}return n};function Et(){return new TransformStream({transform(r,e){xt(r,t=>{const n=t.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,n)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let K;function D(r){return r.reduce((e,t)=>e+t.length,0)}function N(r,e){if(r[0].length===e)return r.shift();const t=new Uint8Array(e);let n=0;for(let i=0;i<e;i++)t[i]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function bt(r,e){K||(K=new TextDecoder);const t=[];let n=0,i=-1,o=!1;return new TransformStream({transform(s,h){for(t.push(s);;){if(n===0){if(D(t)<1)break;const c=N(t,1);o=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(D(t)<2)break;const c=N(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(D(t)<8)break;const c=N(t,8),f=new DataView(c.buffer,c.byteOffset,c.length),d=f.getUint32(0);if(d>Math.pow(2,21)-1){h.enqueue(X);break}i=d*Math.pow(2,32)+f.getUint32(4),n=3}else{if(D(t)<i)break;const c=N(t,i);h.enqueue(te(o?c:K.decode(c),e)),n=0}if(i===0||i>r){h.enqueue(X);break}}}})}const Ce=4;function g(r){if(r)return vt(r)}function vt(r){for(var e in g.prototype)r[e]=g.prototype[e];return r}g.prototype.on=g.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};g.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};g.prototype.off=g.prototype.removeListener=g.prototype.removeAllListeners=g.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};g.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};g.prototype.emitReserved=g.prototype.emit;g.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};g.prototype.hasListeners=function(r){return!!this.listeners(r).length};const V=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),w=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),At="arraybuffer";function Fe(r,...e){return e.reduce((t,n)=>(r.hasOwnProperty(n)&&(t[n]=r[n]),t),{})}const Ct=w.setTimeout,Ft=w.clearTimeout;function M(r,e){e.useNativeTimers?(r.setTimeoutFn=Ct.bind(w),r.clearTimeoutFn=Ft.bind(w)):(r.setTimeoutFn=w.setTimeout.bind(w),r.clearTimeoutFn=w.clearTimeout.bind(w))}const Bt=1.33;function kt(r){return typeof r=="string"?Tt(r):Math.ceil((r.byteLength||r.size)*Bt)}function Tt(r){let e=0,t=0;for(let n=0,i=r.length;n<i;n++)e=r.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function Be(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Rt(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Ot(r){let e={},t=r.split("&");for(let n=0,i=t.length;n<i;n++){let o=t[n].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class St extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class se extends g{constructor(e){super(),this.writable=!1,M(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new St(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=te(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Rt(e);return t.length?"?"+t:""}}class Dt extends se{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};wt(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,_t(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Be()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let ke=!1;try{ke=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Nt=ke;function Lt(){}class Pt extends Dt{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}class A extends g{constructor(e,t,n){super(),this.createRequest=e,M(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=Fe(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=A.requestsCount++,A.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Lt,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete A.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}A.requestsCount=0;A.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ye);else if(typeof addEventListener=="function"){const r="onpagehide"in w?"pagehide":"unload";addEventListener(r,ye,!1)}}function ye(){for(let r in A.requests)A.requests.hasOwnProperty(r)&&A.requests[r].abort()}const qt=(function(){const r=Te({xdomain:!1});return r&&r.responseType!==null})();class It extends Pt{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=qt&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new A(Te,this.uri(),e)}}function Te(r){const e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Nt))return new XMLHttpRequest}catch{}if(!e)try{return new w[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Re=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Ut extends se{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=Re?{}:Fe(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;ee(n,this.supportsBinary,o=>{try{this.doWrite(n,o)}catch{}i&&V(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Be()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const z=w.WebSocket||w.MozWebSocket;class Vt extends Ut{createSocket(e,t,n){return Re?new z(e,t,n):t?new z(e,t):new z(e)}doWrite(e,t){this.ws.send(t)}}class Mt extends se{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=bt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),i=Et();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const o=()=>{n.read().then(({done:h,value:c})=>{h||(this.onPacket(c),o())}).catch(h=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;this._writer.write(n).then(()=>{i&&V(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Ht={websocket:Vt,webtransport:Mt,polling:It},$t=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function J(r){if(r.length>8e3)throw"URI too long";const e=r,t=r.indexOf("["),n=r.indexOf("]");t!=-1&&n!=-1&&(r=r.substring(0,t)+r.substring(t,n).replace(/:/g,";")+r.substring(n,r.length));let i=$t.exec(r||""),o={},s=14;for(;s--;)o[Wt[s]]=i[s]||"";return t!=-1&&n!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Kt(o,o.path),o.queryKey=zt(o,o.query),o}function Kt(r,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function zt(r,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,o){i&&(t[i]=o)}),t}const Q=typeof addEventListener=="function"&&typeof removeEventListener=="function",q=[];Q&&addEventListener("offline",()=>{q.forEach(r=>r())},!1);class B extends g{constructor(e,t){if(super(),this.binaryType=At,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=J(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=J(t.host).host);M(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Ot(this.opts.query)),Q&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},q.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=Ce,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&B.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",B.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(t+=kt(i)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,V(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,i){if(typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(B.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Q&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=q.indexOf(this._offlineEventListener);n!==-1&&q.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}B.protocol=Ce;class Yt extends B{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;B.priorWebsocketSuccess=!1;const i=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",p=>{if(!n)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;B.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=t.name,this.emitReserved("upgradeError",x)}}))};function o(){n||(n=!0,d(),t.close(),t=null)}const s=p=>{const x=new Error("probe error: "+p);x.transport=t.name,o(),this.emitReserved("upgradeError",x)};function h(){s("transport closed")}function c(){s("socket closed")}function f(p){t&&p.name!==t.name&&o()}const d=()=>{t.removeListener("open",i),t.removeListener("error",s),t.removeListener("close",h),this.off("close",c),this.off("upgrading",f)};t.once("open",i),t.once("error",s),t.once("close",h),this.once("close",c),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let Xt=class extends Yt{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>Ht[i]).filter(i=>!!i)),super(e,n)}};function Jt(r,e="",t){let n=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),n=J(r)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+e,n.href=n.protocol+"://"+o+(t&&t.port===n.port?"":":"+n.port),n}const Qt=typeof ArrayBuffer=="function",jt=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Oe=Object.prototype.toString,Gt=typeof Blob=="function"||typeof Blob<"u"&&Oe.call(Blob)==="[object BlobConstructor]",Zt=typeof File=="function"||typeof File<"u"&&Oe.call(File)==="[object FileConstructor]";function ne(r){return Qt&&(r instanceof ArrayBuffer||jt(r))||Gt&&r instanceof Blob||Zt&&r instanceof File}function I(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(I(r[t]))return!0;return!1}if(ne(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return I(r.toJSON(),!0);for(const t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&I(r[t]))return!0;return!1}function es(r){const e=[],t=r.data,n=r;return n.data=j(t,e),n.attachments=e.length,{packet:n,buffers:e}}function j(r,e){if(!r)return r;if(ne(r)){const t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){const t=new Array(r.length);for(let n=0;n<r.length;n++)t[n]=j(r[n],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){const t={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=j(r[n],e));return t}return r}function ts(r,e){return r.data=G(r.data,e),delete r.attachments,r}function G(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=G(r[t],e);else if(typeof r=="object")for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=G(r[t],e));return r}const ss=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var l;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(l||(l={}));class ns{constructor(e){this.replacer=e}encode(e){return(e.type===l.EVENT||e.type===l.ACK)&&I(e)?this.encodeAsBinary({type:e.type===l.EVENT?l.BINARY_EVENT:l.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===l.BINARY_EVENT||e.type===l.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=es(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}}class re extends g{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===l.BINARY_EVENT;n||t.type===l.BINARY_ACK?(t.type=n?l.EVENT:l.ACK,this.reconstructor=new rs(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(ne(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(l[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===l.BINARY_EVENT||n.type===l.BINARY_ACK){const o=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const s=e.substring(o,t);if(s!=Number(s)||e.charAt(t)!=="-")throw new Error("Illegal attachments");const h=Number(s);if(!is(h)||h<0)throw new Error("Illegal attachments");if(h>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=h}if(e.charAt(t+1)==="/"){const o=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(o,t)}else n.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const o=t+1;for(;++t;){const s=e.charAt(t);if(s==null||Number(s)!=s){--t;break}if(t===e.length)break}n.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(re.isPayloadValid(n.type,o))n.data=o;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case l.CONNECT:return ge(t);case l.DISCONNECT:return t===void 0;case l.CONNECT_ERROR:return typeof t=="string"||ge(t);case l.EVENT:case l.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&ss.indexOf(t[0])===-1);case l.ACK:case l.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rs{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=ts(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const is=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function ge(r){return Object.prototype.toString.call(r)==="[object Object]"}const os=Object.freeze(Object.defineProperty({__proto__:null,Decoder:re,Encoder:ns,get PacketType(){return l}},Symbol.toStringTag,{value:"Module"}));function b(r,e,t){return r.on(e,t),function(){r.off(e,t)}}const as=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Se extends g{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[b(e,"open",this.onopen.bind(this)),b(e,"packet",this.onpacket.bind(this)),b(e,"error",this.onerror.bind(this)),b(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,i,o;if(as.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const s={type:l.EVENT,data:t};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const d=this.ids++,p=t.pop();this._registerAckCallback(d,p),s.id=d}const h=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!h||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,t){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===e&&this.sendBuffer.splice(h,1);t.call(this,new Error("operation has timed out"))},i),s=(...h)=>{this.io.clearTimeoutFn(o),t.apply(this,h)};s.withError=!0,this.acks[e]=s}emitWithAck(e,...t){return new Promise((n,i)=>{const o=(s,h)=>s?i(s):n(h);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>(this._queue[0],i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...o)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:l.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case l.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case l.EVENT:case l.BINARY_EVENT:this.onevent(e);break;case l.ACK:case l.BINARY_ACK:this.onack(e);break;case l.DISCONNECT:this.ondisconnect();break;case l.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...i){n||(n=!0,t.packet({type:l.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:l.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function T(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}T.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=(Math.floor(e*10)&1)==0?r-t:r+t}return Math.min(r,this.max)|0};T.prototype.reset=function(){this.attempts=0};T.prototype.setMin=function(r){this.ms=r};T.prototype.setMax=function(r){this.max=r};T.prototype.setJitter=function(r){this.jitter=r};class Z extends g{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,M(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new T({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||os;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Xt(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=b(t,"open",function(){n.onopen(),e&&e()}),o=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),e?e(h):this.maybeReconnectOnOpen()},s=b(t,"error",o);if(this._timeout!==!1){const h=this._timeout,c=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),t.close()},h);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(b(e,"ping",this.onping.bind(this)),b(e,"data",this.ondata.bind(this)),b(e,"error",this.onerror.bind(this)),b(e,"close",this.onclose.bind(this)),b(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){V(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Se(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const R={};function U(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};const t=Jt(r,e.path||"/socket.io"),n=t.source,i=t.id,o=t.path,s=R[i]&&o in R[i].nsps,h=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let c;return h?c=new Z(n,e):(R[i]||(R[i]=new Z(n,e)),c=R[i]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(U,{Manager:Z,Socket:Se,io:U,connect:U});const _=U("/terminal",{autoConnect:!1});_.on("connect",()=>{console.log("手动连接成功")});_.on("disconnect",()=>{console.log("连接已断开")});var Y={exports:{}},_e;function cs(){return _e||(_e=1,(function(r){var e={};r.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length===2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s===12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s===8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s===172||s===175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s===161||s===164||167<=s&&s<=168||s===170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s===198||s===208||215<=s&&s<=216||222<=s&&s<=225||s===230||232<=s&&s<=234||236<=s&&s<=237||s===240||242<=s&&s<=243||247<=s&&s<=250||s===252||s===254||s===257||s===273||s===275||s===283||294<=s&&s<=295||s===299||305<=s&&s<=307||s===312||319<=s&&s<=322||s===324||328<=s&&s<=331||s===333||338<=s&&s<=339||358<=s&&s<=359||s===363||s===462||s===464||s===466||s===468||s===470||s===472||s===474||s===476||s===593||s===609||s===708||s===711||713<=s&&s<=715||s===717||s===720||728<=s&&s<=731||s===733||s===735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s===1025||1040<=s&&s<=1103||s===1105||s===8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s===8240||8242<=s&&s<=8243||s===8245||s===8251||s===8254||s===8308||s===8319||8321<=s&&s<=8324||s===8364||s===8451||s===8453||s===8457||s===8467||s===8470||8481<=s&&s<=8482||s===8486||s===8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s===8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s===8658||s===8660||s===8679||s===8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s===8715||s===8719||s===8721||s===8725||s===8730||8733<=s&&s<=8736||s===8739||s===8741||8743<=s&&s<=8748||s===8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s===8776||s===8780||s===8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s===8853||s===8857||s===8869||s===8895||s===8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s===9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s===9711||9733<=s&&s<=9734||s===9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s===9756||s===9758||s===9792||s===9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s===9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s===9955||9960<=s&&s<=9983||s===10045||s===10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s===65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i==="F"||i==="W"||i==="A"?2:1};function t(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=t(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){var s=e.length(n);i=i??0,o=o===void 0||i===null?1:o,i<0&&(i=s+i),o<0&&(o=s+o);for(var h="",c=0,f=t(n),d=0;d<f.length;d++){var p=f[d],x=e.length(p);if(c>=i-(x===2?1:0))if(c+x<=o)h+=p;else break;c+=x}return h}})(Y)),Y.exports}var O=cs();const hs=()=>{const r=L("/"),e=c=>{const f=/^([A-Za-z]):[\\/]?(.*)/.exec(c);if(!f)return{letter:"",rest:c.replace(/\\/g,"/")};if(!f[1]||!f[2])throw new Error("splitDriveLetter path error");return{letter:f[1].toUpperCase(),rest:f[2].replace(/\\/g,"/")}},t=(c,f)=>c?`${c}:\\${f.replace(/\//g,"\\")}`:f.replace(/\//g,"\\"),n=async()=>{r.value=window.__GLOBAL_CONFIG__.cwd||"/"},i=c=>{r.value=c},o=c=>{const f=/^\s*cd\s+([^\s]*)\s*$/i,d=c.match(f);if(!d)return{isCd:!1};const p=d[1]||"/",{rest:x,letter:u}=e(r.value),m=ct.resolve(`/${x}`,p);return{newCwd:t(u,m.slice(1)),oldCwd:r.value,isCd:!0}},s=c=>{const{isCd:f,newCwd:d,oldCwd:p}=o(c);if(f){_.emit("command",{command:"",cwd:d,oldCwd:p});return}_.emit("command",{command:c,cwd:r.value})},h=(c="")=>{_.emit("tab",{cwd:r.value,lastWord:c})};return{cwd:Ye(()=>r.value),initCwd:n,sendCommand:s,updateCwd:i,sendTabCommand:h}};var us=at();const ls={ref:"terminalContainer",class:"size-full overflow-hidden p-2 pr-0 bg-[#1e1e1e]"},fs={ref:"terminalEl",class:"!h-full"},gs=Xe({__name:"index",setup(r){const{t:e}=Je(),t=hs(),n=de("terminalContainer"),i=de("terminalEl"),{height:o,width:s}=ut(n),h=new dt.FitAddon,c=L(!1),f=L(!1),d=a=>{u&&(u.options.cursorStyle=a?"bar":"block",u.options.cursorBlink=!0,f.value=a)},p=lt(ht,[]),x=L(-1);let u=null,m="",v="",E="",ie;const oe=async()=>{u||(u=new ft.Terminal({theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#c5c5c5"},fontSize:14,fontFamily:'Consolas, "Courier New", monospace',cursorBlink:!0,windowsMode:!0,allowProposedApi:!0,convertEol:!0}),u.loadAddon(h),u.loadAddon(new pt.Unicode11Addon),u.loadAddon(new us.WebLinksAddon),u.attachCustomKeyEventHandler(a=>a.type==="keydown"&&(a.ctrlKey||a.metaKey)&&a.key==="v"?(a.preventDefault(),Le(),!1):!0),i.value&&(u.open(i.value),h.fit()),u.onData(De),ie=await Ke())},H=()=>{m="",v="",E=""},De=a=>{if(u){if(a==="\x1B[A"||a==="\x1B[B"){$e(a);return}if(a==="\r"){Ve();return}if(a===""){Pe();return}if(a.charCodeAt(0)===9||a===" "){qe();return}if(a===""){Ne();return}a.charCodeAt(0)<32&&a!==" "||(m+=a,u.write(a))}},Ne=()=>{d(!1),H(),u?.write("^C"),u?.write(`\r
|
|
1
|
+
import{g as Ye,af as L,v as Xe,aA as Je,aF as de,aM as Qe,a7 as je,a0 as Ge,a6 as Ze,a9 as et,ab as tt,l as st,i as nt}from"./vendor-core-BKehvho7.js";import{c as rt,r as it,a as ot,b as at}from"./vendor-xterm-DbWxaMay.js";import{s as ct,h as ht}from"./index-D88CvPWT.js";import{aE as ut,aH as lt}from"./vendor-ui-CGT0cG1n.js";var ft=rt(),dt=it(),pt=ot();const C=Object.create(null);C.open="0";C.close="1";C.ping="2";C.pong="3";C.message="4";C.upgrade="5";C.noop="6";const P=Object.create(null);Object.keys(C).forEach(r=>{P[C[r]]=r});const X={type:"error",data:"parser error"},we=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ee=typeof ArrayBuffer=="function",be=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,ee=({type:r,data:e},t,n)=>we&&e instanceof Blob?t?n(e):pe(e,n):Ee&&(e instanceof ArrayBuffer||be(e))?t?n(e):pe(new Blob([e]),n):n(C[r]+(e||"")),pe=(r,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(r)};function xe(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let W;function xt(r,e){if(we&&r.data instanceof Blob)return r.data.arrayBuffer().then(xe).then(e);if(Ee&&(r.data instanceof ArrayBuffer||be(r.data)))return e(xe(r.data));ee(r,!1,t=>{W||(W=new TextEncoder),e(W.encode(t))})}const me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<me.length;r++)S[me.charCodeAt(r)]=r;const mt=r=>{let e=r.length*.75,t=r.length,n,i=0,o,s,h,c;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);const f=new ArrayBuffer(e),d=new Uint8Array(f);for(n=0;n<t;n+=4)o=S[r.charCodeAt(n)],s=S[r.charCodeAt(n+1)],h=S[r.charCodeAt(n+2)],c=S[r.charCodeAt(n+3)],d[i++]=o<<2|s>>4,d[i++]=(s&15)<<4|h>>2,d[i++]=(h&3)<<6|c&63;return f},yt=typeof ArrayBuffer=="function",te=(r,e)=>{if(typeof r!="string")return{type:"message",data:ve(r,e)};const t=r.charAt(0);return t==="b"?{type:"message",data:gt(r.substring(1),e)}:P[t]?r.length>1?{type:P[t],data:r.substring(1)}:{type:P[t]}:X},gt=(r,e)=>{if(yt){const t=mt(r);return ve(t,e)}else return{base64:!0,data:r}},ve=(r,e)=>e==="blob"?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer,Ae="",_t=(r,e)=>{const t=r.length,n=new Array(t);let i=0;r.forEach((o,s)=>{ee(o,!1,h=>{n[s]=h,++i===t&&e(n.join(Ae))})})},wt=(r,e)=>{const t=r.split(Ae),n=[];for(let i=0;i<t.length;i++){const o=te(t[i],e);if(n.push(o),o.type==="error")break}return n};function Et(){return new TransformStream({transform(r,e){xt(r,t=>{const n=t.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,n)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let K;function D(r){return r.reduce((e,t)=>e+t.length,0)}function N(r,e){if(r[0].length===e)return r.shift();const t=new Uint8Array(e);let n=0;for(let i=0;i<e;i++)t[i]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function bt(r,e){K||(K=new TextDecoder);const t=[];let n=0,i=-1,o=!1;return new TransformStream({transform(s,h){for(t.push(s);;){if(n===0){if(D(t)<1)break;const c=N(t,1);o=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(D(t)<2)break;const c=N(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(D(t)<8)break;const c=N(t,8),f=new DataView(c.buffer,c.byteOffset,c.length),d=f.getUint32(0);if(d>Math.pow(2,21)-1){h.enqueue(X);break}i=d*Math.pow(2,32)+f.getUint32(4),n=3}else{if(D(t)<i)break;const c=N(t,i);h.enqueue(te(o?c:K.decode(c),e)),n=0}if(i===0||i>r){h.enqueue(X);break}}}})}const Ce=4;function g(r){if(r)return vt(r)}function vt(r){for(var e in g.prototype)r[e]=g.prototype[e];return r}g.prototype.on=g.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};g.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};g.prototype.off=g.prototype.removeListener=g.prototype.removeAllListeners=g.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};g.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};g.prototype.emitReserved=g.prototype.emit;g.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};g.prototype.hasListeners=function(r){return!!this.listeners(r).length};const V=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),w=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),At="arraybuffer";function Fe(r,...e){return e.reduce((t,n)=>(r.hasOwnProperty(n)&&(t[n]=r[n]),t),{})}const Ct=w.setTimeout,Ft=w.clearTimeout;function M(r,e){e.useNativeTimers?(r.setTimeoutFn=Ct.bind(w),r.clearTimeoutFn=Ft.bind(w)):(r.setTimeoutFn=w.setTimeout.bind(w),r.clearTimeoutFn=w.clearTimeout.bind(w))}const Bt=1.33;function kt(r){return typeof r=="string"?Tt(r):Math.ceil((r.byteLength||r.size)*Bt)}function Tt(r){let e=0,t=0;for(let n=0,i=r.length;n<i;n++)e=r.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function Be(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Rt(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Ot(r){let e={},t=r.split("&");for(let n=0,i=t.length;n<i;n++){let o=t[n].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class St extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class se extends g{constructor(e){super(),this.writable=!1,M(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new St(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=te(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Rt(e);return t.length?"?"+t:""}}class Dt extends se{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};wt(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,_t(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Be()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let ke=!1;try{ke=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Nt=ke;function Lt(){}class Pt extends Dt{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}class A extends g{constructor(e,t,n){super(),this.createRequest=e,M(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=Fe(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=A.requestsCount++,A.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Lt,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete A.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}A.requestsCount=0;A.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ye);else if(typeof addEventListener=="function"){const r="onpagehide"in w?"pagehide":"unload";addEventListener(r,ye,!1)}}function ye(){for(let r in A.requests)A.requests.hasOwnProperty(r)&&A.requests[r].abort()}const qt=(function(){const r=Te({xdomain:!1});return r&&r.responseType!==null})();class It extends Pt{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=qt&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new A(Te,this.uri(),e)}}function Te(r){const e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Nt))return new XMLHttpRequest}catch{}if(!e)try{return new w[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Re=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Ut extends se{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=Re?{}:Fe(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;ee(n,this.supportsBinary,o=>{try{this.doWrite(n,o)}catch{}i&&V(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Be()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const z=w.WebSocket||w.MozWebSocket;class Vt extends Ut{createSocket(e,t,n){return Re?new z(e,t,n):t?new z(e,t):new z(e)}doWrite(e,t){this.ws.send(t)}}class Mt extends se{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=bt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),i=Et();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const o=()=>{n.read().then(({done:h,value:c})=>{h||(this.onPacket(c),o())}).catch(h=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;this._writer.write(n).then(()=>{i&&V(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Ht={websocket:Vt,webtransport:Mt,polling:It},$t=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function J(r){if(r.length>8e3)throw"URI too long";const e=r,t=r.indexOf("["),n=r.indexOf("]");t!=-1&&n!=-1&&(r=r.substring(0,t)+r.substring(t,n).replace(/:/g,";")+r.substring(n,r.length));let i=$t.exec(r||""),o={},s=14;for(;s--;)o[Wt[s]]=i[s]||"";return t!=-1&&n!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Kt(o,o.path),o.queryKey=zt(o,o.query),o}function Kt(r,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function zt(r,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,o){i&&(t[i]=o)}),t}const Q=typeof addEventListener=="function"&&typeof removeEventListener=="function",q=[];Q&&addEventListener("offline",()=>{q.forEach(r=>r())},!1);class B extends g{constructor(e,t){if(super(),this.binaryType=At,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=J(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=J(t.host).host);M(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Ot(this.opts.query)),Q&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},q.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=Ce,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&B.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",B.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(t+=kt(i)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,V(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,i){if(typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(B.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Q&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=q.indexOf(this._offlineEventListener);n!==-1&&q.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}B.protocol=Ce;class Yt extends B{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;B.priorWebsocketSuccess=!1;const i=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",p=>{if(!n)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;B.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=t.name,this.emitReserved("upgradeError",x)}}))};function o(){n||(n=!0,d(),t.close(),t=null)}const s=p=>{const x=new Error("probe error: "+p);x.transport=t.name,o(),this.emitReserved("upgradeError",x)};function h(){s("transport closed")}function c(){s("socket closed")}function f(p){t&&p.name!==t.name&&o()}const d=()=>{t.removeListener("open",i),t.removeListener("error",s),t.removeListener("close",h),this.off("close",c),this.off("upgrading",f)};t.once("open",i),t.once("error",s),t.once("close",h),this.once("close",c),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let Xt=class extends Yt{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>Ht[i]).filter(i=>!!i)),super(e,n)}};function Jt(r,e="",t){let n=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),n=J(r)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+e,n.href=n.protocol+"://"+o+(t&&t.port===n.port?"":":"+n.port),n}const Qt=typeof ArrayBuffer=="function",jt=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Oe=Object.prototype.toString,Gt=typeof Blob=="function"||typeof Blob<"u"&&Oe.call(Blob)==="[object BlobConstructor]",Zt=typeof File=="function"||typeof File<"u"&&Oe.call(File)==="[object FileConstructor]";function ne(r){return Qt&&(r instanceof ArrayBuffer||jt(r))||Gt&&r instanceof Blob||Zt&&r instanceof File}function I(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(I(r[t]))return!0;return!1}if(ne(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return I(r.toJSON(),!0);for(const t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&I(r[t]))return!0;return!1}function es(r){const e=[],t=r.data,n=r;return n.data=j(t,e),n.attachments=e.length,{packet:n,buffers:e}}function j(r,e){if(!r)return r;if(ne(r)){const t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){const t=new Array(r.length);for(let n=0;n<r.length;n++)t[n]=j(r[n],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){const t={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=j(r[n],e));return t}return r}function ts(r,e){return r.data=G(r.data,e),delete r.attachments,r}function G(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=G(r[t],e);else if(typeof r=="object")for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=G(r[t],e));return r}const ss=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var l;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(l||(l={}));class ns{constructor(e){this.replacer=e}encode(e){return(e.type===l.EVENT||e.type===l.ACK)&&I(e)?this.encodeAsBinary({type:e.type===l.EVENT?l.BINARY_EVENT:l.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===l.BINARY_EVENT||e.type===l.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=es(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}}class re extends g{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===l.BINARY_EVENT;n||t.type===l.BINARY_ACK?(t.type=n?l.EVENT:l.ACK,this.reconstructor=new rs(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(ne(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(l[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===l.BINARY_EVENT||n.type===l.BINARY_ACK){const o=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const s=e.substring(o,t);if(s!=Number(s)||e.charAt(t)!=="-")throw new Error("Illegal attachments");const h=Number(s);if(!is(h)||h<0)throw new Error("Illegal attachments");if(h>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=h}if(e.charAt(t+1)==="/"){const o=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(o,t)}else n.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const o=t+1;for(;++t;){const s=e.charAt(t);if(s==null||Number(s)!=s){--t;break}if(t===e.length)break}n.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(re.isPayloadValid(n.type,o))n.data=o;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case l.CONNECT:return ge(t);case l.DISCONNECT:return t===void 0;case l.CONNECT_ERROR:return typeof t=="string"||ge(t);case l.EVENT:case l.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&ss.indexOf(t[0])===-1);case l.ACK:case l.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rs{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=ts(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const is=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function ge(r){return Object.prototype.toString.call(r)==="[object Object]"}const os=Object.freeze(Object.defineProperty({__proto__:null,Decoder:re,Encoder:ns,get PacketType(){return l}},Symbol.toStringTag,{value:"Module"}));function b(r,e,t){return r.on(e,t),function(){r.off(e,t)}}const as=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Se extends g{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[b(e,"open",this.onopen.bind(this)),b(e,"packet",this.onpacket.bind(this)),b(e,"error",this.onerror.bind(this)),b(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,i,o;if(as.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const s={type:l.EVENT,data:t};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const d=this.ids++,p=t.pop();this._registerAckCallback(d,p),s.id=d}const h=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!h||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,t){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===e&&this.sendBuffer.splice(h,1);t.call(this,new Error("operation has timed out"))},i),s=(...h)=>{this.io.clearTimeoutFn(o),t.apply(this,h)};s.withError=!0,this.acks[e]=s}emitWithAck(e,...t){return new Promise((n,i)=>{const o=(s,h)=>s?i(s):n(h);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>(this._queue[0],i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...o)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:l.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case l.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case l.EVENT:case l.BINARY_EVENT:this.onevent(e);break;case l.ACK:case l.BINARY_ACK:this.onack(e);break;case l.DISCONNECT:this.ondisconnect();break;case l.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...i){n||(n=!0,t.packet({type:l.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:l.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function T(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}T.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=(Math.floor(e*10)&1)==0?r-t:r+t}return Math.min(r,this.max)|0};T.prototype.reset=function(){this.attempts=0};T.prototype.setMin=function(r){this.ms=r};T.prototype.setMax=function(r){this.max=r};T.prototype.setJitter=function(r){this.jitter=r};class Z extends g{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,M(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new T({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||os;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Xt(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=b(t,"open",function(){n.onopen(),e&&e()}),o=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),e?e(h):this.maybeReconnectOnOpen()},s=b(t,"error",o);if(this._timeout!==!1){const h=this._timeout,c=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),t.close()},h);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(b(e,"ping",this.onping.bind(this)),b(e,"data",this.ondata.bind(this)),b(e,"error",this.onerror.bind(this)),b(e,"close",this.onclose.bind(this)),b(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){V(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Se(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const R={};function U(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};const t=Jt(r,e.path||"/socket.io"),n=t.source,i=t.id,o=t.path,s=R[i]&&o in R[i].nsps,h=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let c;return h?c=new Z(n,e):(R[i]||(R[i]=new Z(n,e)),c=R[i]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(U,{Manager:Z,Socket:Se,io:U,connect:U});const _=U("/terminal",{autoConnect:!1});_.on("connect",()=>{console.log("手动连接成功")});_.on("disconnect",()=>{console.log("连接已断开")});var Y={exports:{}},_e;function cs(){return _e||(_e=1,(function(r){var e={};r.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length===2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s===12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s===8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s===172||s===175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s===161||s===164||167<=s&&s<=168||s===170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s===198||s===208||215<=s&&s<=216||222<=s&&s<=225||s===230||232<=s&&s<=234||236<=s&&s<=237||s===240||242<=s&&s<=243||247<=s&&s<=250||s===252||s===254||s===257||s===273||s===275||s===283||294<=s&&s<=295||s===299||305<=s&&s<=307||s===312||319<=s&&s<=322||s===324||328<=s&&s<=331||s===333||338<=s&&s<=339||358<=s&&s<=359||s===363||s===462||s===464||s===466||s===468||s===470||s===472||s===474||s===476||s===593||s===609||s===708||s===711||713<=s&&s<=715||s===717||s===720||728<=s&&s<=731||s===733||s===735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s===1025||1040<=s&&s<=1103||s===1105||s===8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s===8240||8242<=s&&s<=8243||s===8245||s===8251||s===8254||s===8308||s===8319||8321<=s&&s<=8324||s===8364||s===8451||s===8453||s===8457||s===8467||s===8470||8481<=s&&s<=8482||s===8486||s===8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s===8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s===8658||s===8660||s===8679||s===8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s===8715||s===8719||s===8721||s===8725||s===8730||8733<=s&&s<=8736||s===8739||s===8741||8743<=s&&s<=8748||s===8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s===8776||s===8780||s===8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s===8853||s===8857||s===8869||s===8895||s===8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s===9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s===9711||9733<=s&&s<=9734||s===9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s===9756||s===9758||s===9792||s===9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s===9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s===9955||9960<=s&&s<=9983||s===10045||s===10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s===65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i==="F"||i==="W"||i==="A"?2:1};function t(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=t(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){var s=e.length(n);i=i??0,o=o===void 0||i===null?1:o,i<0&&(i=s+i),o<0&&(o=s+o);for(var h="",c=0,f=t(n),d=0;d<f.length;d++){var p=f[d],x=e.length(p);if(c>=i-(x===2?1:0))if(c+x<=o)h+=p;else break;c+=x}return h}})(Y)),Y.exports}var O=cs();const hs=()=>{const r=L("/"),e=c=>{const f=/^([A-Za-z]):[\\/]?(.*)/.exec(c);if(!f)return{letter:"",rest:c.replace(/\\/g,"/")};if(!f[1]||!f[2])throw new Error("splitDriveLetter path error");return{letter:f[1].toUpperCase(),rest:f[2].replace(/\\/g,"/")}},t=(c,f)=>c?`${c}:\\${f.replace(/\//g,"\\")}`:f.replace(/\//g,"\\"),n=async()=>{r.value=window.__GLOBAL_CONFIG__.cwd||"/"},i=c=>{r.value=c},o=c=>{const f=/^\s*cd\s+([^\s]*)\s*$/i,d=c.match(f);if(!d)return{isCd:!1};const p=d[1]||"/",{rest:x,letter:u}=e(r.value),m=ct.resolve(`/${x}`,p);return{newCwd:t(u,m.slice(1)),oldCwd:r.value,isCd:!0}},s=c=>{const{isCd:f,newCwd:d,oldCwd:p}=o(c);if(f){_.emit("command",{command:"",cwd:d,oldCwd:p});return}_.emit("command",{command:c,cwd:r.value})},h=(c="")=>{_.emit("tab",{cwd:r.value,lastWord:c})};return{cwd:Ye(()=>r.value),initCwd:n,sendCommand:s,updateCwd:i,sendTabCommand:h}};var us=at();const ls={ref:"terminalContainer",class:"size-full overflow-hidden p-2 pr-0 bg-[#1e1e1e]"},fs={ref:"terminalEl",class:"!h-full"},gs=Xe({__name:"index",setup(r){const{t:e}=Je(),t=hs(),n=de("terminalContainer"),i=de("terminalEl"),{height:o,width:s}=ut(n),h=new dt.FitAddon,c=L(!1),f=L(!1),d=a=>{u&&(u.options.cursorStyle=a?"bar":"block",u.options.cursorBlink=!0,f.value=a)},p=lt(ht,[]),x=L(-1);let u=null,m="",v="",E="",ie;const oe=async()=>{u||(u=new ft.Terminal({theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#c5c5c5"},fontSize:14,fontFamily:'Consolas, "Courier New", monospace',cursorBlink:!0,windowsMode:!0,allowProposedApi:!0,convertEol:!0}),u.loadAddon(h),u.loadAddon(new pt.Unicode11Addon),u.loadAddon(new us.WebLinksAddon),u.attachCustomKeyEventHandler(a=>a.type==="keydown"&&(a.ctrlKey||a.metaKey)&&a.key==="v"?(a.preventDefault(),Le(),!1):!0),i.value&&(u.open(i.value),h.fit()),u.onData(De),ie=await Ke())},H=()=>{m="",v="",E=""},De=a=>{if(u){if(a==="\x1B[A"||a==="\x1B[B"){$e(a);return}if(a==="\r"){Ve();return}if(a===""){Pe();return}if(a.charCodeAt(0)===9||a===" "){qe();return}if(a===""){Ne();return}a.charCodeAt(0)<32&&a!==" "||(m+=a,u.write(a))}},Ne=()=>{d(!1),H(),u?.write("^C"),u?.write(`\r
|
|
2
2
|
`),t.sendCommand("^C")},Le=async()=>{try{const a=await navigator.clipboard.readText();if(!a||!u)return;const y=[...a].filter(k=>{const F=k.charCodeAt(0);return F>=32||F===9||F===10||F===13}).join("");y&&(m+=y,u.write(y))}catch{}},Pe=()=>{if(v.length){E.length&&(E=v);const a=v.slice(-1),y=O.characterLength(a);u?.write("\b \b".repeat(y)),v=v.slice(0,-1),E=E.slice(0,-1);return}if(m.length){const a=m.slice(-1),y=O.characterLength(a);u?.write("\b \b".repeat(y)),m=m.slice(0,-1)}},qe=()=>{if(E){t.sendTabCommand(E);return}const a=m.trim().split(/\s+/);a.length>1&&(E=a[a.length-1],t.sendTabCommand(E))},Ie=()=>{for(const a of m){const y=O.characterLength(a);u?.write("\b \b".repeat(y))}m=""},Ue=()=>{for(const a of v){const y=O.characterLength(a);u?.write("\b \b".repeat(y))}v=""},Ve=()=>{if(u?.write(`\r
|
|
3
3
|
`),m==="clear"){u?.clear(),t.sendCommand(""),H();return}m.trim()?(t.sendCommand(m+v),d(!0)):t.sendCommand(""),H()},Me=a=>{a&&(p.value=p.value.filter(y=>y!==a),p.value.unshift(a))},He=a=>`PS ${a}>`,$e=a=>{const y=x.value;a==="\x1B[A"&&(x.value=Math.min(x.value+1,p.value.length-1)),a==="\x1B[B"&&(x.value=Math.max(x.value-1,-1)),y!==x.value&&(Ie(),x.value===-1?m="":m=p.value[x.value]??"",u?.write(m))},We=a=>{if(a){if(Ue(),m.endsWith(E))for(const k of E){const F=O.characterLength(k);u?.write("\b \b".repeat(F)),m=m.slice(0,-1)}u?.write(`${a}`),v=`${a}`}},Ke=async()=>{await t.initCwd(),_.connect();const a=F=>{console.log("终端输出:",F);const{stderr:ce,stdout:he,cwd:$,err:ue,command:le,tab:fe}=F;if(ce){u?.write(`${ce}`);return}if(he){u?.write(`${he}`);return}if($){const ze=He($);u?.write(ze),t.updateCwd($),le&&Me(le),x.value=-1,d(!1);return}if(ue){u?.write(`\x1B[31m${ue}\x1B[0m`),u?.write(`\r
|
|
4
4
|
`),d(!1);return}fe&&We(fe)},y=()=>{c.value=!0,t.sendCommand("")},k=()=>{c.value=!1,u?.writeln(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as kt,E as xt,aD as wt,aE as yt,aF as Et,U as _t}from"./vendor-ui-CGT0cG1n.js";import{M as St,H as Tt,m as J,n as Rt}from"./index-
|
|
1
|
+
import{a as kt,E as xt,aD as wt,aE as yt,aF as Et,U as _t}from"./vendor-ui-CGT0cG1n.js";import{M as St,H as Tt,m as J,n as Rt}from"./index-D88CvPWT.js";import{v as Te,aA as qe,aj as At,ab as A,j as xe,p as vt,aO as ne,l as $,F as He,ah as Ke,i as ee,ap as re,k as we,g as U,ay as Nt,aF as te,a7 as Qe,r as ye,X as Ct,ax as O,aM as se,Y as Xe,H as It,af as B,$ as $t,Z as Mt,ai as ze,q as Ot}from"./vendor-core-BKehvho7.js";import{H as L}from"./core-CcVTMiBP.js";async function Lt(t){try{return(await fetch(t)).ok}catch(e){return console.log(`Error fetching ${t}:`,e.message),!1}}const zt={key:0,class:"text-red-500 text-[10px]"},Pt=Te({__name:"AnchorNode",props:{node:{},isDebug:{type:Boolean,default:!1}},setup(t){const{t:e}=qe(),n=t,s=U(()=>n.node.href.replace(/\s+/g,"-")),r=U(()=>{const a=n.node.titles.join(""),{reason:l,reasonParams:o={}}=St.validateHash(a);return l?e(l,o):""}),i=U(()=>n.node.titles.join(""));return(a,l)=>{const o=At("AnchorNode",!0),u=kt;return A(),xe(u,{href:s.value},vt({default:ne(()=>[ee("div",null,re(i.value),1),t.isDebug&&r.value?(A(),$("div",zt,"("+re(r.value)+")",1)):we("",!0)]),_:2},[t.node.children.length?{name:"sub-link",fn:ne(()=>[(A(!0),$(He,null,Ke(t.node.children,c=>(A(),xe(o,{key:c.href,node:c,"is-debug":t.isDebug},null,8,["node","is-debug"]))),128))]),key:"0"}:void 0]),1032,["href"])}}}),Dt=Te({__name:"index",props:{headings:{},isDebug:{type:Boolean}},emits:["change"],setup(t,{emit:e}){const n=t,s=e,r=Nt(),i=U(()=>Tt.flatHeadingsToTree(n.headings));function a(o){s("change",o)}const l=te("tocRef");return Qe(()=>{l.value?.addEventListener("click",o=>{o.target.closest(".el-anchor__link")&&o.preventDefault()})}),(o,u)=>{const c=xt;return A(),$("div",{ref_key:"tocRef",ref:l,class:"toc-wrapper"},[ye(c,Ct(O(r),{onChange:a}),{default:ne(()=>[(A(!0),$(He,null,Ke(i.value,h=>(A(),xe(Pt,{key:h.href,node:h,"is-debug":t.isDebug},null,8,["node","is-debug"]))),128))]),_:1},16)],512)}}});function Re(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var G=Re();function We(t){G=t}var D={exec:()=>null};function g(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(S.caret,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}var Bt=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),S={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Ut=/^(?:[ \t]*(?:\n|$))+/,Zt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,V=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ft=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ae=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ye=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ve=g(Ye).replace(/bull/g,Ae).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),qt=g(Ye).replace(/bull/g,Ae).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ve=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ht=/^[^\n]+/,Ne=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Kt=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ne).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qt=g(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ae).getRegex(),ce="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ce=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Xt=g("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ce).replace("tag",ce).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Je=g(ve).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),Wt=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Je).getRegex(),Ie={blockquote:Wt,code:Zt,def:Kt,fences:Gt,heading:Ft,hr:V,html:Xt,lheading:Ve,list:Qt,newline:Ut,paragraph:Je,table:D,text:Ht},Pe=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),Yt={...Ie,lheading:qt,table:Pe,paragraph:g(ve).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex()},Vt={...Ie,html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ce).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:D,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(ve).replace("hr",V).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",Ve).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Jt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,je=/^( {2,}|\\)\n(?!\s*$)/,en=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,F=/[\p{P}\p{S}]/u,ue=/[\s\p{P}\p{S}]/u,$e=/[^\s\p{P}\p{S}]/u,tn=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ue).getRegex(),et=/(?!~)[\p{P}\p{S}]/u,nn=/(?!~)[\s\p{P}\p{S}]/u,rn=/(?:[^\s\p{P}\p{S}]|~)/u,sn=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Bt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),tt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,an=g(tt,"u").replace(/punct/g,F).getRegex(),on=g(tt,"u").replace(/punct/g,et).getRegex(),nt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ln=g(nt,"gu").replace(/notPunctSpace/g,$e).replace(/punctSpace/g,ue).replace(/punct/g,F).getRegex(),cn=g(nt,"gu").replace(/notPunctSpace/g,rn).replace(/punctSpace/g,nn).replace(/punct/g,et).getRegex(),un=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$e).replace(/punctSpace/g,ue).replace(/punct/g,F).getRegex(),pn=g(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,F).getRegex(),hn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",dn=g(hn,"gu").replace(/notPunctSpace/g,$e).replace(/punctSpace/g,ue).replace(/punct/g,F).getRegex(),gn=g(/\\(punct)/,"gu").replace(/punct/g,F).getRegex(),fn=g(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bn=g(Ce).replace("(?:-->|$)","-->").getRegex(),mn=g("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ae=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,kn=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ae).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rt=g(/^!?\[(label)\]\[(ref)\]/).replace("label",ae).replace("ref",Ne).getRegex(),st=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ne).getRegex(),xn=g("reflink|nolink(?!\\()","g").replace("reflink",rt).replace("nolink",st).getRegex(),De=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Me={_backpedal:D,anyPunctuation:gn,autolink:fn,blockSkip:sn,br:je,code:jt,del:D,delLDelim:D,delRDelim:D,emStrongLDelim:an,emStrongRDelimAst:ln,emStrongRDelimUnd:un,escape:Jt,link:kn,nolink:st,punctuation:tn,reflink:rt,reflinkSearch:xn,tag:mn,text:en,url:D},wn={...Me,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",ae).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae).getRegex()},Ee={...Me,emStrongRDelimAst:cn,emStrongLDelim:on,delLDelim:pn,delRDelim:dn,url:g(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",De).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:g(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",De).getRegex()},yn={...Ee,br:g(je).replace("{2,}","*").getRegex(),text:g(Ee.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},j={normal:Ie,gfm:Yt,pedantic:Vt},X={normal:Me,gfm:Ee,breaks:yn,pedantic:wn},En={"&":"&","<":"<",">":">",'"':""","'":"'"},Be=t=>En[t];function I(t,e){if(e){if(S.escapeTest.test(t))return t.replace(S.escapeReplace,Be)}else if(S.escapeTestNoEncode.test(t))return t.replace(S.escapeReplaceNoEncode,Be);return t}function Ue(t){try{t=encodeURI(t).replace(S.percentDecode,"%")}catch{return null}return t}function Ze(t,e){let n=t.replace(S.findPipe,(i,a,l)=>{let o=!1,u=a;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),s=n.split(S.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(S.slashPipe,"|");return s}function W(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function _n(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function Sn(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let i=4-n%4;s+=" ".repeat(i),n+=i}else s+=r,n++;return s}function Ge(t,e,n,s,r){let i=e.href,a=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,o}function Tn(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
3
3
|
`).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=r.length?i.slice(r.length):i}).join(`
|
|
4
4
|
`)}var ie=class{options;rules;lexer;constructor(t){this.options=t||G}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:W(n,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as ee,D as te,W as oe,aH as ae,aJ as se,e as le,K as B,J as y}from"./vendor-ui-CGT0cG1n.js";import{m,b as ne,r as I,u as D,M as N,e as re}from"./index-
|
|
1
|
+
import{L as ee,D as te,W as oe,aH as ae,aJ as se,e as le,K as B,J as y}from"./vendor-ui-CGT0cG1n.js";import{m,b as ne,r as I,u as D,M as N,e as re}from"./index-D88CvPWT.js";import{C as ce}from"./useCompEditStore-DhXxYAqN.js";import{c as ie}from"./index-B9hCLAJk.js";import{u as pe}from"./useTeamHeaders-DxHN7-t0.js";/* empty css */import{v as H,aB as me,ab as v,j as L,aO as f,l as A,F as de,ah as ue,ax as d,i as $,ap as b,r as x,aR as fe,q as Y,W as he,aA as Ce,H as ve,aP as _e,Z as ge,X as Pe,af as F,g as k,B as Ee,Y as Ue}from"./vendor-core-BKehvho7.js";import{u as ye}from"./useVscodeOpen-BBdyQ3W2.js";import{_ as Ie}from"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import{v as Te}from"./v4-EwEgHOG0.js";const we={class:"flex items-center justify-between"},Oe=["title"],Me=H({__name:"index",props:he({options:{type:Array,default:()=>[]},placeholderText:{type:String,default:""},openInVscodeText:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(u){const{openCompPathInVscode:T,handlePath:_}=ye(),r=me(u,"modelValue"),g=u;function w(c){const e=g.options.find(i=>i.fullPath===c);e&&T(e.fullPath,`./${m.COMP_CONFIG_FILENAME}`)}function P(c){r.value=c}return(c,e)=>{const i=te,h=ee,O=oe;return v(),L(O,{"model-value":r.value,placeholder:u.placeholderText,onChange:P},{default:f(()=>[(v(!0),A(de,null,ue(u.options,p=>(v(),L(h,{key:p.value,label:d(_)(p.fullPath),value:p.value},{default:f(()=>[$("div",we,[$("span",{title:p.fullPath},b(d(_)(p.fullPath)),9,Oe),x(i,{type:"primary",href:"javascript:void(0)",onClick:[e[0]||(e[0]=fe(()=>{},["stop"])),V=>w(p.fullPath)]},{default:f(()=>[Y(b(u.openInVscodeText),1)]),_:1},8,["onClick"])])]),_:2},1032,["label","value"]))),128))]),_:1},8,["model-value","placeholder"])}}}),$e=H({__name:"index",emits:["updateSuccess"],setup(u,{expose:T,emit:_}){const{t:r}=Ce(),g=_,{headers:w,teamId:P}=pe(),c=ae(ne,!1),e=ve(m.PROVIDE_KEY_COMP_EDIT_STORE),i=F(!1),h=F(!0),O=k(()=>{const o=e.selectedFolder?.basename,t=e.compDetail?.name??"";return o?`${r("comp.compOnlineUpdate")}:${t}`:`${r("comp.compOfflineUpdate")}:${t}`}),p=k(()=>({title:O.value,fullscreen:c.value,top:"5vh",width:"70%"}));async function V(o){h.value=!0;try{const t=await I.v1Comp.compcontrollerLocalcompsbyids({compIds:[o]}),{compInfos:a}=t.data;if(a?.length){let s=a[0];if(a.length>1&&(s=await W(a),!s))return;e.setCompUpdateType(m.COMP_UPDATE_TYPE_ONLINE),i.value=!0,e.setSelectedFolder(s),await S(o,s.path)}else{if(await B.confirm(r("comp.compNotInLocal"),r("common.info"),{type:"warning"}).catch(()=>{})!=="confirm")return;e.setCompUpdateType(m.COMP_UPDATE_TYPE_OFFLINE),i.value=!0,await S(o)}}catch(t){console.error(t),y.error(t.message)}finally{h.value=!1}}async function W(o){const t=o.map(n=>({value:n.fullPathHash,label:n.fullPath,fullPath:n.fullPath})),a=F("");return await B({title:r("comp.selectUpdateFolder"),customClass:"select-message",message:()=>Ee(Me,{modelValue:a.value,"onUpdate:modelValue":n=>a.value=n,options:t,placeholderText:r("comp.selectUpdateFolder"),openInVscodeText:r("comp.openInVscode")}),beforeClose:(n,C,E)=>{if(n==="confirm"){if(!a.value){y.error(r("comp.selectUpdateFolder"));return}E()}else E()}}).catch(()=>{})!=="confirm"?void 0:o.find(n=>n.fullPathHash===a.value)}function M(){i.value=!1}function j(){e.$reset()}function z(o,t){const a=l=>{if(!l?.length||!o)return"";const n=Te(),C=re.getPreviewUrl(o,l);return`${m.COMP_PREVIEW_PREFIX_LOCAL}/${C}?v=${n}`};return t.map(l=>({...l,activeTab:m.COMP_EDIT_TAB_TYPE_MINI,miniEntryUrl:a(l.miniPath),fullEntryUrl:a(l.fullPath)}))}function J(o,t){const a=new Map(o.map(({path:s,signedUrl:l})=>[s,l]));return t.map(s=>{const l=N.replaceBackslashWithSlash(s.miniPath.at(-1)??""),n=N.replaceBackslashWithSlash(s.fullPath?.at(-1)??"");return{...s,activeTab:m.COMP_EDIT_TAB_TYPE_MINI,miniEntryUrl:a.get(l)??"",fullEntryUrl:a.get(n)??""}})}async function S(o,t){e.setLoading(!0);const a=await D.v1Comp.compcontrollerCompdetail({compId:o}),{desc:s,previewConfigs:l,bgColor:n,dep:C,name:E,version:G}=a.data||{};if(e.setCompDetail(a.data),e.setOnlineCompDep(C),e.setCompBgColor(n??"#fff"),e.setExtraInfo({description:s,name:E}),e.setEditCompId(o),e.isOnlineUpdate&&t){const R=await D.v1Comp.compcontrollerComphash({compId:o}),U=await I.v1Comp.compcontrollerCompfilehash({compPath:t}),Z=await I.v1Comp.compcontrollerDep({compPath:t}),{thirdParty:Q}=Z.data;e.setCompDep(Q),e.setLocalCompHash(U.data.compHash),e.setRemoteCompHash(R.data.compHash),e.setPreviewCompList(z(t,l))}else{const U=ie(o)().versionToFileAccessPath[G]??[];e.setSignedUrls(U),e.setPreviewCompList(J(U,l)),e.setCompDep(C)}e.setLoading(!1)}function K({end:o}){const t=e.getCompSubmitParams();if(e.isOnlineUpdate)I.v1Comp.compcontrollerUpdate({compId:e.editCompId,...t,...P?{teamId:P}:{}}).then(()=>{y.success(r("message.success.update")),g("updateSuccess",e.editCompId),M()}).finally(()=>{o()});else if(e.isOfflineUpdate){const{name:a,desc:s,bgColor:l,previewConfigs:n}=t;D.v1Comp.compcontrollerUpdatebasicinfo({compId:e.editCompId,name:a,desc:s,bgColor:l,previewConfigs:n},{headers:w}).then(()=>{y.success(r("message.success.update")),g("updateSuccess",e.editCompId),M()}).finally(()=>{o()})}}async function X(){c.value=!c.value}async function q(){const o=e.editCompId,t=e.selectedFolder,a=e.compUpdateType;e.$reset(),await Ue(),e.setCompUpdateType(a),e.setSelectedFolder(t),S(o,t.path)}return T({open:V,close:M}),(o,t)=>{const a=le,s=se;return v(),L(d(Ie),Pe({modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value=l),class:"comp-update-dialog"},p.value,{"destroy-on-close":"","show-close":"",onClose:j}),{footer:f(()=>[x(a,{onClick:X},{default:f(()=>[Y(b(d(c)?d(r)("common.exitFullscreen"):d(r)("common.fullscreen")),1)]),_:1})]),default:f(()=>[_e((v(),A("div",{class:ge(d(c)?"size-full":"h-[70vh]")},[x(ce,{class:"h-full",onConfirmUpload:K,onReload:q})],2)),[[s,h.value]])]),_:1},16,["modelValue"])}}});export{$e as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.loading-wrapper[data-v-7069e81b]{display:flex;align-items:center;justify-content:center;min-height:120px}.loading-inline[data-v-7069e81b]{min-height:unset;padding:40px 0}.loading-text[data-v-7069e81b]{font-size:13px;color:#909399}.loading-dots[data-v-7069e81b]{display:inline}.loading-dot[data-v-7069e81b]{display:inline-block;opacity:0;animation:dot-blink-7069e81b 1.2s infinite}@keyframes dot-blink-7069e81b{0%,40%{opacity:0}50%,90%{opacity:1}to{opacity:0}}.dot[data-v-f99513fd]:after{content:"";position:absolute;top:0%;right:0%;transform:translate(var(--offsetX),var(--offsetY));width:7px;height:7px;border-radius:50%;background-color:#f5222d;border:1px solid #fff}.grid-container[data-v-0e1fb53a]{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--v435dab90),1fr));gap:var(--v6971b9fd)}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute;width:var(--v435dab90)}.list-leave-none{display:none}.diff-code-loading[data-v-98f9d438]{position:absolute;top:80px;left:50%;transform:translate(-50%)}[data-v-98f9d438] .highlight-file{animation:highlight-pulse-98f9d438 .5s ease;animation-iteration-count:3}@keyframes highlight-pulse-98f9d438{0%,to{box-shadow:none}50%{box-shadow:0 0 0 3px var(--el-color-primary-light-5)}}.d2h-file-wrapper{scroll-margin-top:20px}.no-diff{text-align:center;padding:20px;color:#999}.card-no-padding[data-v-04c9aa78] .el-card__body{padding:0;overflow:hidden}.diff-container{display:flex;flex-direction:column;overflow:hidden}.diff-container .el-dialog__body{flex:1;overflow:hidden}.active[data-v-520b6ba3]{border:1px solid #23b2c5;border-radius:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background);font-weight:700}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{justify-content:space-between;align-items:center;margin-bottom:16px;display:flex}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-size:14px;line-height:23px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}[data-v-3db4fd48] .el-segmented__item-label{overflow:unset}
|