@jxsuite/studio 6.0.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/2020-va2wwra4.js +4 -0
- package/dist/chunks/adapter-f93pafd7.js +4 -0
- package/dist/chunks/{cf-account-picker-bb2yq946.js → cf-account-picker-af1h381v.js} +3 -3
- package/dist/chunks/cf-settings-125tdm0w.js +4 -0
- package/dist/chunks/components-ax2f1fnn.js +4 -0
- package/dist/chunks/content-source-108aqtk1.js +4 -0
- package/dist/chunks/{convert-to-repeater-vqkt7s3s.js → convert-to-repeater-ry5rmppr.js} +3 -3
- package/dist/chunks/editor-pfgdmkb0.js +4 -0
- package/dist/chunks/entry-commands-t0k1q0kx.js +4 -0
- package/dist/chunks/{extension-sections-8beq9ac3.js → extension-sections-6mwh2hf8.js} +3 -3
- package/dist/chunks/file-ops-meej5mqf.js +4 -0
- package/dist/chunks/files-44vp8a2s.js +4 -0
- package/dist/chunks/format-host-7q1petb9.js +4 -0
- package/dist/chunks/fs-events-h2mwnxaz.js +4 -0
- package/dist/chunks/git-panel-zngbymvd.js +4 -0
- package/dist/chunks/{grid-view-ca10def6.js → grid-view-sx9vynsp.js} +15 -15
- package/dist/chunks/icons-p44xhjf0.js +4 -0
- package/dist/chunks/iframe-host-qk3ycq87.js +4 -0
- package/dist/chunks/{index-9ydfe04y.js → index-2veqmnhr.js} +3 -3
- package/dist/chunks/index-wkyfjeqz.js +4 -0
- package/dist/chunks/{javascript-d9pqgc2p.js → javascript-8nbvs12s.js} +3 -3
- package/dist/chunks/jsonMode-s8kt9dsj.js +13 -0
- package/dist/chunks/jx-validate-psgd7vsx.js +4 -0
- package/dist/chunks/layers-panel-1kq2jyfk.js +4 -0
- package/dist/chunks/layers-xd92fg8d.js +4 -0
- package/dist/chunks/lit-html-ac4cwwr4.js +4 -0
- package/dist/chunks/media-picker-0svzkdyb.js +4 -0
- package/dist/chunks/menu-5c55ea3d.js +4 -0
- package/dist/chunks/{monaco-binding-62dtmgbf.js → monaco-binding-z6r70pdt.js} +3 -3
- package/dist/chunks/monaco-buffer-fz6gq5y7.js +4 -0
- package/dist/chunks/monaco-setup-q4axkgj7.js +4 -0
- package/dist/chunks/notify-0xgtn8q1.js +4 -0
- package/dist/chunks/platform-v1qctbe6.js +4 -0
- package/dist/chunks/publish-panel-ym1fmgq5.js +4 -0
- package/dist/chunks/quick-search-a54e6t5n.js +4 -0
- package/dist/chunks/references-gmqp82fs.js +4 -0
- package/dist/chunks/right-panel-v7t9awbk.js +4 -0
- package/dist/chunks/section-registry-vhyf3zsr.js +4 -0
- package/dist/chunks/studio-0bhx5hz6.js +5 -0
- package/dist/chunks/studio-0k1ddnyy.js +6 -0
- package/dist/chunks/studio-1b04pd0j.js +64 -0
- package/dist/chunks/{studio-sxc0zvpt.js → studio-1q1sh2ax.js} +3 -3
- package/dist/chunks/studio-4dwbj6gb.js +5 -0
- package/dist/chunks/studio-4tanh828.js +5 -0
- package/dist/chunks/{studio-fqq890ap.js → studio-55h4mstj.js} +3 -3
- package/dist/chunks/studio-5tnvjkz4.js +5 -0
- package/dist/chunks/studio-60dqgb0c.js +5 -0
- package/dist/chunks/studio-61dp09qg.js +9 -0
- package/dist/chunks/studio-63epcrj2.js +5 -0
- package/dist/chunks/studio-74k29dy9.js +5 -0
- package/dist/chunks/{studio-qa73881a.js → studio-7vg6jcd3.js} +4 -4
- package/dist/chunks/studio-7zx31knw.js +9 -0
- package/dist/chunks/studio-8bxk97km.js +5 -0
- package/dist/chunks/{studio-edbtvcd1.js → studio-8grwxtqk.js} +4 -4
- package/dist/chunks/studio-933e30n4.js +5 -0
- package/dist/chunks/{studio-rr4xkv81.js → studio-98wnwhbg.js} +4 -4
- package/dist/chunks/studio-9mccjwjh.js +14 -0
- package/dist/chunks/studio-a2ke1e4t.js +5 -0
- package/dist/chunks/studio-e3a2a6v3.js +4 -0
- package/dist/chunks/{studio-pwqfmt4p.js → studio-e81q1vb9.js} +4 -4
- package/dist/chunks/{studio-7pgy3xaf.js → studio-epgrmqqm.js} +4 -4
- package/dist/chunks/studio-g1shz58g.js +5 -0
- package/dist/chunks/studio-gf0fz03c.js +5 -0
- package/dist/chunks/studio-gjtpe62q.js +6 -0
- package/dist/chunks/{studio-tzegmy4w.js → studio-gkskhg7m.js} +4 -4
- package/dist/chunks/studio-gx4dnjzd.js +5 -0
- package/dist/chunks/{studio-8xcwewjq.js → studio-h46vtzk8.js} +4 -4
- package/dist/chunks/studio-j03zga3y.js +9 -0
- package/dist/chunks/{studio-4r0sjtx8.js → studio-jhpxeckz.js} +4 -4
- package/dist/chunks/{studio-zd4kayn2.js → studio-k01r7ykp.js} +4 -4
- package/dist/chunks/{studio-03wwfvyt.js → studio-kggey1jt.js} +4 -4
- package/dist/chunks/{studio-hnvnfbdv.js → studio-kk7h30ne.js} +6 -6
- package/dist/chunks/{studio-01qza1n3.js → studio-kt1zqney.js} +4 -4
- package/dist/chunks/{studio-r3kaka4d.js → studio-m3cwhvye.js} +4 -4
- package/dist/chunks/{studio-evwgp1ym.js → studio-mcayt6hz.js} +4 -4
- package/dist/chunks/{studio-5vy2wfm5.js → studio-myjcghv3.js} +4 -4
- package/dist/chunks/studio-n8bxwc3y.js +4 -0
- package/dist/chunks/{studio-ztvcxm3w.js → studio-ngm8gvpb.js} +4 -4
- package/dist/chunks/{studio-01kbbqg3.js → studio-nj5a01jy.js} +196 -196
- package/dist/chunks/{studio-xkfs0dp2.js → studio-pcgz8heb.js} +4 -4
- package/dist/chunks/{studio-0bbxhhce.js → studio-pre0skq6.js} +4 -4
- package/dist/chunks/{studio-n78gjfy8.js → studio-qcsq0t15.js} +4 -4
- package/dist/chunks/studio-qkstvve9.js +5 -0
- package/dist/chunks/studio-qv1pwd3c.js +5 -0
- package/dist/chunks/{studio-rmn2dz59.js → studio-rc6dvxjb.js} +5 -5
- package/dist/chunks/{studio-st75kn99.js → studio-rv11kfwa.js} +7 -7
- package/dist/chunks/studio-s8dmmz66.js +5 -0
- package/dist/chunks/studio-sp5xzbj4.js +6 -0
- package/dist/chunks/{studio-tmeq6mjb.js → studio-szsjbj0g.js} +4 -4
- package/dist/chunks/studio-t1xzawhr.js +16 -0
- package/dist/chunks/{studio-mk00zd5d.js → studio-t6b6qe31.js} +4 -4
- package/dist/chunks/{studio-bftp4n4b.js → studio-tdcprbqb.js} +4 -4
- package/dist/chunks/{studio-ge5fqjth.js → studio-vrmcjf9g.js} +5 -5
- package/dist/chunks/studio-vyc0b4he.js +10 -0
- package/dist/chunks/{studio-semd1s8s.js → studio-w0cgf6jg.js} +4 -4
- package/dist/chunks/{studio-gp02nqnw.js → studio-w3hskzqk.js} +4 -4
- package/dist/chunks/{studio-1wvfxkyy.js → studio-wszjyh0j.js} +4 -4
- package/dist/chunks/studio-xgrgcdyh.js +9 -0
- package/dist/chunks/{studio-y7jehjrp.js → studio-xz2yxfcb.js} +4 -4
- package/dist/chunks/{studio-aje966s9.js → studio-y6n42tgs.js} +4 -4
- package/dist/chunks/{studio-yr04mv2j.js → studio-yb560vxr.js} +4 -4
- package/dist/chunks/{studio-tp642n5g.js → studio-yn9f8vtx.js} +4 -4
- package/dist/chunks/studio-yw05w8f0.js +7 -0
- package/dist/chunks/{studio-cbr9czkn.js → studio-z16sgavc.js} +4 -4
- package/dist/chunks/studio-zey7zsdw.js +12 -0
- package/dist/chunks/{studio-1q6amtph.js → studio-zyqn40w4.js} +4 -4
- package/dist/chunks/tsMode-2frah6h1.js +14 -0
- package/dist/chunks/workspace-zt81g1ms.js +4 -0
- package/dist/chunks/ws-client-n2bh4hkf.js +4 -0
- package/dist/iframe-entry.js +13 -13
- package/dist/manifest.json +62 -62
- package/dist/studio.js +87 -87
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +10 -10
- package/src/canvas/canvas-render.ts +4 -1
- package/src/canvas/canvas-utils.ts +73 -15
- package/src/canvas/iframe-host.ts +67 -21
- package/src/canvas/iframe-inline-edit.ts +22 -4
- package/src/canvas/iframe-interaction.ts +7 -1
- package/src/canvas/iframe-protocol.ts +3 -0
- package/src/canvas/iframe-render.ts +5 -2
- package/src/commands/defaults.ts +4 -1
- package/src/commands/live-context.ts +3 -1
- package/src/editor/shortcuts.ts +55 -27
- package/src/files/media-paths.ts +3 -1
- package/src/new-project/add-repo-modal.ts +459 -59
- package/src/panels/editors.ts +3 -1
- package/src/panels/style-panel.ts +36 -11
- package/src/platforms/cloud.ts +95 -18
- package/src/platforms/devserver.ts +47 -12
- package/src/publish/pages-service.ts +7 -0
- package/src/publish/publish-panel.ts +16 -2
- package/src/studio.ts +14 -2
- package/src/surfaces/add-repo.json +721 -224
- package/src/surfaces/add-repo.ts +196 -31
- package/src/surfaces/library-pane.ts +6 -0
- package/src/surfaces/rail.json +126 -73
- package/src/surfaces/rail.ts +31 -5
- package/src/tabs/typing.ts +31 -0
- package/src/types.ts +42 -3
- package/src/utils/edit-display.ts +30 -1
- package/src/utils/project-dir.ts +24 -0
- package/src/workspace/workspace.ts +7 -0
- package/dist/chunks/2020-cs2sb9t1.js +0 -4
- package/dist/chunks/adapter-y5gdq19c.js +0 -4
- package/dist/chunks/cf-settings-20dznc3j.js +0 -4
- package/dist/chunks/components-q037dya7.js +0 -4
- package/dist/chunks/content-source-t0q184js.js +0 -4
- package/dist/chunks/editor-j5sq149q.js +0 -4
- package/dist/chunks/entry-commands-fxzgcc4k.js +0 -4
- package/dist/chunks/file-ops-2n77759h.js +0 -4
- package/dist/chunks/files-fjy7zpxt.js +0 -4
- package/dist/chunks/format-host-wj3mf3n8.js +0 -4
- package/dist/chunks/fs-events-7kcgn4e9.js +0 -4
- package/dist/chunks/git-panel-7z2mpt2d.js +0 -4
- package/dist/chunks/icons-qbh8akb1.js +0 -4
- package/dist/chunks/iframe-host-a0zjd6xp.js +0 -4
- package/dist/chunks/index-m0x5ztax.js +0 -4
- package/dist/chunks/jsonMode-800yvbem.js +0 -13
- package/dist/chunks/jx-validate-zc9zp77s.js +0 -4
- package/dist/chunks/layers-p677nrh5.js +0 -4
- package/dist/chunks/layers-panel-y4w1dq90.js +0 -4
- package/dist/chunks/lit-html-cfn61dn7.js +0 -4
- package/dist/chunks/media-picker-xg7yjpz9.js +0 -4
- package/dist/chunks/menu-fpekzj6w.js +0 -4
- package/dist/chunks/monaco-buffer-nn4dtx27.js +0 -4
- package/dist/chunks/monaco-setup-tj13ndtm.js +0 -4
- package/dist/chunks/notify-ahs57a2z.js +0 -4
- package/dist/chunks/platform-v9xyfkbx.js +0 -4
- package/dist/chunks/publish-panel-xtbfgg2r.js +0 -4
- package/dist/chunks/quick-search-d3a6m7j3.js +0 -4
- package/dist/chunks/references-99ws0b0m.js +0 -4
- package/dist/chunks/right-panel-31vbk5xp.js +0 -4
- package/dist/chunks/section-registry-b2yzp9sw.js +0 -4
- package/dist/chunks/studio-1a99w39s.js +0 -5
- package/dist/chunks/studio-3ck2a5c4.js +0 -10
- package/dist/chunks/studio-4fde4a0x.js +0 -5
- package/dist/chunks/studio-4jj9gme2.js +0 -6
- package/dist/chunks/studio-4m50vh74.js +0 -16
- package/dist/chunks/studio-4xppwncr.js +0 -4
- package/dist/chunks/studio-5d7wfmnp.js +0 -5
- package/dist/chunks/studio-5e9zsamh.js +0 -9
- package/dist/chunks/studio-5gs9th4b.js +0 -5
- package/dist/chunks/studio-7qvs7v0m.js +0 -5
- package/dist/chunks/studio-84rtc120.js +0 -5
- package/dist/chunks/studio-aekhcdzw.js +0 -7
- package/dist/chunks/studio-aqmph6k4.js +0 -5
- package/dist/chunks/studio-c6zdm25z.js +0 -9
- package/dist/chunks/studio-capk0583.js +0 -9
- package/dist/chunks/studio-chdmwwzw.js +0 -5
- package/dist/chunks/studio-cp1gbff9.js +0 -14
- package/dist/chunks/studio-cqmtbg2p.js +0 -5
- package/dist/chunks/studio-e47215hh.js +0 -5
- package/dist/chunks/studio-fbx6twps.js +0 -6
- package/dist/chunks/studio-fthwn4kf.js +0 -5
- package/dist/chunks/studio-g8dsj3d2.js +0 -6
- package/dist/chunks/studio-gjknvzam.js +0 -9
- package/dist/chunks/studio-hjbg8d5y.js +0 -12
- package/dist/chunks/studio-nbxqcgvf.js +0 -5
- package/dist/chunks/studio-t1eedsyx.js +0 -4
- package/dist/chunks/studio-vavmwshr.js +0 -5
- package/dist/chunks/studio-x5g1xk77.js +0 -5
- package/dist/chunks/studio-x92tgnee.js +0 -64
- package/dist/chunks/studio-xg1942as.js +0 -5
- package/dist/chunks/studio-zev8ssp1.js +0 -5
- package/dist/chunks/tsMode-k9s9fcag.js +0 -14
- package/dist/chunks/workspace-5vmgsagj.js +0 -4
- package/dist/chunks/ws-client-0ja08haa.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function u(t){let n=t.replaceAll("\\","/");return n.length>1&&n.endsWith("/")?n.slice(0,-1):n}function f(t){let n=u(t);return n.startsWith("/")?n:`/${n}`}function p(t,n){return[...t].toSorted((e,s)=>s[n].length-e[n].length)}function g(t,n){return t===n||t.startsWith(`${n}/`)}function
|
|
2
|
-
export{
|
|
1
|
+
function u(t){let n=t.replaceAll("\\","/");return n.length>1&&n.endsWith("/")?n.slice(0,-1):n}function f(t){let n=u(t);return n.startsWith("/")?n:`/${n}`}function p(t,n){return[...t].toSorted((e,s)=>s[n].length-e[n].length)}function g(t,n){return t===n||t.startsWith(`${n}/`)}function WR(t,n){let e=u(n);for(let s of p(t,"dir")){let r=u(s.dir);if(!g(e,r)||e===r)continue;let i=e.slice(r.length+1),{filter:o}=s;if(o&&!o(i))return null;let l=i.split("/").map((c)=>encodeURIComponent(c)).join("/");return`${f(s.urlPrefix)}/${l}`}return null}function h(t,n){let e=n.split("#")[0].split("?")[0];if(!e.startsWith("/"))return null;let s;try{s=decodeURIComponent(e)}catch{return null}if(/%2e|%2f/i.test(s))return null;for(let r of p(t,"urlPrefix")){let i=f(r.urlPrefix);if(!s.startsWith(`${i}/`))continue;let l=s.slice(i.length+1).split("/");if(l.some((a)=>a===""||a==="."||a===".."))return null;let{filter:c}=r;if(c&&!c(l.join("/")))return null;return`${u(r.dir)}/${l.join("/")}`}return null}var A=String.raw`"'\s<>()\\`;var Zp="public";var VR=["mounts","public"];function Xy(t){let n=t.search(/[#?]/);return n===-1?{path:t,suffix:""}:{path:t.slice(0,n),suffix:t.slice(n)}}function W1(t){return t===""||t.startsWith("/")||t.startsWith("#")||t.includes("${")||/^[a-z][\w+.-]*:/i.test(t)}function hi(t){return t.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function zR(t){let n=hi(t),e=n.lastIndexOf("/");return e===-1?"":n.slice(0,e)}function V1(t,n){let s=(t===""||t==="."?[]:hi(t).split("/")).filter((r)=>r!==""&&r!==".");for(let r of n.replaceAll("\\","/").split("/")){if(r===""||r===".")continue;if(r===".."){if(s.length===0)return null;s.pop();continue}s.push(r)}return s.join("/")}function d(t,n,e){let{path:s}=Xy(t);if(!s.startsWith("/"))return[];let r;try{r=decodeURIComponent(s)}catch{return[]}if(/%2e|%2f/i.test(r))return[];let i=r.replace(/^\/+/,"");if(i===""||i.split("/").some((l)=>l==="."||l===".."))return[];let o=[];for(let l of e){if(l==="mounts"){let c=h(n,s);if(c!==null&&!c.startsWith("/")&&!/^[A-Za-z]:/.test(c))o.push(hi(c));continue}o.push(l==="root"?i:`${Zp}/${i}`)}return[...new Set(o)]}function UR(t,n,e,s){let{path:r}=Xy(t);if(r==="")return null;if(W1(t))return r.startsWith("/")?d(r,e,s)[0]??null:null;if(r.endsWith("/"))return null;let i;try{i=decodeURIComponent(r)}catch{return null}let o=V1(n,i);if(o===null||o===""||o===hi(n))return null;return o}function eg(t){return t.split("/").map((n)=>encodeURIComponent(n)).join("/")}function qR(t){let n=[],e=0;while(e<t.length){while(e<t.length&&(/\s/.test(t[e])||t[e]===","))e+=1;if(e>=t.length)break;let s=e;while(e<t.length&&!/\s/.test(t[e]))e+=1;let r=t.slice(s,e);if(r.endsWith(",")){n.push({descriptor:"",url:r.replace(/,+$/,"")});continue}while(e<t.length&&/\s/.test(t[e]))e+=1;let i=e;while(e<t.length&&t[e]!==",")e+=1;let o=t.slice(i,e).trim();if(e+=1,r=r.replace(/,+$/,""),r!=="")n.push({descriptor:o,url:r})}return n}function GR(t){return t.map(({url:n,descriptor:e})=>e?`${n} ${e}`:n).join(", ")}
|
|
2
|
+
export{WR,Zp,VR,Xy,W1,hi,zR,V1,UR,eg,qR,GR};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=29F673A85513B2E564756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-zyqn40w4.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{Ru,Hs,nw,yc,Rn,pe}from"./studio-nj5a01jy.js";import{nv}from"./studio-xgrgcdyh.js";import{tk}from"./studio-1b04pd0j.js";class C{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){if(this._worker)this._worker.dispose(),this._worker=null;this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();if(this._updateExtraLibsToken!==e)return;t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){if(!this._client)this._client=(async()=>{if(this._worker=nv({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("ts.worker.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync())return await this._worker.withSyncedResources(Rn.getModels().filter((e)=>e.getLanguageId()===this._modeId).map((e)=>e.uri));return await this._worker.getProxy()})();return this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();if(this._worker)await this._worker.withSyncedResources(e);return t}}var s={};s["lib.d.ts"]=!0;s["lib.decorators.d.ts"]=!0;s["lib.decorators.legacy.d.ts"]=!0;s["lib.dom.asynciterable.d.ts"]=!0;s["lib.dom.d.ts"]=!0;s["lib.dom.iterable.d.ts"]=!0;s["lib.es2015.collection.d.ts"]=!0;s["lib.es2015.core.d.ts"]=!0;s["lib.es2015.d.ts"]=!0;s["lib.es2015.generator.d.ts"]=!0;s["lib.es2015.iterable.d.ts"]=!0;s["lib.es2015.promise.d.ts"]=!0;s["lib.es2015.proxy.d.ts"]=!0;s["lib.es2015.reflect.d.ts"]=!0;s["lib.es2015.symbol.d.ts"]=!0;s["lib.es2015.symbol.wellknown.d.ts"]=!0;s["lib.es2016.array.include.d.ts"]=!0;s["lib.es2016.d.ts"]=!0;s["lib.es2016.full.d.ts"]=!0;s["lib.es2016.intl.d.ts"]=!0;s["lib.es2017.arraybuffer.d.ts"]=!0;s["lib.es2017.d.ts"]=!0;s["lib.es2017.date.d.ts"]=!0;s["lib.es2017.full.d.ts"]=!0;s["lib.es2017.intl.d.ts"]=!0;s["lib.es2017.object.d.ts"]=!0;s["lib.es2017.sharedmemory.d.ts"]=!0;s["lib.es2017.string.d.ts"]=!0;s["lib.es2017.typedarrays.d.ts"]=!0;s["lib.es2018.asyncgenerator.d.ts"]=!0;s["lib.es2018.asynciterable.d.ts"]=!0;s["lib.es2018.d.ts"]=!0;s["lib.es2018.full.d.ts"]=!0;s["lib.es2018.intl.d.ts"]=!0;s["lib.es2018.promise.d.ts"]=!0;s["lib.es2018.regexp.d.ts"]=!0;s["lib.es2019.array.d.ts"]=!0;s["lib.es2019.d.ts"]=!0;s["lib.es2019.full.d.ts"]=!0;s["lib.es2019.intl.d.ts"]=!0;s["lib.es2019.object.d.ts"]=!0;s["lib.es2019.string.d.ts"]=!0;s["lib.es2019.symbol.d.ts"]=!0;s["lib.es2020.bigint.d.ts"]=!0;s["lib.es2020.d.ts"]=!0;s["lib.es2020.date.d.ts"]=!0;s["lib.es2020.full.d.ts"]=!0;s["lib.es2020.intl.d.ts"]=!0;s["lib.es2020.number.d.ts"]=!0;s["lib.es2020.promise.d.ts"]=!0;s["lib.es2020.sharedmemory.d.ts"]=!0;s["lib.es2020.string.d.ts"]=!0;s["lib.es2020.symbol.wellknown.d.ts"]=!0;s["lib.es2021.d.ts"]=!0;s["lib.es2021.full.d.ts"]=!0;s["lib.es2021.intl.d.ts"]=!0;s["lib.es2021.promise.d.ts"]=!0;s["lib.es2021.string.d.ts"]=!0;s["lib.es2021.weakref.d.ts"]=!0;s["lib.es2022.array.d.ts"]=!0;s["lib.es2022.d.ts"]=!0;s["lib.es2022.error.d.ts"]=!0;s["lib.es2022.full.d.ts"]=!0;s["lib.es2022.intl.d.ts"]=!0;s["lib.es2022.object.d.ts"]=!0;s["lib.es2022.regexp.d.ts"]=!0;s["lib.es2022.string.d.ts"]=!0;s["lib.es2023.array.d.ts"]=!0;s["lib.es2023.collection.d.ts"]=!0;s["lib.es2023.d.ts"]=!0;s["lib.es2023.full.d.ts"]=!0;s["lib.es2023.intl.d.ts"]=!0;s["lib.es2024.arraybuffer.d.ts"]=!0;s["lib.es2024.collection.d.ts"]=!0;s["lib.es2024.d.ts"]=!0;s["lib.es2024.full.d.ts"]=!0;s["lib.es2024.object.d.ts"]=!0;s["lib.es2024.promise.d.ts"]=!0;s["lib.es2024.regexp.d.ts"]=!0;s["lib.es2024.sharedmemory.d.ts"]=!0;s["lib.es2024.string.d.ts"]=!0;s["lib.es5.d.ts"]=!0;s["lib.es6.d.ts"]=!0;s["lib.esnext.array.d.ts"]=!0;s["lib.esnext.collection.d.ts"]=!0;s["lib.esnext.d.ts"]=!0;s["lib.esnext.decorators.d.ts"]=!0;s["lib.esnext.disposable.d.ts"]=!0;s["lib.esnext.error.d.ts"]=!0;s["lib.esnext.float16.d.ts"]=!0;s["lib.esnext.full.d.ts"]=!0;s["lib.esnext.intl.d.ts"]=!0;s["lib.esnext.iterator.d.ts"]=!0;s["lib.esnext.promise.d.ts"]=!0;s["lib.esnext.sharedmemory.d.ts"]=!0;s["lib.scripthost.d.ts"]=!0;s["lib.webworker.asynciterable.d.ts"]=!0;s["lib.webworker.d.ts"]=!0;s["lib.webworker.importscripts.d.ts"]=!0;s["lib.webworker.iterable.d.ts"]=!0;function x(e,t,n=0){if(typeof e==="string")return e;else if(e===void 0)return"";let a="";if(n){a+=t;for(let i=0;i<n;i++)a+=" "}if(a+=e.messageText,n++,e.next)for(let i of e.next)a+=x(i,t,n);return a}function m(e){if(e)return e.map((t)=>t.text).join("");return""}class h{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),a=e.getPositionAt(t.start+t.length),{lineNumber:i,column:c}=n,{lineNumber:l,column:r}=a;return{startLineNumber:i,startColumn:c,endLineNumber:l,endColumn:r}}}class D{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){if(!e)return!1;if(e.path.indexOf("/lib.")===0)return!!s[e.path.slice(1)];return!1}getOrCreateModel(e){let t=yc.parse(e),n=Rn.getModel(t);if(n)return n;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return Rn.createModel(this._libFiles[t.path.slice(1)],"typescript",t);let a=tk.getExtraLibs()[e];if(a)return Rn.createModel(a.content,"typescript",t);return null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){if(!this._containsLibFile(e))return;await this._fetchLibFiles()}_fetchLibFiles(){if(!this._fetchLibFilesPromise)this._fetchLibFilesPromise=this._worker().then((e)=>e.getLibFiles()).then((e)=>{this._hasFetchedLibFiles=!0,this._libFiles=e});return this._fetchLibFilesPromise}}class F extends h{constructor(e,t,n,a){super(a);this._libFiles=e,this._defaults=t,this._selector=n,this._disposables=[],this._listener=Object.create(null);let i=(r)=>{if(r.getLanguageId()!==n)return;let u=()=>{let{onlyVisible:g}=this._defaults.getDiagnosticsOptions();if(g){if(r.isAttachedToEditor())this._doValidate(r)}else this._doValidate(r)},p,f=r.onDidChangeContent(()=>{clearTimeout(p),p=window.setTimeout(u,500)}),d=r.onDidChangeAttached(()=>{let{onlyVisible:g}=this._defaults.getDiagnosticsOptions();if(g)if(r.isAttachedToEditor())u();else Rn.setModelMarkers(r,this._selector,[])});this._listener[r.uri.toString()]={dispose(){f.dispose(),d.dispose(),clearTimeout(p)}},u()},c=(r)=>{Rn.setModelMarkers(r,this._selector,[]);let u=r.uri.toString();if(this._listener[u])this._listener[u].dispose(),delete this._listener[u]};this._disposables.push(Rn.onDidCreateModel((r)=>i(r))),this._disposables.push(Rn.onWillDisposeModel(c)),this._disposables.push(Rn.onDidChangeModelLanguage((r)=>{c(r.model),i(r.model)})),this._disposables.push({dispose(){for(let r of Rn.getModels())c(r)}});let l=()=>{for(let r of Rn.getModels())c(r),i(r)};this._disposables.push(this._defaults.onDidChange(l)),this._disposables.push(this._defaults.onDidExtraLibsChange(l)),Rn.getModels().forEach((r)=>i(r))}dispose(){this._disposables.forEach((e)=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let t=await this._worker(e.uri);if(e.isDisposed())return;let n=[],{noSyntaxValidation:a,noSemanticValidation:i,noSuggestionDiagnostics:c}=this._defaults.getDiagnosticsOptions();if(!a)n.push(t.getSyntacticDiagnostics(e.uri.toString()));if(!i)n.push(t.getSemanticDiagnostics(e.uri.toString()));if(!c)n.push(t.getSuggestionDiagnostics(e.uri.toString()));let l=await Promise.all(n);if(!l||e.isDisposed())return;let r=l.reduce((p,f)=>f.concat(p),[]).filter((p)=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(p.code)===-1),u=r.map((p)=>p.relatedInformation||[]).reduce((p,f)=>f.concat(p),[]).map((p)=>p.file?yc.parse(p.file.fileName):null);if(await this._libFiles.fetchLibFilesIfNecessary(u),e.isDisposed())return;Rn.setModelMarkers(e,this._selector,r.map((p)=>this._convertDiagnostics(e,p)))}_convertDiagnostics(e,t){let n=t.start||0,a=t.length||1,{lineNumber:i,column:c}=e.getPositionAt(n),{lineNumber:l,column:r}=e.getPositionAt(n+a),u=[];if(t.reportsUnnecessary)u.push(nw.Unnecessary);if(t.reportsDeprecated)u.push(nw.Deprecated);return{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:i,startColumn:c,endLineNumber:l,endColumn:r,message:x(t.messageText,`
|
|
2
|
+
`),code:t.code.toString(),tags:u,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];let n=[];return t.forEach((a)=>{let i=e;if(a.file)i=this._libFiles.getOrCreateModel(a.file.fileName);if(!i)return;let c=a.start||0,l=a.length||1,{lineNumber:r,column:u}=i.getPositionAt(c),{lineNumber:p,column:f}=i.getPositionAt(c+l);n.push({resource:i.uri,startLineNumber:r,startColumn:u,endLineNumber:p,endColumn:f,message:x(a.messageText,`
|
|
3
|
+
`)})}),n}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return Hs.Error;case 3:return Hs.Info;case 0:return Hs.Warning;case 2:return Hs.Hint}return Hs.Info}}class _ extends h{get triggerCharacters(){return["."]}async provideCompletionItems(e,t,n,a){let i=e.getWordUntilPosition(t),c=new Ru(t.lineNumber,i.startColumn,t.lineNumber,i.endColumn),l=e.uri,r=e.getOffsetAt(t),u=await this._worker(l);if(e.isDisposed())return;let p=await u.getCompletionsAtPosition(l.toString(),r);if(!p||e.isDisposed())return;return{suggestions:p.entries.map((d)=>{let g=c;if(d.replacementSpan){let k=e.getPositionAt(d.replacementSpan.start),S=e.getPositionAt(d.replacementSpan.start+d.replacementSpan.length);g=new Ru(k.lineNumber,k.column,S.lineNumber,S.column)}let y=[];if(d.kindModifiers!==void 0&&d.kindModifiers.indexOf("deprecated")!==-1)y.push(pe.CompletionItemTag.Deprecated);return{uri:l,position:t,offset:r,range:g,label:d.name,insertText:d.name,sortText:d.sortText,kind:_.convertKind(d.kind),tags:y}})}}async resolveCompletionItem(e,t){let n=e,{uri:a,position:i,offset:c}=n,r=await(await this._worker(a)).getCompletionEntryDetails(a.toString(),c,n.label);if(!r)return n;return{uri:a,position:i,label:r.name,kind:_.convertKind(r.kind),detail:m(r.displayParts),documentation:{value:_.createDocumentationString(r)}}}static convertKind(e){switch(e){case o.primitiveType:case o.keyword:return pe.CompletionItemKind.Keyword;case o.variable:case o.localVariable:return pe.CompletionItemKind.Variable;case o.memberVariable:case o.memberGetAccessor:case o.memberSetAccessor:return pe.CompletionItemKind.Field;case o.function:case o.memberFunction:case o.constructSignature:case o.callSignature:case o.indexSignature:return pe.CompletionItemKind.Function;case o.enum:return pe.CompletionItemKind.Enum;case o.module:return pe.CompletionItemKind.Module;case o.class:return pe.CompletionItemKind.Class;case o.interface:return pe.CompletionItemKind.Interface;case o.warning:return pe.CompletionItemKind.File}return pe.CompletionItemKind.Property}static createDocumentationString(e){let t=m(e.documentation);if(e.tags)for(let n of e.tags)t+=`
|
|
4
|
+
|
|
5
|
+
${V(n)}`;return t}}function V(e){let t=`*@${e.name}*`;if(e.name==="param"&&e.text){let[n,...a]=e.text;if(t+=`\`${n.text}\``,a.length>0)t+=` — ${a.map((i)=>i.text).join(" ")}`}else if(Array.isArray(e.text))t+=` — ${e.text.map((n)=>n.text).join(" ")}`;else if(e.text)t+=` — ${e.text}`;return t}class v extends h{constructor(){super(...arguments);this.signatureHelpTriggerCharacters=["(",","]}static _toSignatureHelpTriggerReason(e){switch(e.triggerKind){case pe.SignatureHelpTriggerKind.TriggerCharacter:if(e.triggerCharacter)if(e.isRetrigger)return{kind:"retrigger",triggerCharacter:e.triggerCharacter};else return{kind:"characterTyped",triggerCharacter:e.triggerCharacter};else return{kind:"invoked"};case pe.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case pe.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}async provideSignatureHelp(e,t,n,a){let i=e.uri,c=e.getOffsetAt(t),l=await this._worker(i);if(e.isDisposed())return;let r=await l.getSignatureHelpItems(i.toString(),c,{triggerReason:v._toSignatureHelpTriggerReason(a)});if(!r||e.isDisposed())return;let u={activeSignature:r.selectedItemIndex,activeParameter:r.argumentIndex,signatures:[]};return r.items.forEach((p)=>{let f={label:"",parameters:[]};f.documentation={value:m(p.documentation)},f.label+=m(p.prefixDisplayParts),p.parameters.forEach((d,g,y)=>{let k=m(d.displayParts),S={label:k,documentation:{value:m(d.documentation)}};if(f.label+=k,f.parameters.push(S),g<y.length-1)f.label+=m(p.separatorDisplayParts)}),f.label+=m(p.suffixDisplayParts),u.signatures.push(f)}),{value:u,dispose(){}}}}class T extends h{async provideHover(e,t,n){let a=e.uri,i=e.getOffsetAt(t),c=await this._worker(a);if(e.isDisposed())return;let l=await c.getQuickInfoAtPosition(a.toString(),i);if(!l||e.isDisposed())return;let r=m(l.documentation),u=l.tags?l.tags.map((f)=>V(f)).join(`
|
|
6
|
+
|
|
7
|
+
`):"",p=m(l.displayParts);return{range:this._textSpanToRange(e,l.textSpan),contents:[{value:"```typescript\n"+p+"\n```\n"},{value:r+(u?`
|
|
8
|
+
|
|
9
|
+
`+u:"")}]}}}class L extends h{async provideDocumentHighlights(e,t,n){let a=e.uri,i=e.getOffsetAt(t),c=await this._worker(a);if(e.isDisposed())return;let l=await c.getDocumentHighlights(a.toString(),i,[a.toString()]);if(!l||e.isDisposed())return;return l.flatMap((r)=>r.highlightSpans.map((u)=>({range:this._textSpanToRange(e,u.textSpan),kind:u.kind==="writtenReference"?pe.DocumentHighlightKind.Write:pe.DocumentHighlightKind.Text})))}}class A extends h{constructor(e,t){super(t);this._libFiles=e}async provideDefinition(e,t,n){let a=e.uri,i=e.getOffsetAt(t),c=await this._worker(a);if(e.isDisposed())return;let l=await c.getDefinitionAtPosition(a.toString(),i);if(!l||e.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(l.map((u)=>yc.parse(u.fileName))),e.isDisposed())return;let r=[];for(let u of l){let p=this._libFiles.getOrCreateModel(u.fileName);if(p)r.push({uri:p.uri,range:this._textSpanToRange(p,u.textSpan)})}return r}}class I extends h{constructor(e,t){super(t);this._libFiles=e}async provideReferences(e,t,n,a){let i=e.uri,c=e.getOffsetAt(t),l=await this._worker(i);if(e.isDisposed())return;let r=await l.getReferencesAtPosition(i.toString(),c);if(!r||e.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(r.map((p)=>yc.parse(p.fileName))),e.isDisposed())return;let u=[];for(let p of r){let f=this._libFiles.getOrCreateModel(p.fileName);if(f)u.push({uri:f.uri,range:this._textSpanToRange(f,p.textSpan)})}return u}}class P extends h{async provideDocumentSymbols(e,t){let n=e.uri,a=await this._worker(n);if(e.isDisposed())return;let i=await a.getNavigationTree(n.toString());if(!i||e.isDisposed())return;let c=(r,u)=>({name:r.text,detail:"",kind:b[r.kind]||pe.SymbolKind.Variable,range:this._textSpanToRange(e,r.spans[0]),selectionRange:this._textSpanToRange(e,r.spans[0]),tags:[],children:r.childItems?.map((f)=>c(f,r.text)),containerName:u});return i.childItems?i.childItems.map((r)=>c(r)):[]}}class o{}o.unknown="";o.keyword="keyword";o.script="script";o.module="module";o.class="class";o.interface="interface";o.type="type";o.enum="enum";o.variable="var";o.localVariable="local var";o.function="function";o.localFunction="local function";o.memberFunction="method";o.memberGetAccessor="getter";o.memberSetAccessor="setter";o.memberVariable="property";o.constructorImplementation="constructor";o.callSignature="call";o.indexSignature="index";o.constructSignature="construct";o.parameter="parameter";o.typeParameter="type parameter";o.primitiveType="primitive type";o.label="label";o.alias="alias";o.const="const";o.let="let";o.warning="warning";var b=Object.create(null);b[o.module]=pe.SymbolKind.Module;b[o.class]=pe.SymbolKind.Class;b[o.enum]=pe.SymbolKind.Enum;b[o.interface]=pe.SymbolKind.Interface;b[o.memberFunction]=pe.SymbolKind.Method;b[o.memberVariable]=pe.SymbolKind.Property;b[o.memberGetAccessor]=pe.SymbolKind.Property;b[o.memberSetAccessor]=pe.SymbolKind.Property;b[o.variable]=pe.SymbolKind.Variable;b[o.const]=pe.SymbolKind.Variable;b[o.localVariable]=pe.SymbolKind.Variable;b[o.variable]=pe.SymbolKind.Variable;b[o.function]=pe.SymbolKind.Function;b[o.localFunction]=pe.SymbolKind.Function;class w extends h{static _convertOptions(e){return{ConvertTabsToSpaces:e.insertSpaces,TabSize:e.tabSize,IndentSize:e.tabSize,IndentStyle:2,NewLineCharacter:`
|
|
10
|
+
`,InsertSpaceAfterCommaDelimiter:!0,InsertSpaceAfterSemicolonInForStatements:!0,InsertSpaceBeforeAndAfterBinaryOperators:!0,InsertSpaceAfterKeywordsInControlFlowStatements:!0,InsertSpaceAfterFunctionKeywordForAnonymousFunctions:!0,InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,PlaceOpenBraceOnNewLineForControlBlocks:!1,PlaceOpenBraceOnNewLineForFunctions:!1}}_convertTextChanges(e,t){return{text:t.newText,range:this._textSpanToRange(e,t.span)}}}class O extends w{constructor(){super(...arguments);this.canFormatMultipleRanges=!1}async provideDocumentRangeFormattingEdits(e,t,n,a){let i=e.uri,c=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),l=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),r=await this._worker(i);if(e.isDisposed())return;let u=await r.getFormattingEditsForRange(i.toString(),c,l,w._convertOptions(n));if(!u||e.isDisposed())return;return u.map((p)=>this._convertTextChanges(e,p))}}class N extends w{get autoFormatTriggerCharacters(){return[";","}",`
|
|
11
|
+
`]}async provideOnTypeFormattingEdits(e,t,n,a,i){let c=e.uri,l=e.getOffsetAt(t),r=await this._worker(c);if(e.isDisposed())return;let u=await r.getFormattingEditsAfterKeystroke(c.toString(),l,n,w._convertOptions(a));if(!u||e.isDisposed())return;return u.map((p)=>this._convertTextChanges(e,p))}}class M extends w{async provideCodeActions(e,t,n,a){let i=e.uri,c=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),l=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),r=w._convertOptions(e.getOptions()),u=n.markers.filter((g)=>g.code).map((g)=>g.code).map(Number),p=await this._worker(i);if(e.isDisposed())return;let f=await p.getCodeFixesAtPosition(i.toString(),c,l,u,r);if(!f||e.isDisposed())return{actions:[],dispose:()=>{}};return{actions:f.filter((g)=>g.changes.filter((y)=>y.isNewFile).length===0).map((g)=>this._tsCodeFixActionToMonacoCodeAction(e,n,g)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(e,t,n){let a=[];for(let c of n.changes)for(let l of c.textChanges)a.push({resource:e.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(e,l.span),text:l.newText}});return{title:n.description,edit:{edits:a},diagnostics:t.markers,kind:"quickfix"}}}class R extends h{constructor(e,t){super(t);this._libFiles=e}async provideRenameEdits(e,t,n,a){let i=e.uri,c=i.toString(),l=e.getOffsetAt(t),r=await this._worker(i);if(e.isDisposed())return;let u=await r.getRenameInfo(c,l,{allowRenameOfImportPath:!1});if(u.canRename===!1)return{edits:[],rejectReason:u.localizedErrorMessage};if(u.fileToRename!==void 0)throw Error("Renaming files is not supported.");let p=await r.findRenameLocations(c,l,!1,!1,!1);if(!p||e.isDisposed())return;let f=[];for(let d of p){let g=this._libFiles.getOrCreateModel(d.fileName);if(g)f.push({resource:g.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(g,d.textSpan),text:n}});else throw Error(`Unknown file ${d.fileName}.`)}return{edits:f}}}class E extends h{async provideInlayHints(e,t,n){let a=e.uri,i=a.toString(),c=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),l=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),r=await this._worker(a);if(e.isDisposed())return null;return{hints:(await r.provideInlayHints(i,c,l)).map((f)=>({...f,label:f.text,position:e.getPositionAt(f.position),kind:this._convertHintKind(f.kind)})),dispose:()=>{}}}_convertHintKind(e){switch(e){case"Parameter":return pe.InlayHintKind.Parameter;case"Type":return pe.InlayHintKind.Type;default:return pe.InlayHintKind.Type}}}var H,W;function te(e){W=j(e,"typescript")}function se(e){H=j(e,"javascript")}function re(){return new Promise((e,t)=>{if(!H)return t("JavaScript not registered!");e(H)})}function ie(){return new Promise((e,t)=>{if(!W)return t("TypeScript not registered!");e(W)})}function j(e,t){let n=[],a=new C(t,e),i=(...r)=>a.getLanguageServiceWorker(...r),c=new D(i);function l(){let{modeConfiguration:r}=e;if(B(n),r.completionItems)n.push(pe.registerCompletionItemProvider(t,new _(i)));if(r.signatureHelp)n.push(pe.registerSignatureHelpProvider(t,new v(i)));if(r.hovers)n.push(pe.registerHoverProvider(t,new T(i)));if(r.documentHighlights)n.push(pe.registerDocumentHighlightProvider(t,new L(i)));if(r.definitions)n.push(pe.registerDefinitionProvider(t,new A(c,i)));if(r.references)n.push(pe.registerReferenceProvider(t,new I(c,i)));if(r.documentSymbols)n.push(pe.registerDocumentSymbolProvider(t,new P(i)));if(r.rename)n.push(pe.registerRenameProvider(t,new R(c,i)));if(r.documentRangeFormattingEdits)n.push(pe.registerDocumentRangeFormattingEditProvider(t,new O(i)));if(r.onTypeFormattingEdits)n.push(pe.registerOnTypeFormattingEditProvider(t,new N(i)));if(r.codeActions)n.push(pe.registerCodeActionProvider(t,new M(i)));if(r.inlayHints)n.push(pe.registerInlayHintsProvider(t,new E(i)));if(r.diagnostics)n.push(new F(c,e,t,i))}return l(),i}function B(e){while(e.length)e.pop().dispose()}export{h as Adapter,M as CodeActionAdaptor,A as DefinitionAdapter,F as DiagnosticsAdapter,L as DocumentHighlightAdapter,O as FormatAdapter,w as FormatHelper,N as FormatOnTypeAdapter,E as InlayHintsAdapter,o as Kind,D as LibFiles,P as OutlineAdapter,T as QuickInfoAdapter,I as ReferenceAdapter,R as RenameAdapter,v as SignatureHelpAdapter,_ as SuggestAdapter,C as WorkerManager,x as flattenDiagnosticMessageText,re as getJavaScriptWorker,ie as getTypeScriptWorker,se as setupJavaScript,te as setupTypeScript};
|
|
12
|
+
|
|
13
|
+
//# debugId=9033496062208A4264756E2164756E21
|
|
14
|
+
//# sourceMappingURL=tsMode-2frah6h1.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{ti,Ap,f1,m,u,Po,Wn,ah,Mo,Pp,Zx,Xx,Jl,Mp,Fp,jp,lh,nl,Hp,Mc,Mr,Yl,Qx,By,m1,e_,g1,b1,ui,Fm,Wy,y1}from"./studio-a2ke1e4t.js";import"./studio-epgrmqqm.js";import"./studio-5tnvjkz4.js";import"./studio-xz2yxfcb.js";import"./studio-55h4mstj.js";export{f1 as MAX_PANES,ti as PRIMARY_PANE,Ap as SECONDARY_PANE,ui as activateTab,Po as activePane,u as activeTab,g1 as closeAllTabs,Mp as closePane,e_ as closeTab,jp as detachTab,Mo as focusPane,lh as insertIntoPane,Pp as isPaneFocused,Hp as isTabActive,m1 as moveTab,Fm as moveTabToPane,Mr as openTab,Xx as paneBeside,Wn as paneById,Fp as paneIsEmpty,ah as paneOfTab,Qx as promoteDirtyPreviewTabs,Yl as promoteTab,Jl as receivingPane,y1 as registerTabCommands,Wy as renameTab,b1 as replaceAllTabs,By as setTabPinned,nl as setWorkspaceProject,Zx as splitRight,Mc as tabIsLive,m as workspace};
|
|
2
|
+
|
|
3
|
+
//# debugId=D957F88A9842AB6864756E2164756E21
|
|
4
|
+
//# sourceMappingURL=workspace-zt81g1ms.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{A0,Io,ha,P0,Kr,ft,pa,wr,fa,Rr,Et,ma,hd,Iu,vc,Ik,Dk,Nk,M0,F0}from"./studio-j03zga3y.js";import{ib}from"./studio-wszjyh0j.js";var x=30000;class O extends A0{constructor(e){super();this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let r=hd();if(this.getLocalState()!==null&&x/2<=r-this.meta.get(this.clientID).lastUpdated)this.setLocalState(this.getLocalState());let s=[];if(this.meta.forEach((o,c)=>{if(c!==this.clientID&&x<=r-o.lastUpdated&&this.states.has(c))s.push(c)}),s.length>0)I(this,s,"timeout")},Io(x/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let r=this.clientID,s=this.meta.get(r),o=s===void 0?0:s.clock+1,c=this.states.get(r);if(e===null)this.states.delete(r);else this.states.set(r,e);this.meta.set(r,{clock:o,lastUpdated:hd()});let a=[],i=[],y=[],f=[];if(e===null)f.push(r);else if(c==null){if(e!=null)a.push(r)}else if(i.push(r),!Iu(c,e))y.push(r);if(a.length>0||y.length>0||f.length>0)this.emit("change",[{added:a,updated:y,removed:f},"local"]);this.emit("update",[{added:a,updated:i,removed:f},"local"])}setLocalStateField(e,r){let s=this.getLocalState();if(s!==null)this.setLocalState({...s,[e]:r})}getStates(){return this.states}}var I=(e,r,s)=>{let o=[];for(let c=0;c<r.length;c++){let a=r[c];if(e.states.has(a)){if(e.states.delete(a),a===e.clientID){let i=e.meta.get(a);e.meta.set(a,{clock:i.clock+1,lastUpdated:hd()})}o.push(a)}}if(o.length>0)e.emit("change",[{added:[],updated:[],removed:o},s]),e.emit("update",[{added:[],updated:[],removed:o},s])},L=(e,r,s=e.states)=>{let o=r.length,c=ha();ft(c,o);for(let a=0;a<o;a++){let i=r[a],y=s.get(i)||null,f=e.meta.get(i).clock;ft(c,i),ft(c,f),pa(c,JSON.stringify(y))}return Kr(c)};var E=(e,r,s)=>{let o=fa(r),c=hd(),a=[],i=[],y=[],f=[],U=Et(o);for(let b=0;b<U;b++){let h=Et(o),g=Et(o),S=JSON.parse(ma(o)),v=e.meta.get(h),k=e.states.get(h),w=v===void 0?0:v.clock;if(w<g||w===g&&S===null&&e.states.has(h)){if(S===null)if(h===e.clientID&&e.getLocalState()!=null)g++;else e.states.delete(h);else e.states.set(h,S);if(e.meta.set(h,{clock:g,lastUpdated:c}),v===void 0&&S!==null)a.push(h);else if(v!==void 0&&S===null)f.push(h);else if(S!==null){if(!Iu(S,k))y.push(h);i.push(h)}}}if(a.length>0||y.length>0||f.length>0)e.emit("change",[{added:a,updated:y,removed:f},s]);if(a.length>0||i.length>0||f.length>0)e.emit("update",[{added:a,updated:i,removed:f},s])};var F=0,D=1,W=2,R=(e,r)=>{ft(e,F);let s=Nk(r);wr(e,s)},q=(e,r,s)=>{ft(e,D),wr(e,Dk(r,s))},H=(e,r,s)=>q(r,s,Rr(e)),j=(e,r,s,o)=>{try{Ik(r,Rr(e),s)}catch(c){if(o!=null)o(c);console.error("Caught error while handling a Yjs update",c)}},N=(e,r)=>{ft(e,W),wr(e,r)},B=j,J=(e,r,s,o,c)=>{let a=Et(e);switch(a){case F:H(e,r,s);break;case D:j(e,s,o,c);break;case W:B(e,s,o,c);break;default:throw Error("Unknown message type")}return a};var G=1;function re(e){let r=e.webSocketImpl??globalThis.WebSocket,s=e.openTimeoutMs??1e4,o=new Map,c=new Set,a=new vc,i=new O(a);i.setLocalState(null);let y=null,f=null,U="connecting",b=!1,h=(t)=>{if(U===t)return;U=t;for(let n of c)n(t)},g=(t)=>{if(y&&y.readyState===G)try{y.send(M0(t))}catch{}},S=(t)=>{g({message:{path:t,type:"open"},type:"control"})};i.on("update",(t,n)=>{if(n==="remote")return;let l=[...t.added,...t.updated,...t.removed];g({body:L(i,l),type:"awareness"})});let v=(t)=>{switch(t.type){case"hello":{f={color:t.color,login:t.login,permission:t.permission,...t.name===void 0?{}:{name:t.name},...t.avatarUrl===void 0?{}:{avatarUrl:t.avatarUrl}};return}case"opened":{let n=o.get(t.path);if(!n)return;if(n.opened&&n.epoch!==t.epoch){w(t.path,n);return}n.epoch=t.epoch,n.opened=!0,n.resolveOpen?.(!0),n.resolveOpen=null;let l=ha();R(l,n.doc),g({body:Kr(l),epoch:n.epoch,path:t.path,type:"doc-sync"});return}case"doc-reset":{let n=o.get(t.path);if(n)w(t.path,n);return}case"flush-ack":{let n=o.get(t.path);if(n){for(let l of n.pendingFlush)l();n.pendingFlush.clear()}return}case"doc-dirty":{let n=o.get(t.path);if(n){n.dirty=t.dirty;for(let l of n.dirtyCbs)l(t.dirty)}return}case"error":{if(!t.path)return;let n=o.get(t.path);if(!n)return;if(t.code==="content-not-loaded"&&e.hydratePath&&!n.hydrated){n.hydrated=!0,e.hydratePath(t.path).then(()=>S(t.path),()=>{n.resolveOpen?.(!1),n.resolveOpen=null});return}if(!n.opened)n.resolveOpen?.(!1),n.resolveOpen=null;break}default:break}},k=(t,n,l)=>{let u=o.get(t);if(!u||!u.opened||u.epoch!==n)return;let d=fa(l),m=ha(),P=J(d,m,u.doc,"remote");if(P0(m)>0)g({body:Kr(m),epoch:n,path:t,type:"doc-sync"});if(P===D&&!u.synced)u.synced=!0,u.resolveSynced()},w=(t,n)=>{o.delete(t),n.resolveOpen?.(!1),n.resolveOpen=null;for(let l of n.resetCbs)l();n.doc.destroy()},M=()=>{h("connecting");let t=e.protocols,n=t===void 0||t.length===0?new r(e.url):new r(e.url,t);y=n,n.binaryType="arraybuffer",n.onopen=()=>{A.opened(),h("connected");for(let u of o.keys())S(u);if(i.getLocalState()!==null)g({body:L(i,[i.clientID]),type:"awareness"})},n.onmessage=(l)=>{let u=l.data,d=u instanceof ArrayBuffer?new Uint8Array(u):u instanceof Uint8Array?u:null;if(!d)return;let m;try{m=F0(d)}catch{return}switch(m.type){case"control":{v(m.message);return}case"doc-sync":{k(m.path,m.epoch,m.body);return}case"awareness":{E(i,m.body,"remote");break}default:break}},n.onclose=()=>{if(b)return;h("offline");for(let l of o.values())l.opened=!1;A.scheduleRetry()},n.onerror=()=>{}},A=ib(M,{...e.reconnectDelayMs===void 0?{}:{baseMs:e.reconnectDelayMs},...e.reconnectRandom===void 0?{}:{random:e.reconnectRandom}});return M(),{destroy(){if(b)return;b=!0,A.dispose(),I(i,[i.clientID],"destroy"),i.destroy(),a.destroy();for(let[t,n]of o)n.resolveOpen?.(!1),n.doc.destroy(),o.delete(t);y?.close()},async openDoc(t){if(b)return null;let n=o.get(t);if(n&&!n.handleDestroyed)return null;let l=()=>{},u=new Promise((p)=>{l=p}),d={dirty:!1,dirtyCbs:new Set,doc:new vc,epoch:0,handleDestroyed:!1,hydrated:!1,opened:!1,pendingFlush:new Set,resetCbs:new Set,resolveOpen:null,resolveSynced:l,synced:!1,whenSynced:u};if(o.set(t,d),d.doc.on("update",(p,V)=>{if(V==="remote"||!d.opened)return;let C=ha();N(C,p),g({body:Kr(C),epoch:d.epoch,path:t,type:"doc-sync"})}),!await new Promise((p)=>{d.resolveOpen=p;let V=setTimeout(()=>{d.resolveOpen=null,p(!1)},s);d.resolveOpen=(C)=>{clearTimeout(V),p(C)},S(t)})){if(o.get(t)===d)o.delete(t);return d.doc.destroy(),null}return{awareness:i,destroy:()=>{if(d.handleDestroyed)return;if(d.handleDestroyed=!0,o.get(t)===d)o.delete(t),g({path:t,type:"doc-close"});d.doc.destroy()},doc:d.doc,flush:()=>new Promise((p)=>{d.pendingFlush.add(p),g({message:{path:t,type:"flush"},type:"control"})}),identity:()=>f,onDirty:(p)=>(d.dirtyCbs.add(p),p(d.dirty),()=>d.dirtyCbs.delete(p)),onReset:(p)=>(d.resetCbs.add(p),()=>d.resetCbs.delete(p)),onStatus:(p)=>(c.add(p),()=>c.delete(p)),whenSynced:d.whenSynced}},status:()=>U}}export{re as createWsCollabConnection};
|
|
2
|
+
|
|
3
|
+
//# debugId=896832FD5B459EE664756E2164756E21
|
|
4
|
+
//# sourceMappingURL=ws-client-n2bh4hkf.js.map
|