@powerhousedao/ph-clint-app 0.1.0-dev.0 → 0.1.0-dev.10
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/connect/assets/AddDriveModal-CBK9gEWg-CCNM0KVP.js +2 -0
- package/dist/connect/assets/AddDriveModal-CBK9gEWg-CCNM0KVP.js.map +1 -0
- package/dist/connect/assets/ClearStorageModal-Cx0Rt-29-BM5nVGF1.js +2 -0
- package/dist/connect/assets/ClearStorageModal-Cx0Rt-29-BM5nVGF1.js.map +1 -0
- package/dist/connect/assets/CookiesPolicyModal-Gae1QuhA-D4gsUPUc.js +2 -0
- package/dist/connect/assets/CookiesPolicyModal-Gae1QuhA-D4gsUPUc.js.map +1 -0
- package/dist/connect/assets/CreateDocumentModal-5i6rmv3C-E3Cp7jBG.js +2 -0
- package/dist/connect/assets/CreateDocumentModal-5i6rmv3C-E3Cp7jBG.js.map +1 -0
- package/dist/connect/assets/DebugSettingsModal-ZNWhlMQN-DQ1zdAiY.js +2 -0
- package/dist/connect/assets/DebugSettingsModal-ZNWhlMQN-DQ1zdAiY.js.map +1 -0
- package/dist/connect/assets/DeleteDriveModal-BbAx_yXt-B21Gj_WB.js +2 -0
- package/dist/connect/assets/DeleteDriveModal-BbAx_yXt-B21Gj_WB.js.map +1 -0
- package/dist/connect/assets/DeleteItemModal-CkWegLlh-BjzQ9bb8.js +2 -0
- package/dist/connect/assets/DeleteItemModal-CkWegLlh-BjzQ9bb8.js.map +1 -0
- package/dist/connect/assets/DisclaimerModal-CCnvwoB5-DDQH0sV5.js +2 -0
- package/dist/connect/assets/DisclaimerModal-CCnvwoB5-DDQH0sV5.js.map +1 -0
- package/dist/connect/assets/DriveSettingsModal-DxMjOsLg-DMAYy5Qu.js +2 -0
- package/dist/connect/assets/DriveSettingsModal-DxMjOsLg-DMAYy5Qu.js.map +1 -0
- package/dist/connect/assets/ExportDocumentWithErrorsModal-hgliF8Gy-BosXc1A4.js +2 -0
- package/dist/connect/assets/ExportDocumentWithErrorsModal-hgliF8Gy-BosXc1A4.js.map +1 -0
- package/dist/connect/assets/InspectorModal-C4rE0Y5E-DYcDcB4c.js +30 -0
- package/dist/connect/assets/InspectorModal-C4rE0Y5E-DYcDcB4c.js.map +1 -0
- package/dist/connect/assets/MissingPackageModal-cr5tZDVw-cjdwZumA.js +2 -0
- package/dist/connect/assets/MissingPackageModal-cr5tZDVw-cjdwZumA.js.map +1 -0
- package/dist/connect/assets/SettingsModal-hA7NvG5u-NnZVwRwT.js +2 -0
- package/dist/connect/assets/SettingsModal-hA7NvG5u-NnZVwRwT.js.map +1 -0
- package/dist/connect/assets/UpgradeDriveModal-DldcNCaT-C3IKavGb.js +2 -0
- package/dist/connect/assets/UpgradeDriveModal-DldcNCaT-C3IKavGb.js.map +1 -0
- package/dist/connect/assets/__vite-browser-external-DfS4o2DG.js +2 -0
- package/dist/connect/assets/__vite-browser-external-DfS4o2DG.js.map +1 -0
- package/dist/connect/assets/__vite-browser-external-HZkqN3TL.js +2 -0
- package/dist/connect/assets/__vite-browser-external-HZkqN3TL.js.map +1 -0
- package/dist/connect/assets/app-module-BbhoykB5-Fa-xjapP.js +29 -0
- package/dist/connect/assets/app-module-BbhoykB5-Fa-xjapP.js.map +1 -0
- package/dist/connect/assets/chunk-B3K2TuZy.js +1 -0
- package/dist/connect/assets/chunk-VBDAOXYI-B4r8Aw5i-CQ-0hltn.js +2 -0
- package/dist/connect/assets/chunk-VBDAOXYI-B4r8Aw5i-CQ-0hltn.js.map +1 -0
- package/dist/connect/assets/chunk-VBDAOXYI-D3T5F-M4.js +3 -0
- package/dist/connect/assets/chunk-VBDAOXYI-D3T5F-M4.js.map +1 -0
- package/dist/connect/assets/chunk-zsgVPwQN.js +1 -0
- package/dist/connect/assets/components-CzmLhCpl.js +2 -0
- package/dist/connect/assets/components-CzmLhCpl.js.map +1 -0
- package/dist/connect/assets/connect-BZY3g1_-.js +2 -0
- package/dist/connect/assets/connect-BZY3g1_-.js.map +1 -0
- package/dist/connect/assets/connect-MjNGHHUz-4lla73ZT.js +501 -0
- package/dist/connect/assets/connect-MjNGHHUz-4lla73ZT.js.map +1 -0
- package/dist/connect/assets/connect-MjNGHHUz-BryDP-UK.js +529 -0
- package/dist/connect/assets/connect-MjNGHHUz-BryDP-UK.js.map +1 -0
- package/dist/connect/assets/connect-MjNGHHUz-DCp-qNSW-CTGw6_fq.js +644 -0
- package/dist/connect/assets/connect-MjNGHHUz-DCp-qNSW-CTGw6_fq.js.map +1 -0
- package/dist/connect/assets/connect.config-DDu1QWU1-CPxkNdH8.js +2 -0
- package/dist/connect/assets/connect.config-DDu1QWU1-CPxkNdH8.js.map +1 -0
- package/dist/connect/assets/dist-B7W7q8B9-CR_p0UE1.js +42 -0
- package/dist/connect/assets/dist-B7W7q8B9-CR_p0UE1.js.map +1 -0
- package/dist/connect/assets/dist-BXygvBtd-DvYcx8sL.js +2 -0
- package/dist/connect/assets/dist-BXygvBtd-DvYcx8sL.js.map +1 -0
- package/dist/connect/assets/dist-CTGANq2I-OEI7AFvB.js +0 -0
- package/dist/connect/assets/document-drive-BF7UoToX-DkpWtXXU.js +385 -0
- package/dist/connect/assets/document-drive-BF7UoToX-DkpWtXXU.js.map +1 -0
- package/dist/connect/assets/document-editor-CHM7Pu4m-BqJ7z0KA.js +29 -0
- package/dist/connect/assets/document-editor-CHM7Pu4m-BqJ7z0KA.js.map +1 -0
- package/dist/connect/assets/documents-D25BA9nW-D6x72KRG.js +57 -0
- package/dist/connect/assets/documents-D25BA9nW-D6x72KRG.js.map +1 -0
- package/dist/connect/assets/editor-9B-mf9yE-CwwLHhk7.js +2 -0
- package/dist/connect/assets/editor-9B-mf9yE-CwwLHhk7.js.map +1 -0
- package/dist/connect/assets/editor-CK3kNsTD-gsrBTl-E.js +13 -0
- package/dist/connect/assets/editor-CK3kNsTD-gsrBTl-E.js.map +1 -0
- package/dist/connect/assets/editor-CQwD5q6a-kwkhqbcn.js +2 -0
- package/dist/connect/assets/editor-CQwD5q6a-kwkhqbcn.js.map +1 -0
- package/dist/connect/assets/editor-CWOotorA-BFOZU67C.js +2 -0
- package/dist/connect/assets/editor-CWOotorA-BFOZU67C.js.map +1 -0
- package/dist/connect/assets/editor-Cf3CPqYZ-Cx9ZGQfp.js +2 -0
- package/dist/connect/assets/editor-Cf3CPqYZ-Cx9ZGQfp.js.map +1 -0
- package/dist/connect/assets/editor-D-RcRLrc-B3ubYCiM.js +1 -0
- package/dist/connect/assets/editor-D3oczmnl.js +2 -0
- package/dist/connect/assets/editor-D3oczmnl.js.map +1 -0
- package/dist/connect/assets/editor-PTrHnWW0-8Lr0hIbT.js +2 -0
- package/dist/connect/assets/editor-PTrHnWW0-8Lr0hIbT.js.map +1 -0
- package/dist/connect/assets/editor-XwOmbkwc-BNkVW6fZ.js +2 -0
- package/dist/connect/assets/editor-XwOmbkwc-BNkVW6fZ.js.map +1 -0
- package/dist/connect/assets/editor-ouUpfWQx-Bwt4WR-8.js +53 -0
- package/dist/connect/assets/editor-ouUpfWQx-Bwt4WR-8.js.map +1 -0
- package/dist/connect/assets/esm-NRvLaTq1.js +485 -0
- package/dist/connect/assets/esm-NRvLaTq1.js.map +1 -0
- package/dist/connect/assets/graphql-editor-CpHMdwcs-TBSYhJDO.js +14 -0
- package/dist/connect/assets/graphql-editor-CpHMdwcs-TBSYhJDO.js.map +1 -0
- package/dist/connect/assets/hooks-DcjZbCsk-DeRtYBVD.js +13 -0
- package/dist/connect/assets/hooks-DcjZbCsk-DeRtYBVD.js.map +1 -0
- package/dist/connect/assets/hooks-Vx4YtE1e-DsujkZGZ.js +2 -0
- package/dist/connect/assets/hooks-Vx4YtE1e-DsujkZGZ.js.map +1 -0
- package/dist/connect/assets/i18next-B07yHGWe.js +2 -0
- package/dist/connect/assets/i18next-B07yHGWe.js.map +1 -0
- package/dist/connect/assets/index-BzDF5yEH.css +2 -0
- package/dist/connect/assets/index-FULRicth.js +133 -0
- package/dist/connect/assets/index-FULRicth.js.map +1 -0
- package/dist/connect/assets/index.modern-Bfz1MSQq.js +2 -0
- package/dist/connect/assets/index.modern-Bfz1MSQq.js.map +1 -0
- package/dist/connect/assets/json-editor-C_IZ6CW1-Cxby5qEA.js +2 -0
- package/dist/connect/assets/json-editor-C_IZ6CW1-Cxby5qEA.js.map +1 -0
- package/dist/connect/assets/load-CXhaOice-8WLmFWs9.js +4 -0
- package/dist/connect/assets/load-CXhaOice-8WLmFWs9.js.map +1 -0
- package/dist/connect/assets/lodash.debounce-eFf-KvWl.js +803 -0
- package/dist/connect/assets/lodash.debounce-eFf-KvWl.js.map +1 -0
- package/dist/connect/assets/nodefs-CVI3Z1Xb-DdUrh9z_.js +2 -0
- package/dist/connect/assets/nodefs-CVI3Z1Xb-DdUrh9z_.js.map +1 -0
- package/dist/connect/assets/nodefs-D0TyfOk-.js +2 -0
- package/dist/connect/assets/nodefs-D0TyfOk-.js.map +1 -0
- package/dist/connect/assets/nodefs-iwlcSNyU.js +2 -0
- package/dist/connect/assets/nodefs-iwlcSNyU.js.map +1 -0
- package/dist/connect/assets/opfs-ahp-C3rjknSS.js +4 -0
- package/dist/connect/assets/opfs-ahp-C3rjknSS.js.map +1 -0
- package/dist/connect/assets/opfs-ahp-Cnv_7n9l-DCmWNksN.js +4 -0
- package/dist/connect/assets/opfs-ahp-Cnv_7n9l-DCmWNksN.js.map +1 -0
- package/dist/connect/assets/opfs-ahp-DnDPNLA9.js +4 -0
- package/dist/connect/assets/opfs-ahp-DnDPNLA9.js.map +1 -0
- package/dist/connect/assets/package-BfEuD7B1-BfRYGKvg.js +2 -0
- package/dist/connect/assets/package-BfEuD7B1-BfRYGKvg.js.map +1 -0
- package/dist/connect/assets/parser-DbYKMg6c-usgms9X3.js +22 -0
- package/dist/connect/assets/parser-DbYKMg6c-usgms9X3.js.map +1 -0
- package/dist/connect/assets/pg_dump-Cvfbb5Q0.wasm +0 -0
- package/dist/connect/assets/pglite-COscPi1Y.data +0 -0
- package/dist/connect/assets/pglite-CeYkvzd0.wasm +0 -0
- package/dist/connect/assets/pglite.worker-DvzUF7C_.js +142 -0
- package/dist/connect/assets/pglite.worker-DvzUF7C_.js.map +1 -0
- package/dist/connect/assets/preload-helper-rov5CBGT.js +1 -0
- package/dist/connect/assets/processor-module-CkuQiq7B-NgwLFT1B.js +39 -0
- package/dist/connect/assets/processor-module-CkuQiq7B-NgwLFT1B.js.map +1 -0
- package/dist/connect/assets/reactor-DAcFOba2-CdQem7g3.js +134 -0
- package/dist/connect/assets/reactor-DAcFOba2-CdQem7g3.js.map +1 -0
- package/dist/connect/assets/schemas-Bj5Xrw0U-EgU8DTwQ.js +40 -0
- package/dist/connect/assets/schemas-Bj5Xrw0U-EgU8DTwQ.js.map +1 -0
- package/dist/connect/assets/state-schemas-CitlQ5rT-CL9kk_uV.js +3 -0
- package/dist/connect/assets/state-schemas-CitlQ5rT-CL9kk_uV.js.map +1 -0
- package/dist/connect/assets/style-D0HSuDqn-CTfeWVw6.js +128 -0
- package/dist/connect/assets/style-D0HSuDqn-CTfeWVw6.js.map +1 -0
- package/dist/connect/assets/subgraph-module-CU_-umq2-CtfVtSp9.js +17 -0
- package/dist/connect/assets/subgraph-module-CU_-umq2-CtfVtSp9.js.map +1 -0
- package/dist/connect/assets/switchboard-Cx2GQN5a.js +2 -0
- package/dist/connect/assets/switchboard-Cx2GQN5a.js.map +1 -0
- package/dist/connect/assets/useRegistryPackages-DSzf8iPN-BYf0GDSw.js +2 -0
- package/dist/connect/assets/useRegistryPackages-DSzf8iPN-BYf0GDSw.js.map +1 -0
- package/dist/connect/assets/useVetraDocument-DF0teXXM-BQzuB5to.js +2 -0
- package/dist/connect/assets/useVetraDocument-DF0teXXM-BQzuB5to.js.map +1 -0
- package/dist/connect/assets/validate-BWGPnihN-R_6oKK2_.js +61 -0
- package/dist/connect/assets/validate-BWGPnihN-R_6oKK2_.js.map +1 -0
- package/dist/connect/icon.ico +0 -0
- package/dist/connect/index.html +51 -0
- package/dist/connect/ph-packages.json +3 -0
- package/package.json +6 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{h as e,m as t,t as n}from"./chunk-VBDAOXYI-B4r8Aw5i-CQ-0hltn.js";t();var r=class extends e{constructor(e){super(e),this.rootDir=(void 0)(e),(void 0)((void 0)(this.rootDir))||(void 0)(this.rootDir)}async init(e,t){return this.pg=e,{emscriptenOpts:{...t,preRun:[...t.preRun||[],e=>{let t=e.FS.filesystems.NODEFS;e.FS.mkdir(n),e.FS.mount(t,{root:this.rootDir},n)}]}}}async closeFs(){this.pg.Module.FS.quit()}};export{r as NodeFS};
|
|
2
|
+
//# sourceMappingURL=nodefs-CVI3Z1Xb-DdUrh9z_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodefs-CVI3Z1Xb-DdUrh9z_.js","names":[],"sources":["../../../node_modules/.pnpm/@powerhousedao+powerhouse-vetra-packages@6.0.0-dev.170_@emnapi+core@1.9.2_@emnapi+runti_2549454b6b7ed6e3af2d6cfad2c5a765/node_modules/@powerhousedao/powerhouse-vetra-packages/dist/browser/nodefs-CVI3Z1Xb.js"],"sourcesContent":["import { h as u, s as ur, t as C } from \"./chunk-VBDAOXYI-B4r8Aw5i.js\";\n//#region ../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/fs/nodefs.js\nu();\nvar m = class extends ur {\n\tconstructor(t) {\n\t\tsuper(t), this.rootDir = (void 0)(t), (void 0)((void 0)(this.rootDir)) || (void 0)(this.rootDir);\n\t}\n\tasync init(t, e) {\n\t\treturn this.pg = t, { emscriptenOpts: {\n\t\t\t...e,\n\t\t\tpreRun: [...e.preRun || [], (r) => {\n\t\t\t\tlet c = r.FS.filesystems.NODEFS;\n\t\t\t\tr.FS.mkdir(C), r.FS.mount(c, { root: this.rootDir }, C);\n\t\t\t}]\n\t\t} };\n\t}\n\tasync closeFs() {\n\t\tthis.pg.Module.FS.quit();\n\t}\n};\n//#endregion\nexport { m as NodeFS };\n\n//# sourceMappingURL=nodefs-CVI3Z1Xb.js.map"],"x_google_ignoreList":[0],"mappings":"wEAEA,GAAG,CACH,IAAI,EAAI,cAAc,CAAG,CACxB,YAAY,EAAG,CACd,MAAM,EAAE,CAAE,KAAK,SAAW,IAAK,IAAG,EAAE,EAAG,IAAK,KAAI,IAAK,IAAG,KAAK,QAAQ,CAAC,GAAK,IAAK,IAAG,KAAK,QAAQ,CAEjG,MAAM,KAAK,EAAG,EAAG,CAChB,MAAO,MAAK,GAAK,EAAG,CAAE,eAAgB,CACrC,GAAG,EACH,OAAQ,CAAC,GAAG,EAAE,QAAU,EAAE,CAAG,GAAM,CAClC,IAAI,EAAI,EAAE,GAAG,YAAY,OACzB,EAAE,GAAG,MAAM,EAAE,CAAE,EAAE,GAAG,MAAM,EAAG,CAAE,KAAM,KAAK,QAAS,CAAE,EAAE,EACtD,CACF,CAAE,CAEJ,MAAM,SAAU,CACf,KAAK,GAAG,OAAO,GAAG,MAAM"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./chunk-B3K2TuZy.js";import{i as t,l as n,t as r}from"./pglite.worker-DvzUF7C_.js";import{t as i}from"./__vite-browser-external-HZkqN3TL.js";var a=e(i(),1);n();var o=class extends t{constructor(e){super(e),this.rootDir=a.resolve(e),a.existsSync(a.join(this.rootDir))||a.mkdirSync(this.rootDir)}async init(e,t){return this.pg=e,{emscriptenOpts:{...t,preRun:[...t.preRun||[],e=>{let t=e.FS.filesystems.NODEFS;e.FS.mkdir(r),e.FS.mount(t,{root:this.rootDir},r)}]}}}async closeFs(){this.pg.Module.FS.quit()}};export{o as NodeFS};
|
|
2
|
+
//# sourceMappingURL=nodefs-D0TyfOk-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodefs-D0TyfOk-.js","names":["n","p","o","s","i"],"sources":["../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/fs/nodefs.js"],"sourcesContent":["import{d as i,e as p}from\"../chunk-VBDAOXYI.js\";import{j as n}from\"../chunk-QY3QWFKW.js\";n();import*as s from\"fs\";import*as o from\"path\";var m=class extends p{constructor(t){super(t),this.rootDir=o.resolve(t),s.existsSync(o.join(this.rootDir))||s.mkdirSync(this.rootDir)}async init(t,e){return this.pg=t,{emscriptenOpts:{...e,preRun:[...e.preRun||[],r=>{let c=r.FS.filesystems.NODEFS;r.FS.mkdir(i),r.FS.mount(c,{root:this.rootDir},i)}]}}}async closeFs(){this.pg.Module.FS.quit()}};export{m as NodeFS};\n//# sourceMappingURL=nodefs.js.map"],"x_google_ignoreList":[0],"mappings":"+KAAyFA,GAAG,CAA6C,IAAI,EAAE,cAAcC,CAAC,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,QAAQC,EAAE,QAAQ,EAAE,CAACC,EAAE,WAAWD,EAAE,KAAK,KAAK,QAAQ,CAAC,EAAEC,EAAE,UAAU,KAAK,QAAQ,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC,MAAO,MAAK,GAAG,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,YAAY,OAAO,EAAE,GAAG,MAAMC,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,KAAK,KAAK,QAAQ,CAACA,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,SAAS,CAAC,KAAK,GAAG,OAAO,GAAG,MAAM"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./chunk-zsgVPwQN.js";import{h as t,s as n,t as r}from"./chunk-VBDAOXYI-D3T5F-M4.js";import{t as i}from"./__vite-browser-external-DfS4o2DG.js";var a=e(i(),1);t();var o=class extends n{constructor(e){super(e),this.rootDir=a.resolve(e),a.existsSync(a.join(this.rootDir))||a.mkdirSync(this.rootDir)}async init(e,t){return this.pg=e,{emscriptenOpts:{...t,preRun:[...t.preRun||[],e=>{let t=e.FS.filesystems.NODEFS;e.FS.mkdir(r),e.FS.mount(t,{root:this.rootDir},r)}]}}}async closeFs(){this.pg.Module.FS.quit()}};export{o as NodeFS};
|
|
2
|
+
//# sourceMappingURL=nodefs-iwlcSNyU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodefs-iwlcSNyU.js","names":["n","p","o","s","i"],"sources":["../../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/fs/nodefs.js"],"sourcesContent":["import{d as i,e as p}from\"../chunk-VBDAOXYI.js\";import{j as n}from\"../chunk-QY3QWFKW.js\";n();import*as s from\"fs\";import*as o from\"path\";var m=class extends p{constructor(t){super(t),this.rootDir=o.resolve(t),s.existsSync(o.join(this.rootDir))||s.mkdirSync(this.rootDir)}async init(t,e){return this.pg=t,{emscriptenOpts:{...e,preRun:[...e.preRun||[],r=>{let c=r.FS.filesystems.NODEFS;r.FS.mkdir(i),r.FS.mount(c,{root:this.rootDir},i)}]}}}async closeFs(){this.pg.Module.FS.quit()}};export{m as NodeFS};\n//# sourceMappingURL=nodefs.js.map"],"x_google_ignoreList":[0],"mappings":"gLAAyFA,GAAG,CAA6C,IAAI,EAAE,cAAcC,CAAC,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,QAAQC,EAAE,QAAQ,EAAE,CAACC,EAAE,WAAWD,EAAE,KAAK,KAAK,QAAQ,CAAC,EAAEC,EAAE,UAAU,KAAK,QAAQ,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC,MAAO,MAAK,GAAG,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,YAAY,OAAO,EAAE,GAAG,MAAMC,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,KAAK,KAAK,QAAQ,CAACA,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,SAAS,CAAC,KAAK,GAAG,OAAO,GAAG,MAAM"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as e,c as t,l as n,n as r,o as i,r as a,s as o,u as s}from"./pglite.worker-DvzUF7C_.js";n();var c=`state.txt`,l=`data`,u={DIR:16384,FILE:32768},d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j=class extends r{constructor(t,{initialPoolSize:n=1e3,maintainedPoolSize:r=100,debug:i=!1}={}){super(t,{debug:i}),e(this,S),e(this,d),e(this,f),e(this,p),e(this,m),e(this,h),e(this,g,new Map),e(this,_,new Map),e(this,v,0),e(this,y,new Map),e(this,b,new Map),this.lastCheckpoint=0,this.checkpointInterval=1e3*60,this.poolCounter=0,e(this,x,new Set),this.initialPoolSize=n,this.maintainedPoolSize=r}async init(e,t){return await i(this,S,C).call(this),super.init(e,t)}async syncToFs(e=!1){await this.maybeCheckpointState(),await this.maintainPool(),e||this.flush()}async closeFs(){for(let e of t(this,_).values())e.close();t(this,h).flush(),t(this,h).close(),this.pg.Module.FS.quit()}async maintainPool(e){e||=this.maintainedPoolSize;let n=e-this.state.pool.length,r=[];for(let e=0;e<n;e++)r.push(new Promise(async e=>{++this.poolCounter;let n=`${(Date.now()-1704063600).toString(16).padStart(8,`0`)}-${this.poolCounter.toString(16).padStart(8,`0`)}`,r=await t(this,p).getFileHandle(n,{create:!0}),a=await r.createSyncAccessHandle();t(this,g).set(n,r),t(this,_).set(n,a),i(this,S,T).call(this,{opp:`createPoolFile`,args:[n]}),this.state.pool.push(n),e()}));for(let e=0;e>n;e--)r.push(new Promise(async e=>{let n=this.state.pool.pop();i(this,S,T).call(this,{opp:`deletePoolFile`,args:[n]});let r=t(this,g).get(n);t(this,_).get(n)?.close(),await t(this,p).removeEntry(r.name),t(this,g).delete(n),t(this,_).delete(n),e()}));await Promise.all(r)}_createPoolFileState(e){this.state.pool.push(e)}_deletePoolFileState(e){let t=this.state.pool.indexOf(e);t>-1&&this.state.pool.splice(t,1)}async maybeCheckpointState(){Date.now()-this.lastCheckpoint>this.checkpointInterval&&await this.checkpointState()}async checkpointState(){let e=new TextEncoder().encode(JSON.stringify(this.state));t(this,h).truncate(0),t(this,h).write(e,{at:0}),t(this,h).flush(),this.lastCheckpoint=Date.now()}flush(){for(let e of t(this,x))try{e.flush()}catch{}t(this,x).clear()}chmod(e,t){i(this,S,w).call(this,{opp:`chmod`,args:[e,t]},()=>{this._chmodState(e,t)})}_chmodState(e,t){let n=i(this,S,D).call(this,e);n.mode=t}close(e){let n=i(this,S,O).call(this,e);t(this,y).delete(e),t(this,b).delete(n)}fstat(e){let t=i(this,S,O).call(this,e);return this.lstat(t)}lstat(e){let n=i(this,S,D).call(this,e),r=n.type===`file`?t(this,_).get(n.backingFilename).getSize():0,a=4096;return{dev:0,ino:0,mode:n.mode,nlink:1,uid:0,gid:0,rdev:0,size:r,blksize:a,blocks:Math.ceil(r/a),atime:n.lastModified,mtime:n.lastModified,ctime:n.lastModified}}mkdir(e,t){i(this,S,w).call(this,{opp:`mkdir`,args:[e,t]},()=>{this._mkdirState(e,t)})}_mkdirState(e,t){let n=i(this,S,E).call(this,e),r=n.pop(),a=[],o=this.state.root;for(let r of n){if(a.push(e),!Object.prototype.hasOwnProperty.call(o.children,r))if(t?.recursive)this.mkdir(a.join(`/`));else throw new M(`ENOENT`,`No such file or directory`);if(o.children[r].type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);o=o.children[r]}if(Object.prototype.hasOwnProperty.call(o.children,r))throw new M(`EEXIST`,`File exists`);let s={type:`directory`,lastModified:Date.now(),mode:t?.mode||u.DIR,children:{}};o.children[r]=s}open(e,n,r){if(i(this,S,D).call(this,e).type!==`file`)throw new M(`EISDIR`,`Is a directory`);let a=i(this,S,k).call(this);return t(this,y).set(a,e),t(this,b).set(e,a),a}readdir(e){let t=i(this,S,D).call(this,e);if(t.type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);return Object.keys(t.children)}read(e,n,r,a,o){let s=i(this,S,O).call(this,e),c=i(this,S,D).call(this,s);if(c.type!==`file`)throw new M(`EISDIR`,`Is a directory`);return t(this,_).get(c.backingFilename).read(new Uint8Array(n.buffer,r,a),{at:o})}rename(e,t){i(this,S,w).call(this,{opp:`rename`,args:[e,t]},()=>{this._renameState(e,t,!0)})}_renameState(e,n,r=!1){let a=i(this,S,E).call(this,e),o=a.pop(),s=i(this,S,D).call(this,a.join(`/`));if(!Object.prototype.hasOwnProperty.call(s.children,o))throw new M(`ENOENT`,`No such file or directory`);let c=i(this,S,E).call(this,n),l=c.pop(),u=i(this,S,D).call(this,c.join(`/`));if(r&&Object.prototype.hasOwnProperty.call(u.children,l)){let e=u.children[l];t(this,_).get(e.backingFilename).truncate(0),this.state.pool.push(e.backingFilename)}u.children[l]=s.children[o],delete s.children[o]}rmdir(e){i(this,S,w).call(this,{opp:`rmdir`,args:[e]},()=>{this._rmdirState(e)})}_rmdirState(e){let t=i(this,S,E).call(this,e),n=t.pop(),r=i(this,S,D).call(this,t.join(`/`));if(!Object.prototype.hasOwnProperty.call(r.children,n))throw new M(`ENOENT`,`No such file or directory`);let a=r.children[n];if(a.type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);if(Object.keys(a.children).length>0)throw new M(`ENOTEMPTY`,`Directory not empty`);delete r.children[n]}truncate(e,n=0){let r=i(this,S,D).call(this,e);if(r.type!==`file`)throw new M(`EISDIR`,`Is a directory`);let a=t(this,_).get(r.backingFilename);if(!a)throw new M(`ENOENT`,`No such file or directory`);a.truncate(n),t(this,x).add(a)}unlink(e){i(this,S,w).call(this,{opp:`unlink`,args:[e]},()=>{this._unlinkState(e,!0)})}_unlinkState(e,n=!1){let r=i(this,S,E).call(this,e),a=r.pop(),o=i(this,S,D).call(this,r.join(`/`));if(!Object.prototype.hasOwnProperty.call(o.children,a))throw new M(`ENOENT`,`No such file or directory`);let s=o.children[a];if(s.type!==`file`)throw new M(`EISDIR`,`Is a directory`);if(delete o.children[a],n){let n=t(this,_).get(s.backingFilename);n?.truncate(0),t(this,x).add(n),t(this,b).has(e)&&(t(this,y).delete(t(this,b).get(e)),t(this,b).delete(e))}this.state.pool.push(s.backingFilename)}utimes(e,t,n){i(this,S,w).call(this,{opp:`utimes`,args:[e,t,n]},()=>{this._utimesState(e,t,n)})}_utimesState(e,t,n){let r=i(this,S,D).call(this,e);r.lastModified=n}writeFile(e,n,r){let a=i(this,S,E).call(this,e),o=a.pop(),s=i(this,S,D).call(this,a.join(`/`));if(Object.prototype.hasOwnProperty.call(s.children,o)){let t=s.children[o];t.lastModified=Date.now(),i(this,S,T).call(this,{opp:`setLastModified`,args:[e,t.lastModified]})}else{if(this.state.pool.length===0)throw Error(`No more file handles available in the pool`);let t={type:`file`,lastModified:Date.now(),mode:r?.mode||u.FILE,backingFilename:this.state.pool.pop()};s.children[o]=t,i(this,S,T).call(this,{opp:`createFileNode`,args:[e,t]})}let c=s.children[o],l=t(this,_).get(c.backingFilename);n.length>0&&(l.write(typeof n==`string`?new TextEncoder().encode(n):new Uint8Array(n),{at:0}),e.startsWith(`/pg_wal`)&&t(this,x).add(l))}_createFileNodeState(e,t){let n=i(this,S,E).call(this,e),r=n.pop(),a=i(this,S,D).call(this,n.join(`/`));a.children[r]=t;let o=this.state.pool.indexOf(t.backingFilename);return o>-1&&this.state.pool.splice(o,1),t}_setLastModifiedState(e,t){let n=i(this,S,D).call(this,e);n.lastModified=t}write(e,n,r,a,o){let s=i(this,S,O).call(this,e),c=i(this,S,D).call(this,s);if(c.type!==`file`)throw new M(`EISDIR`,`Is a directory`);let l=t(this,_).get(c.backingFilename);if(!l)throw new M(`EBADF`,`Bad file descriptor`);let u=l.write(new Uint8Array(n,r,a),{at:o});return s.startsWith(`/pg_wal`)&&t(this,x).add(l),u}};d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,_=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,x=new WeakMap,S=new WeakSet,C=async function(){s(this,d,await navigator.storage.getDirectory()),s(this,f,await i(this,S,A).call(this,this.dataDir,{create:!0})),s(this,p,await i(this,S,A).call(this,l,{from:t(this,f),create:!0})),s(this,m,await t(this,f).getFileHandle(c,{create:!0})),s(this,h,await t(this,m).createSyncAccessHandle());let e=new ArrayBuffer(t(this,h).getSize());t(this,h).read(e,{at:0});let n,r=new TextDecoder().decode(e).split(`
|
|
2
|
+
`),a=!1;try{n=JSON.parse(r[0])}catch{n={root:{type:`directory`,lastModified:Date.now(),mode:u.DIR,children:{}},pool:[]},t(this,h).truncate(0),t(this,h).write(new TextEncoder().encode(JSON.stringify(n)),{at:0}),a=!0}this.state=n;let o=r.slice(1).filter(Boolean).map(e=>JSON.parse(e));for(let e of o){let t=`_${e.opp}State`;if(typeof this[t]==`function`)try{this[t].bind(this)(...e.args)}catch(t){console.warn(`Error applying OPFS AHP WAL entry`,e,t)}}let v=[],y=async e=>{if(e.type===`file`)try{let n=await t(this,p).getFileHandle(e.backingFilename),r=await n.createSyncAccessHandle();t(this,g).set(e.backingFilename,n),t(this,_).set(e.backingFilename,r)}catch(t){console.error(`Error opening file handle for node`,e,t)}else for(let t of Object.values(e.children))v.push(y(t))};await y(this.state.root);let b=[];for(let e of this.state.pool)b.push(new Promise(async n=>{t(this,g).has(e)&&console.warn(`File handle already exists for pool file`,e);let r=await t(this,p).getFileHandle(e),i=await r.createSyncAccessHandle();t(this,g).set(e,r),t(this,_).set(e,i),n()}));await Promise.all([...v,...b]),await this.maintainPool(a?this.initialPoolSize:this.maintainedPoolSize)},w=function(e,n){let r=i(this,S,T).call(this,e);try{n()}catch(e){throw t(this,h).truncate(r),e}},T=function(e){let n=JSON.stringify(e),r=new TextEncoder().encode(`
|
|
3
|
+
${n}`),i=t(this,h).getSize();return t(this,h).write(r,{at:i}),t(this,x).add(t(this,h)),i},E=function(e){return e.split(`/`).filter(Boolean)},D=function(e,t){let n=i(this,S,E).call(this,e),r=t||this.state.root;for(let e of n){if(r.type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);if(!Object.prototype.hasOwnProperty.call(r.children,e))throw new M(`ENOENT`,`No such file or directory`);r=r.children[e]}return r},O=function(e){let n=t(this,y).get(e);if(!n)throw new M(`EBADF`,`Bad file descriptor`);return n},k=function(){let e=++o(this,v)._;for(;t(this,y).has(e);)o(this,v)._++;return e},A=async function(e,n){let r=i(this,S,E).call(this,e),a=n?.from||t(this,d);for(let e of r)a=await a.getDirectoryHandle(e,{create:n?.create});return a};var M=class extends Error{constructor(e,t){super(t),typeof e==`number`?this.code=e:typeof e==`string`&&(this.code=a[e])}};export{j as OpfsAhpFS};
|
|
4
|
+
//# sourceMappingURL=opfs-ahp-C3rjknSS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opfs-ahp-C3rjknSS.js","names":["R","B","r","s","h","E","_","z"],"sources":["../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/fs/opfs-ahp.js"],"sourcesContent":["import{f as B,g as z}from\"../chunk-VBDAOXYI.js\";import{e as s,f as g,g as E,h as r,i as _,j as R}from\"../chunk-QY3QWFKW.js\";R();var $=\"state.txt\",G=\"data\",T={DIR:16384,FILE:32768},H,v,F,M,y,b,m,x,P,D,S,n,C,O,k,w,f,I,W,j,L=class extends B{constructor(e,{initialPoolSize:t=1e3,maintainedPoolSize:o=100,debug:i=!1}={}){super(e,{debug:i});g(this,n);g(this,H);g(this,v);g(this,F);g(this,M);g(this,y);g(this,b,new Map);g(this,m,new Map);g(this,x,0);g(this,P,new Map);g(this,D,new Map);this.lastCheckpoint=0;this.checkpointInterval=1e3*60;this.poolCounter=0;g(this,S,new Set);this.initialPoolSize=t,this.maintainedPoolSize=o}async init(e,t){return await r(this,n,C).call(this),super.init(e,t)}async syncToFs(e=!1){await this.maybeCheckpointState(),await this.maintainPool(),e||this.flush()}async closeFs(){for(let e of s(this,m).values())e.close();s(this,y).flush(),s(this,y).close(),this.pg.Module.FS.quit()}async maintainPool(e){e=e||this.maintainedPoolSize;let t=e-this.state.pool.length,o=[];for(let i=0;i<t;i++)o.push(new Promise(async c=>{++this.poolCounter;let a=`${(Date.now()-1704063600).toString(16).padStart(8,\"0\")}-${this.poolCounter.toString(16).padStart(8,\"0\")}`,h=await s(this,F).getFileHandle(a,{create:!0}),d=await h.createSyncAccessHandle();s(this,b).set(a,h),s(this,m).set(a,d),r(this,n,k).call(this,{opp:\"createPoolFile\",args:[a]}),this.state.pool.push(a),c()}));for(let i=0;i>t;i--)o.push(new Promise(async c=>{let a=this.state.pool.pop();r(this,n,k).call(this,{opp:\"deletePoolFile\",args:[a]});let h=s(this,b).get(a);s(this,m).get(a)?.close(),await s(this,F).removeEntry(h.name),s(this,b).delete(a),s(this,m).delete(a),c()}));await Promise.all(o)}_createPoolFileState(e){this.state.pool.push(e)}_deletePoolFileState(e){let t=this.state.pool.indexOf(e);t>-1&&this.state.pool.splice(t,1)}async maybeCheckpointState(){Date.now()-this.lastCheckpoint>this.checkpointInterval&&await this.checkpointState()}async checkpointState(){let e=new TextEncoder().encode(JSON.stringify(this.state));s(this,y).truncate(0),s(this,y).write(e,{at:0}),s(this,y).flush(),this.lastCheckpoint=Date.now()}flush(){for(let e of s(this,S))try{e.flush()}catch{}s(this,S).clear()}chmod(e,t){r(this,n,O).call(this,{opp:\"chmod\",args:[e,t]},()=>{this._chmodState(e,t)})}_chmodState(e,t){let o=r(this,n,f).call(this,e);o.mode=t}close(e){let t=r(this,n,I).call(this,e);s(this,P).delete(e),s(this,D).delete(t)}fstat(e){let t=r(this,n,I).call(this,e);return this.lstat(t)}lstat(e){let t=r(this,n,f).call(this,e),o=t.type===\"file\"?s(this,m).get(t.backingFilename).getSize():0,i=4096;return{dev:0,ino:0,mode:t.mode,nlink:1,uid:0,gid:0,rdev:0,size:o,blksize:i,blocks:Math.ceil(o/i),atime:t.lastModified,mtime:t.lastModified,ctime:t.lastModified}}mkdir(e,t){r(this,n,O).call(this,{opp:\"mkdir\",args:[e,t]},()=>{this._mkdirState(e,t)})}_mkdirState(e,t){let o=r(this,n,w).call(this,e),i=o.pop(),c=[],a=this.state.root;for(let d of o){if(c.push(e),!Object.prototype.hasOwnProperty.call(a.children,d))if(t?.recursive)this.mkdir(c.join(\"/\"));else throw new p(\"ENOENT\",\"No such file or directory\");if(a.children[d].type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");a=a.children[d]}if(Object.prototype.hasOwnProperty.call(a.children,i))throw new p(\"EEXIST\",\"File exists\");let h={type:\"directory\",lastModified:Date.now(),mode:t?.mode||T.DIR,children:{}};a.children[i]=h}open(e,t,o){if(r(this,n,f).call(this,e).type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");let c=r(this,n,W).call(this);return s(this,P).set(c,e),s(this,D).set(e,c),c}readdir(e){let t=r(this,n,f).call(this,e);if(t.type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");return Object.keys(t.children)}read(e,t,o,i,c){let a=r(this,n,I).call(this,e),h=r(this,n,f).call(this,a);if(h.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");return s(this,m).get(h.backingFilename).read(new Uint8Array(t.buffer,o,i),{at:c})}rename(e,t){r(this,n,O).call(this,{opp:\"rename\",args:[e,t]},()=>{this._renameState(e,t,!0)})}_renameState(e,t,o=!1){let i=r(this,n,w).call(this,e),c=i.pop(),a=r(this,n,f).call(this,i.join(\"/\"));if(!Object.prototype.hasOwnProperty.call(a.children,c))throw new p(\"ENOENT\",\"No such file or directory\");let h=r(this,n,w).call(this,t),d=h.pop(),l=r(this,n,f).call(this,h.join(\"/\"));if(o&&Object.prototype.hasOwnProperty.call(l.children,d)){let u=l.children[d];s(this,m).get(u.backingFilename).truncate(0),this.state.pool.push(u.backingFilename)}l.children[d]=a.children[c],delete a.children[c]}rmdir(e){r(this,n,O).call(this,{opp:\"rmdir\",args:[e]},()=>{this._rmdirState(e)})}_rmdirState(e){let t=r(this,n,w).call(this,e),o=t.pop(),i=r(this,n,f).call(this,t.join(\"/\"));if(!Object.prototype.hasOwnProperty.call(i.children,o))throw new p(\"ENOENT\",\"No such file or directory\");let c=i.children[o];if(c.type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");if(Object.keys(c.children).length>0)throw new p(\"ENOTEMPTY\",\"Directory not empty\");delete i.children[o]}truncate(e,t=0){let o=r(this,n,f).call(this,e);if(o.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");let i=s(this,m).get(o.backingFilename);if(!i)throw new p(\"ENOENT\",\"No such file or directory\");i.truncate(t),s(this,S).add(i)}unlink(e){r(this,n,O).call(this,{opp:\"unlink\",args:[e]},()=>{this._unlinkState(e,!0)})}_unlinkState(e,t=!1){let o=r(this,n,w).call(this,e),i=o.pop(),c=r(this,n,f).call(this,o.join(\"/\"));if(!Object.prototype.hasOwnProperty.call(c.children,i))throw new p(\"ENOENT\",\"No such file or directory\");let a=c.children[i];if(a.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");if(delete c.children[i],t){let h=s(this,m).get(a.backingFilename);h?.truncate(0),s(this,S).add(h),s(this,D).has(e)&&(s(this,P).delete(s(this,D).get(e)),s(this,D).delete(e))}this.state.pool.push(a.backingFilename)}utimes(e,t,o){r(this,n,O).call(this,{opp:\"utimes\",args:[e,t,o]},()=>{this._utimesState(e,t,o)})}_utimesState(e,t,o){let i=r(this,n,f).call(this,e);i.lastModified=o}writeFile(e,t,o){let i=r(this,n,w).call(this,e),c=i.pop(),a=r(this,n,f).call(this,i.join(\"/\"));if(Object.prototype.hasOwnProperty.call(a.children,c)){let l=a.children[c];l.lastModified=Date.now(),r(this,n,k).call(this,{opp:\"setLastModified\",args:[e,l.lastModified]})}else{if(this.state.pool.length===0)throw new Error(\"No more file handles available in the pool\");let l={type:\"file\",lastModified:Date.now(),mode:o?.mode||T.FILE,backingFilename:this.state.pool.pop()};a.children[c]=l,r(this,n,k).call(this,{opp:\"createFileNode\",args:[e,l]})}let h=a.children[c],d=s(this,m).get(h.backingFilename);t.length>0&&(d.write(typeof t==\"string\"?new TextEncoder().encode(t):new Uint8Array(t),{at:0}),e.startsWith(\"/pg_wal\")&&s(this,S).add(d))}_createFileNodeState(e,t){let o=r(this,n,w).call(this,e),i=o.pop(),c=r(this,n,f).call(this,o.join(\"/\"));c.children[i]=t;let a=this.state.pool.indexOf(t.backingFilename);return a>-1&&this.state.pool.splice(a,1),t}_setLastModifiedState(e,t){let o=r(this,n,f).call(this,e);o.lastModified=t}write(e,t,o,i,c){let a=r(this,n,I).call(this,e),h=r(this,n,f).call(this,a);if(h.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");let d=s(this,m).get(h.backingFilename);if(!d)throw new p(\"EBADF\",\"Bad file descriptor\");let l=d.write(new Uint8Array(t,o,i),{at:c});return a.startsWith(\"/pg_wal\")&&s(this,S).add(d),l}};H=new WeakMap,v=new WeakMap,F=new WeakMap,M=new WeakMap,y=new WeakMap,b=new WeakMap,m=new WeakMap,x=new WeakMap,P=new WeakMap,D=new WeakMap,S=new WeakMap,n=new WeakSet,C=async function(){E(this,H,await navigator.storage.getDirectory()),E(this,v,await r(this,n,j).call(this,this.dataDir,{create:!0})),E(this,F,await r(this,n,j).call(this,G,{from:s(this,v),create:!0})),E(this,M,await s(this,v).getFileHandle($,{create:!0})),E(this,y,await s(this,M).createSyncAccessHandle());let e=new ArrayBuffer(s(this,y).getSize());s(this,y).read(e,{at:0});let t,o=new TextDecoder().decode(e).split(`\n`),i=!1;try{t=JSON.parse(o[0])}catch{t={root:{type:\"directory\",lastModified:Date.now(),mode:T.DIR,children:{}},pool:[]},s(this,y).truncate(0),s(this,y).write(new TextEncoder().encode(JSON.stringify(t)),{at:0}),i=!0}this.state=t;let c=o.slice(1).filter(Boolean).map(l=>JSON.parse(l));for(let l of c){let u=`_${l.opp}State`;if(typeof this[u]==\"function\")try{this[u].bind(this)(...l.args)}catch(N){console.warn(\"Error applying OPFS AHP WAL entry\",l,N)}}let a=[],h=async l=>{if(l.type===\"file\")try{let u=await s(this,F).getFileHandle(l.backingFilename),N=await u.createSyncAccessHandle();s(this,b).set(l.backingFilename,u),s(this,m).set(l.backingFilename,N)}catch(u){console.error(\"Error opening file handle for node\",l,u)}else for(let u of Object.values(l.children))a.push(h(u))};await h(this.state.root);let d=[];for(let l of this.state.pool)d.push(new Promise(async u=>{s(this,b).has(l)&&console.warn(\"File handle already exists for pool file\",l);let N=await s(this,F).getFileHandle(l),U=await N.createSyncAccessHandle();s(this,b).set(l,N),s(this,m).set(l,U),u()}));await Promise.all([...a,...d]),await this.maintainPool(i?this.initialPoolSize:this.maintainedPoolSize)},O=function(e,t){let o=r(this,n,k).call(this,e);try{t()}catch(i){throw s(this,y).truncate(o),i}},k=function(e){let t=JSON.stringify(e),o=new TextEncoder().encode(`\n${t}`),i=s(this,y).getSize();return s(this,y).write(o,{at:i}),s(this,S).add(s(this,y)),i},w=function(e){return e.split(\"/\").filter(Boolean)},f=function(e,t){let o=r(this,n,w).call(this,e),i=t||this.state.root;for(let c of o){if(i.type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");if(!Object.prototype.hasOwnProperty.call(i.children,c))throw new p(\"ENOENT\",\"No such file or directory\");i=i.children[c]}return i},I=function(e){let t=s(this,P).get(e);if(!t)throw new p(\"EBADF\",\"Bad file descriptor\");return t},W=function(){let e=++_(this,x)._;for(;s(this,P).has(e);)_(this,x)._++;return e},j=async function(e,t){let o=r(this,n,w).call(this,e),i=t?.from||s(this,H);for(let c of o)i=await i.getDirectoryHandle(c,{create:t?.create});return i};var p=class extends Error{constructor(A,e){super(e),typeof A==\"number\"?this.code=A:typeof A==\"string\"&&(this.code=z[A])}};export{L as OpfsAhpFS};\n//# sourceMappingURL=opfs-ahp.js.map"],"x_google_ignoreList":[0],"mappings":"iGAA4HA,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,IAAI,MAAM,KAAK,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,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AAC,IAAI,OAAO,GAAG,EAAE,eAAe,EAAE,EAAE,CAAC,IAAI,EAAED,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,EAAE,GAAG,MAAMC,EAAE,KAAK,EAAE,CAAC,IAAI,IAAI,KAAK,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,OAAO,GAAG,IAAI,EAAE,cAAc,KAAK,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,GAAG,SAAS,KAAK,KAAK,EAAE,OAAO,GAAG,WAAW,KAAK,KAAKI,EAAE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as e,d as t,g as n,m as r,o as i,p as a,s as o,u as s}from"./chunk-VBDAOXYI-B4r8Aw5i-CQ-0hltn.js";r();var c=`state.txt`,l=`data`,u={DIR:16384,FILE:32768},d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j=class extends s{constructor(t,{initialPoolSize:n=1e3,maintainedPoolSize:r=100,debug:i=!1}={}){super(t,{debug:i}),e(this,S),e(this,d),e(this,f),e(this,p),e(this,m),e(this,h),e(this,g,new Map),e(this,_,new Map),e(this,v,0),e(this,y,new Map),e(this,b,new Map),this.lastCheckpoint=0,this.checkpointInterval=1e3*60,this.poolCounter=0,e(this,x,new Set),this.initialPoolSize=n,this.maintainedPoolSize=r}async init(e,t){return await i(this,S,C).call(this),super.init(e,t)}async syncToFs(e=!1){await this.maybeCheckpointState(),await this.maintainPool(),e||this.flush()}async closeFs(){for(let e of t(this,_).values())e.close();t(this,h).flush(),t(this,h).close(),this.pg.Module.FS.quit()}async maintainPool(e){e||=this.maintainedPoolSize;let n=e-this.state.pool.length,r=[];for(let e=0;e<n;e++)r.push(new Promise(async e=>{++this.poolCounter;let n=`${(Date.now()-1704063600).toString(16).padStart(8,`0`)}-${this.poolCounter.toString(16).padStart(8,`0`)}`,r=await t(this,p).getFileHandle(n,{create:!0}),a=await r.createSyncAccessHandle();t(this,g).set(n,r),t(this,_).set(n,a),i(this,S,T).call(this,{opp:`createPoolFile`,args:[n]}),this.state.pool.push(n),e()}));for(let e=0;e>n;e--)r.push(new Promise(async e=>{let n=this.state.pool.pop();i(this,S,T).call(this,{opp:`deletePoolFile`,args:[n]});let r=t(this,g).get(n);t(this,_).get(n)?.close(),await t(this,p).removeEntry(r.name),t(this,g).delete(n),t(this,_).delete(n),e()}));await Promise.all(r)}_createPoolFileState(e){this.state.pool.push(e)}_deletePoolFileState(e){let t=this.state.pool.indexOf(e);t>-1&&this.state.pool.splice(t,1)}async maybeCheckpointState(){Date.now()-this.lastCheckpoint>this.checkpointInterval&&await this.checkpointState()}async checkpointState(){let e=new TextEncoder().encode(JSON.stringify(this.state));t(this,h).truncate(0),t(this,h).write(e,{at:0}),t(this,h).flush(),this.lastCheckpoint=Date.now()}flush(){for(let e of t(this,x))try{e.flush()}catch{}t(this,x).clear()}chmod(e,t){i(this,S,w).call(this,{opp:`chmod`,args:[e,t]},()=>{this._chmodState(e,t)})}_chmodState(e,t){let n=i(this,S,D).call(this,e);n.mode=t}close(e){let n=i(this,S,O).call(this,e);t(this,y).delete(e),t(this,b).delete(n)}fstat(e){let t=i(this,S,O).call(this,e);return this.lstat(t)}lstat(e){let n=i(this,S,D).call(this,e),r=n.type===`file`?t(this,_).get(n.backingFilename).getSize():0,a=4096;return{dev:0,ino:0,mode:n.mode,nlink:1,uid:0,gid:0,rdev:0,size:r,blksize:a,blocks:Math.ceil(r/a),atime:n.lastModified,mtime:n.lastModified,ctime:n.lastModified}}mkdir(e,t){i(this,S,w).call(this,{opp:`mkdir`,args:[e,t]},()=>{this._mkdirState(e,t)})}_mkdirState(e,t){let n=i(this,S,E).call(this,e),r=n.pop(),a=[],o=this.state.root;for(let r of n){if(a.push(e),!Object.prototype.hasOwnProperty.call(o.children,r))if(t?.recursive)this.mkdir(a.join(`/`));else throw new M(`ENOENT`,`No such file or directory`);if(o.children[r].type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);o=o.children[r]}if(Object.prototype.hasOwnProperty.call(o.children,r))throw new M(`EEXIST`,`File exists`);let s={type:`directory`,lastModified:Date.now(),mode:t?.mode||u.DIR,children:{}};o.children[r]=s}open(e,n,r){if(i(this,S,D).call(this,e).type!==`file`)throw new M(`EISDIR`,`Is a directory`);let a=i(this,S,k).call(this);return t(this,y).set(a,e),t(this,b).set(e,a),a}readdir(e){let t=i(this,S,D).call(this,e);if(t.type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);return Object.keys(t.children)}read(e,n,r,a,o){let s=i(this,S,O).call(this,e),c=i(this,S,D).call(this,s);if(c.type!==`file`)throw new M(`EISDIR`,`Is a directory`);return t(this,_).get(c.backingFilename).read(new Uint8Array(n.buffer,r,a),{at:o})}rename(e,t){i(this,S,w).call(this,{opp:`rename`,args:[e,t]},()=>{this._renameState(e,t,!0)})}_renameState(e,n,r=!1){let a=i(this,S,E).call(this,e),o=a.pop(),s=i(this,S,D).call(this,a.join(`/`));if(!Object.prototype.hasOwnProperty.call(s.children,o))throw new M(`ENOENT`,`No such file or directory`);let c=i(this,S,E).call(this,n),l=c.pop(),u=i(this,S,D).call(this,c.join(`/`));if(r&&Object.prototype.hasOwnProperty.call(u.children,l)){let e=u.children[l];t(this,_).get(e.backingFilename).truncate(0),this.state.pool.push(e.backingFilename)}u.children[l]=s.children[o],delete s.children[o]}rmdir(e){i(this,S,w).call(this,{opp:`rmdir`,args:[e]},()=>{this._rmdirState(e)})}_rmdirState(e){let t=i(this,S,E).call(this,e),n=t.pop(),r=i(this,S,D).call(this,t.join(`/`));if(!Object.prototype.hasOwnProperty.call(r.children,n))throw new M(`ENOENT`,`No such file or directory`);let a=r.children[n];if(a.type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);if(Object.keys(a.children).length>0)throw new M(`ENOTEMPTY`,`Directory not empty`);delete r.children[n]}truncate(e,n=0){let r=i(this,S,D).call(this,e);if(r.type!==`file`)throw new M(`EISDIR`,`Is a directory`);let a=t(this,_).get(r.backingFilename);if(!a)throw new M(`ENOENT`,`No such file or directory`);a.truncate(n),t(this,x).add(a)}unlink(e){i(this,S,w).call(this,{opp:`unlink`,args:[e]},()=>{this._unlinkState(e,!0)})}_unlinkState(e,n=!1){let r=i(this,S,E).call(this,e),a=r.pop(),o=i(this,S,D).call(this,r.join(`/`));if(!Object.prototype.hasOwnProperty.call(o.children,a))throw new M(`ENOENT`,`No such file or directory`);let s=o.children[a];if(s.type!==`file`)throw new M(`EISDIR`,`Is a directory`);if(delete o.children[a],n){let n=t(this,_).get(s.backingFilename);n?.truncate(0),t(this,x).add(n),t(this,b).has(e)&&(t(this,y).delete(t(this,b).get(e)),t(this,b).delete(e))}this.state.pool.push(s.backingFilename)}utimes(e,t,n){i(this,S,w).call(this,{opp:`utimes`,args:[e,t,n]},()=>{this._utimesState(e,t,n)})}_utimesState(e,t,n){let r=i(this,S,D).call(this,e);r.lastModified=n}writeFile(e,n,r){let a=i(this,S,E).call(this,e),o=a.pop(),s=i(this,S,D).call(this,a.join(`/`));if(Object.prototype.hasOwnProperty.call(s.children,o)){let t=s.children[o];t.lastModified=Date.now(),i(this,S,T).call(this,{opp:`setLastModified`,args:[e,t.lastModified]})}else{if(this.state.pool.length===0)throw Error(`No more file handles available in the pool`);let t={type:`file`,lastModified:Date.now(),mode:r?.mode||u.FILE,backingFilename:this.state.pool.pop()};s.children[o]=t,i(this,S,T).call(this,{opp:`createFileNode`,args:[e,t]})}let c=s.children[o],l=t(this,_).get(c.backingFilename);n.length>0&&(l.write(typeof n==`string`?new TextEncoder().encode(n):new Uint8Array(n),{at:0}),e.startsWith(`/pg_wal`)&&t(this,x).add(l))}_createFileNodeState(e,t){let n=i(this,S,E).call(this,e),r=n.pop(),a=i(this,S,D).call(this,n.join(`/`));a.children[r]=t;let o=this.state.pool.indexOf(t.backingFilename);return o>-1&&this.state.pool.splice(o,1),t}_setLastModifiedState(e,t){let n=i(this,S,D).call(this,e);n.lastModified=t}write(e,n,r,a,o){let s=i(this,S,O).call(this,e),c=i(this,S,D).call(this,s);if(c.type!==`file`)throw new M(`EISDIR`,`Is a directory`);let l=t(this,_).get(c.backingFilename);if(!l)throw new M(`EBADF`,`Bad file descriptor`);let u=l.write(new Uint8Array(n,r,a),{at:o});return s.startsWith(`/pg_wal`)&&t(this,x).add(l),u}};d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,_=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,x=new WeakMap,S=new WeakSet,C=async function(){n(this,d,await navigator.storage.getDirectory()),n(this,f,await i(this,S,A).call(this,this.dataDir,{create:!0})),n(this,p,await i(this,S,A).call(this,l,{from:t(this,f),create:!0})),n(this,m,await t(this,f).getFileHandle(c,{create:!0})),n(this,h,await t(this,m).createSyncAccessHandle());let e=new ArrayBuffer(t(this,h).getSize());t(this,h).read(e,{at:0});let r,a=new TextDecoder().decode(e).split(`
|
|
2
|
+
`),o=!1;try{r=JSON.parse(a[0])}catch{r={root:{type:`directory`,lastModified:Date.now(),mode:u.DIR,children:{}},pool:[]},t(this,h).truncate(0),t(this,h).write(new TextEncoder().encode(JSON.stringify(r)),{at:0}),o=!0}this.state=r;let s=a.slice(1).filter(Boolean).map(e=>JSON.parse(e));for(let e of s){let t=`_${e.opp}State`;if(typeof this[t]==`function`)try{this[t].bind(this)(...e.args)}catch(t){console.warn(`Error applying OPFS AHP WAL entry`,e,t)}}let v=[],y=async e=>{if(e.type===`file`)try{let n=await t(this,p).getFileHandle(e.backingFilename),r=await n.createSyncAccessHandle();t(this,g).set(e.backingFilename,n),t(this,_).set(e.backingFilename,r)}catch(t){console.error(`Error opening file handle for node`,e,t)}else for(let t of Object.values(e.children))v.push(y(t))};await y(this.state.root);let b=[];for(let e of this.state.pool)b.push(new Promise(async n=>{t(this,g).has(e)&&console.warn(`File handle already exists for pool file`,e);let r=await t(this,p).getFileHandle(e),i=await r.createSyncAccessHandle();t(this,g).set(e,r),t(this,_).set(e,i),n()}));await Promise.all([...v,...b]),await this.maintainPool(o?this.initialPoolSize:this.maintainedPoolSize)},w=function(e,n){let r=i(this,S,T).call(this,e);try{n()}catch(e){throw t(this,h).truncate(r),e}},T=function(e){let n=JSON.stringify(e),r=new TextEncoder().encode(`
|
|
3
|
+
${n}`),i=t(this,h).getSize();return t(this,h).write(r,{at:i}),t(this,x).add(t(this,h)),i},E=function(e){return e.split(`/`).filter(Boolean)},D=function(e,t){let n=i(this,S,E).call(this,e),r=t||this.state.root;for(let e of n){if(r.type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);if(!Object.prototype.hasOwnProperty.call(r.children,e))throw new M(`ENOENT`,`No such file or directory`);r=r.children[e]}return r},O=function(e){let n=t(this,y).get(e);if(!n)throw new M(`EBADF`,`Bad file descriptor`);return n},k=function(){let e=++o(this,v)._;for(;t(this,y).has(e);)o(this,v)._++;return e},A=async function(e,n){let r=i(this,S,E).call(this,e),a=n?.from||t(this,d);for(let e of r)a=await a.getDirectoryHandle(e,{create:n?.create});return a};var M=class extends Error{constructor(e,t){super(t),typeof e==`number`?this.code=e:typeof e==`string`&&(this.code=a[e])}};export{j as OpfsAhpFS};
|
|
4
|
+
//# sourceMappingURL=opfs-ahp-Cnv_7n9l-DCmWNksN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opfs-ahp-Cnv_7n9l-DCmWNksN.js","names":[],"sources":["../../../node_modules/.pnpm/@powerhousedao+powerhouse-vetra-packages@6.0.0-dev.170_@emnapi+core@1.9.2_@emnapi+runti_2549454b6b7ed6e3af2d6cfad2c5a765/node_modules/@powerhousedao/powerhouse-vetra-packages/dist/browser/opfs-ahp-Cnv_7n9l.js"],"sourcesContent":["import { d as R, f as T$1, g as x$1, h as u, i as cr, m as h, o as pr, p as U } from \"./chunk-VBDAOXYI-B4r8Aw5i.js\";\n//#region ../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/fs/opfs-ahp.js\nu();\nvar $ = \"state.txt\", G = \"data\", T = {\n\tDIR: 16384,\n\tFILE: 32768\n}, H, v, F, M, y, b, m, x, P, D, S, n, C, O, k, w, f, I, W, j, L = class extends cr {\n\tconstructor(e, { initialPoolSize: t = 1e3, maintainedPoolSize: o = 100, debug: i = !1 } = {}) {\n\t\tsuper(e, { debug: i });\n\t\tR(this, n);\n\t\tR(this, H);\n\t\tR(this, v);\n\t\tR(this, F);\n\t\tR(this, M);\n\t\tR(this, y);\n\t\tR(this, b, /* @__PURE__ */ new Map());\n\t\tR(this, m, /* @__PURE__ */ new Map());\n\t\tR(this, x, 0);\n\t\tR(this, P, /* @__PURE__ */ new Map());\n\t\tR(this, D, /* @__PURE__ */ new Map());\n\t\tthis.lastCheckpoint = 0;\n\t\tthis.checkpointInterval = 1e3 * 60;\n\t\tthis.poolCounter = 0;\n\t\tR(this, S, /* @__PURE__ */ new Set());\n\t\tthis.initialPoolSize = t, this.maintainedPoolSize = o;\n\t}\n\tasync init(e, t) {\n\t\treturn await T$1(this, n, C).call(this), super.init(e, t);\n\t}\n\tasync syncToFs(e = !1) {\n\t\tawait this.maybeCheckpointState(), await this.maintainPool(), e || this.flush();\n\t}\n\tasync closeFs() {\n\t\tfor (let e of h(this, m).values()) e.close();\n\t\th(this, y).flush(), h(this, y).close(), this.pg.Module.FS.quit();\n\t}\n\tasync maintainPool(e) {\n\t\te = e || this.maintainedPoolSize;\n\t\tlet t = e - this.state.pool.length, o = [];\n\t\tfor (let i = 0; i < t; i++) o.push(new Promise(async (c) => {\n\t\t\t++this.poolCounter;\n\t\t\tlet a = `${(Date.now() - 1704063600).toString(16).padStart(8, \"0\")}-${this.poolCounter.toString(16).padStart(8, \"0\")}`, h$1 = await h(this, F).getFileHandle(a, { create: !0 }), d = await h$1.createSyncAccessHandle();\n\t\t\th(this, b).set(a, h$1), h(this, m).set(a, d), T$1(this, n, k).call(this, {\n\t\t\t\topp: \"createPoolFile\",\n\t\t\t\targs: [a]\n\t\t\t}), this.state.pool.push(a), c();\n\t\t}));\n\t\tfor (let i = 0; i > t; i--) o.push(new Promise(async (c) => {\n\t\t\tlet a = this.state.pool.pop();\n\t\t\tT$1(this, n, k).call(this, {\n\t\t\t\topp: \"deletePoolFile\",\n\t\t\t\targs: [a]\n\t\t\t});\n\t\t\tlet h$2 = h(this, b).get(a);\n\t\t\th(this, m).get(a)?.close(), await h(this, F).removeEntry(h$2.name), h(this, b).delete(a), h(this, m).delete(a), c();\n\t\t}));\n\t\tawait Promise.all(o);\n\t}\n\t_createPoolFileState(e) {\n\t\tthis.state.pool.push(e);\n\t}\n\t_deletePoolFileState(e) {\n\t\tlet t = this.state.pool.indexOf(e);\n\t\tt > -1 && this.state.pool.splice(t, 1);\n\t}\n\tasync maybeCheckpointState() {\n\t\tDate.now() - this.lastCheckpoint > this.checkpointInterval && await this.checkpointState();\n\t}\n\tasync checkpointState() {\n\t\tlet e = new TextEncoder().encode(JSON.stringify(this.state));\n\t\th(this, y).truncate(0), h(this, y).write(e, { at: 0 }), h(this, y).flush(), this.lastCheckpoint = Date.now();\n\t}\n\tflush() {\n\t\tfor (let e of h(this, S)) try {\n\t\t\te.flush();\n\t\t} catch {}\n\t\th(this, S).clear();\n\t}\n\tchmod(e, t) {\n\t\tT$1(this, n, O).call(this, {\n\t\t\topp: \"chmod\",\n\t\t\targs: [e, t]\n\t\t}, () => {\n\t\t\tthis._chmodState(e, t);\n\t\t});\n\t}\n\t_chmodState(e, t) {\n\t\tlet o = T$1(this, n, f).call(this, e);\n\t\to.mode = t;\n\t}\n\tclose(e) {\n\t\tlet t = T$1(this, n, I).call(this, e);\n\t\th(this, P).delete(e), h(this, D).delete(t);\n\t}\n\tfstat(e) {\n\t\tlet t = T$1(this, n, I).call(this, e);\n\t\treturn this.lstat(t);\n\t}\n\tlstat(e) {\n\t\tlet t = T$1(this, n, f).call(this, e), o = t.type === \"file\" ? h(this, m).get(t.backingFilename).getSize() : 0, i = 4096;\n\t\treturn {\n\t\t\tdev: 0,\n\t\t\tino: 0,\n\t\t\tmode: t.mode,\n\t\t\tnlink: 1,\n\t\t\tuid: 0,\n\t\t\tgid: 0,\n\t\t\trdev: 0,\n\t\t\tsize: o,\n\t\t\tblksize: i,\n\t\t\tblocks: Math.ceil(o / i),\n\t\t\tatime: t.lastModified,\n\t\t\tmtime: t.lastModified,\n\t\t\tctime: t.lastModified\n\t\t};\n\t}\n\tmkdir(e, t) {\n\t\tT$1(this, n, O).call(this, {\n\t\t\topp: \"mkdir\",\n\t\t\targs: [e, t]\n\t\t}, () => {\n\t\t\tthis._mkdirState(e, t);\n\t\t});\n\t}\n\t_mkdirState(e, t) {\n\t\tlet o = T$1(this, n, w).call(this, e), i = o.pop(), c = [], a = this.state.root;\n\t\tfor (let d of o) {\n\t\t\tif (c.push(e), !Object.prototype.hasOwnProperty.call(a.children, d)) if (t?.recursive) this.mkdir(c.join(\"/\"));\n\t\t\telse throw new p(\"ENOENT\", \"No such file or directory\");\n\t\t\tif (a.children[d].type !== \"directory\") throw new p(\"ENOTDIR\", \"Not a directory\");\n\t\t\ta = a.children[d];\n\t\t}\n\t\tif (Object.prototype.hasOwnProperty.call(a.children, i)) throw new p(\"EEXIST\", \"File exists\");\n\t\tlet h = {\n\t\t\ttype: \"directory\",\n\t\t\tlastModified: Date.now(),\n\t\t\tmode: t?.mode || T.DIR,\n\t\t\tchildren: {}\n\t\t};\n\t\ta.children[i] = h;\n\t}\n\topen(e, t, o) {\n\t\tif (T$1(this, n, f).call(this, e).type !== \"file\") throw new p(\"EISDIR\", \"Is a directory\");\n\t\tlet c = T$1(this, n, W).call(this);\n\t\treturn h(this, P).set(c, e), h(this, D).set(e, c), c;\n\t}\n\treaddir(e) {\n\t\tlet t = T$1(this, n, f).call(this, e);\n\t\tif (t.type !== \"directory\") throw new p(\"ENOTDIR\", \"Not a directory\");\n\t\treturn Object.keys(t.children);\n\t}\n\tread(e, t, o, i, c) {\n\t\tlet a = T$1(this, n, I).call(this, e), h$3 = T$1(this, n, f).call(this, a);\n\t\tif (h$3.type !== \"file\") throw new p(\"EISDIR\", \"Is a directory\");\n\t\treturn h(this, m).get(h$3.backingFilename).read(new Uint8Array(t.buffer, o, i), { at: c });\n\t}\n\trename(e, t) {\n\t\tT$1(this, n, O).call(this, {\n\t\t\topp: \"rename\",\n\t\t\targs: [e, t]\n\t\t}, () => {\n\t\t\tthis._renameState(e, t, !0);\n\t\t});\n\t}\n\t_renameState(e, t, o = !1) {\n\t\tlet i = T$1(this, n, w).call(this, e), c = i.pop(), a = T$1(this, n, f).call(this, i.join(\"/\"));\n\t\tif (!Object.prototype.hasOwnProperty.call(a.children, c)) throw new p(\"ENOENT\", \"No such file or directory\");\n\t\tlet h$4 = T$1(this, n, w).call(this, t), d = h$4.pop(), l = T$1(this, n, f).call(this, h$4.join(\"/\"));\n\t\tif (o && Object.prototype.hasOwnProperty.call(l.children, d)) {\n\t\t\tlet u = l.children[d];\n\t\t\th(this, m).get(u.backingFilename).truncate(0), this.state.pool.push(u.backingFilename);\n\t\t}\n\t\tl.children[d] = a.children[c], delete a.children[c];\n\t}\n\trmdir(e) {\n\t\tT$1(this, n, O).call(this, {\n\t\t\topp: \"rmdir\",\n\t\t\targs: [e]\n\t\t}, () => {\n\t\t\tthis._rmdirState(e);\n\t\t});\n\t}\n\t_rmdirState(e) {\n\t\tlet t = T$1(this, n, w).call(this, e), o = t.pop(), i = T$1(this, n, f).call(this, t.join(\"/\"));\n\t\tif (!Object.prototype.hasOwnProperty.call(i.children, o)) throw new p(\"ENOENT\", \"No such file or directory\");\n\t\tlet c = i.children[o];\n\t\tif (c.type !== \"directory\") throw new p(\"ENOTDIR\", \"Not a directory\");\n\t\tif (Object.keys(c.children).length > 0) throw new p(\"ENOTEMPTY\", \"Directory not empty\");\n\t\tdelete i.children[o];\n\t}\n\ttruncate(e, t = 0) {\n\t\tlet o = T$1(this, n, f).call(this, e);\n\t\tif (o.type !== \"file\") throw new p(\"EISDIR\", \"Is a directory\");\n\t\tlet i = h(this, m).get(o.backingFilename);\n\t\tif (!i) throw new p(\"ENOENT\", \"No such file or directory\");\n\t\ti.truncate(t), h(this, S).add(i);\n\t}\n\tunlink(e) {\n\t\tT$1(this, n, O).call(this, {\n\t\t\topp: \"unlink\",\n\t\t\targs: [e]\n\t\t}, () => {\n\t\t\tthis._unlinkState(e, !0);\n\t\t});\n\t}\n\t_unlinkState(e, t = !1) {\n\t\tlet o = T$1(this, n, w).call(this, e), i = o.pop(), c = T$1(this, n, f).call(this, o.join(\"/\"));\n\t\tif (!Object.prototype.hasOwnProperty.call(c.children, i)) throw new p(\"ENOENT\", \"No such file or directory\");\n\t\tlet a = c.children[i];\n\t\tif (a.type !== \"file\") throw new p(\"EISDIR\", \"Is a directory\");\n\t\tif (delete c.children[i], t) {\n\t\t\tlet h$5 = h(this, m).get(a.backingFilename);\n\t\t\th$5?.truncate(0), h(this, S).add(h$5), h(this, D).has(e) && (h(this, P).delete(h(this, D).get(e)), h(this, D).delete(e));\n\t\t}\n\t\tthis.state.pool.push(a.backingFilename);\n\t}\n\tutimes(e, t, o) {\n\t\tT$1(this, n, O).call(this, {\n\t\t\topp: \"utimes\",\n\t\t\targs: [\n\t\t\t\te,\n\t\t\t\tt,\n\t\t\t\to\n\t\t\t]\n\t\t}, () => {\n\t\t\tthis._utimesState(e, t, o);\n\t\t});\n\t}\n\t_utimesState(e, t, o) {\n\t\tlet i = T$1(this, n, f).call(this, e);\n\t\ti.lastModified = o;\n\t}\n\twriteFile(e, t, o) {\n\t\tlet i = T$1(this, n, w).call(this, e), c = i.pop(), a = T$1(this, n, f).call(this, i.join(\"/\"));\n\t\tif (Object.prototype.hasOwnProperty.call(a.children, c)) {\n\t\t\tlet l = a.children[c];\n\t\t\tl.lastModified = Date.now(), T$1(this, n, k).call(this, {\n\t\t\t\topp: \"setLastModified\",\n\t\t\t\targs: [e, l.lastModified]\n\t\t\t});\n\t\t} else {\n\t\t\tif (this.state.pool.length === 0) throw new Error(\"No more file handles available in the pool\");\n\t\t\tlet l = {\n\t\t\t\ttype: \"file\",\n\t\t\t\tlastModified: Date.now(),\n\t\t\t\tmode: o?.mode || T.FILE,\n\t\t\t\tbackingFilename: this.state.pool.pop()\n\t\t\t};\n\t\t\ta.children[c] = l, T$1(this, n, k).call(this, {\n\t\t\t\topp: \"createFileNode\",\n\t\t\t\targs: [e, l]\n\t\t\t});\n\t\t}\n\t\tlet h$6 = a.children[c], d = h(this, m).get(h$6.backingFilename);\n\t\tt.length > 0 && (d.write(typeof t == \"string\" ? new TextEncoder().encode(t) : new Uint8Array(t), { at: 0 }), e.startsWith(\"/pg_wal\") && h(this, S).add(d));\n\t}\n\t_createFileNodeState(e, t) {\n\t\tlet o = T$1(this, n, w).call(this, e), i = o.pop(), c = T$1(this, n, f).call(this, o.join(\"/\"));\n\t\tc.children[i] = t;\n\t\tlet a = this.state.pool.indexOf(t.backingFilename);\n\t\treturn a > -1 && this.state.pool.splice(a, 1), t;\n\t}\n\t_setLastModifiedState(e, t) {\n\t\tlet o = T$1(this, n, f).call(this, e);\n\t\to.lastModified = t;\n\t}\n\twrite(e, t, o, i, c) {\n\t\tlet a = T$1(this, n, I).call(this, e), h$7 = T$1(this, n, f).call(this, a);\n\t\tif (h$7.type !== \"file\") throw new p(\"EISDIR\", \"Is a directory\");\n\t\tlet d = h(this, m).get(h$7.backingFilename);\n\t\tif (!d) throw new p(\"EBADF\", \"Bad file descriptor\");\n\t\tlet l = d.write(new Uint8Array(t, o, i), { at: c });\n\t\treturn a.startsWith(\"/pg_wal\") && h(this, S).add(d), l;\n\t}\n};\nH = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakSet(), C = async function() {\n\tx$1(this, H, await navigator.storage.getDirectory()), x$1(this, v, await T$1(this, n, j).call(this, this.dataDir, { create: !0 })), x$1(this, F, await T$1(this, n, j).call(this, G, {\n\t\tfrom: h(this, v),\n\t\tcreate: !0\n\t})), x$1(this, M, await h(this, v).getFileHandle($, { create: !0 })), x$1(this, y, await h(this, M).createSyncAccessHandle());\n\tlet e = new ArrayBuffer(h(this, y).getSize());\n\th(this, y).read(e, { at: 0 });\n\tlet t, o = new TextDecoder().decode(e).split(`\n`), i = !1;\n\ttry {\n\t\tt = JSON.parse(o[0]);\n\t} catch {\n\t\tt = {\n\t\t\troot: {\n\t\t\t\ttype: \"directory\",\n\t\t\t\tlastModified: Date.now(),\n\t\t\t\tmode: T.DIR,\n\t\t\t\tchildren: {}\n\t\t\t},\n\t\t\tpool: []\n\t\t}, h(this, y).truncate(0), h(this, y).write(new TextEncoder().encode(JSON.stringify(t)), { at: 0 }), i = !0;\n\t}\n\tthis.state = t;\n\tlet c = o.slice(1).filter(Boolean).map((l) => JSON.parse(l));\n\tfor (let l of c) {\n\t\tlet u = `_${l.opp}State`;\n\t\tif (typeof this[u] == \"function\") try {\n\t\t\tthis[u].bind(this)(...l.args);\n\t\t} catch (N) {\n\t\t\tconsole.warn(\"Error applying OPFS AHP WAL entry\", l, N);\n\t\t}\n\t}\n\tlet a = [], h$8 = async (l) => {\n\t\tif (l.type === \"file\") try {\n\t\t\tlet u = await h(this, F).getFileHandle(l.backingFilename), N = await u.createSyncAccessHandle();\n\t\t\th(this, b).set(l.backingFilename, u), h(this, m).set(l.backingFilename, N);\n\t\t} catch (u) {\n\t\t\tconsole.error(\"Error opening file handle for node\", l, u);\n\t\t}\n\t\telse for (let u of Object.values(l.children)) a.push(h$8(u));\n\t};\n\tawait h$8(this.state.root);\n\tlet d = [];\n\tfor (let l of this.state.pool) d.push(new Promise(async (u) => {\n\t\th(this, b).has(l) && console.warn(\"File handle already exists for pool file\", l);\n\t\tlet N = await h(this, F).getFileHandle(l), U = await N.createSyncAccessHandle();\n\t\th(this, b).set(l, N), h(this, m).set(l, U), u();\n\t}));\n\tawait Promise.all([...a, ...d]), await this.maintainPool(i ? this.initialPoolSize : this.maintainedPoolSize);\n}, O = function(e, t) {\n\tlet o = T$1(this, n, k).call(this, e);\n\ttry {\n\t\tt();\n\t} catch (i) {\n\t\tthrow h(this, y).truncate(o), i;\n\t}\n}, k = function(e) {\n\tlet t = JSON.stringify(e), o = new TextEncoder().encode(`\n${t}`), i = h(this, y).getSize();\n\treturn h(this, y).write(o, { at: i }), h(this, S).add(h(this, y)), i;\n}, w = function(e) {\n\treturn e.split(\"/\").filter(Boolean);\n}, f = function(e, t) {\n\tlet o = T$1(this, n, w).call(this, e), i = t || this.state.root;\n\tfor (let c of o) {\n\t\tif (i.type !== \"directory\") throw new p(\"ENOTDIR\", \"Not a directory\");\n\t\tif (!Object.prototype.hasOwnProperty.call(i.children, c)) throw new p(\"ENOENT\", \"No such file or directory\");\n\t\ti = i.children[c];\n\t}\n\treturn i;\n}, I = function(e) {\n\tlet t = h(this, P).get(e);\n\tif (!t) throw new p(\"EBADF\", \"Bad file descriptor\");\n\treturn t;\n}, W = function() {\n\tlet e = ++U(this, x)._;\n\tfor (; h(this, P).has(e);) U(this, x)._++;\n\treturn e;\n}, j = async function(e, t) {\n\tlet o = T$1(this, n, w).call(this, e), i = t?.from || h(this, H);\n\tfor (let c of o) i = await i.getDirectoryHandle(c, { create: t?.create });\n\treturn i;\n};\nvar p = class extends Error {\n\tconstructor(A, e) {\n\t\tsuper(e), typeof A == \"number\" ? this.code = A : typeof A == \"string\" && (this.code = pr[A]);\n\t}\n};\n//#endregion\nexport { L as OpfsAhpFS };\n\n//# sourceMappingURL=opfs-ahp-Cnv_7n9l.js.map"],"x_google_ignoreList":[0],"mappings":"2GAEA,GAAG,CACH,IAAI,EAAI,YAAa,EAAI,OAAQ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AE,CAAC,IACtC,OAAO,GACL,EAAI,eAAe,EAAG,EAAG,CAC3B,IAAI,EAAI,EAAI,KAAM,EAAG,EAAE,CAAC,KAAK,KAAM,EAAE,CAAE,EAAI,GAAG,MAAQ,EAAE,KAAM,EAAE,CAChE,IAAK,IAAI,KAAK,EAAG,EAAI,MAAM,EAAE,mBAAmB,EAAG,CAAE,OAAQ,GAAG,OAAQ,CAAC,CACzE,OAAO,GAER,IAAI,EAAI,cAAc,KAAM,CAC3B,YAAY,EAAG,EAAG,CACjB,MAAM,EAAE,CAAE,OAAO,GAAK,SAAW,KAAK,KAAO,EAAI,OAAO,GAAK,WAAa,KAAK,KAAO,EAAG"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{d as e,f as t,g as n,h as r,i,m as a,o,p as s}from"./chunk-VBDAOXYI-D3T5F-M4.js";r();var c=`state.txt`,l=`data`,u={DIR:16384,FILE:32768},d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j=class extends i{constructor(t,{initialPoolSize:n=1e3,maintainedPoolSize:r=100,debug:i=!1}={}){super(t,{debug:i}),e(this,S),e(this,d),e(this,f),e(this,p),e(this,m),e(this,h),e(this,g,new Map),e(this,_,new Map),e(this,v,0),e(this,y,new Map),e(this,b,new Map),this.lastCheckpoint=0,this.checkpointInterval=1e3*60,this.poolCounter=0,e(this,x,new Set),this.initialPoolSize=n,this.maintainedPoolSize=r}async init(e,n){return await t(this,S,C).call(this),super.init(e,n)}async syncToFs(e=!1){await this.maybeCheckpointState(),await this.maintainPool(),e||this.flush()}async closeFs(){for(let e of a(this,_).values())e.close();a(this,h).flush(),a(this,h).close(),this.pg.Module.FS.quit()}async maintainPool(e){e||=this.maintainedPoolSize;let n=e-this.state.pool.length,r=[];for(let e=0;e<n;e++)r.push(new Promise(async e=>{++this.poolCounter;let n=`${(Date.now()-1704063600).toString(16).padStart(8,`0`)}-${this.poolCounter.toString(16).padStart(8,`0`)}`,r=await a(this,p).getFileHandle(n,{create:!0}),i=await r.createSyncAccessHandle();a(this,g).set(n,r),a(this,_).set(n,i),t(this,S,T).call(this,{opp:`createPoolFile`,args:[n]}),this.state.pool.push(n),e()}));for(let e=0;e>n;e--)r.push(new Promise(async e=>{let n=this.state.pool.pop();t(this,S,T).call(this,{opp:`deletePoolFile`,args:[n]});let r=a(this,g).get(n);a(this,_).get(n)?.close(),await a(this,p).removeEntry(r.name),a(this,g).delete(n),a(this,_).delete(n),e()}));await Promise.all(r)}_createPoolFileState(e){this.state.pool.push(e)}_deletePoolFileState(e){let t=this.state.pool.indexOf(e);t>-1&&this.state.pool.splice(t,1)}async maybeCheckpointState(){Date.now()-this.lastCheckpoint>this.checkpointInterval&&await this.checkpointState()}async checkpointState(){let e=new TextEncoder().encode(JSON.stringify(this.state));a(this,h).truncate(0),a(this,h).write(e,{at:0}),a(this,h).flush(),this.lastCheckpoint=Date.now()}flush(){for(let e of a(this,x))try{e.flush()}catch{}a(this,x).clear()}chmod(e,n){t(this,S,w).call(this,{opp:`chmod`,args:[e,n]},()=>{this._chmodState(e,n)})}_chmodState(e,n){let r=t(this,S,D).call(this,e);r.mode=n}close(e){let n=t(this,S,O).call(this,e);a(this,y).delete(e),a(this,b).delete(n)}fstat(e){let n=t(this,S,O).call(this,e);return this.lstat(n)}lstat(e){let n=t(this,S,D).call(this,e),r=n.type===`file`?a(this,_).get(n.backingFilename).getSize():0,i=4096;return{dev:0,ino:0,mode:n.mode,nlink:1,uid:0,gid:0,rdev:0,size:r,blksize:i,blocks:Math.ceil(r/i),atime:n.lastModified,mtime:n.lastModified,ctime:n.lastModified}}mkdir(e,n){t(this,S,w).call(this,{opp:`mkdir`,args:[e,n]},()=>{this._mkdirState(e,n)})}_mkdirState(e,n){let r=t(this,S,E).call(this,e),i=r.pop(),a=[],o=this.state.root;for(let t of r){if(a.push(e),!Object.prototype.hasOwnProperty.call(o.children,t))if(n?.recursive)this.mkdir(a.join(`/`));else throw new M(`ENOENT`,`No such file or directory`);if(o.children[t].type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);o=o.children[t]}if(Object.prototype.hasOwnProperty.call(o.children,i))throw new M(`EEXIST`,`File exists`);let s={type:`directory`,lastModified:Date.now(),mode:n?.mode||u.DIR,children:{}};o.children[i]=s}open(e,n,r){if(t(this,S,D).call(this,e).type!==`file`)throw new M(`EISDIR`,`Is a directory`);let i=t(this,S,k).call(this);return a(this,y).set(i,e),a(this,b).set(e,i),i}readdir(e){let n=t(this,S,D).call(this,e);if(n.type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);return Object.keys(n.children)}read(e,n,r,i,o){let s=t(this,S,O).call(this,e),c=t(this,S,D).call(this,s);if(c.type!==`file`)throw new M(`EISDIR`,`Is a directory`);return a(this,_).get(c.backingFilename).read(new Uint8Array(n.buffer,r,i),{at:o})}rename(e,n){t(this,S,w).call(this,{opp:`rename`,args:[e,n]},()=>{this._renameState(e,n,!0)})}_renameState(e,n,r=!1){let i=t(this,S,E).call(this,e),o=i.pop(),s=t(this,S,D).call(this,i.join(`/`));if(!Object.prototype.hasOwnProperty.call(s.children,o))throw new M(`ENOENT`,`No such file or directory`);let c=t(this,S,E).call(this,n),l=c.pop(),u=t(this,S,D).call(this,c.join(`/`));if(r&&Object.prototype.hasOwnProperty.call(u.children,l)){let e=u.children[l];a(this,_).get(e.backingFilename).truncate(0),this.state.pool.push(e.backingFilename)}u.children[l]=s.children[o],delete s.children[o]}rmdir(e){t(this,S,w).call(this,{opp:`rmdir`,args:[e]},()=>{this._rmdirState(e)})}_rmdirState(e){let n=t(this,S,E).call(this,e),r=n.pop(),i=t(this,S,D).call(this,n.join(`/`));if(!Object.prototype.hasOwnProperty.call(i.children,r))throw new M(`ENOENT`,`No such file or directory`);let a=i.children[r];if(a.type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);if(Object.keys(a.children).length>0)throw new M(`ENOTEMPTY`,`Directory not empty`);delete i.children[r]}truncate(e,n=0){let r=t(this,S,D).call(this,e);if(r.type!==`file`)throw new M(`EISDIR`,`Is a directory`);let i=a(this,_).get(r.backingFilename);if(!i)throw new M(`ENOENT`,`No such file or directory`);i.truncate(n),a(this,x).add(i)}unlink(e){t(this,S,w).call(this,{opp:`unlink`,args:[e]},()=>{this._unlinkState(e,!0)})}_unlinkState(e,n=!1){let r=t(this,S,E).call(this,e),i=r.pop(),o=t(this,S,D).call(this,r.join(`/`));if(!Object.prototype.hasOwnProperty.call(o.children,i))throw new M(`ENOENT`,`No such file or directory`);let s=o.children[i];if(s.type!==`file`)throw new M(`EISDIR`,`Is a directory`);if(delete o.children[i],n){let t=a(this,_).get(s.backingFilename);t?.truncate(0),a(this,x).add(t),a(this,b).has(e)&&(a(this,y).delete(a(this,b).get(e)),a(this,b).delete(e))}this.state.pool.push(s.backingFilename)}utimes(e,n,r){t(this,S,w).call(this,{opp:`utimes`,args:[e,n,r]},()=>{this._utimesState(e,n,r)})}_utimesState(e,n,r){let i=t(this,S,D).call(this,e);i.lastModified=r}writeFile(e,n,r){let i=t(this,S,E).call(this,e),o=i.pop(),s=t(this,S,D).call(this,i.join(`/`));if(Object.prototype.hasOwnProperty.call(s.children,o)){let n=s.children[o];n.lastModified=Date.now(),t(this,S,T).call(this,{opp:`setLastModified`,args:[e,n.lastModified]})}else{if(this.state.pool.length===0)throw Error(`No more file handles available in the pool`);let n={type:`file`,lastModified:Date.now(),mode:r?.mode||u.FILE,backingFilename:this.state.pool.pop()};s.children[o]=n,t(this,S,T).call(this,{opp:`createFileNode`,args:[e,n]})}let c=s.children[o],l=a(this,_).get(c.backingFilename);n.length>0&&(l.write(typeof n==`string`?new TextEncoder().encode(n):new Uint8Array(n),{at:0}),e.startsWith(`/pg_wal`)&&a(this,x).add(l))}_createFileNodeState(e,n){let r=t(this,S,E).call(this,e),i=r.pop(),a=t(this,S,D).call(this,r.join(`/`));a.children[i]=n;let o=this.state.pool.indexOf(n.backingFilename);return o>-1&&this.state.pool.splice(o,1),n}_setLastModifiedState(e,n){let r=t(this,S,D).call(this,e);r.lastModified=n}write(e,n,r,i,o){let s=t(this,S,O).call(this,e),c=t(this,S,D).call(this,s);if(c.type!==`file`)throw new M(`EISDIR`,`Is a directory`);let l=a(this,_).get(c.backingFilename);if(!l)throw new M(`EBADF`,`Bad file descriptor`);let u=l.write(new Uint8Array(n,r,i),{at:o});return s.startsWith(`/pg_wal`)&&a(this,x).add(l),u}};d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,_=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,x=new WeakMap,S=new WeakSet,C=async function(){n(this,d,await navigator.storage.getDirectory()),n(this,f,await t(this,S,A).call(this,this.dataDir,{create:!0})),n(this,p,await t(this,S,A).call(this,l,{from:a(this,f),create:!0})),n(this,m,await a(this,f).getFileHandle(c,{create:!0})),n(this,h,await a(this,m).createSyncAccessHandle());let e=new ArrayBuffer(a(this,h).getSize());a(this,h).read(e,{at:0});let r,i=new TextDecoder().decode(e).split(`
|
|
2
|
+
`),o=!1;try{r=JSON.parse(i[0])}catch{r={root:{type:`directory`,lastModified:Date.now(),mode:u.DIR,children:{}},pool:[]},a(this,h).truncate(0),a(this,h).write(new TextEncoder().encode(JSON.stringify(r)),{at:0}),o=!0}this.state=r;let s=i.slice(1).filter(Boolean).map(e=>JSON.parse(e));for(let e of s){let t=`_${e.opp}State`;if(typeof this[t]==`function`)try{this[t].bind(this)(...e.args)}catch(t){console.warn(`Error applying OPFS AHP WAL entry`,e,t)}}let v=[],y=async e=>{if(e.type===`file`)try{let t=await a(this,p).getFileHandle(e.backingFilename),n=await t.createSyncAccessHandle();a(this,g).set(e.backingFilename,t),a(this,_).set(e.backingFilename,n)}catch(t){console.error(`Error opening file handle for node`,e,t)}else for(let t of Object.values(e.children))v.push(y(t))};await y(this.state.root);let b=[];for(let e of this.state.pool)b.push(new Promise(async t=>{a(this,g).has(e)&&console.warn(`File handle already exists for pool file`,e);let n=await a(this,p).getFileHandle(e),r=await n.createSyncAccessHandle();a(this,g).set(e,n),a(this,_).set(e,r),t()}));await Promise.all([...v,...b]),await this.maintainPool(o?this.initialPoolSize:this.maintainedPoolSize)},w=function(e,n){let r=t(this,S,T).call(this,e);try{n()}catch(e){throw a(this,h).truncate(r),e}},T=function(e){let t=JSON.stringify(e),n=new TextEncoder().encode(`
|
|
3
|
+
${t}`),r=a(this,h).getSize();return a(this,h).write(n,{at:r}),a(this,x).add(a(this,h)),r},E=function(e){return e.split(`/`).filter(Boolean)},D=function(e,n){let r=t(this,S,E).call(this,e),i=n||this.state.root;for(let e of r){if(i.type!==`directory`)throw new M(`ENOTDIR`,`Not a directory`);if(!Object.prototype.hasOwnProperty.call(i.children,e))throw new M(`ENOENT`,`No such file or directory`);i=i.children[e]}return i},O=function(e){let t=a(this,y).get(e);if(!t)throw new M(`EBADF`,`Bad file descriptor`);return t},k=function(){let e=++s(this,v)._;for(;a(this,y).has(e);)s(this,v)._++;return e},A=async function(e,n){let r=t(this,S,E).call(this,e),i=n?.from||a(this,d);for(let e of r)i=await i.getDirectoryHandle(e,{create:n?.create});return i};var M=class extends Error{constructor(e,t){super(t),typeof e==`number`?this.code=e:typeof e==`string`&&(this.code=o[e])}};export{j as OpfsAhpFS};
|
|
4
|
+
//# sourceMappingURL=opfs-ahp-DnDPNLA9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opfs-ahp-DnDPNLA9.js","names":["R","B","r","s","h","E","_","z"],"sources":["../../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/fs/opfs-ahp.js"],"sourcesContent":["import{f as B,g as z}from\"../chunk-VBDAOXYI.js\";import{e as s,f as g,g as E,h as r,i as _,j as R}from\"../chunk-QY3QWFKW.js\";R();var $=\"state.txt\",G=\"data\",T={DIR:16384,FILE:32768},H,v,F,M,y,b,m,x,P,D,S,n,C,O,k,w,f,I,W,j,L=class extends B{constructor(e,{initialPoolSize:t=1e3,maintainedPoolSize:o=100,debug:i=!1}={}){super(e,{debug:i});g(this,n);g(this,H);g(this,v);g(this,F);g(this,M);g(this,y);g(this,b,new Map);g(this,m,new Map);g(this,x,0);g(this,P,new Map);g(this,D,new Map);this.lastCheckpoint=0;this.checkpointInterval=1e3*60;this.poolCounter=0;g(this,S,new Set);this.initialPoolSize=t,this.maintainedPoolSize=o}async init(e,t){return await r(this,n,C).call(this),super.init(e,t)}async syncToFs(e=!1){await this.maybeCheckpointState(),await this.maintainPool(),e||this.flush()}async closeFs(){for(let e of s(this,m).values())e.close();s(this,y).flush(),s(this,y).close(),this.pg.Module.FS.quit()}async maintainPool(e){e=e||this.maintainedPoolSize;let t=e-this.state.pool.length,o=[];for(let i=0;i<t;i++)o.push(new Promise(async c=>{++this.poolCounter;let a=`${(Date.now()-1704063600).toString(16).padStart(8,\"0\")}-${this.poolCounter.toString(16).padStart(8,\"0\")}`,h=await s(this,F).getFileHandle(a,{create:!0}),d=await h.createSyncAccessHandle();s(this,b).set(a,h),s(this,m).set(a,d),r(this,n,k).call(this,{opp:\"createPoolFile\",args:[a]}),this.state.pool.push(a),c()}));for(let i=0;i>t;i--)o.push(new Promise(async c=>{let a=this.state.pool.pop();r(this,n,k).call(this,{opp:\"deletePoolFile\",args:[a]});let h=s(this,b).get(a);s(this,m).get(a)?.close(),await s(this,F).removeEntry(h.name),s(this,b).delete(a),s(this,m).delete(a),c()}));await Promise.all(o)}_createPoolFileState(e){this.state.pool.push(e)}_deletePoolFileState(e){let t=this.state.pool.indexOf(e);t>-1&&this.state.pool.splice(t,1)}async maybeCheckpointState(){Date.now()-this.lastCheckpoint>this.checkpointInterval&&await this.checkpointState()}async checkpointState(){let e=new TextEncoder().encode(JSON.stringify(this.state));s(this,y).truncate(0),s(this,y).write(e,{at:0}),s(this,y).flush(),this.lastCheckpoint=Date.now()}flush(){for(let e of s(this,S))try{e.flush()}catch{}s(this,S).clear()}chmod(e,t){r(this,n,O).call(this,{opp:\"chmod\",args:[e,t]},()=>{this._chmodState(e,t)})}_chmodState(e,t){let o=r(this,n,f).call(this,e);o.mode=t}close(e){let t=r(this,n,I).call(this,e);s(this,P).delete(e),s(this,D).delete(t)}fstat(e){let t=r(this,n,I).call(this,e);return this.lstat(t)}lstat(e){let t=r(this,n,f).call(this,e),o=t.type===\"file\"?s(this,m).get(t.backingFilename).getSize():0,i=4096;return{dev:0,ino:0,mode:t.mode,nlink:1,uid:0,gid:0,rdev:0,size:o,blksize:i,blocks:Math.ceil(o/i),atime:t.lastModified,mtime:t.lastModified,ctime:t.lastModified}}mkdir(e,t){r(this,n,O).call(this,{opp:\"mkdir\",args:[e,t]},()=>{this._mkdirState(e,t)})}_mkdirState(e,t){let o=r(this,n,w).call(this,e),i=o.pop(),c=[],a=this.state.root;for(let d of o){if(c.push(e),!Object.prototype.hasOwnProperty.call(a.children,d))if(t?.recursive)this.mkdir(c.join(\"/\"));else throw new p(\"ENOENT\",\"No such file or directory\");if(a.children[d].type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");a=a.children[d]}if(Object.prototype.hasOwnProperty.call(a.children,i))throw new p(\"EEXIST\",\"File exists\");let h={type:\"directory\",lastModified:Date.now(),mode:t?.mode||T.DIR,children:{}};a.children[i]=h}open(e,t,o){if(r(this,n,f).call(this,e).type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");let c=r(this,n,W).call(this);return s(this,P).set(c,e),s(this,D).set(e,c),c}readdir(e){let t=r(this,n,f).call(this,e);if(t.type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");return Object.keys(t.children)}read(e,t,o,i,c){let a=r(this,n,I).call(this,e),h=r(this,n,f).call(this,a);if(h.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");return s(this,m).get(h.backingFilename).read(new Uint8Array(t.buffer,o,i),{at:c})}rename(e,t){r(this,n,O).call(this,{opp:\"rename\",args:[e,t]},()=>{this._renameState(e,t,!0)})}_renameState(e,t,o=!1){let i=r(this,n,w).call(this,e),c=i.pop(),a=r(this,n,f).call(this,i.join(\"/\"));if(!Object.prototype.hasOwnProperty.call(a.children,c))throw new p(\"ENOENT\",\"No such file or directory\");let h=r(this,n,w).call(this,t),d=h.pop(),l=r(this,n,f).call(this,h.join(\"/\"));if(o&&Object.prototype.hasOwnProperty.call(l.children,d)){let u=l.children[d];s(this,m).get(u.backingFilename).truncate(0),this.state.pool.push(u.backingFilename)}l.children[d]=a.children[c],delete a.children[c]}rmdir(e){r(this,n,O).call(this,{opp:\"rmdir\",args:[e]},()=>{this._rmdirState(e)})}_rmdirState(e){let t=r(this,n,w).call(this,e),o=t.pop(),i=r(this,n,f).call(this,t.join(\"/\"));if(!Object.prototype.hasOwnProperty.call(i.children,o))throw new p(\"ENOENT\",\"No such file or directory\");let c=i.children[o];if(c.type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");if(Object.keys(c.children).length>0)throw new p(\"ENOTEMPTY\",\"Directory not empty\");delete i.children[o]}truncate(e,t=0){let o=r(this,n,f).call(this,e);if(o.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");let i=s(this,m).get(o.backingFilename);if(!i)throw new p(\"ENOENT\",\"No such file or directory\");i.truncate(t),s(this,S).add(i)}unlink(e){r(this,n,O).call(this,{opp:\"unlink\",args:[e]},()=>{this._unlinkState(e,!0)})}_unlinkState(e,t=!1){let o=r(this,n,w).call(this,e),i=o.pop(),c=r(this,n,f).call(this,o.join(\"/\"));if(!Object.prototype.hasOwnProperty.call(c.children,i))throw new p(\"ENOENT\",\"No such file or directory\");let a=c.children[i];if(a.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");if(delete c.children[i],t){let h=s(this,m).get(a.backingFilename);h?.truncate(0),s(this,S).add(h),s(this,D).has(e)&&(s(this,P).delete(s(this,D).get(e)),s(this,D).delete(e))}this.state.pool.push(a.backingFilename)}utimes(e,t,o){r(this,n,O).call(this,{opp:\"utimes\",args:[e,t,o]},()=>{this._utimesState(e,t,o)})}_utimesState(e,t,o){let i=r(this,n,f).call(this,e);i.lastModified=o}writeFile(e,t,o){let i=r(this,n,w).call(this,e),c=i.pop(),a=r(this,n,f).call(this,i.join(\"/\"));if(Object.prototype.hasOwnProperty.call(a.children,c)){let l=a.children[c];l.lastModified=Date.now(),r(this,n,k).call(this,{opp:\"setLastModified\",args:[e,l.lastModified]})}else{if(this.state.pool.length===0)throw new Error(\"No more file handles available in the pool\");let l={type:\"file\",lastModified:Date.now(),mode:o?.mode||T.FILE,backingFilename:this.state.pool.pop()};a.children[c]=l,r(this,n,k).call(this,{opp:\"createFileNode\",args:[e,l]})}let h=a.children[c],d=s(this,m).get(h.backingFilename);t.length>0&&(d.write(typeof t==\"string\"?new TextEncoder().encode(t):new Uint8Array(t),{at:0}),e.startsWith(\"/pg_wal\")&&s(this,S).add(d))}_createFileNodeState(e,t){let o=r(this,n,w).call(this,e),i=o.pop(),c=r(this,n,f).call(this,o.join(\"/\"));c.children[i]=t;let a=this.state.pool.indexOf(t.backingFilename);return a>-1&&this.state.pool.splice(a,1),t}_setLastModifiedState(e,t){let o=r(this,n,f).call(this,e);o.lastModified=t}write(e,t,o,i,c){let a=r(this,n,I).call(this,e),h=r(this,n,f).call(this,a);if(h.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");let d=s(this,m).get(h.backingFilename);if(!d)throw new p(\"EBADF\",\"Bad file descriptor\");let l=d.write(new Uint8Array(t,o,i),{at:c});return a.startsWith(\"/pg_wal\")&&s(this,S).add(d),l}};H=new WeakMap,v=new WeakMap,F=new WeakMap,M=new WeakMap,y=new WeakMap,b=new WeakMap,m=new WeakMap,x=new WeakMap,P=new WeakMap,D=new WeakMap,S=new WeakMap,n=new WeakSet,C=async function(){E(this,H,await navigator.storage.getDirectory()),E(this,v,await r(this,n,j).call(this,this.dataDir,{create:!0})),E(this,F,await r(this,n,j).call(this,G,{from:s(this,v),create:!0})),E(this,M,await s(this,v).getFileHandle($,{create:!0})),E(this,y,await s(this,M).createSyncAccessHandle());let e=new ArrayBuffer(s(this,y).getSize());s(this,y).read(e,{at:0});let t,o=new TextDecoder().decode(e).split(`\n`),i=!1;try{t=JSON.parse(o[0])}catch{t={root:{type:\"directory\",lastModified:Date.now(),mode:T.DIR,children:{}},pool:[]},s(this,y).truncate(0),s(this,y).write(new TextEncoder().encode(JSON.stringify(t)),{at:0}),i=!0}this.state=t;let c=o.slice(1).filter(Boolean).map(l=>JSON.parse(l));for(let l of c){let u=`_${l.opp}State`;if(typeof this[u]==\"function\")try{this[u].bind(this)(...l.args)}catch(N){console.warn(\"Error applying OPFS AHP WAL entry\",l,N)}}let a=[],h=async l=>{if(l.type===\"file\")try{let u=await s(this,F).getFileHandle(l.backingFilename),N=await u.createSyncAccessHandle();s(this,b).set(l.backingFilename,u),s(this,m).set(l.backingFilename,N)}catch(u){console.error(\"Error opening file handle for node\",l,u)}else for(let u of Object.values(l.children))a.push(h(u))};await h(this.state.root);let d=[];for(let l of this.state.pool)d.push(new Promise(async u=>{s(this,b).has(l)&&console.warn(\"File handle already exists for pool file\",l);let N=await s(this,F).getFileHandle(l),U=await N.createSyncAccessHandle();s(this,b).set(l,N),s(this,m).set(l,U),u()}));await Promise.all([...a,...d]),await this.maintainPool(i?this.initialPoolSize:this.maintainedPoolSize)},O=function(e,t){let o=r(this,n,k).call(this,e);try{t()}catch(i){throw s(this,y).truncate(o),i}},k=function(e){let t=JSON.stringify(e),o=new TextEncoder().encode(`\n${t}`),i=s(this,y).getSize();return s(this,y).write(o,{at:i}),s(this,S).add(s(this,y)),i},w=function(e){return e.split(\"/\").filter(Boolean)},f=function(e,t){let o=r(this,n,w).call(this,e),i=t||this.state.root;for(let c of o){if(i.type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");if(!Object.prototype.hasOwnProperty.call(i.children,c))throw new p(\"ENOENT\",\"No such file or directory\");i=i.children[c]}return i},I=function(e){let t=s(this,P).get(e);if(!t)throw new p(\"EBADF\",\"Bad file descriptor\");return t},W=function(){let e=++_(this,x)._;for(;s(this,P).has(e);)_(this,x)._++;return e},j=async function(e,t){let o=r(this,n,w).call(this,e),i=t?.from||s(this,H);for(let c of o)i=await i.getDirectoryHandle(c,{create:t?.create});return i};var p=class extends Error{constructor(A,e){super(e),typeof A==\"number\"?this.code=A:typeof A==\"string\"&&(this.code=z[A])}};export{L as OpfsAhpFS};\n//# sourceMappingURL=opfs-ahp.js.map"],"x_google_ignoreList":[0],"mappings":"wFAA4HA,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,IAAI,MAAM,KAAK,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,cAAcC,CAAC,CAAC,YAAY,EAAE,CAAC,gBAAgB,EAAE,IAAI,mBAAmB,EAAE,IAAI,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,KAAK,eAAe,EAAE,KAAK,mBAAmB,IAAI,GAAG,KAAK,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,KAAK,EAAE,EAAE,CAAC,OAAO,MAAMC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC,MAAM,SAAS,EAAE,CAAC,EAAE,CAAC,MAAM,K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M,IAAI,EAAE,SAAS,4BAA4B,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,GAAG,EAAE,SAAS,EAAE,CAAC,IAAI,EAAEC,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,EAAE,QAAQ,sBAAsB,CAAC,OAAO,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE,EAAEG,EAAE,KAAK,EAAE,CAAC,EAAE,KAAKH,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,OAAO,GAAG,EAAE,eAAe,EAAE,EAAE,CAAC,IAAI,EAAED,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,EAAE,GAAG,MAAMC,EAAE,KAAK,EAAE,CAAC,IAAI,IAAI,KAAK,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,OAAO,GAAG,IAAI,EAAE,cAAc,KAAK,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,GAAG,SAAS,KAAK,KAAK,EAAE,OAAO,GAAG,WAAW,KAAK,KAAKI,EAAE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={name:`@powerhousedao/connect`,productName:`Powerhouse-Connect`,version:`6.0.0-dev.170`,description:`Powerhouse Connect`,main:`dist/index.html`,type:`module`,engines:{node:`>=24.0.0`},files:[`dist`,`nginx.conf`,`nginx.sh`,`scripts`,`assets`,`public`,`heroku`,`.env`],exports:{".":{types:`./dist/start-connect.d.ts`,import:`./dist/start-connect.js`},"./main.js":{types:`./dist/main.d.ts`,import:`./dist/main.js`},"./assets/*":`./assets/*`,"./style.css":`./dist/style.css`},sideEffects:[`./dist/main.js`,`./dist/start-connect.js`,`./dist/style.css`],license:`AGPL-3.0-only`,author:`powerhouse.inc`,repository:{type:`git`,url:`https://github.com/powerhouse-inc/powerhouse`},bugs:{url:`https://github.com/powerhouse-inc/powerhouse/issues`},homepage:`https://github.com/powerhouse-inc/powerhouse#readme`,scripts:{tsc:`tsc`,lint:`eslint`,test:`vitest --run`,dev:`vite dev`,build:`pnpm run build:bundle && pnpm run build:css`,"build:css":`pnpm exec tailwindcss -i ./style.css -o ./dist/style.css`,"build:bundle":`tsdown`,"build:debug":`PH_DEBUG_BUILD=true vite build`,preview:`vite preview`,"cy:open":`cypress open`,"docker:build":`docker build -f ./Dockerfile --tag connect-test-dev --build-arg TAG=dev .`,"docker:run":`docker run -it -p 4000:4000 -v $(realpath ../../../monorepo):/monorepo -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf.template -e PH_USE_LOCAL=true -e PH_CONNECT_BASE_PATH=/develop/powerhouse/connect -e PORT=4000 connect-test-dev`},dependencies:{"@electric-sql/pglite":`catalog:`,"@electric-sql/pglite-tools":`catalog:`,"@openfeature/core":`1.9.1`,"@openfeature/web-sdk":`1.6.2`,"@powerhousedao/config":`workspace:*`,"@powerhousedao/design-system":`workspace:*`,"@powerhousedao/powerhouse-vetra-packages":`workspace:*`,"@powerhousedao/reactor-browser":`workspace:*`,"@powerhousedao/shared":`workspace:*`,"@powerhousedao/vetra":`workspace:*`,"@powerhousedao/document-engineering":`catalog:`,"@renown/sdk":`workspace:*`,"@sentry/react":`^10.17.0`,"document-model":`workspace:*`,graphql:`catalog:`,"graphql-request":`catalog:`,i18next:`^25.5.3`,kysely:`catalog:`,"kysely-pglite-dialect":`catalog:`,"react-error-boundary":`^4.0.11`,"react-hotkeys-hook":`^4.6.2`,"react-i18next":`^16.0.0`,"react-router-dom":`^6.11.2`,"tailwind-merge":`catalog:`,"usehooks-ts":`^3.1.1`},devDependencies:{"@tailwindcss/cli":`catalog:`,"@tailwindcss/vite":`catalog:`,"@types/bun":`catalog:`,"@types/node":`catalog:`,"@types/react":`catalog:`,"@types/react-dom":`catalog:`,"@types/wicg-file-system-access":`^2023.10.7`,"@vitejs/plugin-react":`catalog:`,cypress:`^14.5.4`,react:`catalog:`,"react-dom":`catalog:`,tailwindcss:`catalog:`,tsdown:`catalog:`,vite:`catalog:`,"vite-bundle-analyzer":`^1.3.6`},peerDependencies:{react:`>=19.0.0`,"react-dom":`>=19.0.0`}};export{e as t};
|
|
2
|
+
//# sourceMappingURL=package-BfEuD7B1-BfRYGKvg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-BfEuD7B1-BfRYGKvg.js","names":[],"sources":["../../../node_modules/.pnpm/@powerhousedao+connect@6.0.0-dev.170_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2_@fastify+_fd7bef13b52bc25c68e8c2976b2b527d/node_modules/@powerhousedao/connect/dist/package-BfEuD7B1.js"],"sourcesContent":["//#region package.json\nvar package_default = {\n\tname: \"@powerhousedao/connect\",\n\tproductName: \"Powerhouse-Connect\",\n\tversion: \"6.0.0-dev.170\",\n\tdescription: \"Powerhouse Connect\",\n\tmain: \"dist/index.html\",\n\ttype: \"module\",\n\tengines: { \"node\": \">=24.0.0\" },\n\tfiles: [\n\t\t\"dist\",\n\t\t\"nginx.conf\",\n\t\t\"nginx.sh\",\n\t\t\"scripts\",\n\t\t\"assets\",\n\t\t\"public\",\n\t\t\"heroku\",\n\t\t\".env\"\n\t],\n\texports: {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/start-connect.d.ts\",\n\t\t\t\"import\": \"./dist/start-connect.js\"\n\t\t},\n\t\t\"./main.js\": {\n\t\t\t\"types\": \"./dist/main.d.ts\",\n\t\t\t\"import\": \"./dist/main.js\"\n\t\t},\n\t\t\"./assets/*\": \"./assets/*\",\n\t\t\"./style.css\": \"./dist/style.css\"\n\t},\n\tsideEffects: [\n\t\t\"./dist/main.js\",\n\t\t\"./dist/start-connect.js\",\n\t\t\"./dist/style.css\"\n\t],\n\tlicense: \"AGPL-3.0-only\",\n\tauthor: \"powerhouse.inc\",\n\trepository: {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/powerhouse-inc/powerhouse\"\n\t},\n\tbugs: { \"url\": \"https://github.com/powerhouse-inc/powerhouse/issues\" },\n\thomepage: \"https://github.com/powerhouse-inc/powerhouse#readme\",\n\tscripts: {\n\t\t\"tsc\": \"tsc\",\n\t\t\"lint\": \"eslint\",\n\t\t\"test\": \"vitest --run\",\n\t\t\"dev\": \"vite dev\",\n\t\t\"build\": \"pnpm run build:bundle && pnpm run build:css\",\n\t\t\"build:css\": \"pnpm exec tailwindcss -i ./style.css -o ./dist/style.css\",\n\t\t\"build:bundle\": \"tsdown\",\n\t\t\"build:debug\": \"PH_DEBUG_BUILD=true vite build\",\n\t\t\"preview\": \"vite preview\",\n\t\t\"cy:open\": \"cypress open\",\n\t\t\"docker:build\": \"docker build -f ./Dockerfile --tag connect-test-dev --build-arg TAG=dev .\",\n\t\t\"docker:run\": \"docker run -it -p 4000:4000 -v $(realpath ../../../monorepo):/monorepo -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf.template -e PH_USE_LOCAL=true -e PH_CONNECT_BASE_PATH=/develop/powerhouse/connect -e PORT=4000 connect-test-dev\"\n\t},\n\tdependencies: {\n\t\t\"@electric-sql/pglite\": \"catalog:\",\n\t\t\"@electric-sql/pglite-tools\": \"catalog:\",\n\t\t\"@openfeature/core\": \"1.9.1\",\n\t\t\"@openfeature/web-sdk\": \"1.6.2\",\n\t\t\"@powerhousedao/config\": \"workspace:*\",\n\t\t\"@powerhousedao/design-system\": \"workspace:*\",\n\t\t\"@powerhousedao/powerhouse-vetra-packages\": \"workspace:*\",\n\t\t\"@powerhousedao/reactor-browser\": \"workspace:*\",\n\t\t\"@powerhousedao/shared\": \"workspace:*\",\n\t\t\"@powerhousedao/vetra\": \"workspace:*\",\n\t\t\"@powerhousedao/document-engineering\": \"catalog:\",\n\t\t\"@renown/sdk\": \"workspace:*\",\n\t\t\"@sentry/react\": \"^10.17.0\",\n\t\t\"document-model\": \"workspace:*\",\n\t\t\"graphql\": \"catalog:\",\n\t\t\"graphql-request\": \"catalog:\",\n\t\t\"i18next\": \"^25.5.3\",\n\t\t\"kysely\": \"catalog:\",\n\t\t\"kysely-pglite-dialect\": \"catalog:\",\n\t\t\"react-error-boundary\": \"^4.0.11\",\n\t\t\"react-hotkeys-hook\": \"^4.6.2\",\n\t\t\"react-i18next\": \"^16.0.0\",\n\t\t\"react-router-dom\": \"^6.11.2\",\n\t\t\"tailwind-merge\": \"catalog:\",\n\t\t\"usehooks-ts\": \"^3.1.1\"\n\t},\n\tdevDependencies: {\n\t\t\"@tailwindcss/cli\": \"catalog:\",\n\t\t\"@tailwindcss/vite\": \"catalog:\",\n\t\t\"@types/bun\": \"catalog:\",\n\t\t\"@types/node\": \"catalog:\",\n\t\t\"@types/react\": \"catalog:\",\n\t\t\"@types/react-dom\": \"catalog:\",\n\t\t\"@types/wicg-file-system-access\": \"^2023.10.7\",\n\t\t\"@vitejs/plugin-react\": \"catalog:\",\n\t\t\"cypress\": \"^14.5.4\",\n\t\t\"react\": \"catalog:\",\n\t\t\"react-dom\": \"catalog:\",\n\t\t\"tailwindcss\": \"catalog:\",\n\t\t\"tsdown\": \"catalog:\",\n\t\t\"vite\": \"catalog:\",\n\t\t\"vite-bundle-analyzer\": \"^1.3.6\"\n\t},\n\tpeerDependencies: {\n\t\t\"react\": \">=19.0.0\",\n\t\t\"react-dom\": \">=19.0.0\"\n\t}\n};\n//#endregion\nexport { package_default as t };\n\n//# sourceMappingURL=package-BfEuD7B1.js.map"],"x_google_ignoreList":[0],"mappings":"AACA,IAAI,EAAkB,CACrB,KAAM,yBACN,YAAa,qBACb,QAAS,gBACT,YAAa,qBACb,KAAM,kBACN,KAAM,SACN,QAAS,CAAE,KAAQ,WAAY,CAC/B,MAAO,CACN,OACA,aACA,WACA,UACA,SACA,SACA,SACA,OACA,CACD,QAAS,CACR,IAAK,CACJ,MAAS,4BACT,OAAU,0BACV,CACD,YAAa,CACZ,MAAS,mBACT,OAAU,iBACV,CACD,aAAc,aACd,cAAe,mBACf,CACD,YAAa,CACZ,iBACA,0BACA,mBACA,CACD,QAAS,gBACT,OAAQ,iBACR,WAAY,CACX,KAAQ,MACR,IAAO,+CACP,CACD,KAAM,CAAE,IAAO,sDAAuD,CACtE,SAAU,sDACV,QAAS,CACR,IAAO,MACP,KAAQ,SACR,KAAQ,eACR,IAAO,WACP,MAAS,8CACT,YAAa,2DACb,eAAgB,SAChB,cAAe,iCACf,QAAW,eACX,UAAW,eACX,eAAgB,4EAChB,aAAc,oOACd,CACD,aAAc,CACb,uBAAwB,WACxB,6BAA8B,WAC9B,oBAAqB,QACrB,uBAAwB,QACxB,wBAAyB,cACzB,+BAAgC,cAChC,2CAA4C,cAC5C,iCAAkC,cAClC,wBAAyB,cACzB,uBAAwB,cACxB,sCAAuC,WACvC,cAAe,cACf,gBAAiB,WACjB,iBAAkB,cAClB,QAAW,WACX,kBAAmB,WACnB,QAAW,UACX,OAAU,WACV,wBAAyB,WACzB,uBAAwB,UACxB,qBAAsB,SACtB,gBAAiB,UACjB,mBAAoB,UACpB,iBAAkB,WAClB,cAAe,SACf,CACD,gBAAiB,CAChB,mBAAoB,WACpB,oBAAqB,WACrB,aAAc,WACd,cAAe,WACf,eAAgB,WAChB,mBAAoB,WACpB,iCAAkC,aAClC,uBAAwB,WACxB,QAAW,UACX,MAAS,WACT,YAAa,WACb,YAAe,WACf,OAAU,WACV,KAAQ,WACR,uBAAwB,SACxB,CACD,iBAAkB,CACjB,MAAS,WACT,YAAa,WACb,CACD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function e(e,t){if(!e)throw Error(t)}function t(e){return typeof e==`object`&&!!e}function n(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}var r=/\r\n|[\n\r]/g;function i(e,t){let i=0,a=1;for(let o of e.body.matchAll(r)){if(typeof o.index==`number`||n(!1),o.index>=t)break;i=o.index+o[0].length,a+=1}return{line:a,column:t+1-i}}function a(e){return o(e.source,i(e.source,e.start))}function o(e,t){let n=e.locationOffset.column-1,r=``.padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,c=t.line===1?n:0,l=t.column+c,u=`${e.name}:${o}:${l}\n`,d=r.split(/\r\n|[\n\r]/g),f=d[i];if(f.length>120){let e=Math.floor(l/80),t=l%80,n=[];for(let e=0;e<f.length;e+=80)n.push(f.slice(e,e+80));return u+s([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>[`|`,e]),[`|`,`^`.padStart(t)],[`|`,n[e+1]]])}return u+s([[`${o-1} |`,d[i-1]],[`${o} |`,f],[`|`,`^`.padStart(l)],[`${o+1} |`,d[i+1]]])}function s(e){let t=e.filter(([e,t])=>t!==void 0),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?` `+t:``)).join(`
|
|
2
|
+
`)}function c(e){let t=e[0];return t==null||`kind`in t||`length`in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var l=class e extends Error{constructor(n,...r){let{nodes:a,source:o,positions:s,path:l,originalError:d,extensions:f}=c(r);super(n),this.name=`GraphQLError`,this.path=l??void 0,this.originalError=d??void 0,this.nodes=u(Array.isArray(a)?a:a?[a]:void 0);let p=u(this.nodes?.map(e=>e.loc).filter(e=>e!=null));this.source=o??p?.[0]?.source,this.positions=s??p?.map(e=>e.start),this.locations=s&&o?s.map(e=>i(o,e)):p?.map(e=>i(e.source,e.start));let m=t(d?.extensions)?d?.extensions:void 0;this.extensions=f??m??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),d!=null&&d.stack?Object.defineProperty(this,`stack`,{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,`stack`,{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return`GraphQLError`}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+=`
|
|
3
|
+
|
|
4
|
+
`+a(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+=`
|
|
5
|
+
|
|
6
|
+
`+o(this.source,t);return e}toJSON(){let e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function u(e){return e===void 0||e.length===0?void 0:e}function d(e,t,n){return new l(`Syntax Error: ${n}`,{source:e,positions:[t]})}var f=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return`Location`}toJSON(){return{start:this.start,end:this.end}}},p=class{constructor(e,t,n,r,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return`Token`}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},m={Name:[],Document:[`definitions`],OperationDefinition:[`description`,`name`,`variableDefinitions`,`directives`,`selectionSet`],VariableDefinition:[`description`,`variable`,`type`,`defaultValue`,`directives`],Variable:[`name`],SelectionSet:[`selections`],Field:[`alias`,`name`,`arguments`,`directives`,`selectionSet`],Argument:[`name`,`value`],FragmentSpread:[`name`,`directives`],InlineFragment:[`typeCondition`,`directives`,`selectionSet`],FragmentDefinition:[`description`,`name`,`variableDefinitions`,`typeCondition`,`directives`,`selectionSet`],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:[`values`],ObjectValue:[`fields`],ObjectField:[`name`,`value`],Directive:[`name`,`arguments`],NamedType:[`name`],ListType:[`type`],NonNullType:[`type`],SchemaDefinition:[`description`,`directives`,`operationTypes`],OperationTypeDefinition:[`type`],ScalarTypeDefinition:[`description`,`name`,`directives`],ObjectTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],FieldDefinition:[`description`,`name`,`arguments`,`type`,`directives`],InputValueDefinition:[`description`,`name`,`type`,`defaultValue`,`directives`],InterfaceTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],UnionTypeDefinition:[`description`,`name`,`directives`,`types`],EnumTypeDefinition:[`description`,`name`,`directives`,`values`],EnumValueDefinition:[`description`,`name`,`directives`],InputObjectTypeDefinition:[`description`,`name`,`directives`,`fields`],DirectiveDefinition:[`description`,`name`,`arguments`,`locations`],SchemaExtension:[`directives`,`operationTypes`],ScalarTypeExtension:[`name`,`directives`],ObjectTypeExtension:[`name`,`interfaces`,`directives`,`fields`],InterfaceTypeExtension:[`name`,`interfaces`,`directives`,`fields`],UnionTypeExtension:[`name`,`directives`,`types`],EnumTypeExtension:[`name`,`directives`,`values`],InputObjectTypeExtension:[`name`,`directives`,`fields`],TypeCoordinate:[`name`],MemberCoordinate:[`name`,`memberName`],ArgumentCoordinate:[`name`,`fieldName`,`argumentName`],DirectiveCoordinate:[`name`],DirectiveArgumentCoordinate:[`name`,`argumentName`]},h=new Set(Object.keys(m));function g(e){let t=e?.kind;return typeof t==`string`&&h.has(t)}var _;(function(e){e.QUERY=`query`,e.MUTATION=`mutation`,e.SUBSCRIPTION=`subscription`})(_||={});var v;(function(e){e.QUERY=`QUERY`,e.MUTATION=`MUTATION`,e.SUBSCRIPTION=`SUBSCRIPTION`,e.FIELD=`FIELD`,e.FRAGMENT_DEFINITION=`FRAGMENT_DEFINITION`,e.FRAGMENT_SPREAD=`FRAGMENT_SPREAD`,e.INLINE_FRAGMENT=`INLINE_FRAGMENT`,e.VARIABLE_DEFINITION=`VARIABLE_DEFINITION`,e.SCHEMA=`SCHEMA`,e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.FIELD_DEFINITION=`FIELD_DEFINITION`,e.ARGUMENT_DEFINITION=`ARGUMENT_DEFINITION`,e.INTERFACE=`INTERFACE`,e.UNION=`UNION`,e.ENUM=`ENUM`,e.ENUM_VALUE=`ENUM_VALUE`,e.INPUT_OBJECT=`INPUT_OBJECT`,e.INPUT_FIELD_DEFINITION=`INPUT_FIELD_DEFINITION`})(v||={});var y;(function(e){e.NAME=`Name`,e.DOCUMENT=`Document`,e.OPERATION_DEFINITION=`OperationDefinition`,e.VARIABLE_DEFINITION=`VariableDefinition`,e.SELECTION_SET=`SelectionSet`,e.FIELD=`Field`,e.ARGUMENT=`Argument`,e.FRAGMENT_SPREAD=`FragmentSpread`,e.INLINE_FRAGMENT=`InlineFragment`,e.FRAGMENT_DEFINITION=`FragmentDefinition`,e.VARIABLE=`Variable`,e.INT=`IntValue`,e.FLOAT=`FloatValue`,e.STRING=`StringValue`,e.BOOLEAN=`BooleanValue`,e.NULL=`NullValue`,e.ENUM=`EnumValue`,e.LIST=`ListValue`,e.OBJECT=`ObjectValue`,e.OBJECT_FIELD=`ObjectField`,e.DIRECTIVE=`Directive`,e.NAMED_TYPE=`NamedType`,e.LIST_TYPE=`ListType`,e.NON_NULL_TYPE=`NonNullType`,e.SCHEMA_DEFINITION=`SchemaDefinition`,e.OPERATION_TYPE_DEFINITION=`OperationTypeDefinition`,e.SCALAR_TYPE_DEFINITION=`ScalarTypeDefinition`,e.OBJECT_TYPE_DEFINITION=`ObjectTypeDefinition`,e.FIELD_DEFINITION=`FieldDefinition`,e.INPUT_VALUE_DEFINITION=`InputValueDefinition`,e.INTERFACE_TYPE_DEFINITION=`InterfaceTypeDefinition`,e.UNION_TYPE_DEFINITION=`UnionTypeDefinition`,e.ENUM_TYPE_DEFINITION=`EnumTypeDefinition`,e.ENUM_VALUE_DEFINITION=`EnumValueDefinition`,e.INPUT_OBJECT_TYPE_DEFINITION=`InputObjectTypeDefinition`,e.DIRECTIVE_DEFINITION=`DirectiveDefinition`,e.SCHEMA_EXTENSION=`SchemaExtension`,e.SCALAR_TYPE_EXTENSION=`ScalarTypeExtension`,e.OBJECT_TYPE_EXTENSION=`ObjectTypeExtension`,e.INTERFACE_TYPE_EXTENSION=`InterfaceTypeExtension`,e.UNION_TYPE_EXTENSION=`UnionTypeExtension`,e.ENUM_TYPE_EXTENSION=`EnumTypeExtension`,e.INPUT_OBJECT_TYPE_EXTENSION=`InputObjectTypeExtension`,e.TYPE_COORDINATE=`TypeCoordinate`,e.MEMBER_COORDINATE=`MemberCoordinate`,e.ARGUMENT_COORDINATE=`ArgumentCoordinate`,e.DIRECTIVE_COORDINATE=`DirectiveCoordinate`,e.DIRECTIVE_ARGUMENT_COORDINATE=`DirectiveArgumentCoordinate`})(y||={});function b(e){return e===9||e===32}function x(e){return e>=48&&e<=57}function S(e){return e>=97&&e<=122||e>=65&&e<=90}function C(e){return S(e)||e===95}function w(e){return S(e)||x(e)||e===95}function T(e){let t=2**53-1,n=null,r=-1;for(let i=0;i<e.length;++i){let a=e[i],o=ee(a);o!==a.length&&(n??=i,r=i,i!==0&&o<t&&(t=o))}return e.map((e,n)=>n===0?e:e.slice(t)).slice(n??0,r+1)}function ee(e){let t=0;for(;t<e.length&&b(e.charCodeAt(t));)++t;return t}function E(e){if(e===``)return!0;let t=!0,n=!1,r=!0,i=!1;for(let a=0;a<e.length;++a)switch(e.codePointAt(a)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,n=!1;break;case 9:case 32:n||=t;break;default:r&&=n,t=!1}return!(t||r&&i)}function D(e,t){let n=e.replace(/"""/g,`\\"""`),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(e=>e.length===0||b(e.charCodeAt(0))),o=n.endsWith(`\\"""`),s=e.endsWith(`"`)&&!o,c=e.endsWith(`\\`),l=s||c,u=!(t!=null&&t.minimize)&&(!i||e.length>70||l||a||o),d=``,f=i&&b(e.charCodeAt(0));return(u&&!f||a)&&(d+=`
|
|
7
|
+
`),d+=n,(u||l)&&(d+=`
|
|
8
|
+
`),`"""`+d+`"""`}var O;(function(e){e.SOF=`<SOF>`,e.EOF=`<EOF>`,e.BANG=`!`,e.DOLLAR=`$`,e.AMP=`&`,e.PAREN_L=`(`,e.PAREN_R=`)`,e.DOT=`.`,e.SPREAD=`...`,e.COLON=`:`,e.EQUALS=`=`,e.AT=`@`,e.BRACKET_L=`[`,e.BRACKET_R=`]`,e.BRACE_L=`{`,e.PIPE=`|`,e.BRACE_R=`}`,e.NAME=`Name`,e.INT=`Int`,e.FLOAT=`Float`,e.STRING=`String`,e.BLOCK_STRING=`BlockString`,e.COMMENT=`Comment`})(O||={});var k=class{constructor(e){let t=new p(O.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return`Lexer`}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==O.EOF)do if(e.next)e=e.next;else{let t=te(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===O.COMMENT);return e}};function A(e){return e===O.BANG||e===O.DOLLAR||e===O.AMP||e===O.PAREN_L||e===O.PAREN_R||e===O.DOT||e===O.SPREAD||e===O.COLON||e===O.EQUALS||e===O.AT||e===O.BRACKET_L||e===O.BRACKET_R||e===O.BRACE_L||e===O.PIPE||e===O.BRACE_R}function j(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function M(e,t){return N(e.charCodeAt(t))&&P(e.charCodeAt(t+1))}function N(e){return e>=55296&&e<=56319}function P(e){return e>=56320&&e<=57343}function F(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return O.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return e===`"`?`'"'`:`"${e}"`}return`U+`+n.toString(16).toUpperCase().padStart(4,`0`)}function I(e,t,n,r,i){let a=e.line;return new p(t,n,r,a,1+n-e.lineStart,i)}function te(e,t){let n=e.source.body,r=n.length,i=t;for(;i<r;){let t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return ne(e,i);case 33:return I(e,O.BANG,i,i+1);case 36:return I(e,O.DOLLAR,i,i+1);case 38:return I(e,O.AMP,i,i+1);case 40:return I(e,O.PAREN_L,i,i+1);case 41:return I(e,O.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return I(e,O.SPREAD,i,i+3);break;case 58:return I(e,O.COLON,i,i+1);case 61:return I(e,O.EQUALS,i,i+1);case 64:return I(e,O.AT,i,i+1);case 91:return I(e,O.BRACKET_L,i,i+1);case 93:return I(e,O.BRACKET_R,i,i+1);case 123:return I(e,O.BRACE_L,i,i+1);case 124:return I(e,O.PIPE,i,i+1);case 125:return I(e,O.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?W(e,i):R(e,i)}if(x(t)||t===45)return re(e,i,t);if(C(t))return G(e,i);throw d(e.source,i,t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:j(t)||M(n,i)?`Unexpected character: ${F(e,i)}.`:`Invalid character: ${F(e,i)}.`)}return I(e,O.EOF,r,r)}function ne(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r;){let e=n.charCodeAt(i);if(e===10||e===13)break;if(j(e))++i;else if(M(n,i))i+=2;else break}return I(e,O.COMMENT,t,i,n.slice(t+1,i))}function re(e,t,n){let r=e.source.body,i=t,a=n,o=!1;if(a===45&&(a=r.charCodeAt(++i)),a===48){if(a=r.charCodeAt(++i),x(a))throw d(e.source,i,`Invalid number, unexpected digit after 0: ${F(e,i)}.`)}else i=L(e,i,a),a=r.charCodeAt(i);if(a===46&&(o=!0,a=r.charCodeAt(++i),i=L(e,i,a),a=r.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=r.charCodeAt(++i),(a===43||a===45)&&(a=r.charCodeAt(++i)),i=L(e,i,a),a=r.charCodeAt(i)),a===46||C(a))throw d(e.source,i,`Invalid number, expected digit but got: ${F(e,i)}.`);return I(e,o?O.FLOAT:O.INT,t,i,r.slice(t,i))}function L(e,t,n){if(!x(n))throw d(e.source,t,`Invalid number, expected digit but got: ${F(e,t)}.`);let r=e.source.body,i=t+1;for(;x(r.charCodeAt(i));)++i;return i}function R(e,t){let n=e.source.body,r=n.length,i=t+1,a=i,o=``;for(;i<r;){let r=n.charCodeAt(i);if(r===34)return o+=n.slice(a,i),I(e,O.STRING,t,i+1,o);if(r===92){o+=n.slice(a,i);let t=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?z(e,i):B(e,i):U(e,i);o+=t.value,i+=t.size,a=i;continue}if(r===10||r===13)break;if(j(r))++i;else if(M(n,i))i+=2;else throw d(e.source,i,`Invalid character within String: ${F(e,i)}.`)}throw d(e.source,i,`Unterminated string.`)}function z(e,t){let n=e.source.body,r=0,i=3;for(;i<12;){let e=n.charCodeAt(t+ i++);if(e===125){if(i<5||!j(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|H(e),r<0)break}throw d(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function B(e,t){let n=e.source.body,r=V(n,t+2);if(j(r))return{value:String.fromCodePoint(r),size:6};if(N(r)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let e=V(n,t+8);if(P(e))return{value:String.fromCodePoint(r,e),size:12}}throw d(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function V(e,t){return H(e.charCodeAt(t))<<12|H(e.charCodeAt(t+1))<<8|H(e.charCodeAt(t+2))<<4|H(e.charCodeAt(t+3))}function H(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function U(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:`"`,size:2};case 92:return{value:`\\`,size:2};case 47:return{value:`/`,size:2};case 98:return{value:`\b`,size:2};case 102:return{value:`\f`,size:2};case 110:return{value:`
|
|
9
|
+
`,size:2};case 114:return{value:`\r`,size:2};case 116:return{value:` `,size:2}}throw d(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function W(e,t){let n=e.source.body,r=n.length,i=e.lineStart,a=t+3,o=a,s=``,c=[];for(;a<r;){let r=n.charCodeAt(a);if(r===34&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34){s+=n.slice(o,a),c.push(s);let r=I(e,O.BLOCK_STRING,t,a+3,T(c).join(`
|
|
10
|
+
`));return e.line+=c.length-1,e.lineStart=i,r}if(r===92&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34&&n.charCodeAt(a+3)===34){s+=n.slice(o,a),o=a+1,a+=4;continue}if(r===10||r===13){s+=n.slice(o,a),c.push(s),r===13&&n.charCodeAt(a+1)===10?a+=2:++a,s=``,o=a,i=a;continue}if(j(r))++a;else if(M(n,a))a+=2;else throw d(e.source,a,`Invalid character within String: ${F(e,a)}.`)}throw d(e.source,a,`Unterminated string.`)}function G(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r&&w(n.charCodeAt(i));)++i;return I(e,O.NAME,t,i,n.slice(t,i))}var K=10,q=2;function J(e){return Y(e,[])}function Y(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return ie(e,t);default:return String(e)}}function ie(e,t){if(e===null)return`null`;if(t.includes(e))return`[Circular]`;let n=[...t,e];if(ae(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:Y(t,n)}else if(Array.isArray(e))return se(e,n);return oe(e,n)}function ae(e){return typeof e.toJSON==`function`}function oe(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>q?`[`+ce(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+Y(n,t)).join(`, `)+` }`}function se(e,t){if(e.length===0)return`[]`;if(t.length>q)return`[Array]`;let n=Math.min(K,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(Y(e[r],t));return r===1?i.push(`... 1 more item`):r>1&&i.push(`... ${r} more items`),`[`+i.join(`, `)+`]`}function ce(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}var X=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if(typeof e==`object`&&e){let n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){let t=J(e);throw Error(`Cannot use ${n} "${t}" from another module or realm.
|
|
11
|
+
|
|
12
|
+
Ensure that there is only one instance of "graphql" in the node_modules
|
|
13
|
+
directory. If different versions of "graphql" are the dependencies of other
|
|
14
|
+
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
15
|
+
|
|
16
|
+
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
17
|
+
|
|
18
|
+
Duplicate "graphql" modules cannot be used at the same time since different
|
|
19
|
+
versions may have different capabilities and behavior. The data from one
|
|
20
|
+
version used in the function from another could produce confusing and
|
|
21
|
+
spurious results.`)}}return!1},Z=class{constructor(t,n=`GraphQL request`,r={line:1,column:1}){typeof t==`string`||e(!1,`Body must be a string. Received: ${J(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||e(!1,`line in locationOffset is 1-indexed and must be positive.`),this.locationOffset.column>0||e(!1,`column in locationOffset is 1-indexed and must be positive.`)}get[Symbol.toStringTag](){return`Source`}};function le(e){return X(e,Z)}function ue(e,t){let n=new de(e,t),r=n.parseDocument();return Object.defineProperty(r,`tokenCount`,{enumerable:!1,value:n.tokenCount}),r}var de=class{constructor(e,t={}){let{lexer:n,...r}=t;n?this._lexer=n:this._lexer=new k(le(e)?e:new Z(e)),this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(O.NAME);return this.node(e,{kind:y.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:y.DOCUMENT,definitions:this.many(O.SOF,this.parseDefinition,O.EOF)})}parseDefinition(){if(this.peek(O.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===O.BRACE_L)throw d(this._lexer.source,this._lexer.token.start,`Unexpected description, descriptions are not supported on shorthand queries.`);if(t.kind===O.NAME){switch(t.value){case`schema`:return this.parseSchemaDefinition();case`scalar`:return this.parseScalarTypeDefinition();case`type`:return this.parseObjectTypeDefinition();case`interface`:return this.parseInterfaceTypeDefinition();case`union`:return this.parseUnionTypeDefinition();case`enum`:return this.parseEnumTypeDefinition();case`input`:return this.parseInputObjectTypeDefinition();case`directive`:return this.parseDirectiveDefinition()}switch(t.value){case`query`:case`mutation`:case`subscription`:return this.parseOperationDefinition();case`fragment`:return this.parseFragmentDefinition()}if(e)throw d(this._lexer.source,this._lexer.token.start,`Unexpected description, only GraphQL definitions support descriptions.`);switch(t.value){case`extend`:return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(O.BRACE_L))return this.node(e,{kind:y.OPERATION_DEFINITION,operation:_.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),n=this.parseOperationType(),r;return this.peek(O.NAME)&&(r=this.parseName()),this.node(e,{kind:y.OPERATION_DEFINITION,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(O.NAME);switch(e.value){case`query`:return _.QUERY;case`mutation`:return _.MUTATION;case`subscription`:return _.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(O.PAREN_L,this.parseVariableDefinition,O.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:y.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(O.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(O.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(O.DOLLAR),this.node(e,{kind:y.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:y.SELECTION_SET,selections:this.many(O.BRACE_L,this.parseSelection,O.BRACE_R)})}parseSelection(){return this.peek(O.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),n,r;return this.expectOptionalToken(O.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:y.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(O.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(O.PAREN_L,t,O.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(O.COLON),this.node(t,{kind:y.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(O.SPREAD);let t=this.expectOptionalKeyword(`on`);return!t&&this.peek(O.NAME)?this.node(e,{kind:y.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:y.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return this.expectKeyword(`fragment`),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:y.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:y.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value===`on`)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case O.BRACKET_L:return this.parseList(e);case O.BRACE_L:return this.parseObject(e);case O.INT:return this.advanceLexer(),this.node(t,{kind:y.INT,value:t.value});case O.FLOAT:return this.advanceLexer(),this.node(t,{kind:y.FLOAT,value:t.value});case O.STRING:case O.BLOCK_STRING:return this.parseStringLiteral();case O.NAME:switch(this.advanceLexer(),t.value){case`true`:return this.node(t,{kind:y.BOOLEAN,value:!0});case`false`:return this.node(t,{kind:y.BOOLEAN,value:!1});case`null`:return this.node(t,{kind:y.NULL});default:return this.node(t,{kind:y.ENUM,value:t.value})}case O.DOLLAR:if(e)if(this.expectToken(O.DOLLAR),this._lexer.token.kind===O.NAME){let e=this._lexer.token.value;throw d(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:y.STRING,value:e.value,block:e.kind===O.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:y.LIST,values:this.any(O.BRACKET_L,()=>this.parseValueLiteral(e),O.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:y.OBJECT,fields:this.any(O.BRACE_L,()=>this.parseObjectField(e),O.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(O.COLON),this.node(t,{kind:y.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(O.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(O.AT),this.node(t,{kind:y.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(O.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(O.BRACKET_R),t=this.node(e,{kind:y.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(O.BANG)?this.node(e,{kind:y.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:y.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(O.STRING)||this.peek(O.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`schema`);let n=this.parseConstDirectives(),r=this.many(O.BRACE_L,this.parseOperationTypeDefinition,O.BRACE_R);return this.node(e,{kind:y.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(O.COLON);let n=this.parseNamedType();return this.node(e,{kind:y.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`scalar`);let n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:y.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`type`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:y.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword(`implements`)?this.delimitedMany(O.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(O.BRACE_L,this.parseFieldDefinition,O.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(O.COLON);let i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:y.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(O.PAREN_L,this.parseInputValueDef,O.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(O.COLON);let r=this.parseTypeReference(),i;this.expectOptionalToken(O.EQUALS)&&(i=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(e,{kind:y.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`interface`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:y.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`union`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:y.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(O.EQUALS)?this.delimitedMany(O.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`enum`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:y.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(O.BRACE_L,this.parseEnumValueDefinition,O.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:y.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if(this._lexer.token.value===`true`||this._lexer.token.value===`false`||this._lexer.token.value===`null`)throw d(this._lexer.source,this._lexer.token.start,`${Q(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`input`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:y.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(O.BRACE_L,this.parseInputValueDef,O.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===O.NAME)switch(e.value){case`schema`:return this.parseSchemaExtension();case`scalar`:return this.parseScalarTypeExtension();case`type`:return this.parseObjectTypeExtension();case`interface`:return this.parseInterfaceTypeExtension();case`union`:return this.parseUnionTypeExtension();case`enum`:return this.parseEnumTypeExtension();case`input`:return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`schema`);let t=this.parseConstDirectives(),n=this.optionalMany(O.BRACE_L,this.parseOperationTypeDefinition,O.BRACE_R);if(t.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:y.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`scalar`);let t=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:y.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`type`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:y.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`interface`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:y.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`union`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:y.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`enum`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:y.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`input`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:y.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`directive`),this.expectToken(O.AT);let n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword(`repeatable`);this.expectKeyword(`on`);let a=this.parseDirectiveLocations();return this.node(e,{kind:y.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a})}parseDirectiveLocations(){return this.delimitedMany(O.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(v,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(O.AT),n=this.parseName(),r;!t&&this.expectOptionalToken(O.DOT)&&(r=this.parseName());let i;return(t||r)&&this.expectOptionalToken(O.PAREN_L)&&(i=this.parseName(),this.expectToken(O.COLON),this.expectToken(O.PAREN_R)),t?i?this.node(e,{kind:y.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:i}):this.node(e,{kind:y.DIRECTIVE_COORDINATE,name:n}):r?i?this.node(e,{kind:y.ARGUMENT_COORDINATE,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:y.MEMBER_COORDINATE,name:n,memberName:r}):this.node(e,{kind:y.TYPE_COORDINATE,name:n})}node(e,t){return this._options.noLocation!==!0&&(t.loc=new f(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw d(this._lexer.source,t.start,`Expected ${$(e)}, found ${Q(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){let t=this._lexer.token;if(t.kind===O.NAME&&t.value===e)this.advanceLexer();else throw d(this._lexer.source,t.start,`Expected "${e}", found ${Q(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===O.NAME&&t.value===e?(this.advanceLexer(),!0):!1}unexpected(e){let t=e??this._lexer.token;return d(this._lexer.source,t.start,`Unexpected ${Q(t)}.`)}any(e,t,n){this.expectToken(e);let r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let e=[];do e.push(t.call(this));while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==O.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw d(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function Q(e){let t=e.value;return $(e.kind)+(t==null?``:` "${t}"`)}function $(e){return A(e)?`"${e}"`:e}export{m as a,X as c,C as d,g as f,D as g,ue as h,_ as i,n as l,E as m,l as n,e as o,t as p,y as r,J as s,v as t,w as u};
|
|
22
|
+
//# sourceMappingURL=parser-DbYKMg6c-usgms9X3.js.map
|