lookatstudy-mobile 0.33.2 → 0.34.0
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/package.json +1 -1
- package/server.cjs +977 -503
- package/web/assets/{CanvasStage-Gd9IcpRA.js → CanvasStage-CpZeMgwT.js} +1 -1
- package/web/assets/{CommandPalette-DAynMTxU.js → CommandPalette-BlRArZBr.js} +1 -1
- package/web/assets/{CompanionBotLab-ZoBUVdSh.js → CompanionBotLab-Ch7CGv7f.js} +1 -1
- package/web/assets/{CourseSearchPanel-D1VejiyW.js → CourseSearchPanel-C7KIDdON.js} +1 -1
- package/web/assets/{ExamView-B2Ps3sl8.js → ExamView-8XI8Nw1H.js} +1 -1
- package/web/assets/{ReviewPanel-CQVX2nYz.js → ReviewPanel-CTzPBfgZ.js} +1 -1
- package/web/assets/SettingsView-CoGqUXEr.js +15 -0
- package/web/assets/{VoicePanel-hA4wtfPr.js → VoicePanel-BhC8Hu-3.js} +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-D6Hk3Y7l.js → abnfDiagram-VCTEODGH-CTwnb_LX.js} +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-ODA7YWAP-BvyMBGPN.js → abnfDiagram-VCTEODGH-ODA7YWAP-C1dBUZ7b.js} +1 -1
- package/web/assets/api-web-BZuBkYKX.js +1 -0
- package/web/assets/{architectureDiagram-5GKGNRK7-C4PU3XN7-Bew1e_oO.js → architectureDiagram-5GKGNRK7-C4PU3XN7-ChothZwf.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-C7Kp_VCT.js → architectureDiagram-5GKGNRK7-DOTrgigK.js} +1 -1
- package/web/assets/{arrow-right-rT190nhw.js → arrow-right-BQgpe45F.js} +1 -1
- package/web/assets/{blockDiagram-I7D4REHJ-Z33I9bv_.js → blockDiagram-I7D4REHJ-DyYXGdPV.js} +1 -1
- package/web/assets/{blockDiagram-NRAW4CY4-UMJ6PMQQ-BH4SHysg.js → blockDiagram-NRAW4CY4-UMJ6PMQQ-DOFYspw-.js} +1 -1
- package/web/assets/{c4Diagram-7LVT6UL2-UvW7IuNF.js → c4Diagram-7LVT6UL2-0AsslgW1.js} +1 -1
- package/web/assets/{c4Diagram-UCG6FXSJ-75X3U2P3-IAl07Y5s.js → c4Diagram-UCG6FXSJ-75X3U2P3-B96ZJV69.js} +1 -1
- package/web/assets/channel-CB0qYQAs.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-CarLXuZT.js → chunk-2Q5K7J3B-YcEvx37Y.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-DwCCLy6d.js → chunk-5VM5RSS4-BFI2AG6f.js} +1 -1
- package/web/assets/{chunk-7XDTSPCN-A-CYYjR9.js → chunk-7XDTSPCN-BjlU6ynD.js} +1 -1
- package/web/assets/{chunk-CTNIYPP6-CF37J8Wl.js → chunk-CTNIYPP6-LyWaVAeX.js} +1 -1
- package/web/assets/{chunk-CXNFBKHE-Dol1xkx9.js → chunk-CXNFBKHE-9OIQHuxw.js} +1 -1
- package/web/assets/{chunk-F27PBJKO-CCKF34J6.js → chunk-F27PBJKO-C1TvQsHt.js} +1 -1
- package/web/assets/{chunk-IMKFNOWR-ChnROkLb.js → chunk-IMKFNOWR-B7G8Z_Ng.js} +1 -1
- package/web/assets/{chunk-ISA7TJRJ-xSTEZzVx.js → chunk-ISA7TJRJ-BL4KA7xt.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-omYL3Obe.js → chunk-JWPE2WC7-CH4FMDWX.js} +1 -1
- package/web/assets/{chunk-LV3HUYFY-Bk9nvQV-.js → chunk-LV3HUYFY-Ch9MhjBs.js} +1 -1
- package/web/assets/{chunk-M3IUQBOH-CAVmNM6v.js → chunk-M3IUQBOH-BcqMygxc.js} +1 -1
- package/web/assets/{chunk-NDIOYS4C-DGwQ1S-J.js → chunk-NDIOYS4C-DE45Abjh.js} +1 -1
- package/web/assets/{chunk-POPQ4Y6H-C0Zgm0cx.js → chunk-POPQ4Y6H-D-SBQItu.js} +1 -1
- package/web/assets/{chunk-RE4WF27V-Br7-3LIe.js → chunk-RE4WF27V-C1subsXL.js} +1 -1
- package/web/assets/{chunk-SVP7TREG-IZUpDCWY.js → chunk-SVP7TREG-cLlInCCA.js} +1 -1
- package/web/assets/{chunk-TICWLB2K-FxWFH9Jf.js → chunk-TICWLB2K-DxNEFrwG.js} +1 -1
- package/web/assets/{chunk-VII2H2IX-CSYYAPr-.js → chunk-VII2H2IX-ymoFJHrt.js} +1 -1
- package/web/assets/{chunk-X5GNSKZ3-Dchniejs.js → chunk-X5GNSKZ3-Cce97LK8.js} +1 -1
- package/web/assets/{chunk-XCWWM2C3-CkB_7V6A.js → chunk-XCWWM2C3-DDsEpbkx.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-mXFfWdd4.js → chunk-XXDRQBXY-BlitsaYT.js} +1 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-gE6ypOty.js +1 -0
- package/web/assets/classDiagram-ZZMXUADV-6pfB_2-g.js +1 -0
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-gE6ypOty.js +1 -0
- package/web/assets/classDiagram-v2-VYDZK3BY-6pfB_2-g.js +1 -0
- package/web/assets/{core-C__jCKLW.js → core-Cz8RF5Ss.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-OB24KH3T-CZMlLgoQ.js → cose-bilkent-JH36ORCC-OB24KH3T-CHMfylG8.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-pqa9xs1w.js → cose-bilkent-JH36ORCC-Z1v0LKQQ.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-Bzlfkn3M.js → cynefin-OW5HDTMX-B8B-PAKZ.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-GVF3BKWE-Bd4Ot2ae.js → cynefin-OW5HDTMX-GVF3BKWE-B8BGNTw-.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-C0bSmN09.js → cynefinDiagram-5FMLGOSQ-Dx-FYIVc.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-H3WIRU3N-Q5MnkiSc.js → cynefinDiagram-5FMLGOSQ-H3WIRU3N-BV3TRRUk.js} +1 -1
- package/web/assets/{dagre-3AP2YEHR-DCERTXHT-CJZg19fe.js → dagre-3AP2YEHR-DCERTXHT-US6ZPid6.js} +1 -1
- package/web/assets/{dagre-GXQ25YYZ-JmpF3dnx.js → dagre-GXQ25YYZ-DvgJpvrR.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-Du2A_-O-.js → diagram-S7CK7UJ4-IA_lpeJb.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-MULGZGEL-3I2Tacmz.js → diagram-S7CK7UJ4-MULGZGEL-9X64zpVt.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-C7idBPLC.js → diagram-UQ7AKVKN-BI77k4Eg.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-YQBY353J-Bd-LRcw1.js → diagram-UQ7AKVKN-YQBY353J-BSFLZLn0.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-WLNH2ELY-DSymPCZL.js → diagram-VSXAHHWV-WLNH2ELY-BVJvpn3p.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-BKZF79gO.js → diagram-VSXAHHWV-qtk4pu7a.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-Dhw4qEcD.js → diagram-VX7I27RA-D1OUoA-L.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-XW6YQV5G-BWEKbFNG.js → diagram-VX7I27RA-XW6YQV5G-c8XHmzOy.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-CkQJvuAa.js → diagram-Z3DM3KII-A7_8IFdk.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-HG7RF65D-WDQq7tAf.js → diagram-Z3DM3KII-HG7RF65D-Cw_b8aFx.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-OKY4VHYD-Bpih3QFv.js → ebnfDiagram-PWID7BFC-OKY4VHYD-DpM76Qo-.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-BdXZV32p.js → ebnfDiagram-PWID7BFC-s9w7t4t-.js} +1 -1
- package/web/assets/{elk.bundled-SZmCpI5p.js → elk.bundled-B1HkkibK.js} +1 -1
- package/web/assets/{erDiagram-RLTQ6QDP-jpRq-UGG.js → erDiagram-RLTQ6QDP-BqZVVONb.js} +1 -1
- package/web/assets/{erDiagram-SSCWMZ5O-PIPKOIK7-D0mRljF8.js → erDiagram-SSCWMZ5O-PIPKOIK7-mvBqIA0l.js} +1 -1
- package/web/assets/{flowDiagram-A5DVABFB-2Z4AVO5R-BJE_0PFG.js → flowDiagram-A5DVABFB-2Z4AVO5R-Y6pTj-b3.js} +1 -1
- package/web/assets/{flowDiagram-HODETNUW-CuyRnAfK.js → flowDiagram-HODETNUW-Bd7fJP9N.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-TunEgpI8.js → ganttDiagram-EL5Y4UJY-Bu47S_cy.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-JZNG7GOG-yFTfjUwE.js → ganttDiagram-EL5Y4UJY-JZNG7GOG-rP8k0IHr.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-BgzYKWnb.js → gitGraphDiagram-WWUBYQGX-6TDOHnoT.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-DMWMLL3G-uGNiKmaN.js → gitGraphDiagram-WWUBYQGX-DMWMLL3G-B2RIK0rX.js} +1 -1
- package/web/assets/{index-BNvqgHhT.js → index-5Ng_lap_.js} +1 -1
- package/web/assets/index-DpPK19Iz.css +1 -0
- package/web/assets/index-DpUqsNSC.js +53 -0
- package/web/assets/{index-CFVpnh5A.js → index-DqlC7JoQ.js} +1 -1
- package/web/assets/{index-T8vA0XV2.js → index-DqnX7_zV.js} +4 -4
- package/web/assets/{infoDiagram-27XIBGKW-B8l9g0jD.js → infoDiagram-27XIBGKW-CNG9rO3x.js} +1 -1
- package/web/assets/{infoDiagram-RXCK75RN-HANS5KVC-BBl7fKsQ.js → infoDiagram-RXCK75RN-HANS5KVC-BLQAuzZo.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-7GCIT7WU-Bt-TE7vw.js → ishikawaDiagram-5VMMS53U-7GCIT7WU-cUZxo0qy.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-CzwJL0NU.js → ishikawaDiagram-5VMMS53U-O4xGKyXs.js} +1 -1
- package/web/assets/{journeyDiagram-3NMN7TZE-B8wTvg0T.js → journeyDiagram-3NMN7TZE-CXvTN2XW.js} +1 -1
- package/web/assets/{journeyDiagram-EYS64GPL-OAPELBT7-A4dOTrJK.js → journeyDiagram-EYS64GPL-OAPELBT7-DkfyTyBt.js} +1 -1
- package/web/assets/{kanban-definition-3QL26DDD-I7RKWQQY-fVSx48Ir.js → kanban-definition-3QL26DDD-I7RKWQQY-CgdUNDmE.js} +1 -1
- package/web/assets/{kanban-definition-UXKFOSKX-Ba0UYhk_.js → kanban-definition-UXKFOSKX-CXs9ROJB.js} +1 -1
- package/web/assets/{katex-N6JRN4PM-CHwboYl9.js → katex-N6JRN4PM-BjAz2jJx.js} +1 -1
- package/web/assets/{layout-Dw29D4oc.js → layout-Cp9w3JfL.js} +1 -1
- package/web/assets/{main-DrJVBtna.js → main-YTxb38yo.js} +111 -111
- package/web/assets/{mermaid-layout-elk.core-CicnJpM7.js → mermaid-layout-elk.core-DUbLagu1.js} +2 -2
- package/web/assets/{mermaid.core-CkjogKiM.js → mermaid.core-Czgmmu3m.js} +5 -5
- package/web/assets/{mindmap-definition-FBJOCRG2-KIYZG64Y-xsFUfLdH.js → mindmap-definition-FBJOCRG2-KIYZG64Y-DTs3kC-2.js} +1 -1
- package/web/assets/{mindmap-definition-YA3MSWOX-CILBhFg_.js → mindmap-definition-YA3MSWOX-8ZLAntKe.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-C-d4b8Dk.js → pegDiagram-XKGWAZYB-Ddy9tOBo.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-OIP57N6J-Bnh4Krz5.js → pegDiagram-XKGWAZYB-OIP57N6J-CX1pDkyu.js} +1 -1
- package/web/assets/{pet-C2gtNZEs.js → pet-DCzJVVt6.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-2UOTW327-CQuNMHQ1.js → pieDiagram-E7YTZNPT-2UOTW327-CJbVQ7j0.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-__8_Z3l_.js → pieDiagram-E7YTZNPT-bhM8Af8W.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-JT_Oydow.js → quadrantDiagram-AXDQQJYC-BPNVp-tm.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-SN3ASJJK-BHmr4hy8.js → quadrantDiagram-AXDQQJYC-SN3ASJJK-JrUYqoH6.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-34742W6X-BuzOX6qM.js → railroadDiagram-O6MQD6OU-34742W6X-CNPl0cRd.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-BL4fzNdr.js → railroadDiagram-O6MQD6OU-Djl7WlNw.js} +1 -1
- package/web/assets/{render-O7CIS3YK-lZh9RHoM.js → render-O7CIS3YK-SgZRy1rl.js} +7 -7
- package/web/assets/{requirementDiagram-BXWQKSXE-BX4Og0gc.js → requirementDiagram-BXWQKSXE-DvRiMfSd.js} +1 -1
- package/web/assets/{requirementDiagram-EFPCY7ZU-NGAFFSMB-Be_4b6Ca.js → requirementDiagram-EFPCY7ZU-NGAFFSMB-CetNYmyR.js} +1 -1
- package/web/assets/{rotate-ccw-jAam_EWy.js → rotate-ccw-CmUerE0X.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-3D3M4XPB-DQyfvfY9.js → sankeyDiagram-P5KCCOFB-3D3M4XPB-DTBggk4D.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-CsMuk8xO.js → sankeyDiagram-P5KCCOFB-Chf73i3x.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-CqLVTAiQ.js → sequenceDiagram-WJ2MYXX4-DH8S7n6r.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-Q2IOPB4R-CKxbF_KH.js → sequenceDiagram-WJ2MYXX4-Q2IOPB4R-BaqhVeKy.js} +1 -1
- package/web/assets/{sizeCapture-INFHLROL-B_yzF7FU.js → sizeCapture-INFHLROL-DoWkN5kB.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-PSGVOMYM-DdyuBiOR.js → sizeCapture-X5ZJPWSS-PSGVOMYM-D1w8fJEe.js} +1 -1
- package/web/assets/{stateDiagram-D77RDMKH-BW1HJ7hN.js → stateDiagram-D77RDMKH-C2Bmxn5D.js} +1 -1
- package/web/assets/{stateDiagram-HBIQ2CUA-4M2S6MAN-DYW1Q86F.js → stateDiagram-HBIQ2CUA-4M2S6MAN-DmtO2hG4.js} +1 -1
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-BRoIf1d6.js +1 -0
- package/web/assets/stateDiagram-v2-MP3YSRHH-BVoQ569f.js +1 -0
- package/web/assets/{swimlanes-42K2YHIH-CSEPYP51.js → swimlanes-42K2YHIH-CtCB4ffC.js} +1 -1
- package/web/assets/{swimlanes-XN3QIQJK-N6N2CCQ6-DK5asoC3.js → swimlanes-XN3QIQJK-N6N2CCQ6-C7V48a-4.js} +1 -1
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-B6zzyUKq.js +8 -0
- package/web/assets/swimlanesDiagram-VR7AAH4N-XUZui9QT.js +8 -0
- package/web/assets/{timeline-definition-24CTP7MA-CNV-7RF0.js → timeline-definition-24CTP7MA-CGdYfJkN.js} +1 -1
- package/web/assets/{timeline-definition-24CTP7MA-KN7RSRVM-WJCyYFqv.js → timeline-definition-24CTP7MA-KN7RSRVM-CPntDgZR.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-AKJ7LXAN-D7P4RYfo.js → vennDiagram-4TSXK5OY-AKJ7LXAN-CGIdSvWW.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-DnO_E0gl.js → vennDiagram-4TSXK5OY-BpWlDJtb.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-3B6A3BN5-BDz-qu7A.js → wardleyDiagram-VM6X3IG4-3B6A3BN5-DXGnwCFx.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-DriPUoP9.js → wardleyDiagram-VM6X3IG4-DqcLqOTM.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-OBDNV6WG-D6KLvT_R.js → xychartDiagram-S5SC5T6Z-OBDNV6WG-DIO8oTNs.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-dsrWxH2R.js → xychartDiagram-S5SC5T6Z-VQI7mnX_.js} +1 -1
- package/web/index.html +3 -3
- package/web/pet.html +3 -3
- package/web/assets/SettingsView-D2LV8vux.js +0 -10
- package/web/assets/api-web-BCzlfr07.js +0 -1
- package/web/assets/channel-Br11ibHK.js +0 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-vwLxJ0gZ.js +0 -1
- package/web/assets/classDiagram-ZZMXUADV-B-kQs3FT.js +0 -1
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-vwLxJ0gZ.js +0 -1
- package/web/assets/classDiagram-v2-VYDZK3BY-B-kQs3FT.js +0 -1
- package/web/assets/index-3R9G44mo.js +0 -53
- package/web/assets/index-DPow_Z3A.css +0 -1
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-BlV86LYk.js +0 -1
- package/web/assets/stateDiagram-v2-MP3YSRHH-DlFDcdin.js +0 -1
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-CxQIfxrF.js +0 -8
- package/web/assets/swimlanesDiagram-VR7AAH4N-CTm10_mn.js +0 -8
package/server.cjs
CHANGED
|
@@ -6312,9 +6312,9 @@ var init_table = __esm({
|
|
|
6312
6312
|
[IsDrizzleTable] = true;
|
|
6313
6313
|
/** @internal */
|
|
6314
6314
|
[ExtraConfigBuilder] = void 0;
|
|
6315
|
-
constructor(name19,
|
|
6315
|
+
constructor(name19, schema32, baseName) {
|
|
6316
6316
|
this[TableName] = this[OriginalName] = name19;
|
|
6317
|
-
this[Schema] =
|
|
6317
|
+
this[Schema] = schema32;
|
|
6318
6318
|
this[BaseName] = baseName;
|
|
6319
6319
|
}
|
|
6320
6320
|
};
|
|
@@ -7378,7 +7378,7 @@ var init_sql = __esm({
|
|
|
7378
7378
|
return new SQL([new StringChunk(str2)]);
|
|
7379
7379
|
}
|
|
7380
7380
|
sql2.raw = raw;
|
|
7381
|
-
function
|
|
7381
|
+
function join16(chunks, separator) {
|
|
7382
7382
|
const result = [];
|
|
7383
7383
|
for (const [i, chunk] of chunks.entries()) {
|
|
7384
7384
|
if (i > 0 && separator !== void 0) {
|
|
@@ -7388,7 +7388,7 @@ var init_sql = __esm({
|
|
|
7388
7388
|
}
|
|
7389
7389
|
return new SQL(result);
|
|
7390
7390
|
}
|
|
7391
|
-
sql2.join =
|
|
7391
|
+
sql2.join = join16;
|
|
7392
7392
|
function identifier(value) {
|
|
7393
7393
|
return new Name(value);
|
|
7394
7394
|
}
|
|
@@ -7437,11 +7437,11 @@ var init_sql = __esm({
|
|
|
7437
7437
|
[ViewBaseConfig];
|
|
7438
7438
|
/** @internal */
|
|
7439
7439
|
[IsDrizzleView] = true;
|
|
7440
|
-
constructor({ name: name26, schema:
|
|
7440
|
+
constructor({ name: name26, schema: schema32, selectedFields, query: query2 }) {
|
|
7441
7441
|
this[ViewBaseConfig] = {
|
|
7442
7442
|
name: name26,
|
|
7443
7443
|
originalName: name26,
|
|
7444
|
-
schema:
|
|
7444
|
+
schema: schema32,
|
|
7445
7445
|
selectedFields,
|
|
7446
7446
|
query: query2,
|
|
7447
7447
|
isExisting: !query2,
|
|
@@ -7912,14 +7912,14 @@ function getOrderByOperators() {
|
|
|
7912
7912
|
desc
|
|
7913
7913
|
};
|
|
7914
7914
|
}
|
|
7915
|
-
function extractTablesRelationalConfig(
|
|
7916
|
-
if (Object.keys(
|
|
7917
|
-
|
|
7915
|
+
function extractTablesRelationalConfig(schema32, configHelpers) {
|
|
7916
|
+
if (Object.keys(schema32).length === 1 && "default" in schema32 && !is(schema32["default"], Table)) {
|
|
7917
|
+
schema32 = schema32["default"];
|
|
7918
7918
|
}
|
|
7919
7919
|
const tableNamesMap = {};
|
|
7920
7920
|
const relationsBuffer = {};
|
|
7921
7921
|
const tablesConfig = {};
|
|
7922
|
-
for (const [key2, value] of Object.entries(
|
|
7922
|
+
for (const [key2, value] of Object.entries(schema32)) {
|
|
7923
7923
|
if (is(value, Table)) {
|
|
7924
7924
|
const dbName = getTableUniqueName(value);
|
|
7925
7925
|
const bufferedRelations = relationsBuffer[dbName];
|
|
@@ -8001,7 +8001,7 @@ function createMany(sourceTable) {
|
|
|
8001
8001
|
return new Many(sourceTable, referencedTable, config2);
|
|
8002
8002
|
};
|
|
8003
8003
|
}
|
|
8004
|
-
function normalizeRelation(
|
|
8004
|
+
function normalizeRelation(schema32, tableNamesMap, relation) {
|
|
8005
8005
|
if (is(relation, One) && relation.config) {
|
|
8006
8006
|
return {
|
|
8007
8007
|
fields: relation.config.fields,
|
|
@@ -8014,7 +8014,7 @@ function normalizeRelation(schema31, tableNamesMap, relation) {
|
|
|
8014
8014
|
`Table "${relation.referencedTable[Table.Symbol.Name]}" not found in schema`
|
|
8015
8015
|
);
|
|
8016
8016
|
}
|
|
8017
|
-
const referencedTableConfig =
|
|
8017
|
+
const referencedTableConfig = schema32[referencedTableTsName];
|
|
8018
8018
|
if (!referencedTableConfig) {
|
|
8019
8019
|
throw new Error(`Table "${referencedTableTsName}" not found in schema`);
|
|
8020
8020
|
}
|
|
@@ -9028,8 +9028,8 @@ var init_all = __esm({
|
|
|
9028
9028
|
});
|
|
9029
9029
|
|
|
9030
9030
|
// node_modules/drizzle-orm/sqlite-core/table.js
|
|
9031
|
-
function sqliteTableBase(name19, columns, extraConfig,
|
|
9032
|
-
const rawTable = new SQLiteTable(name19,
|
|
9031
|
+
function sqliteTableBase(name19, columns, extraConfig, schema32, baseName = name19) {
|
|
9032
|
+
const rawTable = new SQLiteTable(name19, schema32, baseName);
|
|
9033
9033
|
const parsedColumns = typeof columns === "function" ? columns(getSQLiteColumnBuilders()) : columns;
|
|
9034
9034
|
const builtColumns = Object.fromEntries(
|
|
9035
9035
|
Object.entries(parsedColumns).map(([name26, colBuilderBase]) => {
|
|
@@ -9373,18 +9373,18 @@ var init_casing = __esm({
|
|
|
9373
9373
|
getColumnCasing(column) {
|
|
9374
9374
|
if (!column.keyAsName)
|
|
9375
9375
|
return column.name;
|
|
9376
|
-
const
|
|
9376
|
+
const schema32 = column.table[Table.Symbol.Schema] ?? "public";
|
|
9377
9377
|
const tableName = column.table[Table.Symbol.OriginalName];
|
|
9378
|
-
const key2 = `${
|
|
9378
|
+
const key2 = `${schema32}.${tableName}.${column.name}`;
|
|
9379
9379
|
if (!this.cache[key2]) {
|
|
9380
9380
|
this.cacheTable(column.table);
|
|
9381
9381
|
}
|
|
9382
9382
|
return this.cache[key2];
|
|
9383
9383
|
}
|
|
9384
9384
|
cacheTable(table) {
|
|
9385
|
-
const
|
|
9385
|
+
const schema32 = table[Table.Symbol.Schema] ?? "public";
|
|
9386
9386
|
const tableName = table[Table.Symbol.OriginalName];
|
|
9387
|
-
const tableKey = `${
|
|
9387
|
+
const tableKey = `${schema32}.${tableName}`;
|
|
9388
9388
|
if (!this.cachedTables[tableKey]) {
|
|
9389
9389
|
for (const column of Object.values(table[Table.Symbol.Columns])) {
|
|
9390
9390
|
const columnKey = `${tableKey}.${column.name}`;
|
|
@@ -9960,7 +9960,7 @@ var init_dialect = __esm({
|
|
|
9960
9960
|
}
|
|
9961
9961
|
buildRelationalQuery({
|
|
9962
9962
|
fullSchema,
|
|
9963
|
-
schema:
|
|
9963
|
+
schema: schema32,
|
|
9964
9964
|
tableNamesMap,
|
|
9965
9965
|
table,
|
|
9966
9966
|
tableConfig,
|
|
@@ -10068,7 +10068,7 @@ var init_dialect = __esm({
|
|
|
10068
10068
|
relation
|
|
10069
10069
|
} of selectedRelations) {
|
|
10070
10070
|
const normalizedRelation = normalizeRelation(
|
|
10071
|
-
|
|
10071
|
+
schema32,
|
|
10072
10072
|
tableNamesMap,
|
|
10073
10073
|
relation
|
|
10074
10074
|
);
|
|
@@ -10088,10 +10088,10 @@ var init_dialect = __esm({
|
|
|
10088
10088
|
);
|
|
10089
10089
|
const builtRelation = this.buildRelationalQuery({
|
|
10090
10090
|
fullSchema,
|
|
10091
|
-
schema:
|
|
10091
|
+
schema: schema32,
|
|
10092
10092
|
tableNamesMap,
|
|
10093
10093
|
table: fullSchema[relationTableTsName],
|
|
10094
|
-
tableConfig:
|
|
10094
|
+
tableConfig: schema32[relationTableTsName],
|
|
10095
10095
|
queryConfig: is(relation, One) ? selectedRelationConfigValue === true ? { limit: 1 } : { ...selectedRelationConfigValue, limit: 1 } : selectedRelationConfigValue,
|
|
10096
10096
|
tableAlias: relationTableAlias,
|
|
10097
10097
|
joinOn: joinOn2,
|
|
@@ -10399,7 +10399,7 @@ var init_select2 = __esm({
|
|
|
10399
10399
|
const tableName = getTableLikeName(table);
|
|
10400
10400
|
for (const item of extractUsedTable(table))
|
|
10401
10401
|
this.usedTables.add(item);
|
|
10402
|
-
if (typeof tableName === "string" && this.config.joins?.some((
|
|
10402
|
+
if (typeof tableName === "string" && this.config.joins?.some((join16) => join16.alias === tableName)) {
|
|
10403
10403
|
throw new Error(`Alias "${tableName}" is already used in this query`);
|
|
10404
10404
|
}
|
|
10405
10405
|
if (!this.isPartialSelect) {
|
|
@@ -11288,7 +11288,7 @@ var init_update = __esm({
|
|
|
11288
11288
|
createJoin(joinType) {
|
|
11289
11289
|
return (table, on) => {
|
|
11290
11290
|
const tableName = getTableLikeName(table);
|
|
11291
|
-
if (typeof tableName === "string" && this.config.joins.some((
|
|
11291
|
+
if (typeof tableName === "string" && this.config.joins.some((join16) => join16.alias === tableName)) {
|
|
11292
11292
|
throw new Error(`Alias "${tableName}" is already used in this query`);
|
|
11293
11293
|
}
|
|
11294
11294
|
if (typeof on === "function") {
|
|
@@ -11491,10 +11491,10 @@ var init_query = __esm({
|
|
|
11491
11491
|
init_query_promise();
|
|
11492
11492
|
init_relations();
|
|
11493
11493
|
RelationalQueryBuilder = class {
|
|
11494
|
-
constructor(mode, fullSchema,
|
|
11494
|
+
constructor(mode, fullSchema, schema32, tableNamesMap, table, tableConfig, dialect, session) {
|
|
11495
11495
|
this.mode = mode;
|
|
11496
11496
|
this.fullSchema = fullSchema;
|
|
11497
|
-
this.schema =
|
|
11497
|
+
this.schema = schema32;
|
|
11498
11498
|
this.tableNamesMap = tableNamesMap;
|
|
11499
11499
|
this.table = table;
|
|
11500
11500
|
this.tableConfig = tableConfig;
|
|
@@ -11550,10 +11550,10 @@ var init_query = __esm({
|
|
|
11550
11550
|
}
|
|
11551
11551
|
};
|
|
11552
11552
|
SQLiteRelationalQuery = class extends QueryPromise {
|
|
11553
|
-
constructor(fullSchema,
|
|
11553
|
+
constructor(fullSchema, schema32, tableNamesMap, table, tableConfig, dialect, session, config2, mode) {
|
|
11554
11554
|
super();
|
|
11555
11555
|
this.fullSchema = fullSchema;
|
|
11556
|
-
this.schema =
|
|
11556
|
+
this.schema = schema32;
|
|
11557
11557
|
this.tableNamesMap = tableNamesMap;
|
|
11558
11558
|
this.table = table;
|
|
11559
11559
|
this.tableConfig = tableConfig;
|
|
@@ -11683,14 +11683,14 @@ var init_db = __esm({
|
|
|
11683
11683
|
init_query();
|
|
11684
11684
|
init_raw();
|
|
11685
11685
|
BaseSQLiteDatabase = class {
|
|
11686
|
-
constructor(resultKind, dialect, session,
|
|
11686
|
+
constructor(resultKind, dialect, session, schema32) {
|
|
11687
11687
|
this.resultKind = resultKind;
|
|
11688
11688
|
this.dialect = dialect;
|
|
11689
11689
|
this.session = session;
|
|
11690
|
-
this._ =
|
|
11691
|
-
schema:
|
|
11692
|
-
fullSchema:
|
|
11693
|
-
tableNamesMap:
|
|
11690
|
+
this._ = schema32 ? {
|
|
11691
|
+
schema: schema32.schema,
|
|
11692
|
+
fullSchema: schema32.fullSchema,
|
|
11693
|
+
tableNamesMap: schema32.tableNamesMap
|
|
11694
11694
|
} : {
|
|
11695
11695
|
schema: void 0,
|
|
11696
11696
|
fullSchema: {},
|
|
@@ -11702,10 +11702,10 @@ var init_db = __esm({
|
|
|
11702
11702
|
for (const [tableName, columns] of Object.entries(this._.schema)) {
|
|
11703
11703
|
query2[tableName] = new RelationalQueryBuilder(
|
|
11704
11704
|
resultKind,
|
|
11705
|
-
|
|
11705
|
+
schema32.fullSchema,
|
|
11706
11706
|
this._.schema,
|
|
11707
11707
|
this._.tableNamesMap,
|
|
11708
|
-
|
|
11708
|
+
schema32.fullSchema[tableName],
|
|
11709
11709
|
columns,
|
|
11710
11710
|
dialect,
|
|
11711
11711
|
session
|
|
@@ -12206,9 +12206,9 @@ var init_session = __esm({
|
|
|
12206
12206
|
}
|
|
12207
12207
|
};
|
|
12208
12208
|
SQLiteTransaction = class extends BaseSQLiteDatabase {
|
|
12209
|
-
constructor(resultType, dialect, session,
|
|
12210
|
-
super(resultType, dialect, session,
|
|
12211
|
-
this.schema =
|
|
12209
|
+
constructor(resultType, dialect, session, schema32, nestedIndex = 0) {
|
|
12210
|
+
super(resultType, dialect, session, schema32);
|
|
12211
|
+
this.schema = schema32;
|
|
12212
12212
|
this.nestedIndex = nestedIndex;
|
|
12213
12213
|
}
|
|
12214
12214
|
static [entityKind] = "SQLiteTransaction";
|
|
@@ -12369,10 +12369,10 @@ var init_session2 = __esm({
|
|
|
12369
12369
|
init_session();
|
|
12370
12370
|
init_utils();
|
|
12371
12371
|
SQLJsSession = class extends SQLiteSession {
|
|
12372
|
-
constructor(client, dialect,
|
|
12372
|
+
constructor(client, dialect, schema32, options = {}) {
|
|
12373
12373
|
super(dialect);
|
|
12374
12374
|
this.client = client;
|
|
12375
|
-
this.schema =
|
|
12375
|
+
this.schema = schema32;
|
|
12376
12376
|
this.logger = options.logger ?? new NoopLogger();
|
|
12377
12377
|
}
|
|
12378
12378
|
static [entityKind] = "SQLJsSession";
|
|
@@ -12496,20 +12496,20 @@ function drizzle(client, config2 = {}) {
|
|
|
12496
12496
|
} else if (config2.logger !== false) {
|
|
12497
12497
|
logger = config2.logger;
|
|
12498
12498
|
}
|
|
12499
|
-
let
|
|
12499
|
+
let schema32;
|
|
12500
12500
|
if (config2.schema) {
|
|
12501
12501
|
const tablesConfig = extractTablesRelationalConfig(
|
|
12502
12502
|
config2.schema,
|
|
12503
12503
|
createTableRelationsHelpers
|
|
12504
12504
|
);
|
|
12505
|
-
|
|
12505
|
+
schema32 = {
|
|
12506
12506
|
fullSchema: config2.schema,
|
|
12507
12507
|
schema: tablesConfig.tables,
|
|
12508
12508
|
tableNamesMap: tablesConfig.tableNamesMap
|
|
12509
12509
|
};
|
|
12510
12510
|
}
|
|
12511
|
-
const session = new SQLJsSession(client, dialect,
|
|
12512
|
-
return new BaseSQLiteDatabase("sync", dialect, session,
|
|
12511
|
+
const session = new SQLJsSession(client, dialect, schema32, { logger });
|
|
12512
|
+
return new BaseSQLiteDatabase("sync", dialect, session, schema32);
|
|
12513
12513
|
}
|
|
12514
12514
|
var init_driver = __esm({
|
|
12515
12515
|
"node_modules/drizzle-orm/sql-js/driver.js"() {
|
|
@@ -15115,9 +15115,9 @@ function optionalKeys(shape) {
|
|
|
15115
15115
|
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
15116
15116
|
});
|
|
15117
15117
|
}
|
|
15118
|
-
function pick(
|
|
15118
|
+
function pick(schema32, mask) {
|
|
15119
15119
|
const newShape = {};
|
|
15120
|
-
const currDef =
|
|
15120
|
+
const currDef = schema32._zod.def;
|
|
15121
15121
|
for (const key2 in mask) {
|
|
15122
15122
|
if (!(key2 in currDef.shape)) {
|
|
15123
15123
|
throw new Error(`Unrecognized key: "${key2}"`);
|
|
@@ -15126,15 +15126,15 @@ function pick(schema31, mask) {
|
|
|
15126
15126
|
continue;
|
|
15127
15127
|
newShape[key2] = currDef.shape[key2];
|
|
15128
15128
|
}
|
|
15129
|
-
return clone(
|
|
15130
|
-
...
|
|
15129
|
+
return clone(schema32, {
|
|
15130
|
+
...schema32._zod.def,
|
|
15131
15131
|
shape: newShape,
|
|
15132
15132
|
checks: []
|
|
15133
15133
|
});
|
|
15134
15134
|
}
|
|
15135
|
-
function omit(
|
|
15136
|
-
const newShape = { ...
|
|
15137
|
-
const currDef =
|
|
15135
|
+
function omit(schema32, mask) {
|
|
15136
|
+
const newShape = { ...schema32._zod.def.shape };
|
|
15137
|
+
const currDef = schema32._zod.def;
|
|
15138
15138
|
for (const key2 in mask) {
|
|
15139
15139
|
if (!(key2 in currDef.shape)) {
|
|
15140
15140
|
throw new Error(`Unrecognized key: "${key2}"`);
|
|
@@ -15143,27 +15143,27 @@ function omit(schema31, mask) {
|
|
|
15143
15143
|
continue;
|
|
15144
15144
|
delete newShape[key2];
|
|
15145
15145
|
}
|
|
15146
|
-
return clone(
|
|
15147
|
-
...
|
|
15146
|
+
return clone(schema32, {
|
|
15147
|
+
...schema32._zod.def,
|
|
15148
15148
|
shape: newShape,
|
|
15149
15149
|
checks: []
|
|
15150
15150
|
});
|
|
15151
15151
|
}
|
|
15152
|
-
function extend(
|
|
15152
|
+
function extend(schema32, shape) {
|
|
15153
15153
|
if (!isPlainObject(shape)) {
|
|
15154
15154
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
15155
15155
|
}
|
|
15156
15156
|
const def = {
|
|
15157
|
-
...
|
|
15157
|
+
...schema32._zod.def,
|
|
15158
15158
|
get shape() {
|
|
15159
|
-
const _shape = { ...
|
|
15159
|
+
const _shape = { ...schema32._zod.def.shape, ...shape };
|
|
15160
15160
|
assignProp(this, "shape", _shape);
|
|
15161
15161
|
return _shape;
|
|
15162
15162
|
},
|
|
15163
15163
|
checks: []
|
|
15164
15164
|
// delete existing checks
|
|
15165
15165
|
};
|
|
15166
|
-
return clone(
|
|
15166
|
+
return clone(schema32, def);
|
|
15167
15167
|
}
|
|
15168
15168
|
function merge(a, b) {
|
|
15169
15169
|
return clone(a, {
|
|
@@ -15178,8 +15178,8 @@ function merge(a, b) {
|
|
|
15178
15178
|
// delete existing checks
|
|
15179
15179
|
});
|
|
15180
15180
|
}
|
|
15181
|
-
function partial(Class2,
|
|
15182
|
-
const oldShape =
|
|
15181
|
+
function partial(Class2, schema32, mask) {
|
|
15182
|
+
const oldShape = schema32._zod.def.shape;
|
|
15183
15183
|
const shape = { ...oldShape };
|
|
15184
15184
|
if (mask) {
|
|
15185
15185
|
for (const key2 in mask) {
|
|
@@ -15201,14 +15201,14 @@ function partial(Class2, schema31, mask) {
|
|
|
15201
15201
|
}) : oldShape[key2];
|
|
15202
15202
|
}
|
|
15203
15203
|
}
|
|
15204
|
-
return clone(
|
|
15205
|
-
...
|
|
15204
|
+
return clone(schema32, {
|
|
15205
|
+
...schema32._zod.def,
|
|
15206
15206
|
shape,
|
|
15207
15207
|
checks: []
|
|
15208
15208
|
});
|
|
15209
15209
|
}
|
|
15210
|
-
function required(Class2,
|
|
15211
|
-
const oldShape =
|
|
15210
|
+
function required(Class2, schema32, mask) {
|
|
15211
|
+
const oldShape = schema32._zod.def.shape;
|
|
15212
15212
|
const shape = { ...oldShape };
|
|
15213
15213
|
if (mask) {
|
|
15214
15214
|
for (const key2 in mask) {
|
|
@@ -15230,8 +15230,8 @@ function required(Class2, schema31, mask) {
|
|
|
15230
15230
|
});
|
|
15231
15231
|
}
|
|
15232
15232
|
}
|
|
15233
|
-
return clone(
|
|
15234
|
-
...
|
|
15233
|
+
return clone(schema32, {
|
|
15234
|
+
...schema32._zod.def,
|
|
15235
15235
|
shape,
|
|
15236
15236
|
// optional: [],
|
|
15237
15237
|
checks: []
|
|
@@ -15543,9 +15543,9 @@ var init_parse = __esm({
|
|
|
15543
15543
|
init_core();
|
|
15544
15544
|
init_errors2();
|
|
15545
15545
|
init_util();
|
|
15546
|
-
_parse = (_Err) => (
|
|
15546
|
+
_parse = (_Err) => (schema32, value, _ctx, _params) => {
|
|
15547
15547
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
15548
|
-
const result =
|
|
15548
|
+
const result = schema32._zod.run({ value, issues: [] }, ctx);
|
|
15549
15549
|
if (result instanceof Promise) {
|
|
15550
15550
|
throw new $ZodAsyncError();
|
|
15551
15551
|
}
|
|
@@ -15557,9 +15557,9 @@ var init_parse = __esm({
|
|
|
15557
15557
|
return result.value;
|
|
15558
15558
|
};
|
|
15559
15559
|
parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
15560
|
-
_parseAsync = (_Err) => async (
|
|
15560
|
+
_parseAsync = (_Err) => async (schema32, value, _ctx, params) => {
|
|
15561
15561
|
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
15562
|
-
let result =
|
|
15562
|
+
let result = schema32._zod.run({ value, issues: [] }, ctx);
|
|
15563
15563
|
if (result instanceof Promise)
|
|
15564
15564
|
result = await result;
|
|
15565
15565
|
if (result.issues.length) {
|
|
@@ -15570,9 +15570,9 @@ var init_parse = __esm({
|
|
|
15570
15570
|
return result.value;
|
|
15571
15571
|
};
|
|
15572
15572
|
parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
15573
|
-
_safeParse = (_Err) => (
|
|
15573
|
+
_safeParse = (_Err) => (schema32, value, _ctx) => {
|
|
15574
15574
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
15575
|
-
const result =
|
|
15575
|
+
const result = schema32._zod.run({ value, issues: [] }, ctx);
|
|
15576
15576
|
if (result instanceof Promise) {
|
|
15577
15577
|
throw new $ZodAsyncError();
|
|
15578
15578
|
}
|
|
@@ -15582,9 +15582,9 @@ var init_parse = __esm({
|
|
|
15582
15582
|
} : { success: true, data: result.value };
|
|
15583
15583
|
};
|
|
15584
15584
|
safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
15585
|
-
_safeParseAsync = (_Err) => async (
|
|
15585
|
+
_safeParseAsync = (_Err) => async (schema32, value, _ctx) => {
|
|
15586
15586
|
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
15587
|
-
let result =
|
|
15587
|
+
let result = schema32._zod.run({ value, issues: [] }, ctx);
|
|
15588
15588
|
if (result instanceof Promise)
|
|
15589
15589
|
result = await result;
|
|
15590
15590
|
return result.issues.length ? {
|
|
@@ -23000,14 +23000,14 @@ var init_registries = __esm({
|
|
|
23000
23000
|
this._map = /* @__PURE__ */ new Map();
|
|
23001
23001
|
this._idmap = /* @__PURE__ */ new Map();
|
|
23002
23002
|
}
|
|
23003
|
-
add(
|
|
23003
|
+
add(schema32, ..._meta) {
|
|
23004
23004
|
const meta = _meta[0];
|
|
23005
|
-
this._map.set(
|
|
23005
|
+
this._map.set(schema32, meta);
|
|
23006
23006
|
if (meta && typeof meta === "object" && "id" in meta) {
|
|
23007
23007
|
if (this._idmap.has(meta.id)) {
|
|
23008
23008
|
throw new Error(`ID ${meta.id} already exists in the registry`);
|
|
23009
23009
|
}
|
|
23010
|
-
this._idmap.set(meta.id,
|
|
23010
|
+
this._idmap.set(meta.id, schema32);
|
|
23011
23011
|
}
|
|
23012
23012
|
return this;
|
|
23013
23013
|
}
|
|
@@ -23016,25 +23016,25 @@ var init_registries = __esm({
|
|
|
23016
23016
|
this._idmap = /* @__PURE__ */ new Map();
|
|
23017
23017
|
return this;
|
|
23018
23018
|
}
|
|
23019
|
-
remove(
|
|
23020
|
-
const meta = this._map.get(
|
|
23019
|
+
remove(schema32) {
|
|
23020
|
+
const meta = this._map.get(schema32);
|
|
23021
23021
|
if (meta && typeof meta === "object" && "id" in meta) {
|
|
23022
23022
|
this._idmap.delete(meta.id);
|
|
23023
23023
|
}
|
|
23024
|
-
this._map.delete(
|
|
23024
|
+
this._map.delete(schema32);
|
|
23025
23025
|
return this;
|
|
23026
23026
|
}
|
|
23027
|
-
get(
|
|
23028
|
-
const p =
|
|
23027
|
+
get(schema32) {
|
|
23028
|
+
const p = schema32._zod.parent;
|
|
23029
23029
|
if (p) {
|
|
23030
23030
|
const pm = { ...this.get(p) ?? {} };
|
|
23031
23031
|
delete pm.id;
|
|
23032
|
-
return { ...pm, ...this._map.get(
|
|
23032
|
+
return { ...pm, ...this._map.get(schema32) };
|
|
23033
23033
|
}
|
|
23034
|
-
return this._map.get(
|
|
23034
|
+
return this._map.get(schema32);
|
|
23035
23035
|
}
|
|
23036
|
-
has(
|
|
23037
|
-
return this._map.has(
|
|
23036
|
+
has(schema32) {
|
|
23037
|
+
return this._map.has(schema32);
|
|
23038
23038
|
}
|
|
23039
23039
|
};
|
|
23040
23040
|
globalRegistry = /* @__PURE__ */ registry();
|
|
@@ -23595,11 +23595,11 @@ function _endsWith(suffix, params) {
|
|
|
23595
23595
|
suffix
|
|
23596
23596
|
});
|
|
23597
23597
|
}
|
|
23598
|
-
function _property(property,
|
|
23598
|
+
function _property(property, schema32, params) {
|
|
23599
23599
|
return new $ZodCheckProperty({
|
|
23600
23600
|
check: "property",
|
|
23601
23601
|
property,
|
|
23602
|
-
schema:
|
|
23602
|
+
schema: schema32,
|
|
23603
23603
|
...normalizeParams(params)
|
|
23604
23604
|
});
|
|
23605
23605
|
}
|
|
@@ -23804,22 +23804,22 @@ function _promise(Class2, innerType) {
|
|
|
23804
23804
|
function _custom(Class2, fn, _params) {
|
|
23805
23805
|
const norm = normalizeParams(_params);
|
|
23806
23806
|
norm.abort ?? (norm.abort = true);
|
|
23807
|
-
const
|
|
23807
|
+
const schema32 = new Class2({
|
|
23808
23808
|
type: "custom",
|
|
23809
23809
|
check: "custom",
|
|
23810
23810
|
fn,
|
|
23811
23811
|
...norm
|
|
23812
23812
|
});
|
|
23813
|
-
return
|
|
23813
|
+
return schema32;
|
|
23814
23814
|
}
|
|
23815
23815
|
function _refine(Class2, fn, _params) {
|
|
23816
|
-
const
|
|
23816
|
+
const schema32 = new Class2({
|
|
23817
23817
|
type: "custom",
|
|
23818
23818
|
check: "custom",
|
|
23819
23819
|
fn,
|
|
23820
23820
|
...normalizeParams(_params)
|
|
23821
23821
|
});
|
|
23822
|
-
return
|
|
23822
|
+
return schema32;
|
|
23823
23823
|
}
|
|
23824
23824
|
function _stringbool(Classes2, _params) {
|
|
23825
23825
|
const params = normalizeParams(_params);
|
|
@@ -23992,8 +23992,8 @@ function toJSONSchema(input, _params) {
|
|
|
23992
23992
|
const gen2 = new JSONSchemaGenerator(_params);
|
|
23993
23993
|
const defs = {};
|
|
23994
23994
|
for (const entry of input._idmap.entries()) {
|
|
23995
|
-
const [_,
|
|
23996
|
-
gen2.process(
|
|
23995
|
+
const [_, schema32] = entry;
|
|
23996
|
+
gen2.process(schema32);
|
|
23997
23997
|
}
|
|
23998
23998
|
const schemas = {};
|
|
23999
23999
|
const external = {
|
|
@@ -24002,8 +24002,8 @@ function toJSONSchema(input, _params) {
|
|
|
24002
24002
|
defs
|
|
24003
24003
|
};
|
|
24004
24004
|
for (const entry of input._idmap.entries()) {
|
|
24005
|
-
const [key2,
|
|
24006
|
-
schemas[key2] = gen2.emit(
|
|
24005
|
+
const [key2, schema32] = entry;
|
|
24006
|
+
schemas[key2] = gen2.emit(schema32, {
|
|
24007
24007
|
..._params,
|
|
24008
24008
|
external
|
|
24009
24009
|
});
|
|
@@ -24025,8 +24025,8 @@ function isTransforming(_schema, _ctx) {
|
|
|
24025
24025
|
if (ctx.seen.has(_schema))
|
|
24026
24026
|
return false;
|
|
24027
24027
|
ctx.seen.add(_schema);
|
|
24028
|
-
const
|
|
24029
|
-
const def =
|
|
24028
|
+
const schema32 = _schema;
|
|
24029
|
+
const def = schema32._zod.def;
|
|
24030
24030
|
switch (def.type) {
|
|
24031
24031
|
case "string":
|
|
24032
24032
|
case "number":
|
|
@@ -24134,9 +24134,9 @@ var init_to_json_schema = __esm({
|
|
|
24134
24134
|
this.io = params?.io ?? "output";
|
|
24135
24135
|
this.seen = /* @__PURE__ */ new Map();
|
|
24136
24136
|
}
|
|
24137
|
-
process(
|
|
24137
|
+
process(schema32, _params = { path: [], schemaPath: [] }) {
|
|
24138
24138
|
var _a27;
|
|
24139
|
-
const def =
|
|
24139
|
+
const def = schema32._zod.def;
|
|
24140
24140
|
const formatMap = {
|
|
24141
24141
|
guid: "uuid",
|
|
24142
24142
|
url: "uri",
|
|
@@ -24145,27 +24145,27 @@ var init_to_json_schema = __esm({
|
|
|
24145
24145
|
regex: ""
|
|
24146
24146
|
// do not set
|
|
24147
24147
|
};
|
|
24148
|
-
const seen = this.seen.get(
|
|
24148
|
+
const seen = this.seen.get(schema32);
|
|
24149
24149
|
if (seen) {
|
|
24150
24150
|
seen.count++;
|
|
24151
|
-
const isCycle = _params.schemaPath.includes(
|
|
24151
|
+
const isCycle = _params.schemaPath.includes(schema32);
|
|
24152
24152
|
if (isCycle) {
|
|
24153
24153
|
seen.cycle = _params.path;
|
|
24154
24154
|
}
|
|
24155
24155
|
return seen.schema;
|
|
24156
24156
|
}
|
|
24157
24157
|
const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
|
|
24158
|
-
this.seen.set(
|
|
24159
|
-
const overrideSchema =
|
|
24158
|
+
this.seen.set(schema32, result);
|
|
24159
|
+
const overrideSchema = schema32._zod.toJSONSchema?.();
|
|
24160
24160
|
if (overrideSchema) {
|
|
24161
24161
|
result.schema = overrideSchema;
|
|
24162
24162
|
} else {
|
|
24163
24163
|
const params = {
|
|
24164
24164
|
..._params,
|
|
24165
|
-
schemaPath: [..._params.schemaPath,
|
|
24165
|
+
schemaPath: [..._params.schemaPath, schema32],
|
|
24166
24166
|
path: _params.path
|
|
24167
24167
|
};
|
|
24168
|
-
const parent =
|
|
24168
|
+
const parent = schema32._zod.parent;
|
|
24169
24169
|
if (parent) {
|
|
24170
24170
|
result.ref = parent;
|
|
24171
24171
|
this.process(parent, params);
|
|
@@ -24176,7 +24176,7 @@ var init_to_json_schema = __esm({
|
|
|
24176
24176
|
case "string": {
|
|
24177
24177
|
const json2 = _json;
|
|
24178
24178
|
json2.type = "string";
|
|
24179
|
-
const { minimum, maximum, format, patterns, contentEncoding } =
|
|
24179
|
+
const { minimum, maximum, format, patterns, contentEncoding } = schema32._zod.bag;
|
|
24180
24180
|
if (typeof minimum === "number")
|
|
24181
24181
|
json2.minLength = minimum;
|
|
24182
24182
|
if (typeof maximum === "number")
|
|
@@ -24205,7 +24205,7 @@ var init_to_json_schema = __esm({
|
|
|
24205
24205
|
}
|
|
24206
24206
|
case "number": {
|
|
24207
24207
|
const json2 = _json;
|
|
24208
|
-
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } =
|
|
24208
|
+
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema32._zod.bag;
|
|
24209
24209
|
if (typeof format === "string" && format.includes("int"))
|
|
24210
24210
|
json2.type = "integer";
|
|
24211
24211
|
else
|
|
@@ -24287,7 +24287,7 @@ var init_to_json_schema = __esm({
|
|
|
24287
24287
|
}
|
|
24288
24288
|
case "array": {
|
|
24289
24289
|
const json2 = _json;
|
|
24290
|
-
const { minimum, maximum } =
|
|
24290
|
+
const { minimum, maximum } = schema32._zod.bag;
|
|
24291
24291
|
if (typeof minimum === "number")
|
|
24292
24292
|
json2.minItems = minimum;
|
|
24293
24293
|
if (typeof maximum === "number")
|
|
@@ -24384,7 +24384,7 @@ var init_to_json_schema = __esm({
|
|
|
24384
24384
|
path: [...params.path, "items"]
|
|
24385
24385
|
});
|
|
24386
24386
|
}
|
|
24387
|
-
const { minimum, maximum } =
|
|
24387
|
+
const { minimum, maximum } = schema32._zod.bag;
|
|
24388
24388
|
if (typeof minimum === "number")
|
|
24389
24389
|
json2.minItems = minimum;
|
|
24390
24390
|
if (typeof maximum === "number")
|
|
@@ -24467,7 +24467,7 @@ var init_to_json_schema = __esm({
|
|
|
24467
24467
|
format: "binary",
|
|
24468
24468
|
contentEncoding: "binary"
|
|
24469
24469
|
};
|
|
24470
|
-
const { minimum, maximum, mime } =
|
|
24470
|
+
const { minimum, maximum, mime } = schema32._zod.bag;
|
|
24471
24471
|
if (minimum !== void 0)
|
|
24472
24472
|
file2.minLength = minimum;
|
|
24473
24473
|
if (maximum !== void 0)
|
|
@@ -24541,7 +24541,7 @@ var init_to_json_schema = __esm({
|
|
|
24541
24541
|
}
|
|
24542
24542
|
case "template_literal": {
|
|
24543
24543
|
const json2 = _json;
|
|
24544
|
-
const pattern =
|
|
24544
|
+
const pattern = schema32._zod.pattern;
|
|
24545
24545
|
if (!pattern)
|
|
24546
24546
|
throw new Error("Pattern not found in template literal");
|
|
24547
24547
|
json2.type = "string";
|
|
@@ -24571,7 +24571,7 @@ var init_to_json_schema = __esm({
|
|
|
24571
24571
|
break;
|
|
24572
24572
|
}
|
|
24573
24573
|
case "lazy": {
|
|
24574
|
-
const innerType =
|
|
24574
|
+
const innerType = schema32._zod.innerType;
|
|
24575
24575
|
this.process(innerType, params);
|
|
24576
24576
|
result.ref = innerType;
|
|
24577
24577
|
break;
|
|
@@ -24588,20 +24588,20 @@ var init_to_json_schema = __esm({
|
|
|
24588
24588
|
}
|
|
24589
24589
|
}
|
|
24590
24590
|
}
|
|
24591
|
-
const meta = this.metadataRegistry.get(
|
|
24591
|
+
const meta = this.metadataRegistry.get(schema32);
|
|
24592
24592
|
if (meta)
|
|
24593
24593
|
Object.assign(result.schema, meta);
|
|
24594
|
-
if (this.io === "input" && isTransforming(
|
|
24594
|
+
if (this.io === "input" && isTransforming(schema32)) {
|
|
24595
24595
|
delete result.schema.examples;
|
|
24596
24596
|
delete result.schema.default;
|
|
24597
24597
|
}
|
|
24598
24598
|
if (this.io === "input" && result.schema._prefault)
|
|
24599
24599
|
(_a27 = result.schema).default ?? (_a27.default = result.schema._prefault);
|
|
24600
24600
|
delete result.schema._prefault;
|
|
24601
|
-
const _result = this.seen.get(
|
|
24601
|
+
const _result = this.seen.get(schema32);
|
|
24602
24602
|
return _result.schema;
|
|
24603
24603
|
}
|
|
24604
|
-
emit(
|
|
24604
|
+
emit(schema32, _params) {
|
|
24605
24605
|
const params = {
|
|
24606
24606
|
cycles: _params?.cycles ?? "ref",
|
|
24607
24607
|
reused: _params?.reused ?? "inline",
|
|
@@ -24609,7 +24609,7 @@ var init_to_json_schema = __esm({
|
|
|
24609
24609
|
// uri: _params?.uri ?? ((id) => `${id}`),
|
|
24610
24610
|
external: _params?.external ?? void 0
|
|
24611
24611
|
};
|
|
24612
|
-
const root = this.seen.get(
|
|
24612
|
+
const root = this.seen.get(schema32);
|
|
24613
24613
|
if (!root)
|
|
24614
24614
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
24615
24615
|
const makeURI = (entry) => {
|
|
@@ -24641,11 +24641,11 @@ var init_to_json_schema = __esm({
|
|
|
24641
24641
|
seen.def = { ...seen.schema };
|
|
24642
24642
|
if (defId)
|
|
24643
24643
|
seen.defId = defId;
|
|
24644
|
-
const
|
|
24645
|
-
for (const key2 in
|
|
24646
|
-
delete
|
|
24644
|
+
const schema33 = seen.schema;
|
|
24645
|
+
for (const key2 in schema33) {
|
|
24646
|
+
delete schema33[key2];
|
|
24647
24647
|
}
|
|
24648
|
-
|
|
24648
|
+
schema33.$ref = ref;
|
|
24649
24649
|
};
|
|
24650
24650
|
if (params.cycles === "throw") {
|
|
24651
24651
|
for (const entry of this.seen.entries()) {
|
|
@@ -24659,13 +24659,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24659
24659
|
}
|
|
24660
24660
|
for (const entry of this.seen.entries()) {
|
|
24661
24661
|
const seen = entry[1];
|
|
24662
|
-
if (
|
|
24662
|
+
if (schema32 === entry[0]) {
|
|
24663
24663
|
extractToDef(entry);
|
|
24664
24664
|
continue;
|
|
24665
24665
|
}
|
|
24666
24666
|
if (params.external) {
|
|
24667
24667
|
const ext = params.external.registry.get(entry[0])?.id;
|
|
24668
|
-
if (
|
|
24668
|
+
if (schema32 !== entry[0] && ext) {
|
|
24669
24669
|
extractToDef(entry);
|
|
24670
24670
|
continue;
|
|
24671
24671
|
}
|
|
@@ -24688,8 +24688,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24688
24688
|
}
|
|
24689
24689
|
const flattenRef = (zodSchema2, params2) => {
|
|
24690
24690
|
const seen = this.seen.get(zodSchema2);
|
|
24691
|
-
const
|
|
24692
|
-
const _cached = { ...
|
|
24691
|
+
const schema33 = seen.def ?? seen.schema;
|
|
24692
|
+
const _cached = { ...schema33 };
|
|
24693
24693
|
if (seen.ref === null) {
|
|
24694
24694
|
return;
|
|
24695
24695
|
}
|
|
@@ -24699,17 +24699,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24699
24699
|
flattenRef(ref, params2);
|
|
24700
24700
|
const refSchema = this.seen.get(ref).schema;
|
|
24701
24701
|
if (refSchema.$ref && params2.target === "draft-7") {
|
|
24702
|
-
|
|
24703
|
-
|
|
24702
|
+
schema33.allOf = schema33.allOf ?? [];
|
|
24703
|
+
schema33.allOf.push(refSchema);
|
|
24704
24704
|
} else {
|
|
24705
|
-
Object.assign(
|
|
24706
|
-
Object.assign(
|
|
24705
|
+
Object.assign(schema33, refSchema);
|
|
24706
|
+
Object.assign(schema33, _cached);
|
|
24707
24707
|
}
|
|
24708
24708
|
}
|
|
24709
24709
|
if (!seen.isParent)
|
|
24710
24710
|
this.override({
|
|
24711
24711
|
zodSchema: zodSchema2,
|
|
24712
|
-
jsonSchema:
|
|
24712
|
+
jsonSchema: schema33,
|
|
24713
24713
|
path: seen.path ?? []
|
|
24714
24714
|
});
|
|
24715
24715
|
};
|
|
@@ -24725,7 +24725,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24725
24725
|
console.warn(`Invalid target: ${this.target}`);
|
|
24726
24726
|
}
|
|
24727
24727
|
if (params.external?.uri) {
|
|
24728
|
-
const id = params.external.registry.get(
|
|
24728
|
+
const id = params.external.registry.get(schema32)?.id;
|
|
24729
24729
|
if (!id)
|
|
24730
24730
|
throw new Error("Schema is missing an `id` property");
|
|
24731
24731
|
result.$id = params.external.uri(id);
|
|
@@ -25267,8 +25267,8 @@ function date3(params) {
|
|
|
25267
25267
|
function array(element, params) {
|
|
25268
25268
|
return _array(ZodArray, element, params);
|
|
25269
25269
|
}
|
|
25270
|
-
function keyof(
|
|
25271
|
-
const shape =
|
|
25270
|
+
function keyof(schema32) {
|
|
25271
|
+
const shape = schema32._zod.def.shape;
|
|
25272
25272
|
return literal(Object.keys(shape));
|
|
25273
25273
|
}
|
|
25274
25274
|
function object(shape, params) {
|
|
@@ -25541,8 +25541,8 @@ function json(params) {
|
|
|
25541
25541
|
});
|
|
25542
25542
|
return jsonSchema2;
|
|
25543
25543
|
}
|
|
25544
|
-
function preprocess(fn,
|
|
25545
|
-
return pipe(transform(fn),
|
|
25544
|
+
function preprocess(fn, schema32) {
|
|
25545
|
+
return pipe(transform(fn), schema32);
|
|
25546
25546
|
}
|
|
25547
25547
|
var ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber, ZodNumberFormat, ZodBoolean, ZodBigInt, ZodBigIntFormat, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodDate, ZodArray, ZodObject, ZodUnion, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodEnum, ZodLiteral, ZodFile, ZodTransform, ZodOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch, ZodNaN, ZodPipe, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodPromise, ZodCustom, stringbool;
|
|
25548
25548
|
var init_schemas2 = __esm({
|
|
@@ -27003,30 +27003,30 @@ function floatSafeRemainder2(val, step) {
|
|
|
27003
27003
|
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
27004
27004
|
return valInt % stepInt / 10 ** decCount;
|
|
27005
27005
|
}
|
|
27006
|
-
function deepPartialify(
|
|
27007
|
-
if (
|
|
27006
|
+
function deepPartialify(schema32) {
|
|
27007
|
+
if (schema32 instanceof ZodObject2) {
|
|
27008
27008
|
const newShape = {};
|
|
27009
|
-
for (const key2 in
|
|
27010
|
-
const fieldSchema =
|
|
27009
|
+
for (const key2 in schema32.shape) {
|
|
27010
|
+
const fieldSchema = schema32.shape[key2];
|
|
27011
27011
|
newShape[key2] = ZodOptional2.create(deepPartialify(fieldSchema));
|
|
27012
27012
|
}
|
|
27013
27013
|
return new ZodObject2({
|
|
27014
|
-
...
|
|
27014
|
+
...schema32._def,
|
|
27015
27015
|
shape: () => newShape
|
|
27016
27016
|
});
|
|
27017
|
-
} else if (
|
|
27017
|
+
} else if (schema32 instanceof ZodArray2) {
|
|
27018
27018
|
return new ZodArray2({
|
|
27019
|
-
...
|
|
27020
|
-
type: deepPartialify(
|
|
27019
|
+
...schema32._def,
|
|
27020
|
+
type: deepPartialify(schema32.element)
|
|
27021
27021
|
});
|
|
27022
|
-
} else if (
|
|
27023
|
-
return ZodOptional2.create(deepPartialify(
|
|
27024
|
-
} else if (
|
|
27025
|
-
return ZodNullable2.create(deepPartialify(
|
|
27026
|
-
} else if (
|
|
27027
|
-
return ZodTuple2.create(
|
|
27022
|
+
} else if (schema32 instanceof ZodOptional2) {
|
|
27023
|
+
return ZodOptional2.create(deepPartialify(schema32.unwrap()));
|
|
27024
|
+
} else if (schema32 instanceof ZodNullable2) {
|
|
27025
|
+
return ZodNullable2.create(deepPartialify(schema32.unwrap()));
|
|
27026
|
+
} else if (schema32 instanceof ZodTuple2) {
|
|
27027
|
+
return ZodTuple2.create(schema32.items.map((item) => deepPartialify(item)));
|
|
27028
27028
|
} else {
|
|
27029
|
-
return
|
|
27029
|
+
return schema32;
|
|
27030
27030
|
}
|
|
27031
27031
|
}
|
|
27032
27032
|
function mergeValues2(a, b) {
|
|
@@ -28753,9 +28753,9 @@ var init_types = __esm({
|
|
|
28753
28753
|
return this.min(1, message);
|
|
28754
28754
|
}
|
|
28755
28755
|
};
|
|
28756
|
-
ZodArray2.create = (
|
|
28756
|
+
ZodArray2.create = (schema32, params) => {
|
|
28757
28757
|
return new ZodArray2({
|
|
28758
|
-
type:
|
|
28758
|
+
type: schema32,
|
|
28759
28759
|
minLength: null,
|
|
28760
28760
|
maxLength: null,
|
|
28761
28761
|
exactLength: null,
|
|
@@ -28976,8 +28976,8 @@ var init_types = __esm({
|
|
|
28976
28976
|
// }) as any;
|
|
28977
28977
|
// return merged;
|
|
28978
28978
|
// }
|
|
28979
|
-
setKey(key2,
|
|
28980
|
-
return this.augment({ [key2]:
|
|
28979
|
+
setKey(key2, schema32) {
|
|
28980
|
+
return this.augment({ [key2]: schema32 });
|
|
28981
28981
|
}
|
|
28982
28982
|
// merge<Incoming extends AnyZodObject>(
|
|
28983
28983
|
// merging: Incoming
|
|
@@ -29385,10 +29385,10 @@ var init_types = __esm({
|
|
|
29385
29385
|
status.dirty();
|
|
29386
29386
|
}
|
|
29387
29387
|
const items = [...ctx.data].map((item, itemIndex) => {
|
|
29388
|
-
const
|
|
29389
|
-
if (!
|
|
29388
|
+
const schema32 = this._def.items[itemIndex] || this._def.rest;
|
|
29389
|
+
if (!schema32)
|
|
29390
29390
|
return null;
|
|
29391
|
-
return
|
|
29391
|
+
return schema32._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
|
29392
29392
|
}).filter((x) => !!x);
|
|
29393
29393
|
if (ctx.common.async) {
|
|
29394
29394
|
return Promise.all(items).then((results) => {
|
|
@@ -29895,9 +29895,9 @@ var init_types = __esm({
|
|
|
29895
29895
|
}));
|
|
29896
29896
|
}
|
|
29897
29897
|
};
|
|
29898
|
-
ZodPromise2.create = (
|
|
29898
|
+
ZodPromise2.create = (schema32, params) => {
|
|
29899
29899
|
return new ZodPromise2({
|
|
29900
|
-
type:
|
|
29900
|
+
type: schema32,
|
|
29901
29901
|
typeName: ZodFirstPartyTypeKind.ZodPromise,
|
|
29902
29902
|
...processCreateParams(params)
|
|
29903
29903
|
});
|
|
@@ -30025,17 +30025,17 @@ var init_types = __esm({
|
|
|
30025
30025
|
util.assertNever(effect);
|
|
30026
30026
|
}
|
|
30027
30027
|
};
|
|
30028
|
-
ZodEffects.create = (
|
|
30028
|
+
ZodEffects.create = (schema32, effect, params) => {
|
|
30029
30029
|
return new ZodEffects({
|
|
30030
|
-
schema:
|
|
30030
|
+
schema: schema32,
|
|
30031
30031
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
30032
30032
|
effect,
|
|
30033
30033
|
...processCreateParams(params)
|
|
30034
30034
|
});
|
|
30035
30035
|
};
|
|
30036
|
-
ZodEffects.createWithPreprocess = (preprocess2,
|
|
30036
|
+
ZodEffects.createWithPreprocess = (preprocess2, schema32, params) => {
|
|
30037
30037
|
return new ZodEffects({
|
|
30038
|
-
schema:
|
|
30038
|
+
schema: schema32,
|
|
30039
30039
|
effect: { type: "preprocess", transform: preprocess2 },
|
|
30040
30040
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
30041
30041
|
...processCreateParams(params)
|
|
@@ -31184,9 +31184,9 @@ function standardSchemaValidator(standardSchema) {
|
|
|
31184
31184
|
}
|
|
31185
31185
|
async function validateTypes({
|
|
31186
31186
|
value,
|
|
31187
|
-
schema:
|
|
31187
|
+
schema: schema32
|
|
31188
31188
|
}) {
|
|
31189
|
-
const result = await safeValidateTypes({ value, schema:
|
|
31189
|
+
const result = await safeValidateTypes({ value, schema: schema32 });
|
|
31190
31190
|
if (!result.success) {
|
|
31191
31191
|
throw TypeValidationError.wrap({ value, cause: result.error });
|
|
31192
31192
|
}
|
|
@@ -31194,9 +31194,9 @@ async function validateTypes({
|
|
|
31194
31194
|
}
|
|
31195
31195
|
async function safeValidateTypes({
|
|
31196
31196
|
value,
|
|
31197
|
-
schema:
|
|
31197
|
+
schema: schema32
|
|
31198
31198
|
}) {
|
|
31199
|
-
const validator22 = asValidator(
|
|
31199
|
+
const validator22 = asValidator(schema32);
|
|
31200
31200
|
try {
|
|
31201
31201
|
if (validator22.validate == null) {
|
|
31202
31202
|
return { success: true, value, rawValue: value };
|
|
@@ -31220,14 +31220,14 @@ async function safeValidateTypes({
|
|
|
31220
31220
|
}
|
|
31221
31221
|
async function parseJSON({
|
|
31222
31222
|
text: text3,
|
|
31223
|
-
schema:
|
|
31223
|
+
schema: schema32
|
|
31224
31224
|
}) {
|
|
31225
31225
|
try {
|
|
31226
31226
|
const value = secureJsonParse(text3);
|
|
31227
|
-
if (
|
|
31227
|
+
if (schema32 == null) {
|
|
31228
31228
|
return value;
|
|
31229
31229
|
}
|
|
31230
|
-
return validateTypes({ value, schema:
|
|
31230
|
+
return validateTypes({ value, schema: schema32 });
|
|
31231
31231
|
} catch (error40) {
|
|
31232
31232
|
if (JSONParseError.isInstance(error40) || TypeValidationError.isInstance(error40)) {
|
|
31233
31233
|
throw error40;
|
|
@@ -31237,14 +31237,14 @@ async function parseJSON({
|
|
|
31237
31237
|
}
|
|
31238
31238
|
async function safeParseJSON({
|
|
31239
31239
|
text: text3,
|
|
31240
|
-
schema:
|
|
31240
|
+
schema: schema32
|
|
31241
31241
|
}) {
|
|
31242
31242
|
try {
|
|
31243
31243
|
const value = secureJsonParse(text3);
|
|
31244
|
-
if (
|
|
31244
|
+
if (schema32 == null) {
|
|
31245
31245
|
return { success: true, value, rawValue: value };
|
|
31246
31246
|
}
|
|
31247
|
-
return await safeValidateTypes({ value, schema:
|
|
31247
|
+
return await safeValidateTypes({ value, schema: schema32 });
|
|
31248
31248
|
} catch (error40) {
|
|
31249
31249
|
return {
|
|
31250
31250
|
success: false,
|
|
@@ -31263,7 +31263,7 @@ function isParsableJson(input) {
|
|
|
31263
31263
|
}
|
|
31264
31264
|
function parseJsonEventStream({
|
|
31265
31265
|
stream,
|
|
31266
|
-
schema:
|
|
31266
|
+
schema: schema32
|
|
31267
31267
|
}) {
|
|
31268
31268
|
return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream()).pipeThrough(
|
|
31269
31269
|
new TransformStream({
|
|
@@ -31271,7 +31271,7 @@ function parseJsonEventStream({
|
|
|
31271
31271
|
if (data === "[DONE]") {
|
|
31272
31272
|
return;
|
|
31273
31273
|
}
|
|
31274
|
-
controller.enqueue(await safeParseJSON({ text: data, schema:
|
|
31274
|
+
controller.enqueue(await safeParseJSON({ text: data, schema: schema32 }));
|
|
31275
31275
|
}
|
|
31276
31276
|
})
|
|
31277
31277
|
);
|
|
@@ -31279,14 +31279,14 @@ function parseJsonEventStream({
|
|
|
31279
31279
|
async function parseProviderOptions({
|
|
31280
31280
|
provider,
|
|
31281
31281
|
providerOptions,
|
|
31282
|
-
schema:
|
|
31282
|
+
schema: schema32
|
|
31283
31283
|
}) {
|
|
31284
31284
|
if ((providerOptions == null ? void 0 : providerOptions[provider]) == null) {
|
|
31285
31285
|
return void 0;
|
|
31286
31286
|
}
|
|
31287
31287
|
const parsedProviderOptions = await safeValidateTypes({
|
|
31288
31288
|
value: providerOptions[provider],
|
|
31289
|
-
schema:
|
|
31289
|
+
schema: schema32
|
|
31290
31290
|
});
|
|
31291
31291
|
if (!parsedProviderOptions.success) {
|
|
31292
31292
|
throw new InvalidArgumentError({
|
|
@@ -31431,12 +31431,12 @@ async function readResponseBodyAsText({
|
|
|
31431
31431
|
);
|
|
31432
31432
|
}
|
|
31433
31433
|
function lazySchema(createSchema) {
|
|
31434
|
-
let
|
|
31434
|
+
let schema32;
|
|
31435
31435
|
return () => {
|
|
31436
|
-
if (
|
|
31437
|
-
|
|
31436
|
+
if (schema32 == null) {
|
|
31437
|
+
schema32 = createSchema();
|
|
31438
31438
|
}
|
|
31439
|
-
return
|
|
31439
|
+
return schema32;
|
|
31440
31440
|
};
|
|
31441
31441
|
}
|
|
31442
31442
|
function jsonSchema(jsonSchema2, {
|
|
@@ -31594,13 +31594,13 @@ function parseIntersectionDef(def, refs3) {
|
|
|
31594
31594
|
})
|
|
31595
31595
|
].filter((x) => !!x);
|
|
31596
31596
|
const mergedAllOf = [];
|
|
31597
|
-
allOf.forEach((
|
|
31598
|
-
if (isJsonSchema7AllOfType(
|
|
31599
|
-
mergedAllOf.push(...
|
|
31597
|
+
allOf.forEach((schema32) => {
|
|
31598
|
+
if (isJsonSchema7AllOfType(schema32)) {
|
|
31599
|
+
mergedAllOf.push(...schema32.allOf);
|
|
31600
31600
|
} else {
|
|
31601
|
-
let nestedSchema =
|
|
31602
|
-
if ("additionalProperties" in
|
|
31603
|
-
const { additionalProperties, ...rest } =
|
|
31601
|
+
let nestedSchema = schema32;
|
|
31602
|
+
if ("additionalProperties" in schema32 && schema32.additionalProperties === false) {
|
|
31603
|
+
const { additionalProperties, ...rest } = schema32;
|
|
31604
31604
|
nestedSchema = rest;
|
|
31605
31605
|
}
|
|
31606
31606
|
mergedAllOf.push(nestedSchema);
|
|
@@ -31778,44 +31778,44 @@ function escapeNonAlphaNumeric(source) {
|
|
|
31778
31778
|
}
|
|
31779
31779
|
return result;
|
|
31780
31780
|
}
|
|
31781
|
-
function addFormat(
|
|
31781
|
+
function addFormat(schema32, value, message, refs3) {
|
|
31782
31782
|
var _a27;
|
|
31783
|
-
if (
|
|
31784
|
-
if (!
|
|
31785
|
-
|
|
31783
|
+
if (schema32.format || ((_a27 = schema32.anyOf) == null ? void 0 : _a27.some((x) => x.format))) {
|
|
31784
|
+
if (!schema32.anyOf) {
|
|
31785
|
+
schema32.anyOf = [];
|
|
31786
31786
|
}
|
|
31787
|
-
if (
|
|
31788
|
-
|
|
31789
|
-
format:
|
|
31787
|
+
if (schema32.format) {
|
|
31788
|
+
schema32.anyOf.push({
|
|
31789
|
+
format: schema32.format
|
|
31790
31790
|
});
|
|
31791
|
-
delete
|
|
31791
|
+
delete schema32.format;
|
|
31792
31792
|
}
|
|
31793
|
-
|
|
31793
|
+
schema32.anyOf.push({
|
|
31794
31794
|
format: value,
|
|
31795
31795
|
...message && refs3.errorMessages && { errorMessage: { format: message } }
|
|
31796
31796
|
});
|
|
31797
31797
|
} else {
|
|
31798
|
-
|
|
31798
|
+
schema32.format = value;
|
|
31799
31799
|
}
|
|
31800
31800
|
}
|
|
31801
|
-
function addPattern(
|
|
31801
|
+
function addPattern(schema32, regex, message, refs3) {
|
|
31802
31802
|
var _a27;
|
|
31803
|
-
if (
|
|
31804
|
-
if (!
|
|
31805
|
-
|
|
31803
|
+
if (schema32.pattern || ((_a27 = schema32.allOf) == null ? void 0 : _a27.some((x) => x.pattern))) {
|
|
31804
|
+
if (!schema32.allOf) {
|
|
31805
|
+
schema32.allOf = [];
|
|
31806
31806
|
}
|
|
31807
|
-
if (
|
|
31808
|
-
|
|
31809
|
-
pattern:
|
|
31807
|
+
if (schema32.pattern) {
|
|
31808
|
+
schema32.allOf.push({
|
|
31809
|
+
pattern: schema32.pattern
|
|
31810
31810
|
});
|
|
31811
|
-
delete
|
|
31811
|
+
delete schema32.pattern;
|
|
31812
31812
|
}
|
|
31813
|
-
|
|
31813
|
+
schema32.allOf.push({
|
|
31814
31814
|
pattern: stringifyRegExpWithFlags(regex, refs3),
|
|
31815
31815
|
...message && refs3.errorMessages && { errorMessage: { pattern: message } }
|
|
31816
31816
|
});
|
|
31817
31817
|
} else {
|
|
31818
|
-
|
|
31818
|
+
schema32.pattern = stringifyRegExpWithFlags(regex, refs3);
|
|
31819
31819
|
}
|
|
31820
31820
|
}
|
|
31821
31821
|
function stringifyRegExpWithFlags(regex, refs3) {
|
|
@@ -31902,7 +31902,7 @@ function stringifyRegExpWithFlags(regex, refs3) {
|
|
|
31902
31902
|
}
|
|
31903
31903
|
function parseRecordDef(def, refs3) {
|
|
31904
31904
|
var _a27, _b24, _c, _d, _e, _f;
|
|
31905
|
-
const
|
|
31905
|
+
const schema32 = {
|
|
31906
31906
|
type: "object",
|
|
31907
31907
|
additionalProperties: (_a27 = parseDef(def.valueType._def, {
|
|
31908
31908
|
...refs3,
|
|
@@ -31912,12 +31912,12 @@ function parseRecordDef(def, refs3) {
|
|
|
31912
31912
|
if (((_b24 = def.keyType) == null ? void 0 : _b24._def.typeName) === ZodFirstPartyTypeKind.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {
|
|
31913
31913
|
const { type, ...keyType } = parseStringDef(def.keyType._def, refs3);
|
|
31914
31914
|
return {
|
|
31915
|
-
...
|
|
31915
|
+
...schema32,
|
|
31916
31916
|
propertyNames: keyType
|
|
31917
31917
|
};
|
|
31918
31918
|
} else if (((_d = def.keyType) == null ? void 0 : _d._def.typeName) === ZodFirstPartyTypeKind.ZodEnum) {
|
|
31919
31919
|
return {
|
|
31920
|
-
...
|
|
31920
|
+
...schema32,
|
|
31921
31921
|
propertyNames: {
|
|
31922
31922
|
enum: def.keyType._def.values
|
|
31923
31923
|
}
|
|
@@ -31928,11 +31928,11 @@ function parseRecordDef(def, refs3) {
|
|
|
31928
31928
|
refs3
|
|
31929
31929
|
);
|
|
31930
31930
|
return {
|
|
31931
|
-
...
|
|
31931
|
+
...schema32,
|
|
31932
31932
|
propertyNames: keyType
|
|
31933
31933
|
};
|
|
31934
31934
|
}
|
|
31935
|
-
return
|
|
31935
|
+
return schema32;
|
|
31936
31936
|
}
|
|
31937
31937
|
function parseMapDef(def, refs3) {
|
|
31938
31938
|
if (refs3.mapStrategy === "record") {
|
|
@@ -32140,9 +32140,9 @@ function decideAdditionalProperties(def, refs3) {
|
|
|
32140
32140
|
return refs3.removeAdditionalStrategy === "strict" ? refs3.allowedAdditionalProperties : refs3.rejectedAdditionalProperties;
|
|
32141
32141
|
}
|
|
32142
32142
|
}
|
|
32143
|
-
function safeIsOptional(
|
|
32143
|
+
function safeIsOptional(schema32) {
|
|
32144
32144
|
try {
|
|
32145
|
-
return
|
|
32145
|
+
return schema32.isOptional();
|
|
32146
32146
|
} catch (e) {
|
|
32147
32147
|
return true;
|
|
32148
32148
|
}
|
|
@@ -32155,18 +32155,18 @@ function parseSetDef(def, refs3) {
|
|
|
32155
32155
|
...refs3,
|
|
32156
32156
|
currentPath: [...refs3.currentPath, "items"]
|
|
32157
32157
|
});
|
|
32158
|
-
const
|
|
32158
|
+
const schema32 = {
|
|
32159
32159
|
type: "array",
|
|
32160
32160
|
uniqueItems: true,
|
|
32161
32161
|
items
|
|
32162
32162
|
};
|
|
32163
32163
|
if (def.minSize) {
|
|
32164
|
-
|
|
32164
|
+
schema32.minItems = def.minSize.value;
|
|
32165
32165
|
}
|
|
32166
32166
|
if (def.maxSize) {
|
|
32167
|
-
|
|
32167
|
+
schema32.maxItems = def.maxSize.value;
|
|
32168
32168
|
}
|
|
32169
|
-
return
|
|
32169
|
+
return schema32;
|
|
32170
32170
|
}
|
|
32171
32171
|
function parseTupleDef(def, refs3) {
|
|
32172
32172
|
if (def.rest) {
|
|
@@ -32297,11 +32297,11 @@ function zodSchema(zodSchema2, options) {
|
|
|
32297
32297
|
function isSchema(value) {
|
|
32298
32298
|
return typeof value === "object" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && "jsonSchema" in value && "validate" in value;
|
|
32299
32299
|
}
|
|
32300
|
-
function asSchema(
|
|
32301
|
-
return
|
|
32300
|
+
function asSchema(schema32) {
|
|
32301
|
+
return schema32 == null ? jsonSchema({
|
|
32302
32302
|
properties: {},
|
|
32303
32303
|
additionalProperties: false
|
|
32304
|
-
}) : isSchema(
|
|
32304
|
+
}) : isSchema(schema32) ? schema32 : typeof schema32 === "function" ? schema32() : zodSchema(schema32);
|
|
32305
32305
|
}
|
|
32306
32306
|
function convertBase64ToUint8Array(base64String) {
|
|
32307
32307
|
const base64Url = base64String.replace(/-/g, "+").replace(/_/g, "/");
|
|
@@ -33077,7 +33077,7 @@ var init_dist4 = __esm({
|
|
|
33077
33077
|
)
|
|
33078
33078
|
};
|
|
33079
33079
|
};
|
|
33080
|
-
zodToJsonSchema = (
|
|
33080
|
+
zodToJsonSchema = (schema32, options) => {
|
|
33081
33081
|
var _a27;
|
|
33082
33082
|
const refs3 = getRefs(options);
|
|
33083
33083
|
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce(
|
|
@@ -33099,7 +33099,7 @@ var init_dist4 = __esm({
|
|
|
33099
33099
|
) : void 0;
|
|
33100
33100
|
const name26 = typeof options === "string" ? options : (options == null ? void 0 : options.nameStrategy) === "title" ? void 0 : options == null ? void 0 : options.name;
|
|
33101
33101
|
const main2 = (_a27 = parseDef(
|
|
33102
|
-
|
|
33102
|
+
schema32._def,
|
|
33103
33103
|
name26 === void 0 ? refs3 : {
|
|
33104
33104
|
...refs3,
|
|
33105
33105
|
currentPath: [...refs3.basePath, refs3.definitionPath, name26]
|
|
@@ -37287,8 +37287,8 @@ async function doParseToolCall({
|
|
|
37287
37287
|
availableTools: Object.keys(tools)
|
|
37288
37288
|
});
|
|
37289
37289
|
}
|
|
37290
|
-
const
|
|
37291
|
-
const parseResult = toolCall.input.trim() === "" ? await safeValidateTypes({ value: {}, schema:
|
|
37290
|
+
const schema32 = asSchema(tool2.inputSchema);
|
|
37291
|
+
const parseResult = toolCall.input.trim() === "" ? await safeValidateTypes({ value: {}, schema: schema32 }) : await safeParseJSON({ text: toolCall.input, schema: schema32 });
|
|
37292
37292
|
if (parseResult.success === false) {
|
|
37293
37293
|
throw new InvalidToolInputError({
|
|
37294
37294
|
toolName,
|
|
@@ -40427,14 +40427,14 @@ function extractReasoningContent(content) {
|
|
|
40427
40427
|
}
|
|
40428
40428
|
function getOutputStrategy({
|
|
40429
40429
|
output,
|
|
40430
|
-
schema:
|
|
40430
|
+
schema: schema32,
|
|
40431
40431
|
enumValues
|
|
40432
40432
|
}) {
|
|
40433
40433
|
switch (output) {
|
|
40434
40434
|
case "object":
|
|
40435
|
-
return objectOutputStrategy(asSchema(
|
|
40435
|
+
return objectOutputStrategy(asSchema(schema32));
|
|
40436
40436
|
case "array":
|
|
40437
|
-
return arrayOutputStrategy(asSchema(
|
|
40437
|
+
return arrayOutputStrategy(asSchema(schema32));
|
|
40438
40438
|
case "enum":
|
|
40439
40439
|
return enumOutputStrategy(enumValues);
|
|
40440
40440
|
case "no-schema":
|
|
@@ -40500,7 +40500,7 @@ async function parseAndValidateObjectResultWithRepair(result, outputStrategy, re
|
|
|
40500
40500
|
}
|
|
40501
40501
|
function validateObjectGenerationInput({
|
|
40502
40502
|
output,
|
|
40503
|
-
schema:
|
|
40503
|
+
schema: schema32,
|
|
40504
40504
|
schemaName,
|
|
40505
40505
|
schemaDescription,
|
|
40506
40506
|
enumValues
|
|
@@ -40513,10 +40513,10 @@ function validateObjectGenerationInput({
|
|
|
40513
40513
|
});
|
|
40514
40514
|
}
|
|
40515
40515
|
if (output === "no-schema") {
|
|
40516
|
-
if (
|
|
40516
|
+
if (schema32 != null) {
|
|
40517
40517
|
throw new InvalidArgumentError2({
|
|
40518
40518
|
parameter: "schema",
|
|
40519
|
-
value:
|
|
40519
|
+
value: schema32,
|
|
40520
40520
|
message: "Schema is not supported for no-schema output."
|
|
40521
40521
|
});
|
|
40522
40522
|
}
|
|
@@ -40543,10 +40543,10 @@ function validateObjectGenerationInput({
|
|
|
40543
40543
|
}
|
|
40544
40544
|
}
|
|
40545
40545
|
if (output === "object") {
|
|
40546
|
-
if (
|
|
40546
|
+
if (schema32 == null) {
|
|
40547
40547
|
throw new InvalidArgumentError2({
|
|
40548
40548
|
parameter: "schema",
|
|
40549
|
-
value:
|
|
40549
|
+
value: schema32,
|
|
40550
40550
|
message: "Schema is required for object output."
|
|
40551
40551
|
});
|
|
40552
40552
|
}
|
|
@@ -40559,10 +40559,10 @@ function validateObjectGenerationInput({
|
|
|
40559
40559
|
}
|
|
40560
40560
|
}
|
|
40561
40561
|
if (output === "array") {
|
|
40562
|
-
if (
|
|
40562
|
+
if (schema32 == null) {
|
|
40563
40563
|
throw new InvalidArgumentError2({
|
|
40564
40564
|
parameter: "schema",
|
|
40565
|
-
value:
|
|
40565
|
+
value: schema32,
|
|
40566
40566
|
message: "Element schema is required for array output."
|
|
40567
40567
|
});
|
|
40568
40568
|
}
|
|
@@ -40575,10 +40575,10 @@ function validateObjectGenerationInput({
|
|
|
40575
40575
|
}
|
|
40576
40576
|
}
|
|
40577
40577
|
if (output === "enum") {
|
|
40578
|
-
if (
|
|
40578
|
+
if (schema32 != null) {
|
|
40579
40579
|
throw new InvalidArgumentError2({
|
|
40580
40580
|
parameter: "schema",
|
|
40581
|
-
value:
|
|
40581
|
+
value: schema32,
|
|
40582
40582
|
message: "Schema is not supported for enum output."
|
|
40583
40583
|
});
|
|
40584
40584
|
}
|
|
@@ -44725,9 +44725,9 @@ var init_dist6 = __esm({
|
|
|
44725
44725
|
});
|
|
44726
44726
|
}
|
|
44727
44727
|
};
|
|
44728
|
-
objectOutputStrategy = (
|
|
44728
|
+
objectOutputStrategy = (schema32) => ({
|
|
44729
44729
|
type: "object",
|
|
44730
|
-
jsonSchema:
|
|
44730
|
+
jsonSchema: schema32.jsonSchema,
|
|
44731
44731
|
async validatePartialResult({ value, textDelta }) {
|
|
44732
44732
|
return {
|
|
44733
44733
|
success: true,
|
|
@@ -44739,7 +44739,7 @@ var init_dist6 = __esm({
|
|
|
44739
44739
|
};
|
|
44740
44740
|
},
|
|
44741
44741
|
async validateFinalResult(value) {
|
|
44742
|
-
return safeValidateTypes({ value, schema:
|
|
44742
|
+
return safeValidateTypes({ value, schema: schema32 });
|
|
44743
44743
|
},
|
|
44744
44744
|
createElementStream() {
|
|
44745
44745
|
throw new UnsupportedFunctionalityError({
|
|
@@ -44747,8 +44747,8 @@ var init_dist6 = __esm({
|
|
|
44747
44747
|
});
|
|
44748
44748
|
}
|
|
44749
44749
|
});
|
|
44750
|
-
arrayOutputStrategy = (
|
|
44751
|
-
const { $schema, ...itemSchema } =
|
|
44750
|
+
arrayOutputStrategy = (schema32) => {
|
|
44751
|
+
const { $schema, ...itemSchema } = schema32.jsonSchema;
|
|
44752
44752
|
return {
|
|
44753
44753
|
type: "array",
|
|
44754
44754
|
// wrap in object that contains array of elements, since most LLMs will not
|
|
@@ -44783,7 +44783,7 @@ var init_dist6 = __esm({
|
|
|
44783
44783
|
const resultArray = [];
|
|
44784
44784
|
for (let i = 0; i < inputArray.length; i++) {
|
|
44785
44785
|
const element = inputArray[i];
|
|
44786
|
-
const result = await safeValidateTypes({ value: element, schema:
|
|
44786
|
+
const result = await safeValidateTypes({ value: element, schema: schema32 });
|
|
44787
44787
|
if (i === inputArray.length - 1 && !isFinalDelta) {
|
|
44788
44788
|
continue;
|
|
44789
44789
|
}
|
|
@@ -44825,7 +44825,7 @@ var init_dist6 = __esm({
|
|
|
44825
44825
|
const inputArray = value.elements;
|
|
44826
44826
|
const resultArray = [];
|
|
44827
44827
|
for (const element of inputArray) {
|
|
44828
|
-
const result = await safeValidateTypes({ value: element, schema:
|
|
44828
|
+
const result = await safeValidateTypes({ value: element, schema: schema32 });
|
|
44829
44829
|
if (!result.success) {
|
|
44830
44830
|
return result;
|
|
44831
44831
|
}
|
|
@@ -45543,12 +45543,12 @@ var init_dist6 = __esm({
|
|
|
45543
45543
|
object2 = ({
|
|
45544
45544
|
schema: inputSchema
|
|
45545
45545
|
}) => {
|
|
45546
|
-
const
|
|
45546
|
+
const schema32 = asSchema(inputSchema);
|
|
45547
45547
|
return {
|
|
45548
45548
|
type: "object",
|
|
45549
45549
|
responseFormat: {
|
|
45550
45550
|
type: "json",
|
|
45551
|
-
schema:
|
|
45551
|
+
schema: schema32.jsonSchema
|
|
45552
45552
|
},
|
|
45553
45553
|
async parsePartial({ text: text22 }) {
|
|
45554
45554
|
const result = await parsePartialJson(text22);
|
|
@@ -45582,7 +45582,7 @@ var init_dist6 = __esm({
|
|
|
45582
45582
|
}
|
|
45583
45583
|
const validationResult = await safeValidateTypes({
|
|
45584
45584
|
value: parseResult.value,
|
|
45585
|
-
schema:
|
|
45585
|
+
schema: schema32
|
|
45586
45586
|
});
|
|
45587
45587
|
if (!validationResult.success) {
|
|
45588
45588
|
throw new NoObjectGeneratedError({
|
|
@@ -52160,9 +52160,9 @@ function standardSchemaValidator2(standardSchema) {
|
|
|
52160
52160
|
}
|
|
52161
52161
|
async function validateTypes2({
|
|
52162
52162
|
value,
|
|
52163
|
-
schema:
|
|
52163
|
+
schema: schema32
|
|
52164
52164
|
}) {
|
|
52165
|
-
const result = await safeValidateTypes2({ value, schema:
|
|
52165
|
+
const result = await safeValidateTypes2({ value, schema: schema32 });
|
|
52166
52166
|
if (!result.success) {
|
|
52167
52167
|
throw TypeValidationError2.wrap({ value, cause: result.error });
|
|
52168
52168
|
}
|
|
@@ -52170,9 +52170,9 @@ async function validateTypes2({
|
|
|
52170
52170
|
}
|
|
52171
52171
|
async function safeValidateTypes2({
|
|
52172
52172
|
value,
|
|
52173
|
-
schema:
|
|
52173
|
+
schema: schema32
|
|
52174
52174
|
}) {
|
|
52175
|
-
const validator22 = asValidator2(
|
|
52175
|
+
const validator22 = asValidator2(schema32);
|
|
52176
52176
|
try {
|
|
52177
52177
|
if (validator22.validate == null) {
|
|
52178
52178
|
return { success: true, value, rawValue: value };
|
|
@@ -52196,14 +52196,14 @@ async function safeValidateTypes2({
|
|
|
52196
52196
|
}
|
|
52197
52197
|
async function parseJSON2({
|
|
52198
52198
|
text: text3,
|
|
52199
|
-
schema:
|
|
52199
|
+
schema: schema32
|
|
52200
52200
|
}) {
|
|
52201
52201
|
try {
|
|
52202
52202
|
const value = secureJsonParse2(text3);
|
|
52203
|
-
if (
|
|
52203
|
+
if (schema32 == null) {
|
|
52204
52204
|
return value;
|
|
52205
52205
|
}
|
|
52206
|
-
return validateTypes2({ value, schema:
|
|
52206
|
+
return validateTypes2({ value, schema: schema32 });
|
|
52207
52207
|
} catch (error40) {
|
|
52208
52208
|
if (JSONParseError2.isInstance(error40) || TypeValidationError2.isInstance(error40)) {
|
|
52209
52209
|
throw error40;
|
|
@@ -52213,14 +52213,14 @@ async function parseJSON2({
|
|
|
52213
52213
|
}
|
|
52214
52214
|
async function safeParseJSON2({
|
|
52215
52215
|
text: text3,
|
|
52216
|
-
schema:
|
|
52216
|
+
schema: schema32
|
|
52217
52217
|
}) {
|
|
52218
52218
|
try {
|
|
52219
52219
|
const value = secureJsonParse2(text3);
|
|
52220
|
-
if (
|
|
52220
|
+
if (schema32 == null) {
|
|
52221
52221
|
return { success: true, value, rawValue: value };
|
|
52222
52222
|
}
|
|
52223
|
-
return await safeValidateTypes2({ value, schema:
|
|
52223
|
+
return await safeValidateTypes2({ value, schema: schema32 });
|
|
52224
52224
|
} catch (error40) {
|
|
52225
52225
|
return {
|
|
52226
52226
|
success: false,
|
|
@@ -52239,7 +52239,7 @@ function isParsableJson2(input) {
|
|
|
52239
52239
|
}
|
|
52240
52240
|
function parseJsonEventStream2({
|
|
52241
52241
|
stream,
|
|
52242
|
-
schema:
|
|
52242
|
+
schema: schema32
|
|
52243
52243
|
}) {
|
|
52244
52244
|
return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream()).pipeThrough(
|
|
52245
52245
|
new TransformStream({
|
|
@@ -52247,7 +52247,7 @@ function parseJsonEventStream2({
|
|
|
52247
52247
|
if (data === "[DONE]") {
|
|
52248
52248
|
return;
|
|
52249
52249
|
}
|
|
52250
|
-
controller.enqueue(await safeParseJSON2({ text: data, schema:
|
|
52250
|
+
controller.enqueue(await safeParseJSON2({ text: data, schema: schema32 }));
|
|
52251
52251
|
}
|
|
52252
52252
|
})
|
|
52253
52253
|
);
|
|
@@ -52255,14 +52255,14 @@ function parseJsonEventStream2({
|
|
|
52255
52255
|
async function parseProviderOptions2({
|
|
52256
52256
|
provider,
|
|
52257
52257
|
providerOptions,
|
|
52258
|
-
schema:
|
|
52258
|
+
schema: schema32
|
|
52259
52259
|
}) {
|
|
52260
52260
|
if ((providerOptions == null ? void 0 : providerOptions[provider]) == null) {
|
|
52261
52261
|
return void 0;
|
|
52262
52262
|
}
|
|
52263
52263
|
const parsedProviderOptions = await safeValidateTypes2({
|
|
52264
52264
|
value: providerOptions[provider],
|
|
52265
|
-
schema:
|
|
52265
|
+
schema: schema32
|
|
52266
52266
|
});
|
|
52267
52267
|
if (!parsedProviderOptions.success) {
|
|
52268
52268
|
throw new InvalidArgumentError3({
|
|
@@ -54872,8 +54872,8 @@ function mapAnthropicStopReason({
|
|
|
54872
54872
|
return "unknown";
|
|
54873
54873
|
}
|
|
54874
54874
|
}
|
|
54875
|
-
function sanitizeJsonSchema(
|
|
54876
|
-
return sanitizeSchema(
|
|
54875
|
+
function sanitizeJsonSchema(schema32) {
|
|
54876
|
+
return sanitizeSchema(schema32);
|
|
54877
54877
|
}
|
|
54878
54878
|
function sanitizeDefinition(definition) {
|
|
54879
54879
|
if (typeof definition === "boolean" || !isPlainObject2(definition)) {
|
|
@@ -54881,47 +54881,47 @@ function sanitizeDefinition(definition) {
|
|
|
54881
54881
|
}
|
|
54882
54882
|
return sanitizeSchema(definition);
|
|
54883
54883
|
}
|
|
54884
|
-
function sanitizeSchema(
|
|
54884
|
+
function sanitizeSchema(schema32) {
|
|
54885
54885
|
const result = {};
|
|
54886
|
-
const schemaWithDefs =
|
|
54887
|
-
if (
|
|
54888
|
-
return { $ref:
|
|
54886
|
+
const schemaWithDefs = schema32;
|
|
54887
|
+
if (schema32.$ref != null) {
|
|
54888
|
+
return { $ref: schema32.$ref };
|
|
54889
54889
|
}
|
|
54890
|
-
if (
|
|
54891
|
-
result.$schema =
|
|
54890
|
+
if (schema32.$schema != null) {
|
|
54891
|
+
result.$schema = schema32.$schema;
|
|
54892
54892
|
}
|
|
54893
|
-
if (
|
|
54894
|
-
result.$id =
|
|
54893
|
+
if (schema32.$id != null) {
|
|
54894
|
+
result.$id = schema32.$id;
|
|
54895
54895
|
}
|
|
54896
|
-
if (
|
|
54897
|
-
result.title =
|
|
54896
|
+
if (schema32.title != null) {
|
|
54897
|
+
result.title = schema32.title;
|
|
54898
54898
|
}
|
|
54899
|
-
if (
|
|
54900
|
-
result.description =
|
|
54899
|
+
if (schema32.description != null) {
|
|
54900
|
+
result.description = schema32.description;
|
|
54901
54901
|
}
|
|
54902
|
-
if (
|
|
54903
|
-
result.default =
|
|
54902
|
+
if (schema32.default !== void 0) {
|
|
54903
|
+
result.default = schema32.default;
|
|
54904
54904
|
}
|
|
54905
|
-
if (
|
|
54906
|
-
result.const =
|
|
54905
|
+
if (schema32.const !== void 0) {
|
|
54906
|
+
result.const = schema32.const;
|
|
54907
54907
|
}
|
|
54908
|
-
if (
|
|
54909
|
-
result.enum =
|
|
54908
|
+
if (schema32.enum != null) {
|
|
54909
|
+
result.enum = schema32.enum;
|
|
54910
54910
|
}
|
|
54911
|
-
if (
|
|
54912
|
-
result.type =
|
|
54911
|
+
if (schema32.type != null) {
|
|
54912
|
+
result.type = schema32.type;
|
|
54913
54913
|
}
|
|
54914
|
-
if (
|
|
54915
|
-
result.anyOf =
|
|
54916
|
-
} else if (
|
|
54917
|
-
result.anyOf =
|
|
54914
|
+
if (schema32.anyOf != null) {
|
|
54915
|
+
result.anyOf = schema32.anyOf.map(sanitizeDefinition);
|
|
54916
|
+
} else if (schema32.oneOf != null) {
|
|
54917
|
+
result.anyOf = schema32.oneOf.map(sanitizeDefinition);
|
|
54918
54918
|
}
|
|
54919
|
-
if (
|
|
54920
|
-
result.allOf =
|
|
54919
|
+
if (schema32.allOf != null) {
|
|
54920
|
+
result.allOf = schema32.allOf.map(sanitizeDefinition);
|
|
54921
54921
|
}
|
|
54922
|
-
if (
|
|
54922
|
+
if (schema32.definitions != null) {
|
|
54923
54923
|
result.definitions = Object.fromEntries(
|
|
54924
|
-
Object.entries(
|
|
54924
|
+
Object.entries(schema32.definitions).map(([name19, definition]) => [
|
|
54925
54925
|
name19,
|
|
54926
54926
|
sanitizeDefinition(definition)
|
|
54927
54927
|
])
|
|
@@ -54936,43 +54936,43 @@ function sanitizeSchema(schema31) {
|
|
|
54936
54936
|
])
|
|
54937
54937
|
);
|
|
54938
54938
|
}
|
|
54939
|
-
if (
|
|
54940
|
-
if (
|
|
54939
|
+
if (schema32.type === "object" || schema32.properties != null) {
|
|
54940
|
+
if (schema32.properties != null) {
|
|
54941
54941
|
result.properties = Object.fromEntries(
|
|
54942
|
-
Object.entries(
|
|
54942
|
+
Object.entries(schema32.properties).map(([name19, definition]) => [
|
|
54943
54943
|
name19,
|
|
54944
54944
|
sanitizeDefinition(definition)
|
|
54945
54945
|
])
|
|
54946
54946
|
);
|
|
54947
54947
|
}
|
|
54948
54948
|
result.additionalProperties = false;
|
|
54949
|
-
if (
|
|
54950
|
-
result.required =
|
|
54949
|
+
if (schema32.required != null) {
|
|
54950
|
+
result.required = schema32.required;
|
|
54951
54951
|
}
|
|
54952
54952
|
}
|
|
54953
|
-
if (
|
|
54954
|
-
result.items = Array.isArray(
|
|
54953
|
+
if (schema32.items != null) {
|
|
54954
|
+
result.items = Array.isArray(schema32.items) ? schema32.items.map(sanitizeDefinition) : sanitizeDefinition(schema32.items);
|
|
54955
54955
|
}
|
|
54956
|
-
if (typeof
|
|
54957
|
-
result.format =
|
|
54956
|
+
if (typeof schema32.format === "string" && SUPPORTED_STRING_FORMATS.has(schema32.format)) {
|
|
54957
|
+
result.format = schema32.format;
|
|
54958
54958
|
}
|
|
54959
|
-
const constraintDescription = getConstraintDescription(
|
|
54959
|
+
const constraintDescription = getConstraintDescription(schema32);
|
|
54960
54960
|
if (constraintDescription != null) {
|
|
54961
54961
|
result.description = result.description == null ? constraintDescription : `${result.description}
|
|
54962
54962
|
${constraintDescription}`;
|
|
54963
54963
|
}
|
|
54964
54964
|
return result;
|
|
54965
54965
|
}
|
|
54966
|
-
function getConstraintDescription(
|
|
54966
|
+
function getConstraintDescription(schema32) {
|
|
54967
54967
|
const descriptions = DESCRIPTION_CONSTRAINT_KEYS.flatMap((key2) => {
|
|
54968
|
-
const value =
|
|
54968
|
+
const value = schema32[key2];
|
|
54969
54969
|
if (value == null || value === false) {
|
|
54970
54970
|
return [];
|
|
54971
54971
|
}
|
|
54972
54972
|
return `${formatConstraintName(key2)}: ${formatConstraintValue(value)}`;
|
|
54973
54973
|
});
|
|
54974
|
-
if (typeof
|
|
54975
|
-
descriptions.push(`format: ${
|
|
54974
|
+
if (typeof schema32.format === "string" && !SUPPORTED_STRING_FORMATS.has(schema32.format)) {
|
|
54975
|
+
descriptions.push(`format: ${schema32.format}`);
|
|
54976
54976
|
}
|
|
54977
54977
|
return descriptions.length === 0 ? void 0 : `${descriptions.join("; ")}.`;
|
|
54978
54978
|
}
|
|
@@ -58411,10 +58411,10 @@ function convertJSONSchemaDefinition(jsonSchema2, isRoot, referenceContext) {
|
|
|
58411
58411
|
}
|
|
58412
58412
|
if (anyOf) {
|
|
58413
58413
|
if (anyOf.some(
|
|
58414
|
-
(
|
|
58414
|
+
(schema32) => typeof schema32 === "object" && (schema32 == null ? void 0 : schema32.type) === "null"
|
|
58415
58415
|
)) {
|
|
58416
58416
|
const nonNullSchemas = anyOf.filter(
|
|
58417
|
-
(
|
|
58417
|
+
(schema32) => !(typeof schema32 === "object" && (schema32 == null ? void 0 : schema32.type) === "null")
|
|
58418
58418
|
);
|
|
58419
58419
|
if (nonNullSchemas.length === 1) {
|
|
58420
58420
|
const converted = convertJSONSchemaDefinition(
|
|
@@ -61071,8 +61071,8 @@ function getCustomProvider(db, id) {
|
|
|
61071
61071
|
return row ? rowToCustomProvider(row) : null;
|
|
61072
61072
|
}
|
|
61073
61073
|
function createCustomProvider(db, input) {
|
|
61074
|
-
const { randomUUID:
|
|
61075
|
-
const id = `custom-${
|
|
61074
|
+
const { randomUUID: randomUUID19 } = require("node:crypto");
|
|
61075
|
+
const id = `custom-${randomUUID19().slice(0, 8)}`;
|
|
61076
61076
|
const modelsJson = input.models ? JSON.stringify(input.models) : null;
|
|
61077
61077
|
db.insert(customProviders).values({
|
|
61078
61078
|
id,
|
|
@@ -61162,9 +61162,9 @@ function resolveActiveContextWindow(db) {
|
|
|
61162
61162
|
if (preset)
|
|
61163
61163
|
return resolveModelContextWindow(preset.models, model);
|
|
61164
61164
|
if (providerId.startsWith("custom-")) {
|
|
61165
|
-
const
|
|
61166
|
-
if (
|
|
61167
|
-
return resolveModelContextWindow(
|
|
61165
|
+
const cp2 = getCustomProvider(db, providerId);
|
|
61166
|
+
if (cp2)
|
|
61167
|
+
return resolveModelContextWindow(cp2.models, model);
|
|
61168
61168
|
}
|
|
61169
61169
|
return null;
|
|
61170
61170
|
}
|
|
@@ -96393,9 +96393,9 @@ var require_dom = __commonJS({
|
|
|
96393
96393
|
if (parent.nodeType === Node5.DOCUMENT_NODE) {
|
|
96394
96394
|
(_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);
|
|
96395
96395
|
}
|
|
96396
|
-
var
|
|
96397
|
-
if (
|
|
96398
|
-
|
|
96396
|
+
var cp2 = node.parentNode;
|
|
96397
|
+
if (cp2) {
|
|
96398
|
+
cp2.removeChild(node);
|
|
96399
96399
|
}
|
|
96400
96400
|
if (node.nodeType === DOCUMENT_FRAGMENT_NODE2) {
|
|
96401
96401
|
var newFirst = node.firstChild;
|
|
@@ -106820,7 +106820,7 @@ var require_loadImage = __commonJS({
|
|
|
106820
106820
|
var fs5 = require("fs");
|
|
106821
106821
|
var fetch4 = global.fetch || require_lib3();
|
|
106822
106822
|
var isURL = require_is_url();
|
|
106823
|
-
var
|
|
106823
|
+
var readFile6 = util2.promisify(fs5.readFile);
|
|
106824
106824
|
module2.exports = async (image) => {
|
|
106825
106825
|
let data = image;
|
|
106826
106826
|
if (typeof image === "undefined") {
|
|
@@ -106833,7 +106833,7 @@ var require_loadImage = __commonJS({
|
|
|
106833
106833
|
} else if (/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(image)) {
|
|
106834
106834
|
data = Buffer.from(image.split(",")[1], "base64");
|
|
106835
106835
|
} else {
|
|
106836
|
-
data = await
|
|
106836
|
+
data = await readFile6(image);
|
|
106837
106837
|
}
|
|
106838
106838
|
} else if (Buffer.isBuffer(image)) {
|
|
106839
106839
|
data = image;
|
|
@@ -110781,14 +110781,14 @@ function pushCodeUnit(parts, chunk, codeUnit) {
|
|
|
110781
110781
|
if (chunk.length >= CHUNK)
|
|
110782
110782
|
flushChunk(parts, chunk);
|
|
110783
110783
|
}
|
|
110784
|
-
function pushCodePoint(parts, chunk,
|
|
110785
|
-
if (
|
|
110786
|
-
pushCodeUnit(parts, chunk,
|
|
110784
|
+
function pushCodePoint(parts, chunk, cp2) {
|
|
110785
|
+
if (cp2 <= 65535) {
|
|
110786
|
+
pushCodeUnit(parts, chunk, cp2);
|
|
110787
110787
|
return;
|
|
110788
110788
|
}
|
|
110789
|
-
|
|
110790
|
-
pushCodeUnit(parts, chunk, 55296 + (
|
|
110791
|
-
pushCodeUnit(parts, chunk, 56320 + (
|
|
110789
|
+
cp2 -= 65536;
|
|
110790
|
+
pushCodeUnit(parts, chunk, 55296 + (cp2 >> 10));
|
|
110791
|
+
pushCodeUnit(parts, chunk, 56320 + (cp2 & 1023));
|
|
110792
110792
|
}
|
|
110793
110793
|
function decodeUTF8(bytes) {
|
|
110794
110794
|
const parts = [];
|
|
@@ -110821,8 +110821,8 @@ function decodeUTF8(bytes) {
|
|
|
110821
110821
|
i++;
|
|
110822
110822
|
continue;
|
|
110823
110823
|
}
|
|
110824
|
-
const
|
|
110825
|
-
pushCodeUnit(parts, chunk,
|
|
110824
|
+
const cp3 = (b1 & 31) << 6 | b23 & 63;
|
|
110825
|
+
pushCodeUnit(parts, chunk, cp3);
|
|
110826
110826
|
i += 2;
|
|
110827
110827
|
continue;
|
|
110828
110828
|
}
|
|
@@ -110841,8 +110841,8 @@ function decodeUTF8(bytes) {
|
|
|
110841
110841
|
i++;
|
|
110842
110842
|
continue;
|
|
110843
110843
|
}
|
|
110844
|
-
const
|
|
110845
|
-
pushCodeUnit(parts, chunk,
|
|
110844
|
+
const cp3 = (b1 & 15) << 12 | (b23 & 63) << 6 | b32 & 63;
|
|
110845
|
+
pushCodeUnit(parts, chunk, cp3);
|
|
110846
110846
|
i += 3;
|
|
110847
110847
|
continue;
|
|
110848
110848
|
}
|
|
@@ -110861,8 +110861,8 @@ function decodeUTF8(bytes) {
|
|
|
110861
110861
|
i++;
|
|
110862
110862
|
continue;
|
|
110863
110863
|
}
|
|
110864
|
-
const
|
|
110865
|
-
pushCodePoint(parts, chunk,
|
|
110864
|
+
const cp2 = (b1 & 7) << 18 | (b22 & 63) << 12 | (b3 & 63) << 6 | b42 & 63;
|
|
110865
|
+
pushCodePoint(parts, chunk, cp2);
|
|
110866
110866
|
i += 4;
|
|
110867
110867
|
}
|
|
110868
110868
|
flushChunk(parts, chunk);
|
|
@@ -118947,7 +118947,7 @@ var init_pdf2 = __esm({
|
|
|
118947
118947
|
var defineProperty = Object.defineProperty;
|
|
118948
118948
|
var stringSlice = uncurryThis("".slice);
|
|
118949
118949
|
var replace2 = uncurryThis("".replace);
|
|
118950
|
-
var
|
|
118950
|
+
var join16 = uncurryThis([].join);
|
|
118951
118951
|
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
|
|
118952
118952
|
return defineProperty(function() {
|
|
118953
118953
|
}, "length", { value: 8 }).length !== 8;
|
|
@@ -118980,7 +118980,7 @@ var init_pdf2 = __esm({
|
|
|
118980
118980
|
}
|
|
118981
118981
|
var state = enforceInternalState(value);
|
|
118982
118982
|
if (!hasOwn(state, "source")) {
|
|
118983
|
-
state.source =
|
|
118983
|
+
state.source = join16(TEMPLATE, typeof name19 == "string" ? name19 : "");
|
|
118984
118984
|
}
|
|
118985
118985
|
return value;
|
|
118986
118986
|
};
|
|
@@ -121644,7 +121644,7 @@ var init_pdf2 = __esm({
|
|
|
121644
121644
|
var charAt = uncurryThis("".charAt);
|
|
121645
121645
|
var Uint8Array2 = globalThis2.Uint8Array;
|
|
121646
121646
|
var $Array = globalThis2.Array;
|
|
121647
|
-
var
|
|
121647
|
+
var join16 = uncurryThis([].join);
|
|
121648
121648
|
var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array2 || !Uint8Array2.prototype.toBase64 || !function() {
|
|
121649
121649
|
try {
|
|
121650
121650
|
var target = new Uint8Array2();
|
|
@@ -121692,7 +121692,7 @@ var init_pdf2 = __esm({
|
|
|
121692
121692
|
result[written++] = "=";
|
|
121693
121693
|
}
|
|
121694
121694
|
}
|
|
121695
|
-
return
|
|
121695
|
+
return join16(result, "");
|
|
121696
121696
|
}
|
|
121697
121697
|
});
|
|
121698
121698
|
},
|
|
@@ -121704,7 +121704,7 @@ var init_pdf2 = __esm({
|
|
|
121704
121704
|
var anUint8Array = __webpack_require__4(4154);
|
|
121705
121705
|
var notDetached = __webpack_require__4(5169);
|
|
121706
121706
|
var numberToString2 = uncurryThis(1.1.toString);
|
|
121707
|
-
var
|
|
121707
|
+
var join16 = uncurryThis([].join);
|
|
121708
121708
|
var $Array = Array;
|
|
121709
121709
|
var Uint8Array2 = globalThis2.Uint8Array;
|
|
121710
121710
|
var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array2 || !Uint8Array2.prototype.toHex || !function() {
|
|
@@ -121725,7 +121725,7 @@ var init_pdf2 = __esm({
|
|
|
121725
121725
|
var hex = numberToString2(this[i], 16);
|
|
121726
121726
|
result[i] = hex.length === 1 ? "0" + hex : hex;
|
|
121727
121727
|
}
|
|
121728
|
-
return
|
|
121728
|
+
return join16(result, "");
|
|
121729
121729
|
}
|
|
121730
121730
|
});
|
|
121731
121731
|
},
|
|
@@ -158174,7 +158174,7 @@ var init_pdf_worker = __esm({
|
|
|
158174
158174
|
var defineProperty = Object.defineProperty;
|
|
158175
158175
|
var stringSlice = uncurryThis("".slice);
|
|
158176
158176
|
var replace2 = uncurryThis("".replace);
|
|
158177
|
-
var
|
|
158177
|
+
var join16 = uncurryThis([].join);
|
|
158178
158178
|
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
|
|
158179
158179
|
return defineProperty(function() {
|
|
158180
158180
|
}, "length", { value: 8 }).length !== 8;
|
|
@@ -158207,7 +158207,7 @@ var init_pdf_worker = __esm({
|
|
|
158207
158207
|
}
|
|
158208
158208
|
var state = enforceInternalState(value);
|
|
158209
158209
|
if (!hasOwn(state, "source")) {
|
|
158210
|
-
state.source =
|
|
158210
|
+
state.source = join16(TEMPLATE, typeof name19 == "string" ? name19 : "");
|
|
158211
158211
|
}
|
|
158212
158212
|
return value;
|
|
158213
158213
|
};
|
|
@@ -160457,7 +160457,7 @@ var init_pdf_worker = __esm({
|
|
|
160457
160457
|
var charAt = uncurryThis("".charAt);
|
|
160458
160458
|
var Uint8Array2 = globalThis2.Uint8Array;
|
|
160459
160459
|
var $Array = globalThis2.Array;
|
|
160460
|
-
var
|
|
160460
|
+
var join16 = uncurryThis([].join);
|
|
160461
160461
|
var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array2 || !Uint8Array2.prototype.toBase64 || !function() {
|
|
160462
160462
|
try {
|
|
160463
160463
|
var target = new Uint8Array2();
|
|
@@ -160505,7 +160505,7 @@ var init_pdf_worker = __esm({
|
|
|
160505
160505
|
result[written++] = "=";
|
|
160506
160506
|
}
|
|
160507
160507
|
}
|
|
160508
|
-
return
|
|
160508
|
+
return join16(result, "");
|
|
160509
160509
|
}
|
|
160510
160510
|
});
|
|
160511
160511
|
},
|
|
@@ -160517,7 +160517,7 @@ var init_pdf_worker = __esm({
|
|
|
160517
160517
|
var anUint8Array = __webpack_require__4(4154);
|
|
160518
160518
|
var notDetached = __webpack_require__4(5169);
|
|
160519
160519
|
var numberToString2 = uncurryThis(1.1.toString);
|
|
160520
|
-
var
|
|
160520
|
+
var join16 = uncurryThis([].join);
|
|
160521
160521
|
var $Array = Array;
|
|
160522
160522
|
var Uint8Array2 = globalThis2.Uint8Array;
|
|
160523
160523
|
var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array2 || !Uint8Array2.prototype.toHex || !function() {
|
|
@@ -160538,7 +160538,7 @@ var init_pdf_worker = __esm({
|
|
|
160538
160538
|
var hex = numberToString2(this[i], 16);
|
|
160539
160539
|
result[i] = hex.length === 1 ? "0" + hex : hex;
|
|
160540
160540
|
}
|
|
160541
|
-
return
|
|
160541
|
+
return join16(result, "");
|
|
160542
160542
|
}
|
|
160543
160543
|
});
|
|
160544
160544
|
},
|
|
@@ -274018,16 +274018,16 @@ var require_pdf_worker = __commonJS({
|
|
|
274018
274018
|
}
|
|
274019
274019
|
seenAt = true;
|
|
274020
274020
|
for (var i = 0; i < buffer.length; i++) {
|
|
274021
|
-
var
|
|
274022
|
-
if (
|
|
274021
|
+
var cp2 = buffer[i];
|
|
274022
|
+
if (cp2 === " " || cp2 === "\n" || cp2 === "\r") {
|
|
274023
274023
|
err2("Invalid whitespace in authority.");
|
|
274024
274024
|
continue;
|
|
274025
274025
|
}
|
|
274026
|
-
if (
|
|
274026
|
+
if (cp2 === ":" && this._password === null) {
|
|
274027
274027
|
this._password = "";
|
|
274028
274028
|
continue;
|
|
274029
274029
|
}
|
|
274030
|
-
var tempC = percentEscape(
|
|
274030
|
+
var tempC = percentEscape(cp2);
|
|
274031
274031
|
if (this._password !== null) {
|
|
274032
274032
|
this._password += tempC;
|
|
274033
274033
|
} else {
|
|
@@ -274540,7 +274540,7 @@ var require_pdf_worker = __commonJS({
|
|
|
274540
274540
|
includes: function includes(searchElement) {
|
|
274541
274541
|
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
|
|
274542
274542
|
},
|
|
274543
|
-
join: function
|
|
274543
|
+
join: function join16(separator) {
|
|
274544
274544
|
return arrayJoin.apply(validate(this), arguments);
|
|
274545
274545
|
},
|
|
274546
274546
|
lastIndexOf: function lastIndexOf(searchElement) {
|
|
@@ -301244,16 +301244,16 @@ var require_pdf = __commonJS({
|
|
|
301244
301244
|
}
|
|
301245
301245
|
seenAt = true;
|
|
301246
301246
|
for (var i = 0; i < buffer.length; i++) {
|
|
301247
|
-
var
|
|
301248
|
-
if (
|
|
301247
|
+
var cp2 = buffer[i];
|
|
301248
|
+
if (cp2 === " " || cp2 === "\n" || cp2 === "\r") {
|
|
301249
301249
|
err2("Invalid whitespace in authority.");
|
|
301250
301250
|
continue;
|
|
301251
301251
|
}
|
|
301252
|
-
if (
|
|
301252
|
+
if (cp2 === ":" && this._password === null) {
|
|
301253
301253
|
this._password = "";
|
|
301254
301254
|
continue;
|
|
301255
301255
|
}
|
|
301256
|
-
var tempC = percentEscape(
|
|
301256
|
+
var tempC = percentEscape(cp2);
|
|
301257
301257
|
if (this._password !== null) {
|
|
301258
301258
|
this._password += tempC;
|
|
301259
301259
|
} else {
|
|
@@ -301760,7 +301760,7 @@ var require_pdf = __commonJS({
|
|
|
301760
301760
|
includes: function includes(searchElement) {
|
|
301761
301761
|
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
|
|
301762
301762
|
},
|
|
301763
|
-
join: function
|
|
301763
|
+
join: function join16(separator) {
|
|
301764
301764
|
return arrayJoin.apply(validate(this), arguments);
|
|
301765
301765
|
},
|
|
301766
301766
|
lastIndexOf: function lastIndexOf(searchElement) {
|
|
@@ -336583,16 +336583,16 @@ var require_pdf_worker2 = __commonJS({
|
|
|
336583
336583
|
}
|
|
336584
336584
|
seenAt = true;
|
|
336585
336585
|
for (var i = 0; i < buffer.length; i++) {
|
|
336586
|
-
var
|
|
336587
|
-
if (
|
|
336586
|
+
var cp2 = buffer[i];
|
|
336587
|
+
if (cp2 === " " || cp2 === "\n" || cp2 === "\r") {
|
|
336588
336588
|
err2("Invalid whitespace in authority.");
|
|
336589
336589
|
continue;
|
|
336590
336590
|
}
|
|
336591
|
-
if (
|
|
336591
|
+
if (cp2 === ":" && this._password === null) {
|
|
336592
336592
|
this._password = "";
|
|
336593
336593
|
continue;
|
|
336594
336594
|
}
|
|
336595
|
-
var tempC = percentEscape(
|
|
336595
|
+
var tempC = percentEscape(cp2);
|
|
336596
336596
|
if (this._password !== null) {
|
|
336597
336597
|
this._password += tempC;
|
|
336598
336598
|
} else {
|
|
@@ -337105,7 +337105,7 @@ var require_pdf_worker2 = __commonJS({
|
|
|
337105
337105
|
includes: function includes(searchElement) {
|
|
337106
337106
|
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
|
|
337107
337107
|
},
|
|
337108
|
-
join: function
|
|
337108
|
+
join: function join16(separator) {
|
|
337109
337109
|
return arrayJoin.apply(validate(this), arguments);
|
|
337110
337110
|
},
|
|
337111
337111
|
lastIndexOf: function lastIndexOf(searchElement) {
|
|
@@ -363915,16 +363915,16 @@ var require_pdf2 = __commonJS({
|
|
|
363915
363915
|
}
|
|
363916
363916
|
seenAt = true;
|
|
363917
363917
|
for (var i = 0; i < buffer.length; i++) {
|
|
363918
|
-
var
|
|
363919
|
-
if (
|
|
363918
|
+
var cp2 = buffer[i];
|
|
363919
|
+
if (cp2 === " " || cp2 === "\n" || cp2 === "\r") {
|
|
363920
363920
|
err2("Invalid whitespace in authority.");
|
|
363921
363921
|
continue;
|
|
363922
363922
|
}
|
|
363923
|
-
if (
|
|
363923
|
+
if (cp2 === ":" && this._password === null) {
|
|
363924
363924
|
this._password = "";
|
|
363925
363925
|
continue;
|
|
363926
363926
|
}
|
|
363927
|
-
var tempC = percentEscape(
|
|
363927
|
+
var tempC = percentEscape(cp2);
|
|
363928
363928
|
if (this._password !== null) {
|
|
363929
363929
|
this._password += tempC;
|
|
363930
363930
|
} else {
|
|
@@ -364431,7 +364431,7 @@ var require_pdf2 = __commonJS({
|
|
|
364431
364431
|
includes: function includes(searchElement) {
|
|
364432
364432
|
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
|
|
364433
364433
|
},
|
|
364434
|
-
join: function
|
|
364434
|
+
join: function join16(separator) {
|
|
364435
364435
|
return arrayJoin.apply(validate(this), arguments);
|
|
364436
364436
|
},
|
|
364437
364437
|
lastIndexOf: function lastIndexOf(searchElement) {
|
|
@@ -413526,16 +413526,16 @@ var require_pdf_worker3 = __commonJS({
|
|
|
413526
413526
|
}
|
|
413527
413527
|
seenAt = true;
|
|
413528
413528
|
for (var i = 0; i < buffer.length; i++) {
|
|
413529
|
-
var
|
|
413530
|
-
if (
|
|
413529
|
+
var cp2 = buffer[i];
|
|
413530
|
+
if (cp2 === " " || cp2 === "\n" || cp2 === "\r") {
|
|
413531
413531
|
err2("Invalid whitespace in authority.");
|
|
413532
413532
|
continue;
|
|
413533
413533
|
}
|
|
413534
|
-
if (
|
|
413534
|
+
if (cp2 === ":" && this._password === null) {
|
|
413535
413535
|
this._password = "";
|
|
413536
413536
|
continue;
|
|
413537
413537
|
}
|
|
413538
|
-
var tempC = percentEscape(
|
|
413538
|
+
var tempC = percentEscape(cp2);
|
|
413539
413539
|
if (this._password !== null) {
|
|
413540
413540
|
this._password += tempC;
|
|
413541
413541
|
} else {
|
|
@@ -427109,16 +427109,16 @@ var require_pdf3 = __commonJS({
|
|
|
427109
427109
|
}
|
|
427110
427110
|
seenAt = true;
|
|
427111
427111
|
for (var i = 0; i < buffer.length; i++) {
|
|
427112
|
-
var
|
|
427113
|
-
if (
|
|
427112
|
+
var cp2 = buffer[i];
|
|
427113
|
+
if (cp2 === " " || cp2 === "\n" || cp2 === "\r") {
|
|
427114
427114
|
err2("Invalid whitespace in authority.");
|
|
427115
427115
|
continue;
|
|
427116
427116
|
}
|
|
427117
|
-
if (
|
|
427117
|
+
if (cp2 === ":" && this._password === null) {
|
|
427118
427118
|
this._password = "";
|
|
427119
427119
|
continue;
|
|
427120
427120
|
}
|
|
427121
|
-
var tempC = percentEscape(
|
|
427121
|
+
var tempC = percentEscape(cp2);
|
|
427122
427122
|
if (this._password !== null) {
|
|
427123
427123
|
this._password += tempC;
|
|
427124
427124
|
} else {
|
|
@@ -429332,16 +429332,16 @@ var require_pdf_worker4 = __commonJS({
|
|
|
429332
429332
|
}
|
|
429333
429333
|
seenAt = true;
|
|
429334
429334
|
for (var i = 0; i < buffer.length; i++) {
|
|
429335
|
-
var
|
|
429336
|
-
if (
|
|
429335
|
+
var cp2 = buffer[i];
|
|
429336
|
+
if (cp2 === " " || cp2 === "\n" || cp2 === "\r") {
|
|
429337
429337
|
err2("Invalid whitespace in authority.");
|
|
429338
429338
|
continue;
|
|
429339
429339
|
}
|
|
429340
|
-
if (
|
|
429340
|
+
if (cp2 === ":" && this._password === null) {
|
|
429341
429341
|
this._password = "";
|
|
429342
429342
|
continue;
|
|
429343
429343
|
}
|
|
429344
|
-
var tempC = percentEscape(
|
|
429344
|
+
var tempC = percentEscape(cp2);
|
|
429345
429345
|
if (this._password !== null) {
|
|
429346
429346
|
this._password += tempC;
|
|
429347
429347
|
} else {
|
|
@@ -472867,16 +472867,16 @@ var require_pdf4 = __commonJS({
|
|
|
472867
472867
|
}
|
|
472868
472868
|
seenAt = true;
|
|
472869
472869
|
for (var i = 0; i < buffer.length; i++) {
|
|
472870
|
-
var
|
|
472871
|
-
if (
|
|
472870
|
+
var cp2 = buffer[i];
|
|
472871
|
+
if (cp2 === " " || cp2 === "\n" || cp2 === "\r") {
|
|
472872
472872
|
err2("Invalid whitespace in authority.");
|
|
472873
472873
|
continue;
|
|
472874
472874
|
}
|
|
472875
|
-
if (
|
|
472875
|
+
if (cp2 === ":" && this._password === null) {
|
|
472876
472876
|
this._password = "";
|
|
472877
472877
|
continue;
|
|
472878
472878
|
}
|
|
472879
|
-
var tempC = percentEscape(
|
|
472879
|
+
var tempC = percentEscape(cp2);
|
|
472880
472880
|
if (this._password !== null) {
|
|
472881
472881
|
this._password += tempC;
|
|
472882
472882
|
} else {
|
|
@@ -489877,7 +489877,7 @@ var init_Tokenizer = __esm({
|
|
|
489877
489877
|
this.sequenceIndex = 0;
|
|
489878
489878
|
this.xmlMode = xmlMode;
|
|
489879
489879
|
this.decodeEntities = decodeEntities2;
|
|
489880
|
-
this.entityDecoder = new EntityDecoder(xmlMode ? xmlDecodeTree : htmlDecodeTree, (
|
|
489880
|
+
this.entityDecoder = new EntityDecoder(xmlMode ? xmlDecodeTree : htmlDecodeTree, (cp2, consumed) => this.emitCodePoint(cp2, consumed));
|
|
489881
489881
|
}
|
|
489882
489882
|
reset() {
|
|
489883
489883
|
this.state = State.Text;
|
|
@@ -490442,21 +490442,21 @@ var init_Tokenizer = __esm({
|
|
|
490442
490442
|
this.cbs.ontext(this.sectionStart, endIndex);
|
|
490443
490443
|
}
|
|
490444
490444
|
}
|
|
490445
|
-
emitCodePoint(
|
|
490445
|
+
emitCodePoint(cp2, consumed) {
|
|
490446
490446
|
if (this.baseState !== State.Text && this.baseState !== State.InSpecialTag) {
|
|
490447
490447
|
if (this.sectionStart < this.entityStart) {
|
|
490448
490448
|
this.cbs.onattribdata(this.sectionStart, this.entityStart);
|
|
490449
490449
|
}
|
|
490450
490450
|
this.sectionStart = this.entityStart + consumed;
|
|
490451
490451
|
this.index = this.sectionStart - 1;
|
|
490452
|
-
this.cbs.onattribentity(
|
|
490452
|
+
this.cbs.onattribentity(cp2);
|
|
490453
490453
|
} else {
|
|
490454
490454
|
if (this.sectionStart < this.entityStart) {
|
|
490455
490455
|
this.cbs.ontext(this.sectionStart, this.entityStart);
|
|
490456
490456
|
}
|
|
490457
490457
|
this.sectionStart = this.entityStart + consumed;
|
|
490458
490458
|
this.index = this.sectionStart - 1;
|
|
490459
|
-
this.cbs.ontextentity(
|
|
490459
|
+
this.cbs.ontextentity(cp2, this.sectionStart);
|
|
490460
490460
|
}
|
|
490461
490461
|
}
|
|
490462
490462
|
};
|
|
@@ -490600,10 +490600,10 @@ var init_Parser = __esm({
|
|
|
490600
490600
|
this.startIndex = endIndex;
|
|
490601
490601
|
}
|
|
490602
490602
|
/** @internal */
|
|
490603
|
-
ontextentity(
|
|
490603
|
+
ontextentity(cp2, endIndex) {
|
|
490604
490604
|
var _a27, _b20;
|
|
490605
490605
|
this.endIndex = endIndex - 1;
|
|
490606
|
-
(_b20 = (_a27 = this.cbs).ontext) === null || _b20 === void 0 ? void 0 : _b20.call(_a27, fromCodePoint(
|
|
490606
|
+
(_b20 = (_a27 = this.cbs).ontext) === null || _b20 === void 0 ? void 0 : _b20.call(_a27, fromCodePoint(cp2));
|
|
490607
490607
|
this.startIndex = endIndex;
|
|
490608
490608
|
}
|
|
490609
490609
|
/**
|
|
@@ -490724,8 +490724,8 @@ var init_Parser = __esm({
|
|
|
490724
490724
|
this.attribvalue += this.getSlice(start, endIndex);
|
|
490725
490725
|
}
|
|
490726
490726
|
/** @internal */
|
|
490727
|
-
onattribentity(
|
|
490728
|
-
this.attribvalue += fromCodePoint(
|
|
490727
|
+
onattribentity(cp2) {
|
|
490728
|
+
this.attribvalue += fromCodePoint(cp2);
|
|
490729
490729
|
}
|
|
490730
490730
|
/** @internal */
|
|
490731
490731
|
onattribend(quote, endIndex) {
|
|
@@ -494934,9 +494934,9 @@ function encodeXML2(input) {
|
|
|
494934
494934
|
last = index += 1;
|
|
494935
494935
|
continue;
|
|
494936
494936
|
}
|
|
494937
|
-
const
|
|
494938
|
-
out += `&#x${
|
|
494939
|
-
if (
|
|
494937
|
+
const cp2 = input.codePointAt(index);
|
|
494938
|
+
out += `&#x${cp2.toString(16)};`;
|
|
494939
|
+
if (cp2 !== char)
|
|
494940
494940
|
index++;
|
|
494941
494941
|
last = index += 1;
|
|
494942
494942
|
}
|
|
@@ -506923,10 +506923,10 @@ var require_select = __commonJS({
|
|
|
506923
506923
|
if (m[2]) {
|
|
506924
506924
|
return "";
|
|
506925
506925
|
}
|
|
506926
|
-
var
|
|
506927
|
-
return String.fromCodePoint ? String.fromCodePoint(
|
|
506926
|
+
var cp2 = parseInt(m[1], 16);
|
|
506927
|
+
return String.fromCodePoint ? String.fromCodePoint(cp2) : (
|
|
506928
506928
|
// Not all JavaScript implementations have String.fromCodePoint yet.
|
|
506929
|
-
String.fromCharCode(
|
|
506929
|
+
String.fromCharCode(cp2)
|
|
506930
506930
|
);
|
|
506931
506931
|
});
|
|
506932
506932
|
} else if (rules.ident.test(str2)) {
|
|
@@ -506941,10 +506941,10 @@ var require_select = __commonJS({
|
|
|
506941
506941
|
if (!m) {
|
|
506942
506942
|
return s[1];
|
|
506943
506943
|
}
|
|
506944
|
-
var
|
|
506945
|
-
return String.fromCodePoint ? String.fromCodePoint(
|
|
506944
|
+
var cp2 = parseInt(m[1], 16);
|
|
506945
|
+
return String.fromCodePoint ? String.fromCodePoint(cp2) : (
|
|
506946
506946
|
// Not all JavaScript implementations have String.fromCodePoint yet.
|
|
506947
|
-
String.fromCharCode(
|
|
506947
|
+
String.fromCharCode(cp2)
|
|
506948
506948
|
);
|
|
506949
506949
|
});
|
|
506950
506950
|
};
|
|
@@ -522170,14 +522170,14 @@ var require_turndown_cjs = __commonJS({
|
|
|
522170
522170
|
} else if (node.nodeType === 1) {
|
|
522171
522171
|
replacement = replacementForNode.call(self2, node);
|
|
522172
522172
|
}
|
|
522173
|
-
return
|
|
522173
|
+
return join16(output, replacement);
|
|
522174
522174
|
}, "");
|
|
522175
522175
|
}
|
|
522176
522176
|
function postProcess(output) {
|
|
522177
522177
|
var self2 = this;
|
|
522178
522178
|
this.rules.forEach(function(rule) {
|
|
522179
522179
|
if (typeof rule.append === "function") {
|
|
522180
|
-
output =
|
|
522180
|
+
output = join16(output, rule.append(self2.options));
|
|
522181
522181
|
}
|
|
522182
522182
|
});
|
|
522183
522183
|
return output.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
|
|
@@ -522190,7 +522190,7 @@ var require_turndown_cjs = __commonJS({
|
|
|
522190
522190
|
content = content.trim();
|
|
522191
522191
|
return whitespace2.leading + rule.replacement(content, node, this.options) + whitespace2.trailing;
|
|
522192
522192
|
}
|
|
522193
|
-
function
|
|
522193
|
+
function join16(output, replacement) {
|
|
522194
522194
|
var s1 = trimTrailingNewlines(output);
|
|
522195
522195
|
var s2 = trimLeadingNewlines(replacement);
|
|
522196
522196
|
var nls = Math.max(output.length - s1.length, replacement.length - s2.length);
|
|
@@ -530152,34 +530152,34 @@ function getAssetsRoot() {
|
|
|
530152
530152
|
if (assetsRootOverride)
|
|
530153
530153
|
return assetsRootOverride;
|
|
530154
530154
|
const { app } = require("electron");
|
|
530155
|
-
return (0,
|
|
530155
|
+
return (0, import_node_path14.join)(app.getPath("userData"), "assets");
|
|
530156
530156
|
}
|
|
530157
530157
|
function getCourseAssetsDir(courseId) {
|
|
530158
|
-
return (0,
|
|
530158
|
+
return (0, import_node_path14.join)(getAssetsRoot(), courseId);
|
|
530159
530159
|
}
|
|
530160
530160
|
function getAssetFilePath(courseId, filename) {
|
|
530161
|
-
return (0,
|
|
530161
|
+
return (0, import_node_path14.join)(getCourseAssetsDir(courseId), filename);
|
|
530162
530162
|
}
|
|
530163
530163
|
async function copyImageToAssets(sourceAbsPath, courseId, destFilename) {
|
|
530164
530164
|
const dir = getCourseAssetsDir(courseId);
|
|
530165
|
-
if (!(0,
|
|
530166
|
-
await (0,
|
|
530165
|
+
if (!(0, import_node_fs13.existsSync)(dir)) {
|
|
530166
|
+
await (0, import_promises7.mkdir)(dir, { recursive: true });
|
|
530167
530167
|
}
|
|
530168
530168
|
const destPath = getAssetFilePath(courseId, destFilename);
|
|
530169
|
-
await (0,
|
|
530169
|
+
await (0, import_promises7.copyFile)(sourceAbsPath, destPath);
|
|
530170
530170
|
return destFilename;
|
|
530171
530171
|
}
|
|
530172
530172
|
async function writeBufferToAssets(buffer, courseId, destFilename) {
|
|
530173
530173
|
const dir = getCourseAssetsDir(courseId);
|
|
530174
|
-
if (!(0,
|
|
530175
|
-
await (0,
|
|
530174
|
+
if (!(0, import_node_fs13.existsSync)(dir)) {
|
|
530175
|
+
await (0, import_promises7.mkdir)(dir, { recursive: true });
|
|
530176
530176
|
}
|
|
530177
530177
|
const destPath = getAssetFilePath(courseId, destFilename);
|
|
530178
|
-
await (0,
|
|
530178
|
+
await (0, import_promises7.writeFile)(destPath, buffer);
|
|
530179
530179
|
return destFilename;
|
|
530180
530180
|
}
|
|
530181
530181
|
function persistAssetRecord(db, input) {
|
|
530182
|
-
const id = (0,
|
|
530182
|
+
const id = (0, import_node_crypto17.randomUUID)();
|
|
530183
530183
|
const mimeType = input.mimeType ?? inferMime(input.filename);
|
|
530184
530184
|
db.insert(nodeAssets).values({
|
|
530185
530185
|
id,
|
|
@@ -530217,30 +530217,30 @@ async function getAssetDataUrl(db, assetId) {
|
|
|
530217
530217
|
if (!asset)
|
|
530218
530218
|
return null;
|
|
530219
530219
|
const filePath = getAssetFilePath(asset.courseId, asset.filename);
|
|
530220
|
-
if (!(0,
|
|
530220
|
+
if (!(0, import_node_fs13.existsSync)(filePath))
|
|
530221
530221
|
return null;
|
|
530222
|
-
const buf = await (0,
|
|
530222
|
+
const buf = await (0, import_promises7.readFile)(filePath);
|
|
530223
530223
|
const base643 = buf.toString("base64");
|
|
530224
530224
|
return `data:${asset.mimeType};base64,${base643}`;
|
|
530225
530225
|
}
|
|
530226
530226
|
async function deleteCourseAssetsFiles(courseId) {
|
|
530227
530227
|
const dir = getCourseAssetsDir(courseId);
|
|
530228
|
-
if (!(0,
|
|
530228
|
+
if (!(0, import_node_fs13.existsSync)(dir))
|
|
530229
530229
|
return;
|
|
530230
|
-
const { rm } = await import("node:fs/promises");
|
|
530231
|
-
await
|
|
530230
|
+
const { rm: rm2 } = await import("node:fs/promises");
|
|
530231
|
+
await rm2(dir, { recursive: true, force: true });
|
|
530232
530232
|
}
|
|
530233
|
-
var
|
|
530233
|
+
var import_node_path14, import_promises7, import_node_fs13, import_node_crypto17, EXT_MIME, assetsRootOverride;
|
|
530234
530234
|
var init_asset_service = __esm({
|
|
530235
530235
|
"src/main/services/asset-service.ts"() {
|
|
530236
530236
|
"use strict";
|
|
530237
|
-
|
|
530238
|
-
|
|
530239
|
-
|
|
530237
|
+
import_node_path14 = require("node:path");
|
|
530238
|
+
import_promises7 = require("node:fs/promises");
|
|
530239
|
+
import_node_fs13 = require("node:fs");
|
|
530240
530240
|
init_drizzle_orm();
|
|
530241
530241
|
init_schema();
|
|
530242
530242
|
init_schema();
|
|
530243
|
-
|
|
530243
|
+
import_node_crypto17 = require("node:crypto");
|
|
530244
530244
|
init_db2();
|
|
530245
530245
|
EXT_MIME = {
|
|
530246
530246
|
png: "image/png",
|
|
@@ -530529,7 +530529,7 @@ function applyCourseStructure(db, courseId, proposal) {
|
|
|
530529
530529
|
for (const l of allLessons) {
|
|
530530
530530
|
db.update(contentNodes).set({ parentId: null, orderIdx: 0 }).where(eq(contentNodes.id, l.id)).run();
|
|
530531
530531
|
}
|
|
530532
|
-
const { randomUUID:
|
|
530532
|
+
const { randomUUID: randomUUID19 } = require("node:crypto");
|
|
530533
530533
|
const validLessonIds = new Set(allLessons.map((l) => l.id));
|
|
530534
530534
|
const skippedSet = new Set(
|
|
530535
530535
|
proposal.skippedNodeIds.filter((id) => validLessonIds.has(id))
|
|
@@ -530540,7 +530540,7 @@ function applyCourseStructure(db, courseId, proposal) {
|
|
|
530540
530540
|
const validIds = sec.lessonIds.filter((id) => validLessonIds.has(id));
|
|
530541
530541
|
if (validIds.length === 0)
|
|
530542
530542
|
continue;
|
|
530543
|
-
const sectionId =
|
|
530543
|
+
const sectionId = randomUUID19();
|
|
530544
530544
|
const secWorld = sec.world ?? "study";
|
|
530545
530545
|
db.insert(contentNodes).values({
|
|
530546
530546
|
id: sectionId,
|
|
@@ -530670,9 +530670,9 @@ function applyWorldClassification(db, courseId, classifications) {
|
|
|
530670
530670
|
}
|
|
530671
530671
|
}
|
|
530672
530672
|
if (orphanPractice.length > 0) {
|
|
530673
|
-
const { randomUUID:
|
|
530673
|
+
const { randomUUID: randomUUID19 } = require("node:crypto");
|
|
530674
530674
|
const maxOrder = Math.max(...sections.map((s) => s.orderIdx), 0);
|
|
530675
|
-
const practiceSectionId =
|
|
530675
|
+
const practiceSectionId = randomUUID19();
|
|
530676
530676
|
db.insert(contentNodes).values({
|
|
530677
530677
|
id: practiceSectionId,
|
|
530678
530678
|
courseId,
|
|
@@ -530925,7 +530925,7 @@ async function persistTranslations(db, courseId, locale, translations) {
|
|
|
530925
530925
|
db.update(contentNodeTranslations).set({ title: transTitle, content: transEntry.content }).where(eq(contentNodeTranslations.id, existing.id)).run();
|
|
530926
530926
|
} else {
|
|
530927
530927
|
db.insert(contentNodeTranslations).values({
|
|
530928
|
-
id: (0,
|
|
530928
|
+
id: (0, import_node_crypto25.randomUUID)(),
|
|
530929
530929
|
nodeId: node.id,
|
|
530930
530930
|
courseId,
|
|
530931
530931
|
locale,
|
|
@@ -531005,11 +531005,11 @@ function getCourseTitleTranslations(db, courseId, locale) {
|
|
|
531005
531005
|
).all();
|
|
531006
531006
|
return new Map(rows.map((r) => [r.nodeId, r.title]));
|
|
531007
531007
|
}
|
|
531008
|
-
var
|
|
531008
|
+
var import_node_crypto25;
|
|
531009
531009
|
var init_translation_service = __esm({
|
|
531010
531010
|
"src/main/services/translation-service.ts"() {
|
|
531011
531011
|
"use strict";
|
|
531012
|
-
|
|
531012
|
+
import_node_crypto25 = require("node:crypto");
|
|
531013
531013
|
init_drizzle_orm();
|
|
531014
531014
|
init_dist6();
|
|
531015
531015
|
init_schema();
|
|
@@ -531020,14 +531020,14 @@ var init_translation_service = __esm({
|
|
|
531020
531020
|
|
|
531021
531021
|
// src/main/serve/index.ts
|
|
531022
531022
|
var import_node_os4 = require("node:os");
|
|
531023
|
-
var
|
|
531023
|
+
var import_node_path18 = require("node:path");
|
|
531024
531024
|
|
|
531025
531025
|
// src/main/serve/server.ts
|
|
531026
531026
|
var import_node_http = require("node:http");
|
|
531027
531027
|
var import_node_https3 = require("node:https");
|
|
531028
|
-
var
|
|
531029
|
-
var
|
|
531030
|
-
var
|
|
531028
|
+
var import_node_fs15 = require("node:fs");
|
|
531029
|
+
var import_node_path17 = require("node:path");
|
|
531030
|
+
var import_node_crypto27 = require("node:crypto");
|
|
531031
531031
|
|
|
531032
531032
|
// node_modules/ws/wrapper.mjs
|
|
531033
531033
|
var import_stream = __toESM(require_stream(), 1);
|
|
@@ -531059,7 +531059,7 @@ function parseClientFrame(raw) {
|
|
|
531059
531059
|
}
|
|
531060
531060
|
|
|
531061
531061
|
// src/main/ipc/index.ts
|
|
531062
|
-
var
|
|
531062
|
+
var import_node_path15 = require("node:path");
|
|
531063
531063
|
init_db2();
|
|
531064
531064
|
|
|
531065
531065
|
// src/main/services/dsh-import-service.ts
|
|
@@ -531702,7 +531702,7 @@ function baseResult() {
|
|
|
531702
531702
|
// src/main/ipc/index.ts
|
|
531703
531703
|
init_schema();
|
|
531704
531704
|
init_drizzle_orm();
|
|
531705
|
-
var
|
|
531705
|
+
var import_node_crypto26 = require("node:crypto");
|
|
531706
531706
|
|
|
531707
531707
|
// src/main/services/import-plan-store.ts
|
|
531708
531708
|
var import_node_fs3 = require("node:fs");
|
|
@@ -534136,8 +534136,8 @@ function mapRow(row) {
|
|
|
534136
534136
|
var HARD = /* @__PURE__ */ new Set(["\u3002", "!", "?", "\uFF01", "\uFF1F", ";", "\uFF1B", "\u2026"]);
|
|
534137
534137
|
var SOFT = /* @__PURE__ */ new Set([",", "\uFF0C", "\u3001", ":", "\uFF1A", " ", " "]);
|
|
534138
534138
|
var EMOJI_CP_RE = /[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}]/u;
|
|
534139
|
-
function isEmojiCp(
|
|
534140
|
-
return
|
|
534139
|
+
function isEmojiCp(cp2) {
|
|
534140
|
+
return cp2 != null && EMOJI_CP_RE.test(String.fromCodePoint(cp2));
|
|
534141
534141
|
}
|
|
534142
534142
|
var CLOSERS = /* @__PURE__ */ new Set(["\u201D", '"', "\u300D", "\u300F", "\u300B", ")", "\u3011", "])".slice(0, 1)]);
|
|
534143
534143
|
function normalizeSpeechText(md) {
|
|
@@ -534178,9 +534178,9 @@ function splitSentences(text3, opts = {}) {
|
|
|
534178
534178
|
};
|
|
534179
534179
|
while (i < n) {
|
|
534180
534180
|
const ch2 = text3[i];
|
|
534181
|
-
const
|
|
534182
|
-
if (isEmojiCp(
|
|
534183
|
-
let j = i + (
|
|
534181
|
+
const cp2 = text3.codePointAt(i);
|
|
534182
|
+
if (isEmojiCp(cp2)) {
|
|
534183
|
+
let j = i + (cp2 > 65535 ? 2 : 1);
|
|
534184
534184
|
while (j < n) {
|
|
534185
534185
|
const cj = text3.codePointAt(j);
|
|
534186
534186
|
const ul = cj > 65535 ? 2 : 1;
|
|
@@ -560396,6 +560396,454 @@ function setCompanionPackVehicle(dataDir, id, vehicle) {
|
|
|
560396
560396
|
return { ok: true };
|
|
560397
560397
|
}
|
|
560398
560398
|
|
|
560399
|
+
// src/main/services/shimeji/shimeji-pack-service.ts
|
|
560400
|
+
var import_node_path13 = require("node:path");
|
|
560401
|
+
var import_promises6 = require("node:fs/promises");
|
|
560402
|
+
var import_node_fs12 = require("node:fs");
|
|
560403
|
+
var import_node_crypto15 = require("node:crypto");
|
|
560404
|
+
init_esm2();
|
|
560405
|
+
init_schema();
|
|
560406
|
+
init_schema();
|
|
560407
|
+
init_drizzle_orm();
|
|
560408
|
+
|
|
560409
|
+
// src/main/services/shimeji/pure/shimeji-parse.ts
|
|
560410
|
+
var ACTION_KIND_MAP = {
|
|
560411
|
+
"\u7D44\u307F\u8FBC\u307F": "Embedded",
|
|
560412
|
+
Embedded: "Embedded",
|
|
560413
|
+
"\u9759\u6B62": "Stay",
|
|
560414
|
+
Stay: "Stay",
|
|
560415
|
+
"\u79FB\u52D5": "Move",
|
|
560416
|
+
Move: "Move",
|
|
560417
|
+
"\u56FA\u5B9A": "Animate",
|
|
560418
|
+
Animate: "Animate",
|
|
560419
|
+
"\u8907\u5408": "Sequence",
|
|
560420
|
+
Sequence: "Sequence"
|
|
560421
|
+
};
|
|
560422
|
+
function pickAttr(tag, names) {
|
|
560423
|
+
for (const n of names) {
|
|
560424
|
+
const m = tag.match(new RegExp(`${n}="([^"]*)"`));
|
|
560425
|
+
if (m)
|
|
560426
|
+
return m[1];
|
|
560427
|
+
}
|
|
560428
|
+
return void 0;
|
|
560429
|
+
}
|
|
560430
|
+
function parsePoint(v) {
|
|
560431
|
+
if (!v)
|
|
560432
|
+
return [0, 0];
|
|
560433
|
+
const parts = v.split(",").map((s) => Number(s.trim()));
|
|
560434
|
+
return [Number.isFinite(parts[0]) ? parts[0] : 0, Number.isFinite(parts[1]) ? parts[1] : 0];
|
|
560435
|
+
}
|
|
560436
|
+
function stripBom(s) {
|
|
560437
|
+
return s.charCodeAt(0) === 65279 ? s.slice(1) : s;
|
|
560438
|
+
}
|
|
560439
|
+
function normalizeImage(v) {
|
|
560440
|
+
const base = v.split("/").pop() ?? v;
|
|
560441
|
+
return base.trim();
|
|
560442
|
+
}
|
|
560443
|
+
function parseShimejiActions(xml) {
|
|
560444
|
+
const text3 = stripBom(xml);
|
|
560445
|
+
const actions = [];
|
|
560446
|
+
const opens = [];
|
|
560447
|
+
const re2 = /<(?:動作|Action)(?=[\s/>])/g;
|
|
560448
|
+
let m;
|
|
560449
|
+
while (m = re2.exec(text3))
|
|
560450
|
+
opens.push(m.index);
|
|
560451
|
+
for (let i = 0; i < opens.length; i++) {
|
|
560452
|
+
const start = opens[i];
|
|
560453
|
+
const end = i + 1 < opens.length ? opens[i + 1] : text3.length;
|
|
560454
|
+
const block = text3.slice(start, end);
|
|
560455
|
+
const openTag = block.slice(0, block.indexOf(">") + 1);
|
|
560456
|
+
const name19 = pickAttr(openTag, ["\u540D\u524D", "Name"]);
|
|
560457
|
+
if (!name19)
|
|
560458
|
+
continue;
|
|
560459
|
+
const kindRaw = pickAttr(openTag, ["\u7A2E\u985E", "Type"]) ?? "Embedded";
|
|
560460
|
+
const kind = ACTION_KIND_MAP[kindRaw] ?? "Embedded";
|
|
560461
|
+
const className = pickAttr(openTag, ["\u30AF\u30E9\u30B9", "Class"]);
|
|
560462
|
+
const poses = [];
|
|
560463
|
+
const poseRe = /<(?:ポーズ|Pose)(?=[\s/>])[^>]*>/g;
|
|
560464
|
+
let pm;
|
|
560465
|
+
while (pm = poseRe.exec(block)) {
|
|
560466
|
+
const attrs = pm[0].slice(1, -1);
|
|
560467
|
+
const image = normalizeImage(pickAttr(attrs, ["\u753B\u50CF", "Image"]) ?? "");
|
|
560468
|
+
if (!image)
|
|
560469
|
+
continue;
|
|
560470
|
+
poses.push({
|
|
560471
|
+
image,
|
|
560472
|
+
anchor: parsePoint(pickAttr(attrs, ["\u57FA\u6E96\u5EA7\u6A19", "ImageAnchor"])),
|
|
560473
|
+
velocity: parsePoint(pickAttr(attrs, ["\u79FB\u52D5\u901F\u5EA6", "Velocity"])),
|
|
560474
|
+
duration: Number(pickAttr(attrs, ["\u9577\u3055", "Duration"]) ?? 1) || 1
|
|
560475
|
+
});
|
|
560476
|
+
}
|
|
560477
|
+
actions.push({ name: name19, kind, ...className ? { className } : {}, poses });
|
|
560478
|
+
}
|
|
560479
|
+
return actions;
|
|
560480
|
+
}
|
|
560481
|
+
function parseShimejiBehaviors(xml) {
|
|
560482
|
+
const text3 = stripBom(xml);
|
|
560483
|
+
const behaviors = [];
|
|
560484
|
+
const opens = [];
|
|
560485
|
+
const re2 = /<(?:行動|Behavior)(?=[\s/>])/g;
|
|
560486
|
+
let m;
|
|
560487
|
+
while (m = re2.exec(text3))
|
|
560488
|
+
opens.push(m.index);
|
|
560489
|
+
for (let i = 0; i < opens.length; i++) {
|
|
560490
|
+
const block = text3.slice(opens[i], i + 1 < opens.length ? opens[i + 1] : text3.length);
|
|
560491
|
+
const openTag = block.slice(0, block.indexOf(">") + 1);
|
|
560492
|
+
const name19 = pickAttr(openTag, ["\u540D\u524D", "Name"]);
|
|
560493
|
+
if (!name19)
|
|
560494
|
+
continue;
|
|
560495
|
+
const frequency = Number(pickAttr(openTag, ["\u983B\u5EA6", "Frequency"]) ?? 0) || 0;
|
|
560496
|
+
const next = [];
|
|
560497
|
+
const refRe = /<(?:行動参照|BehaviorReference)(?=[\s/>])[^>]*>/g;
|
|
560498
|
+
let rm2;
|
|
560499
|
+
while (rm2 = refRe.exec(block)) {
|
|
560500
|
+
const n = pickAttr(rm2[0], ["\u540D\u524D", "Name"]);
|
|
560501
|
+
if (n)
|
|
560502
|
+
next.push({ name: n, frequency: Number(pickAttr(rm2[0], ["\u983B\u5EA6", "Frequency"]) ?? 1) || 1 });
|
|
560503
|
+
}
|
|
560504
|
+
behaviors.push({ name: name19, frequency, next });
|
|
560505
|
+
}
|
|
560506
|
+
return behaviors;
|
|
560507
|
+
}
|
|
560508
|
+
var ACTION_ARCHIVE = [
|
|
560509
|
+
// ── 地面系(scene·ground) ──
|
|
560510
|
+
{ en: "Stand", ja: "\u7ACB\u3064", archive: "scene", slot: "ground" },
|
|
560511
|
+
{ en: "Walk", ja: "\u6B69\u304F", archive: "scene", slot: "ground" },
|
|
560512
|
+
{ en: "Run", ja: "\u8D70\u308B", archive: "scene", slot: "ground" },
|
|
560513
|
+
{ en: "Dash", ja: "\u731B\u30C0\u30C3\u30B7\u30E5", archive: "scene", slot: "ground" },
|
|
560514
|
+
{ en: "Sit", ja: "\u5EA7\u308B", archive: "scene", slot: "ground" },
|
|
560515
|
+
{ en: "SitAndLookUp", ja: "\u5EA7\u3063\u3066\u898B\u4E0A\u3052\u308B", archive: "scene", slot: "ground" },
|
|
560516
|
+
{ en: "SitWithLegsUp", ja: "\u697D\u306B\u5EA7\u308B", archive: "scene", slot: "ground" },
|
|
560517
|
+
{ en: "SitWithLegsDown", ja: "\u8DB3\u3092\u4E0B\u308D\u3057\u3066\u5EA7\u308B", archive: "scene", slot: "ground" },
|
|
560518
|
+
{ en: "SitAndDangleLegs", ja: "\u5EA7\u3063\u3066\u8DB3\u3092\u3076\u3089\u3076\u3089\u3055\u305B\u308B", archive: "scene", slot: "ground" },
|
|
560519
|
+
{ en: "Sprawl", ja: "\u5BDD\u305D\u3079\u308B", archive: "scene", slot: "ground", note: "\u5B66\u4E60\u8005\u6CA1\u52B2\u2192\u8EBA\u5E73(\u4F34\u5B66\u4E8B\u4EF6)" },
|
|
560520
|
+
{ en: "Creep", ja: "\u305A\u308A\u305A\u308A", archive: "scene", slot: "ground" },
|
|
560521
|
+
{ en: "WalkAlongWorkAreaFloor", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u3092\u6B69\u304F", archive: "scene", slot: "ground" },
|
|
560522
|
+
{ en: "RunAlongWorkAreaFloor", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u3092\u8D70\u308B", archive: "scene", slot: "ground" },
|
|
560523
|
+
{ en: "CrawlAlongWorkAreaFloor", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u3067\u305A\u308A\u305A\u308A", archive: "scene", slot: "ground" },
|
|
560524
|
+
{ en: "WalkLeftAlongFloorAndSit", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u306E\u5DE6\u306E\u7AEF\u3063\u3053\u3067\u5EA7\u308B", archive: "scene", slot: "ground" },
|
|
560525
|
+
{ en: "WalkRightAlongFloorAndSit", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u306E\u53F3\u306E\u7AEF\u3063\u3053\u3067\u5EA7\u308B", archive: "scene", slot: "ground" },
|
|
560526
|
+
{ en: "WalkLeftAndSit", ja: "\u8D70\u3063\u3066\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u306E\u5DE6\u306E\u7AEF\u3063\u3053\u3067\u5EA7\u308B", archive: "scene", slot: "ground" },
|
|
560527
|
+
{ en: "WalkRightAndSit", ja: "\u8D70\u3063\u3066\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u306E\u53F3\u306E\u7AEF\u3063\u3053\u3067\u5EA7\u308B", archive: "scene", slot: "ground" },
|
|
560528
|
+
// ── 交互系(scene·interact/celebrate/tired) ──
|
|
560529
|
+
{ en: "Fall", ja: "\u843D\u4E0B\u3059\u308B", archive: "scene", slot: "interact" },
|
|
560530
|
+
{ en: "Falling", ja: "\u843D\u3061\u308B", archive: "scene", slot: "interact" },
|
|
560531
|
+
{ en: "Dragged", ja: "\u30C9\u30E9\u30C3\u30B0\u3055\u308C\u308B", archive: "scene", slot: "interact" },
|
|
560532
|
+
{ en: "Thrown", ja: "\u6295\u3052\u3089\u308C\u308B", archive: "scene", slot: "interact" },
|
|
560533
|
+
{ en: "Resisting", ja: "\u62B5\u6297\u3059\u308B", archive: "scene", slot: "interact" },
|
|
560534
|
+
{ en: "Pinched", ja: "\u3064\u307E\u307E\u308C\u308B", archive: "scene", slot: "interact" },
|
|
560535
|
+
{ en: "Bouncing", ja: "\u8DF3\u306D\u308B", archive: "scene", slot: "celebrate" },
|
|
560536
|
+
{ en: "Jumping", ja: "\u30B8\u30E3\u30F3\u30D7", archive: "scene", slot: "celebrate" },
|
|
560537
|
+
{ en: "Tripping", ja: "\u8EE2\u3076", archive: "scene", slot: "interact", note: "\u7403\u649E\u53CD\u5E94\u5E27" },
|
|
560538
|
+
// ── 墙壁系(scene·wall,二期) ──
|
|
560539
|
+
{ en: "GrabWall", ja: "\u58C1\u306B\u63B4\u307E\u308B", archive: "scene", slot: "wall" },
|
|
560540
|
+
{ en: "ClimbWall", ja: "\u58C1\u3092\u767B\u308B", archive: "scene", slot: "wall" },
|
|
560541
|
+
{ en: "ClimbHalfwayAlongWall", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u58C1\u3092\u9014\u4E2D\u307E\u3067\u767B\u308B", archive: "scene", slot: "wall" },
|
|
560542
|
+
{ en: "ClimbAlongWall", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u58C1\u3092\u767B\u308B", archive: "scene", slot: "wall" },
|
|
560543
|
+
{ en: "FallFromWall", ja: "\u58C1\u304B\u3089\u843D\u3061\u308B", archive: "scene", slot: "wall" },
|
|
560544
|
+
{ en: "GrabWorkAreaBottomLeftWall", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u304B\u3089\u5DE6\u306E\u58C1\u306B\u3088\u3058\u306E\u307C\u308B", archive: "scene", slot: "wall" },
|
|
560545
|
+
{ en: "GrabWorkAreaBottomRightWall", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u304B\u3089\u53F3\u306E\u58C1\u306B\u3088\u3058\u306E\u307C\u308B", archive: "scene", slot: "wall" },
|
|
560546
|
+
{ en: "WalkAndGrabBottomLeftWall", ja: "\u8D70\u3063\u3066\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u304B\u3089\u5DE6\u306E\u58C1\u306B\u3088\u3058\u306E\u307C\u308B", archive: "scene", slot: "wall" },
|
|
560547
|
+
{ en: "WalkAndGrabBottomRightWall", ja: "\u8D70\u3063\u3066\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0B\u8FBA\u304B\u3089\u53F3\u306E\u58C1\u306B\u3088\u3058\u306E\u307C\u308B", archive: "scene", slot: "wall" },
|
|
560548
|
+
{ en: "HoldOntoWall", ja: "\u58C1\u306B\u63B4\u307E\u3063\u3066\u30DC\u30FC\u3063\u3068\u3059\u308B", archive: "scene", slot: "wall" },
|
|
560549
|
+
{ en: "JumpFromLeftWall", ja: "\u5DE6\u306E\u58C1\u306B\u98DB\u3073\u3064\u304F", archive: "scene", slot: "wall" },
|
|
560550
|
+
{ en: "JumpFromRightWall", ja: "\u53F3\u306E\u58C1\u306B\u98DB\u3073\u3064\u304F", archive: "scene", slot: "wall" },
|
|
560551
|
+
// ── 天花板系(scene·ceiling,二期) ──
|
|
560552
|
+
{ en: "GrabCeiling", ja: "\u5929\u4E95\u306B\u63B4\u307E\u308B", archive: "scene", slot: "ceiling" },
|
|
560553
|
+
{ en: "ClimbCeiling", ja: "\u5929\u4E95\u3092\u4F1D\u3046", archive: "scene", slot: "ceiling" },
|
|
560554
|
+
{ en: "HoldOntoCeiling", ja: "\u5929\u4E95\u306B\u63B4\u307E\u3063\u3066\u30DC\u30FC\u3063\u3068\u3059\u308B", archive: "scene", slot: "ceiling" },
|
|
560555
|
+
{ en: "FallFromCeiling", ja: "\u5929\u4E95\u304B\u3089\u843D\u3061\u308B", archive: "scene", slot: "ceiling" },
|
|
560556
|
+
{ en: "ClimbAlongCeiling", ja: "\u30EF\u30FC\u30AF\u30A8\u30EA\u30A2\u306E\u4E0A\u8FBA\u3092\u4F1D\u3046", archive: "scene", slot: "ceiling" },
|
|
560557
|
+
// ── 鼠标系(scene·mouse,二期) ──
|
|
560558
|
+
{ en: "ChaseMouse", ja: "\u30DE\u30A6\u30B9\u306E\u5468\u308A\u306B\u96C6\u307E\u308B", archive: "scene", slot: "mouse" },
|
|
560559
|
+
{ en: "SitAndLookAtMouse", ja: "\u5EA7\u3063\u3066\u30DE\u30A6\u30B9\u306E\u307B\u3046\u3092\u898B\u308B", archive: "scene", slot: "mouse" },
|
|
560560
|
+
{ en: "SitAndFaceMouse", ja: "\u5EA7\u3063\u3066\u30DE\u30A6\u30B9\u306E\u307B\u3046\u3092\u898B\u3066\u305F\u3089\u9996\u304C\u56DE\u3063\u305F", archive: "scene", slot: "mouse" },
|
|
560561
|
+
// ── 花活(fx:播动画,无位移语义) ──
|
|
560562
|
+
{ en: "SplitIntoTwo", ja: "\u5206\u88C2\u3059\u308B", archive: "fx", note: "\u64AD\u52A8\u753B\u4E0D\u751F\u6210\u7B2C\u4E8C\u53EA(\u5355\u751F\u7269\u8BBE\u5B9A)" },
|
|
560563
|
+
{ en: "Divided", ja: "\u5206\u88C2\u3057\u305F", archive: "fx" },
|
|
560564
|
+
{ en: "PullUpShimeji", ja: "\u5F15\u3063\u3053\u629C\u304F", archive: "fx" },
|
|
560565
|
+
{ en: "PullUpShimeji1", ja: "\u5F15\u3063\u3053\u629C\u304F1", archive: "fx" },
|
|
560566
|
+
{ en: "PullUpShimeji2", ja: "\u5F15\u3063\u3053\u629C\u304F2", archive: "fx" },
|
|
560567
|
+
{ en: "PullUp", ja: "\u5F15\u3063\u3053\u629C\u304B\u308C\u308B", archive: "fx" },
|
|
560568
|
+
{ en: "Look", ja: "\u632F\u308A\u5411\u304F", archive: "fx", note: "\u671D\u5411\u5207\u6362\u5185\u90E8\u7528" },
|
|
560569
|
+
{ en: "StandUp", ja: "\u7ACB\u3063\u3066\u30DC\u30FC\u3063\u3068\u3059\u308B", archive: "fx" },
|
|
560570
|
+
{ en: "LieDown", ja: "\u5BDD\u305D\u3079\u3063\u3066\u30DC\u30FC\u3063\u3068\u3059\u308B", archive: "fx", slot: "tired" },
|
|
560571
|
+
{ en: "SitWhileDanglingLegs", ja: "\u5EA7\u3063\u3066\u8DB3\u3092\u3076\u3089\u3076\u3089\u3055\u305B\u308B(\u8907\u5408)", archive: "fx" },
|
|
560572
|
+
{ en: "Bouncing-", ja: "\u8DF3\u306D\u308B(\u8907\u5408)", archive: "fx" },
|
|
560573
|
+
// ── IE/窗口系列(scene·panel,三期;宿主=页面面板) ──
|
|
560574
|
+
{ en: "WalkAlongIECeiling", ja: "IE\u306E\u5929\u4E95\u3092\u6B69\u304F", archive: "scene", slot: "panel" },
|
|
560575
|
+
{ en: "RunAlongIECeiling", ja: "IE\u306E\u5929\u4E95\u3092\u8D70\u308B", archive: "scene", slot: "panel" },
|
|
560576
|
+
{ en: "CrawlAlongIECeiling", ja: "IE\u306E\u5929\u4E95\u3067\u305A\u308A\u305A\u308A", archive: "scene", slot: "panel" },
|
|
560577
|
+
{ en: "SitOnTheLeftEdgeOfIE", ja: "IE\u306E\u5929\u4E95\u306E\u5DE6\u306E\u7AEF\u3063\u3053\u3067\u5EA7\u308B", archive: "scene", slot: "panel" },
|
|
560578
|
+
{ en: "SitOnTheRightEdgeOfIE", ja: "IE\u306E\u5929\u4E95\u306E\u53F3\u306E\u7AEF\u3063\u3053\u3067\u5EA7\u308B", archive: "scene", slot: "panel" },
|
|
560579
|
+
{ en: "JumpFromLeftEdgeOfIE", ja: "IE\u306E\u5929\u4E95\u306E\u5DE6\u306E\u7AEF\u3063\u3053\u304B\u3089\u98DB\u3073\u964D\u308A\u308B", archive: "scene", slot: "panel" },
|
|
560580
|
+
{ en: "JumpFromRightEdgeOfIE", ja: "IE\u306E\u5929\u4E95\u306E\u53F3\u306E\u7AEF\u3063\u3053\u304B\u3089\u98DB\u3073\u964D\u308A\u308B", archive: "scene", slot: "panel" },
|
|
560581
|
+
{ en: "WalkLeftAlongIEAndSit", ja: "\u8D70\u3063\u3066IE\u306E\u5929\u4E95\u306E\u5DE6\u306E\u7AEF\u3063\u3053\u3067\u5EA7\u308B", archive: "scene", slot: "panel" },
|
|
560582
|
+
{ en: "WalkRightAlongIEAndSit", ja: "\u8D70\u3063\u3066IE\u306E\u5929\u4E95\u306E\u53F3\u306E\u7AEF\u3063\u3053\u3067\u5EA7\u308B", archive: "scene", slot: "panel" },
|
|
560583
|
+
{ en: "WalkLeftAlongIEAndJump", ja: "\u8D70\u3063\u3066IE\u306E\u5929\u4E95\u306E\u5DE6\u306E\u7AEF\u3063\u3053\u304B\u3089\u98DB\u3073\u964D\u308A\u308B", archive: "scene", slot: "panel" },
|
|
560584
|
+
{ en: "WalkRightAlongIEAndJump", ja: "\u8D70\u3063\u3066IE\u306E\u5929\u4E95\u306E\u53F3\u306E\u7AEF\u3063\u3053\u304B\u3089\u98DB\u3073\u964D\u308A\u308B", archive: "scene", slot: "panel" },
|
|
560585
|
+
{ en: "DashIeCeilingLeftEdgeFromJump", ja: "\u731B\u30C0\u30C3\u30B7\u30E5\u3067IE\u306E\u5929\u4E95\u306E\u5DE6\u306E\u7AEF\u3063\u3053\u304B\u3089\u98DB\u3073\u964D\u308A\u308B", archive: "scene", slot: "panel" },
|
|
560586
|
+
{ en: "DashIeCeilingRightEdgeFromJump", ja: "\u731B\u30C0\u30C3\u30B7\u30E5\u3067IE\u306E\u5929\u4E95\u306E\u53F3\u306E\u7AEF\u3063\u3053\u304B\u3089\u98DB\u3073\u964D\u308A\u308B", archive: "scene", slot: "panel" },
|
|
560587
|
+
{ en: "HoldOntoIEWall", ja: "IE\u306E\u58C1\u3092\u9014\u4E2D\u307E\u3067\u767B\u308B", archive: "scene", slot: "panel" },
|
|
560588
|
+
{ en: "ClimbIEWall", ja: "IE\u306E\u58C1\u3092\u767B\u308B", archive: "scene", slot: "panel" },
|
|
560589
|
+
{ en: "ClimbIEBottom", ja: "IE\u306E\u4E0B\u8FBA\u3092\u4F1D\u3046", archive: "scene", slot: "panel" },
|
|
560590
|
+
{ en: "GrabIEBottomLeftWall", ja: "IE\u306E\u4E0B\u8FBA\u304B\u3089\u5DE6\u306E\u58C1\u306B\u3088\u3058\u306E\u307C\u308B", archive: "scene", slot: "panel" },
|
|
560591
|
+
{ en: "GrabIEBottomRightWall", ja: "IE\u306E\u4E0B\u8FBA\u304B\u3089\u53F3\u306E\u58C1\u306B\u3088\u3058\u306E\u307C\u308B", archive: "scene", slot: "panel" },
|
|
560592
|
+
{ en: "JumpOnIELeftWall", ja: "IE\u306E\u5DE6\u306B\u98DB\u3073\u3064\u304F", archive: "scene", slot: "panel" },
|
|
560593
|
+
{ en: "JumpOnIERightWall", ja: "IE\u306E\u53F3\u306B\u98DB\u3073\u3064\u304F", archive: "scene", slot: "panel" },
|
|
560594
|
+
{ en: "JumpFromBottomOfIE", ja: "IE\u306E\u4E0B\u306B\u98DB\u3073\u3064\u304F", archive: "scene", slot: "panel" },
|
|
560595
|
+
{ en: "ThrowIEFromLeft", ja: "IE\u3092\u5DE6\u306B\u6295\u3052\u308B", archive: "skip", note: "\u6254\u7A97\u53E3\u65E0\u5BF9\u5E94\u5BBF\u4E3B\u884C\u4E3A" },
|
|
560596
|
+
{ en: "ThrowIEFromRight", ja: "IE\u3092\u53F3\u306B\u6295\u3052\u308B", archive: "skip", note: "\u6254\u7A97\u53E3\u65E0\u5BF9\u5E94\u5BBF\u4E3B\u884C\u4E3A" },
|
|
560597
|
+
{ en: "WalkAndThrowIEFromLeft", ja: "\u8D70\u3063\u3066IE\u3092\u5DE6\u306B\u6295\u3052\u308B", archive: "skip", note: "\u6254\u7A97\u53E3\u65E0\u5BF9\u5E94\u5BBF\u4E3B\u884C\u4E3A" },
|
|
560598
|
+
{ en: "WalkAndThrowIEFromRight", ja: "\u8D70\u3063\u3066IE\u3092\u53F3\u306B\u6295\u3052\u308B", archive: "skip", note: "\u6254\u7A97\u53E3\u65E0\u5BF9\u5E94\u5BBF\u4E3B\u884C\u4E3A" },
|
|
560599
|
+
{ en: "FallWithIe", ja: "IE\u3092\u6301\u3063\u3066\u843D\u3061\u308B", archive: "skip", note: "IE \u4E13\u5C5E\u5185\u7F6E\u52A8\u4F5C" },
|
|
560600
|
+
{ en: "SitDown", ja: "\u5EA7\u3063\u3066\u30DC\u30FC\u3063\u3068\u3059\u308B", archive: "scene", slot: "ground" },
|
|
560601
|
+
{ en: "SitAndSpinHeadAction", ja: "\u5EA7\u3063\u3066\u9996\u304C\u56DE\u308B", archive: "fx" },
|
|
560602
|
+
{ en: "SitAndSpinHead", ja: "\u5EA7\u3063\u3066\u30DE\u30A6\u30B9\u306E\u307B\u3046\u3092\u898B\u3066\u305F\u3089\u9996\u304C\u56DE\u3063\u305F", archive: "scene", slot: "mouse" },
|
|
560603
|
+
{ en: "Divide1", ja: "\u5206\u88C21", archive: "fx" },
|
|
560604
|
+
{ en: "WalkWithIe", ja: "IE\u3092\u6301\u3063\u3066\u6B69\u304F", archive: "skip", note: "IE \u4E13\u5C5E\u5185\u7F6E\u52A8\u4F5C" },
|
|
560605
|
+
{ en: "RunWithIe", ja: "IE\u3092\u6301\u3063\u3066\u8D70\u308B", archive: "skip", note: "IE \u4E13\u5C5E\u5185\u7F6E\u52A8\u4F5C" },
|
|
560606
|
+
{ en: "ThrowIe", ja: "IE\u3092\u6295\u3052\u308B", archive: "skip", note: "IE \u4E13\u5C5E\u5185\u7F6E\u52A8\u4F5C" },
|
|
560607
|
+
// ── 内置辅助(解析层内部,不上映射) ──
|
|
560608
|
+
{ en: "SitAndLookUpAtMouse", ja: "\u5EA7\u3063\u3066\u30DE\u30A6\u30B9\u3092\u898B\u4E0A\u3052\u308B", archive: "scene", slot: "mouse" },
|
|
560609
|
+
{ en: "DangleLegs", ja: "\u8DB3\u3092\u3076\u3089\u3076\u3089\u3055\u305B\u308B", archive: "fx" },
|
|
560610
|
+
{ en: "Offset", ja: "\u5909\u4F4D", archive: "fx", note: "\u4F4D\u79FB\u52A8\u4F5C\u5185\u90E8\u7528" }
|
|
560611
|
+
];
|
|
560612
|
+
function archiveOf(actionName) {
|
|
560613
|
+
const hit = ACTION_ARCHIVE.find((e) => e.en === actionName || e.ja === actionName);
|
|
560614
|
+
if (hit)
|
|
560615
|
+
return { entry: hit, archive: hit.archive, ...hit.slot ? { slot: hit.slot } : {} };
|
|
560616
|
+
return { entry: null, archive: "fx" };
|
|
560617
|
+
}
|
|
560618
|
+
|
|
560619
|
+
// src/main/services/shimeji/shimeji-pack-service.ts
|
|
560620
|
+
function getSetting(db, key2) {
|
|
560621
|
+
return db.select().from(settings).where(eq(settings.key, key2)).get()?.value ?? null;
|
|
560622
|
+
}
|
|
560623
|
+
function setSetting(db, key2, value) {
|
|
560624
|
+
const existing = db.select().from(settings).where(eq(settings.key, key2)).get();
|
|
560625
|
+
if (existing)
|
|
560626
|
+
db.update(settings).set({ value }).where(eq(settings.key, key2)).run();
|
|
560627
|
+
else
|
|
560628
|
+
db.insert(settings).values({ key: key2, value }).run();
|
|
560629
|
+
}
|
|
560630
|
+
function packsRoot(dataDir) {
|
|
560631
|
+
return (0, import_node_path13.join)(dataDir, "shimeji-packs");
|
|
560632
|
+
}
|
|
560633
|
+
function stagingRoot(dataDir) {
|
|
560634
|
+
return (0, import_node_path13.join)(packsRoot(dataDir), ".staging");
|
|
560635
|
+
}
|
|
560636
|
+
async function readJson(path6) {
|
|
560637
|
+
try {
|
|
560638
|
+
return JSON.parse(await (0, import_promises6.readFile)(path6, "utf8"));
|
|
560639
|
+
} catch {
|
|
560640
|
+
return null;
|
|
560641
|
+
}
|
|
560642
|
+
}
|
|
560643
|
+
function discoverCharacters(files) {
|
|
560644
|
+
const out = [];
|
|
560645
|
+
const confPaths = Object.keys(files).filter((p) => /(^|\/)conf\/[Aa]ctions\.xml$/.test(p));
|
|
560646
|
+
for (const actionsPath of confPaths) {
|
|
560647
|
+
const confDir = actionsPath.replace(/conf\/[Aa]ctions\.xml$/, "").replace(/\/$/, "");
|
|
560648
|
+
const selfImg = confDir ? `${confDir}/img` : "img";
|
|
560649
|
+
const hasSelfImg = Object.keys(files).some((p) => {
|
|
560650
|
+
if (!p.startsWith(`${selfImg}/`) || !p.endsWith(".png"))
|
|
560651
|
+
return false;
|
|
560652
|
+
const rest = p.slice(selfImg.length + 1);
|
|
560653
|
+
if (rest.includes("/"))
|
|
560654
|
+
return false;
|
|
560655
|
+
return rest.toLowerCase() !== "icon.png";
|
|
560656
|
+
});
|
|
560657
|
+
if (hasSelfImg) {
|
|
560658
|
+
out.push({
|
|
560659
|
+
confDir,
|
|
560660
|
+
imgPrefix: selfImg,
|
|
560661
|
+
name: confDir.split("/").pop() ?? "Shimeji",
|
|
560662
|
+
actionsPath
|
|
560663
|
+
});
|
|
560664
|
+
continue;
|
|
560665
|
+
}
|
|
560666
|
+
const imgBase = confDir ? `${confDir}/img` : "img";
|
|
560667
|
+
const breeds = /* @__PURE__ */ new Set();
|
|
560668
|
+
for (const p of Object.keys(files)) {
|
|
560669
|
+
if (!p.startsWith(`${imgBase}/`) || !p.endsWith(".png"))
|
|
560670
|
+
continue;
|
|
560671
|
+
const rest = p.slice(imgBase.length + 1);
|
|
560672
|
+
const breed = rest.includes("/") ? rest.split("/")[0] : "";
|
|
560673
|
+
if (breed)
|
|
560674
|
+
breeds.add(breed);
|
|
560675
|
+
}
|
|
560676
|
+
for (const breed of [...breeds].sort()) {
|
|
560677
|
+
out.push({ confDir, imgPrefix: `${imgBase}/${breed}`, name: breed, actionsPath });
|
|
560678
|
+
}
|
|
560679
|
+
}
|
|
560680
|
+
return out;
|
|
560681
|
+
}
|
|
560682
|
+
function detectFormat(actionsXmlPath, xml) {
|
|
560683
|
+
const base = actionsXmlPath.split("/").pop() ?? "";
|
|
560684
|
+
if (base === "Actions.xml" && xml.includes("\u30DE\u30B9\u30B3\u30C3\u30C8"))
|
|
560685
|
+
return "\u539F\u7248";
|
|
560686
|
+
if (xml.includes("<Mascot"))
|
|
560687
|
+
return "ee";
|
|
560688
|
+
return xml.includes("\u52D5\u4F5C") ? "\u539F\u7248" : "ee";
|
|
560689
|
+
}
|
|
560690
|
+
async function importShimejiZip(db, dataDir, zipBase64) {
|
|
560691
|
+
const zipBuf = Buffer.from(zipBase64, "base64");
|
|
560692
|
+
const entries3 = unzipSync(new Uint8Array(zipBuf));
|
|
560693
|
+
const files = {};
|
|
560694
|
+
for (const [path6, data] of Object.entries(entries3)) {
|
|
560695
|
+
if (!path6.startsWith("__MACOSX") && !path6.endsWith("/"))
|
|
560696
|
+
files[path6.replace(/\\/g, "/")] = data;
|
|
560697
|
+
}
|
|
560698
|
+
const chars2 = discoverCharacters(files);
|
|
560699
|
+
if (chars2.length === 0)
|
|
560700
|
+
throw new Error("\u672A\u627E\u5230 Shimeji \u89D2\u8272\u76EE\u5F55(\u9700\u542B conf/Actions.xml \u4E0E img/)");
|
|
560701
|
+
const importId = (0, import_node_crypto15.randomUUID)().slice(0, 8);
|
|
560702
|
+
const stagingDir = (0, import_node_path13.join)(stagingRoot(dataDir), importId);
|
|
560703
|
+
await (0, import_promises6.mkdir)(stagingDir, { recursive: true });
|
|
560704
|
+
for (const [path6, data] of Object.entries(files)) {
|
|
560705
|
+
const target = (0, import_node_path13.join)(stagingDir, path6);
|
|
560706
|
+
await (0, import_promises6.mkdir)((0, import_node_path13.dirname)(target), { recursive: true });
|
|
560707
|
+
await (0, import_promises6.writeFile)(target, data);
|
|
560708
|
+
}
|
|
560709
|
+
const characters = chars2.map((c) => {
|
|
560710
|
+
const xml = new TextDecoder().decode(files[c.actionsPath]);
|
|
560711
|
+
const actions = parseShimejiActions(xml);
|
|
560712
|
+
const frames = Object.keys(files).filter((p) => p.startsWith(`${c.imgPrefix}/`) && p.endsWith(".png") && !p.toLowerCase().endsWith("icon.png"));
|
|
560713
|
+
const iconPath = `${c.imgPrefix}/icon.png`;
|
|
560714
|
+
return {
|
|
560715
|
+
ref: c.imgPrefix,
|
|
560716
|
+
name: c.name,
|
|
560717
|
+
iconBase64: files[iconPath] ? Buffer.from(files[iconPath]).toString("base64") : null,
|
|
560718
|
+
frameCount: frames.length,
|
|
560719
|
+
actionCount: actions.length,
|
|
560720
|
+
format: detectFormat(c.actionsPath, xml)
|
|
560721
|
+
};
|
|
560722
|
+
});
|
|
560723
|
+
return { importId, characters };
|
|
560724
|
+
}
|
|
560725
|
+
async function confirmShimejiImport(_db2, dataDir, importId, characterRefs) {
|
|
560726
|
+
const stagingDir = (0, import_node_path13.join)(stagingRoot(dataDir), importId);
|
|
560727
|
+
if (!(0, import_node_fs12.existsSync)(stagingDir))
|
|
560728
|
+
throw new Error(`\u5BFC\u5165\u4F1A\u8BDD\u4E0D\u5B58\u5728\u6216\u5DF2\u8FC7\u671F: ${importId}`);
|
|
560729
|
+
const created = [];
|
|
560730
|
+
for (const ref of characterRefs) {
|
|
560731
|
+
const srcImgDir = (0, import_node_path13.join)(stagingDir, ref);
|
|
560732
|
+
if (!(0, import_node_fs12.existsSync)(srcImgDir))
|
|
560733
|
+
continue;
|
|
560734
|
+
const name19 = ref.split("/").pop() ?? ref;
|
|
560735
|
+
const confDir = /\/img(\/[^/]+)?$/.test(ref) ? ref.replace(/\/img(\/[^/]+)?$/, "") : "";
|
|
560736
|
+
const actionsPath = ["Actions.xml", "actions.xml"].map((f) => (0, import_node_path13.join)(stagingDir, confDir, "conf", f)).find((p) => (0, import_node_fs12.existsSync)(p));
|
|
560737
|
+
const xml = await (0, import_promises6.readFile)(actionsPath, "utf8");
|
|
560738
|
+
const format = detectFormat(actionsPath, xml);
|
|
560739
|
+
const actions = parseShimejiActions(xml).map((a) => ({ ...a, slot: archiveOf(a.name).slot }));
|
|
560740
|
+
const behPath = ["Behavior.xml", "behaviors.xml"].map((f) => (0, import_node_path13.join)(stagingDir, confDir, "conf", f)).find((p) => (0, import_node_fs12.existsSync)(p));
|
|
560741
|
+
const behaviors = behPath ? parseShimejiBehaviors(await (0, import_promises6.readFile)(behPath, "utf8")) : [];
|
|
560742
|
+
const packId = `shimeji-${(0, import_node_crypto15.randomUUID)().slice(0, 8)}`;
|
|
560743
|
+
const packDir = (0, import_node_path13.join)(packsRoot(dataDir), packId);
|
|
560744
|
+
await (0, import_promises6.mkdir)(packDir, { recursive: true });
|
|
560745
|
+
await (0, import_promises6.cp)(srcImgDir, (0, import_node_path13.join)(packDir, "img"), { recursive: true });
|
|
560746
|
+
const imgFiles = (await (0, import_promises6.readdir)((0, import_node_path13.join)(packDir, "img"))).filter((f) => f.endsWith(".png") && !f.toLowerCase().endsWith("icon.png"));
|
|
560747
|
+
const manifest = {
|
|
560748
|
+
id: packId,
|
|
560749
|
+
name: name19,
|
|
560750
|
+
format,
|
|
560751
|
+
frames: imgFiles,
|
|
560752
|
+
actions,
|
|
560753
|
+
behaviors,
|
|
560754
|
+
archiveVersion: 1,
|
|
560755
|
+
importedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
560756
|
+
};
|
|
560757
|
+
await (0, import_promises6.writeFile)((0, import_node_path13.join)(packDir, "manifest.json"), JSON.stringify(manifest));
|
|
560758
|
+
created.push({
|
|
560759
|
+
id: packId,
|
|
560760
|
+
name: name19,
|
|
560761
|
+
format,
|
|
560762
|
+
frameCount: imgFiles.length,
|
|
560763
|
+
actionCount: actions.length,
|
|
560764
|
+
iconBase64: (0, import_node_fs12.existsSync)((0, import_node_path13.join)(packDir, "img", "icon.png")) ? (await (0, import_promises6.readFile)((0, import_node_path13.join)(packDir, "img", "icon.png"))).toString("base64") : null,
|
|
560765
|
+
active: false
|
|
560766
|
+
});
|
|
560767
|
+
}
|
|
560768
|
+
await (0, import_promises6.rm)(stagingDir, { recursive: true, force: true });
|
|
560769
|
+
return created;
|
|
560770
|
+
}
|
|
560771
|
+
async function getShimejiPack(_db2, dataDir, packId) {
|
|
560772
|
+
if (!/^shimeji-[0-9a-f]{8}$/.test(packId))
|
|
560773
|
+
return null;
|
|
560774
|
+
return readJson((0, import_node_path13.join)(packsRoot(dataDir), packId, "manifest.json"));
|
|
560775
|
+
}
|
|
560776
|
+
async function listShimejiPacks(db, dataDir) {
|
|
560777
|
+
const root = packsRoot(dataDir);
|
|
560778
|
+
if (!(0, import_node_fs12.existsSync)(root))
|
|
560779
|
+
return [];
|
|
560780
|
+
const activeId = db ? getSetting(db, "shimeji_active_pack") ?? null : null;
|
|
560781
|
+
const out = [];
|
|
560782
|
+
for (const dir of (await (0, import_promises6.readdir)(root, { withFileTypes: true })).filter((d) => d.isDirectory() && !d.name.startsWith("."))) {
|
|
560783
|
+
const manifest = await readJson((0, import_node_path13.join)(root, dir.name, "manifest.json"));
|
|
560784
|
+
if (!manifest)
|
|
560785
|
+
continue;
|
|
560786
|
+
let iconBase64 = null;
|
|
560787
|
+
try {
|
|
560788
|
+
iconBase64 = (await (0, import_promises6.readFile)((0, import_node_path13.join)(root, dir.name, "img", "icon.png"))).toString("base64");
|
|
560789
|
+
} catch {
|
|
560790
|
+
}
|
|
560791
|
+
out.push({
|
|
560792
|
+
id: manifest.id,
|
|
560793
|
+
name: manifest.name,
|
|
560794
|
+
format: manifest.format,
|
|
560795
|
+
frameCount: manifest.frames.length,
|
|
560796
|
+
actionCount: manifest.actions.length,
|
|
560797
|
+
iconBase64,
|
|
560798
|
+
active: manifest.id === activeId,
|
|
560799
|
+
vehicle: manifest.vehicle
|
|
560800
|
+
});
|
|
560801
|
+
}
|
|
560802
|
+
return out;
|
|
560803
|
+
}
|
|
560804
|
+
async function activateShimejiPack(db, packId) {
|
|
560805
|
+
setSetting(db, "shimeji_active_pack", packId);
|
|
560806
|
+
}
|
|
560807
|
+
var VEH_WHITELIST = /* @__PURE__ */ new Set(["silver", "ember", "frost", "moss", "astro", "ink"]);
|
|
560808
|
+
async function setVehicleShimeji(db, dataDir, packId, vehicle) {
|
|
560809
|
+
if (!/^shimeji-[0-9a-f]{8}$/.test(packId))
|
|
560810
|
+
return { ok: false };
|
|
560811
|
+
if (!VEH_WHITELIST.has(vehicle))
|
|
560812
|
+
return { ok: false };
|
|
560813
|
+
const file2 = (0, import_node_path13.join)(packsRoot(dataDir), packId, "manifest.json");
|
|
560814
|
+
const manifest = await readJson(file2);
|
|
560815
|
+
if (!manifest)
|
|
560816
|
+
return { ok: false };
|
|
560817
|
+
manifest.vehicle = vehicle;
|
|
560818
|
+
await (0, import_promises6.writeFile)(file2, JSON.stringify(manifest));
|
|
560819
|
+
return { ok: true };
|
|
560820
|
+
}
|
|
560821
|
+
async function deleteShimejiPack(db, dataDir, packId) {
|
|
560822
|
+
if (!/^shimeji-[0-9a-f]{8}$/.test(packId))
|
|
560823
|
+
return;
|
|
560824
|
+
if ((getSetting(db, "shimeji_active_pack") ?? null) === packId)
|
|
560825
|
+
db.delete(settings).where(eq(settings.key, "shimeji_active_pack")).run();
|
|
560826
|
+
await (0, import_promises6.rm)((0, import_node_path13.join)(packsRoot(dataDir), packId), { recursive: true, force: true });
|
|
560827
|
+
}
|
|
560828
|
+
async function getActiveShimejiPack(db, dataDir) {
|
|
560829
|
+
const activeId = getSetting(db, "shimeji_active_pack") ?? null;
|
|
560830
|
+
if (!activeId)
|
|
560831
|
+
return null;
|
|
560832
|
+
return getShimejiPack(db, dataDir, activeId);
|
|
560833
|
+
}
|
|
560834
|
+
async function getShimejiFrameDataUrl(_db2, dataDir, packId, frame) {
|
|
560835
|
+
if (!/^shimeji-[0-9a-f]{8}$/.test(packId))
|
|
560836
|
+
return null;
|
|
560837
|
+
if (!/^[\w.-]+\.png$/i.test(frame))
|
|
560838
|
+
return null;
|
|
560839
|
+
try {
|
|
560840
|
+
const buf = await (0, import_promises6.readFile)((0, import_node_path13.join)(packsRoot(dataDir), packId, "img", frame));
|
|
560841
|
+
return `data:image/png;base64,${buf.toString("base64")}`;
|
|
560842
|
+
} catch {
|
|
560843
|
+
return null;
|
|
560844
|
+
}
|
|
560845
|
+
}
|
|
560846
|
+
|
|
560399
560847
|
// src/main/services/progress-service.ts
|
|
560400
560848
|
init_drizzle_orm();
|
|
560401
560849
|
init_schema();
|
|
@@ -560580,7 +561028,7 @@ function findLessonForPractice(db, practiceNodeId) {
|
|
|
560580
561028
|
init_drizzle_orm();
|
|
560581
561029
|
init_schema();
|
|
560582
561030
|
init_schema();
|
|
560583
|
-
var
|
|
561031
|
+
var import_node_crypto16 = require("node:crypto");
|
|
560584
561032
|
|
|
560585
561033
|
// src/main/services/pure/frontmatter.ts
|
|
560586
561034
|
var FRONTMATTER = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
@@ -560689,7 +561137,7 @@ function getSoul(db, name19) {
|
|
|
560689
561137
|
return row ? mapRow2(row) : null;
|
|
560690
561138
|
}
|
|
560691
561139
|
function createSoul(db, input) {
|
|
560692
|
-
const id = (0,
|
|
561140
|
+
const id = (0, import_node_crypto16.randomUUID)();
|
|
560693
561141
|
db.insert(souls).values({
|
|
560694
561142
|
id,
|
|
560695
561143
|
name: input.name,
|
|
@@ -560724,7 +561172,7 @@ function seedBuiltinSouls(db) {
|
|
|
560724
561172
|
continue;
|
|
560725
561173
|
const parsed = parseFrontmatter(file2.raw);
|
|
560726
561174
|
db.insert(souls).values({
|
|
560727
|
-
id: (0,
|
|
561175
|
+
id: (0, import_node_crypto16.randomUUID)(),
|
|
560728
561176
|
name: file2.slug,
|
|
560729
561177
|
description: parsed.description,
|
|
560730
561178
|
type: "builtin",
|
|
@@ -561242,7 +561690,7 @@ init_schema();
|
|
|
561242
561690
|
|
|
561243
561691
|
// src/main/services/pure/friction-context.ts
|
|
561244
561692
|
init_drizzle_orm();
|
|
561245
|
-
var
|
|
561693
|
+
var import_node_crypto18 = require("node:crypto");
|
|
561246
561694
|
init_schema();
|
|
561247
561695
|
var CATEGORY_LABEL = {
|
|
561248
561696
|
confused: "\u7CCA\u6D82",
|
|
@@ -561250,7 +561698,7 @@ var CATEGORY_LABEL = {
|
|
|
561250
561698
|
frustrated: "\u53D7\u632B"
|
|
561251
561699
|
};
|
|
561252
561700
|
function insertFrictionDb(db, nodeId, category, summary) {
|
|
561253
|
-
db.insert(frictionLog).values({ id: (0,
|
|
561701
|
+
db.insert(frictionLog).values({ id: (0, import_node_crypto18.randomUUID)(), nodeId, category, summary }).run();
|
|
561254
561702
|
}
|
|
561255
561703
|
function buildFrictionContext(db, nodeId) {
|
|
561256
561704
|
const rows = db.select().from(frictionLog).where(
|
|
@@ -561408,12 +561856,12 @@ function buildSoulLangReminder(locale) {
|
|
|
561408
561856
|
init_drizzle_orm();
|
|
561409
561857
|
init_schema();
|
|
561410
561858
|
init_schema();
|
|
561411
|
-
var
|
|
561859
|
+
var import_node_crypto20 = require("node:crypto");
|
|
561412
561860
|
|
|
561413
561861
|
// src/main/services/kc-service.ts
|
|
561414
561862
|
init_drizzle_orm();
|
|
561415
561863
|
init_schema();
|
|
561416
|
-
var
|
|
561864
|
+
var import_node_crypto19 = require("node:crypto");
|
|
561417
561865
|
function getKnowledgePoints(db, nodeId) {
|
|
561418
561866
|
const row = db.select({ kp: contentNodes.knowledgePoints }).from(contentNodes).where(eq(contentNodes.id, nodeId)).get();
|
|
561419
561867
|
if (!row?.kp)
|
|
@@ -561447,7 +561895,7 @@ function ensureKcRows(db, nodeId) {
|
|
|
561447
561895
|
for (let i = 0; i < kps.length; i++) {
|
|
561448
561896
|
if (!existing.has(i)) {
|
|
561449
561897
|
db.insert(knowledgeComponentMastery).values({
|
|
561450
|
-
id: (0,
|
|
561898
|
+
id: (0, import_node_crypto19.randomUUID)(),
|
|
561451
561899
|
nodeId,
|
|
561452
561900
|
kcIndex: i,
|
|
561453
561901
|
mastery: BKT_DEFAULTS.pInit,
|
|
@@ -561469,7 +561917,7 @@ function updateKcMastery(db, nodeId, kcIndex, correct) {
|
|
|
561469
561917
|
db.update(knowledgeComponentMastery).set({ mastery: newMastery, testedCount: row.testedCount + 1 }).where(eq(knowledgeComponentMastery.id, row.id)).run();
|
|
561470
561918
|
} else {
|
|
561471
561919
|
db.insert(knowledgeComponentMastery).values({
|
|
561472
|
-
id: (0,
|
|
561920
|
+
id: (0, import_node_crypto19.randomUUID)(),
|
|
561473
561921
|
nodeId,
|
|
561474
561922
|
kcIndex,
|
|
561475
561923
|
mastery: newMastery,
|
|
@@ -561575,7 +562023,7 @@ function getXpStatus(db, now2 = /* @__PURE__ */ new Date()) {
|
|
|
561575
562023
|
|
|
561576
562024
|
// src/main/services/proposal-service.ts
|
|
561577
562025
|
function createProposal(db, input) {
|
|
561578
|
-
const id = (0,
|
|
562026
|
+
const id = (0, import_node_crypto20.randomUUID)();
|
|
561579
562027
|
const now2 = (/* @__PURE__ */ new Date()).toISOString();
|
|
561580
562028
|
db.insert(proposals).values({
|
|
561581
562029
|
id,
|
|
@@ -561710,7 +562158,7 @@ function executeOperation(db, op) {
|
|
|
561710
562158
|
case "add_to_srs": {
|
|
561711
562159
|
const dueAt = new Date(Date.now() + 24 * 60 * 60 * 1e3).toISOString();
|
|
561712
562160
|
db.insert(srsItems).values({
|
|
561713
|
-
id: (0,
|
|
562161
|
+
id: (0, import_node_crypto20.randomUUID)(),
|
|
561714
562162
|
nodeId: op.nodeId,
|
|
561715
562163
|
easeFactor: 250,
|
|
561716
562164
|
intervalDays: 1,
|
|
@@ -561739,7 +562187,7 @@ function mapRow3(row) {
|
|
|
561739
562187
|
init_drizzle_orm();
|
|
561740
562188
|
init_schema();
|
|
561741
562189
|
init_schema();
|
|
561742
|
-
var
|
|
562190
|
+
var import_node_crypto21 = require("node:crypto");
|
|
561743
562191
|
function sqlUtcNow() {
|
|
561744
562192
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " ");
|
|
561745
562193
|
}
|
|
@@ -561794,7 +562242,7 @@ function upsertSlot(db, args) {
|
|
|
561794
562242
|
db.update(memory).set({ summary: args.summary, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }).where(eq(memory.id, args.existingId)).run();
|
|
561795
562243
|
} else {
|
|
561796
562244
|
db.insert(memory).values({
|
|
561797
|
-
id: (0,
|
|
562245
|
+
id: (0, import_node_crypto21.randomUUID)(),
|
|
561798
562246
|
nodeId: args.nodeId,
|
|
561799
562247
|
courseId: args.courseId,
|
|
561800
562248
|
summary: args.summary,
|
|
@@ -562736,8 +563184,8 @@ function saveChatHistory(db, nodeId, history2) {
|
|
|
562736
563184
|
if (existing) {
|
|
562737
563185
|
db.update(chatSessions).set({ messagesJson }).where(eq(chatSessions.nodeId, nodeId)).run();
|
|
562738
563186
|
} else {
|
|
562739
|
-
const { randomUUID:
|
|
562740
|
-
db.insert(chatSessions).values({ id:
|
|
563187
|
+
const { randomUUID: randomUUID19 } = require("node:crypto");
|
|
563188
|
+
db.insert(chatSessions).values({ id: randomUUID19(), nodeId, messagesJson }).run();
|
|
562741
563189
|
}
|
|
562742
563190
|
}
|
|
562743
563191
|
async function handleAgentChatThread(win, threadId, userMessage, displayText, locale, attachments) {
|
|
@@ -562852,9 +563300,9 @@ function getContextUsage(db, nodeId, locale) {
|
|
|
562852
563300
|
if (preset) {
|
|
562853
563301
|
visionCapable = supportsVision(preset, model);
|
|
562854
563302
|
} else if (providerId.startsWith("custom-")) {
|
|
562855
|
-
const
|
|
562856
|
-
if (
|
|
562857
|
-
visionCapable =
|
|
563303
|
+
const cp2 = getCustomProvider(db, providerId);
|
|
563304
|
+
if (cp2) {
|
|
563305
|
+
visionCapable = cp2.vision || cp2.kind === "vision";
|
|
562858
563306
|
}
|
|
562859
563307
|
}
|
|
562860
563308
|
const override = getVisionOverride(db);
|
|
@@ -563004,7 +563452,7 @@ function getDashboard(db, courseId, now2 = /* @__PURE__ */ new Date()) {
|
|
|
563004
563452
|
init_drizzle_orm();
|
|
563005
563453
|
init_schema();
|
|
563006
563454
|
init_schema();
|
|
563007
|
-
var
|
|
563455
|
+
var import_node_crypto22 = require("node:crypto");
|
|
563008
563456
|
function searchContent(sqljs, query2, limit = 10) {
|
|
563009
563457
|
const terms = query2.trim().split(/\s+/).filter(Boolean);
|
|
563010
563458
|
if (terms.length === 0)
|
|
@@ -563063,7 +563511,7 @@ function updateMemory(db, input) {
|
|
|
563063
563511
|
category: existing.category
|
|
563064
563512
|
};
|
|
563065
563513
|
}
|
|
563066
|
-
const id = (0,
|
|
563514
|
+
const id = (0, import_node_crypto22.randomUUID)();
|
|
563067
563515
|
db.insert(memory).values({ id, nodeId, summary: input.summary, category }).run();
|
|
563068
563516
|
return { id, nodeId, summary: input.summary, category };
|
|
563069
563517
|
}
|
|
@@ -563084,7 +563532,7 @@ function getMemory(db, nodeId, category) {
|
|
|
563084
563532
|
init_drizzle_orm();
|
|
563085
563533
|
init_schema();
|
|
563086
563534
|
init_schema();
|
|
563087
|
-
var
|
|
563535
|
+
var import_node_crypto23 = require("node:crypto");
|
|
563088
563536
|
init_markdown_course();
|
|
563089
563537
|
function insertExamNode(db, courseId, sectionId, sectionTitle, orderIdx) {
|
|
563090
563538
|
const existing = db.select().from(contentNodes).all().find(
|
|
@@ -563092,7 +563540,7 @@ function insertExamNode(db, courseId, sectionId, sectionTitle, orderIdx) {
|
|
|
563092
563540
|
);
|
|
563093
563541
|
if (existing)
|
|
563094
563542
|
return null;
|
|
563095
|
-
const examId = (0,
|
|
563543
|
+
const examId = (0, import_node_crypto23.randomUUID)();
|
|
563096
563544
|
db.insert(contentNodes).values({
|
|
563097
563545
|
id: examId,
|
|
563098
563546
|
courseId,
|
|
@@ -563138,7 +563586,7 @@ function generateCourseFromMarkdown(db, md, opts) {
|
|
|
563138
563586
|
let totalExams = 0;
|
|
563139
563587
|
let firstLessonId = null;
|
|
563140
563588
|
for (const section2 of parsed.sections) {
|
|
563141
|
-
const sectionId = (0,
|
|
563589
|
+
const sectionId = (0, import_node_crypto23.randomUUID)();
|
|
563142
563590
|
db.insert(contentNodes).values({
|
|
563143
563591
|
id: sectionId,
|
|
563144
563592
|
courseId,
|
|
@@ -563150,7 +563598,7 @@ function generateCourseFromMarkdown(db, md, opts) {
|
|
|
563150
563598
|
}).run();
|
|
563151
563599
|
let lessonOrder = 0;
|
|
563152
563600
|
for (const lesson of section2.lessons) {
|
|
563153
|
-
const lessonId = (0,
|
|
563601
|
+
const lessonId = (0, import_node_crypto23.randomUUID)();
|
|
563154
563602
|
const isFirstEver = firstLessonId === null;
|
|
563155
563603
|
db.insert(contentNodes).values({
|
|
563156
563604
|
id: lessonId,
|
|
@@ -563215,7 +563663,7 @@ function generateCourseFromRepoFiles(db, parsed, opts) {
|
|
|
563215
563663
|
let totalExams = 0;
|
|
563216
563664
|
let firstLessonId = null;
|
|
563217
563665
|
for (const section2 of parsed.sections) {
|
|
563218
|
-
const sectionId = (0,
|
|
563666
|
+
const sectionId = (0, import_node_crypto23.randomUUID)();
|
|
563219
563667
|
const sectionWorld = section2.world ?? "study";
|
|
563220
563668
|
db.insert(contentNodes).values({
|
|
563221
563669
|
id: sectionId,
|
|
@@ -563229,7 +563677,7 @@ function generateCourseFromRepoFiles(db, parsed, opts) {
|
|
|
563229
563677
|
}).run();
|
|
563230
563678
|
let lessonOrder = 0;
|
|
563231
563679
|
for (const lesson of section2.lessons) {
|
|
563232
|
-
const lessonId = (0,
|
|
563680
|
+
const lessonId = (0, import_node_crypto23.randomUUID)();
|
|
563233
563681
|
const isFirstEver = firstLessonId === null;
|
|
563234
563682
|
const lessonWorld = lesson.world ?? sectionWorld;
|
|
563235
563683
|
db.insert(contentNodes).values({
|
|
@@ -563458,8 +563906,8 @@ async function generateExercise(db, nodeId, type, locale) {
|
|
|
563458
563906
|
if (!parsed.ok) {
|
|
563459
563907
|
throw new Error(`AI \u51FA\u9898\u683C\u5F0F\u9519\u8BEF: ${parsed.error}`);
|
|
563460
563908
|
}
|
|
563461
|
-
const { randomUUID:
|
|
563462
|
-
const id =
|
|
563909
|
+
const { randomUUID: randomUUID19 } = require("node:crypto");
|
|
563910
|
+
const id = randomUUID19();
|
|
563463
563911
|
db.insert(exercises).values({
|
|
563464
563912
|
id,
|
|
563465
563913
|
nodeId,
|
|
@@ -563692,7 +564140,7 @@ function setPromise(nodeId, p) {
|
|
|
563692
564140
|
}
|
|
563693
564141
|
|
|
563694
564142
|
// src/main/services/exam-service.ts
|
|
563695
|
-
var
|
|
564143
|
+
var import_node_crypto24 = require("node:crypto");
|
|
563696
564144
|
var ONE_STAR_THRESHOLD = 0.6;
|
|
563697
564145
|
var TWO_STAR_THRESHOLD = 0.8;
|
|
563698
564146
|
var THREE_STAR_THRESHOLD = 0.95;
|
|
@@ -563854,7 +564302,7 @@ async function generateExamBank(db, examNodeId, locale) {
|
|
|
563854
564302
|
}
|
|
563855
564303
|
for (const q of collected) {
|
|
563856
564304
|
db.insert(exercises).values({
|
|
563857
|
-
id: (0,
|
|
564305
|
+
id: (0, import_node_crypto24.randomUUID)(),
|
|
563858
564306
|
nodeId: examNodeId,
|
|
563859
564307
|
type: "mcq",
|
|
563860
564308
|
prompt: q.prompt,
|
|
@@ -563881,7 +564329,7 @@ function startExamAttempt(db, examNodeId) {
|
|
|
563881
564329
|
if (dangling) {
|
|
563882
564330
|
gradeAndFinalize(db, examNodeId, dangling, safeParseRecord(dangling.answersJson), true);
|
|
563883
564331
|
}
|
|
563884
|
-
const id = (0,
|
|
564332
|
+
const id = (0, import_node_crypto24.randomUUID)();
|
|
563885
564333
|
db.insert(examAttempts).values({
|
|
563886
564334
|
id,
|
|
563887
564335
|
examNodeId,
|
|
@@ -564436,7 +564884,7 @@ function registerCourseHandlers(deps) {
|
|
|
564436
564884
|
);
|
|
564437
564885
|
let importCancelRequested = false;
|
|
564438
564886
|
let importRunning = false;
|
|
564439
|
-
const planStore = createPlanStore((0,
|
|
564887
|
+
const planStore = createPlanStore((0, import_node_path15.join)(deps.dataDir, "import-plans"));
|
|
564440
564888
|
const runImportJob = (jobId, work) => {
|
|
564441
564889
|
void (async () => {
|
|
564442
564890
|
try {
|
|
@@ -564462,7 +564910,7 @@ function registerCourseHandlers(deps) {
|
|
|
564462
564910
|
return null;
|
|
564463
564911
|
if (importRunning)
|
|
564464
564912
|
throw new Error("\u5DF2\u6709\u5BFC\u5165\u4EFB\u52A1\u5728\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7B49\u5B83\u7ED3\u675F\u6216\u5148\u53D6\u6D88");
|
|
564465
|
-
const jobId = (0,
|
|
564913
|
+
const jobId = (0, import_node_crypto26.randomUUID)();
|
|
564466
564914
|
importRunning = true;
|
|
564467
564915
|
importCancelRequested = false;
|
|
564468
564916
|
const shouldAbort = () => importCancelRequested;
|
|
@@ -564482,7 +564930,7 @@ function registerCourseHandlers(deps) {
|
|
|
564482
564930
|
throw new Error("\u65E0\u6548\u7684 GitHub URL");
|
|
564483
564931
|
if (importRunning)
|
|
564484
564932
|
throw new Error("\u5DF2\u6709\u5BFC\u5165\u4EFB\u52A1\u5728\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7B49\u5B83\u7ED3\u675F\u6216\u5148\u53D6\u6D88");
|
|
564485
|
-
const jobId = (0,
|
|
564933
|
+
const jobId = (0, import_node_crypto26.randomUUID)();
|
|
564486
564934
|
importRunning = true;
|
|
564487
564935
|
importCancelRequested = false;
|
|
564488
564936
|
const shouldAbort = () => importCancelRequested;
|
|
@@ -564503,7 +564951,7 @@ function registerCourseHandlers(deps) {
|
|
|
564503
564951
|
throw new Error("\u65E0\u6CD5\u8BC6\u522B\u7684\u94FE\u63A5:\u8BF7\u7C98\u8D34 http(s) \u7F51\u5740\u6216 GitHub \u4ED3\u5E93\u5730\u5740");
|
|
564504
564952
|
if (importRunning)
|
|
564505
564953
|
throw new Error("\u5DF2\u6709\u5BFC\u5165\u4EFB\u52A1\u5728\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7B49\u5B83\u7ED3\u675F\u6216\u5148\u53D6\u6D88");
|
|
564506
|
-
const jobId = (0,
|
|
564954
|
+
const jobId = (0, import_node_crypto26.randomUUID)();
|
|
564507
564955
|
importRunning = true;
|
|
564508
564956
|
importCancelRequested = false;
|
|
564509
564957
|
const shouldAbort = () => importCancelRequested;
|
|
@@ -564525,7 +564973,7 @@ function registerCourseHandlers(deps) {
|
|
|
564525
564973
|
throw new Error("\u6CA1\u6709\u53EF\u5BFC\u5165\u7684\u6587\u672C\u5185\u5BB9");
|
|
564526
564974
|
if (importRunning)
|
|
564527
564975
|
throw new Error("\u5DF2\u6709\u5BFC\u5165\u4EFB\u52A1\u5728\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7B49\u5B83\u7ED3\u675F\u6216\u5148\u53D6\u6D88");
|
|
564528
|
-
const jobId = (0,
|
|
564976
|
+
const jobId = (0, import_node_crypto26.randomUUID)();
|
|
564529
564977
|
importRunning = true;
|
|
564530
564978
|
importCancelRequested = false;
|
|
564531
564979
|
const shouldAbort = () => importCancelRequested;
|
|
@@ -564558,7 +565006,7 @@ function registerCourseHandlers(deps) {
|
|
|
564558
565006
|
}
|
|
564559
565007
|
if (importRunning)
|
|
564560
565008
|
throw new Error("\u5DF2\u6709\u5BFC\u5165\u4EFB\u52A1\u5728\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7B49\u5B83\u7ED3\u675F\u6216\u5148\u53D6\u6D88");
|
|
564561
|
-
const jobId = (0,
|
|
565009
|
+
const jobId = (0, import_node_crypto26.randomUUID)();
|
|
564562
565010
|
importRunning = true;
|
|
564563
565011
|
importCancelRequested = false;
|
|
564564
565012
|
const shouldAbort = () => importCancelRequested;
|
|
@@ -564591,7 +565039,7 @@ function registerCourseHandlers(deps) {
|
|
|
564591
565039
|
throw new Error("\u97F3\u9891\u603B\u91CF\u8D85\u8FC7 200MB \u4E0A\u9650,\u8BF7\u5206\u6279\u5BFC\u5165");
|
|
564592
565040
|
if (importRunning)
|
|
564593
565041
|
throw new Error("\u5DF2\u6709\u5BFC\u5165\u4EFB\u52A1\u5728\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7B49\u5B83\u7ED3\u675F\u6216\u5148\u53D6\u6D88");
|
|
564594
|
-
const jobId = (0,
|
|
565042
|
+
const jobId = (0, import_node_crypto26.randomUUID)();
|
|
564595
565043
|
importRunning = true;
|
|
564596
565044
|
importCancelRequested = false;
|
|
564597
565045
|
const shouldAbort = () => importCancelRequested;
|
|
@@ -564620,7 +565068,7 @@ function registerCourseHandlers(deps) {
|
|
|
564620
565068
|
throw new Error("\u627E\u4E0D\u5230\u5BF9\u5E94\u7684\u5BFC\u5165\u65B9\u6848\u5FEB\u7167(\u53EF\u80FD\u5DF2\u8FC7\u671F)");
|
|
564621
565069
|
if (importRunning)
|
|
564622
565070
|
throw new Error("\u5DF2\u6709\u5BFC\u5165\u4EFB\u52A1\u5728\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7B49\u5B83\u7ED3\u675F\u6216\u5148\u53D6\u6D88");
|
|
564623
|
-
const jobId = (0,
|
|
565071
|
+
const jobId = (0, import_node_crypto26.randomUUID)();
|
|
564624
565072
|
importRunning = true;
|
|
564625
565073
|
importCancelRequested = false;
|
|
564626
565074
|
const shouldAbort = () => importCancelRequested;
|
|
@@ -564656,7 +565104,7 @@ function registerCourseHandlers(deps) {
|
|
|
564656
565104
|
throw new Error("\u8BFE\u7A0B\u5305\u4E0D\u542B\u8BFE\u7A0B\u7ED3\u6784,\u65E0\u6CD5\u76F4\u63A5\u5BFC\u5165");
|
|
564657
565105
|
if (importRunning)
|
|
564658
565106
|
throw new Error("\u5DF2\u6709\u5BFC\u5165\u4EFB\u52A1\u5728\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7B49\u5B83\u7ED3\u675F\u6216\u5148\u53D6\u6D88");
|
|
564659
|
-
const jobId = (0,
|
|
565107
|
+
const jobId = (0, import_node_crypto26.randomUUID)();
|
|
564660
565108
|
importRunning = true;
|
|
564661
565109
|
importCancelRequested = false;
|
|
564662
565110
|
const shouldAbort = () => importCancelRequested;
|
|
@@ -565329,6 +565777,32 @@ function registerCompanionPackHandlers(deps) {
|
|
|
565329
565777
|
handle("companionPack:setVehicle", async (_e, input) => {
|
|
565330
565778
|
return setCompanionPackVehicle(deps.dataDir, input.id, input.vehicle);
|
|
565331
565779
|
});
|
|
565780
|
+
handle("shimeji:importZip", async (_e, input) => {
|
|
565781
|
+
return importShimejiZip(getDb(), deps.dataDir, input.zipBase64);
|
|
565782
|
+
});
|
|
565783
|
+
handle("shimeji:confirmImport", async (_e, input) => {
|
|
565784
|
+
return { packs: await confirmShimejiImport(getDb(), deps.dataDir, input.importId, input.characterRefs) };
|
|
565785
|
+
});
|
|
565786
|
+
handle("shimeji:list", async () => {
|
|
565787
|
+
return { packs: await listShimejiPacks(getDb(), deps.dataDir) };
|
|
565788
|
+
});
|
|
565789
|
+
handle("shimeji:getActive", async () => {
|
|
565790
|
+
return getActiveShimejiPack(getDb(), deps.dataDir);
|
|
565791
|
+
});
|
|
565792
|
+
handle("shimeji:getFrame", async (_e, input) => {
|
|
565793
|
+
return getShimejiFrameDataUrl(getDb(), deps.dataDir, input.packId, input.frame);
|
|
565794
|
+
});
|
|
565795
|
+
handle("shimeji:activate", async (_e, input) => {
|
|
565796
|
+
await activateShimejiPack(getDb(), input.id);
|
|
565797
|
+
return { ok: true };
|
|
565798
|
+
});
|
|
565799
|
+
handle("shimeji:delete", async (_e, input) => {
|
|
565800
|
+
await deleteShimejiPack(getDb(), deps.dataDir, input.id);
|
|
565801
|
+
return { ok: true };
|
|
565802
|
+
});
|
|
565803
|
+
handle("shimeji:setVehicle", async (_e, input) => {
|
|
565804
|
+
return setVehicleShimeji(getDb(), deps.dataDir, input.id, input.vehicle);
|
|
565805
|
+
});
|
|
565332
565806
|
}
|
|
565333
565807
|
function registerThreadHandlers() {
|
|
565334
565808
|
handle(
|
|
@@ -565444,8 +565918,8 @@ init_asset_service();
|
|
|
565444
565918
|
|
|
565445
565919
|
// src/main/services/seed.ts
|
|
565446
565920
|
init_db2();
|
|
565447
|
-
var
|
|
565448
|
-
var
|
|
565921
|
+
var import_node_fs14 = require("node:fs");
|
|
565922
|
+
var import_node_path16 = require("node:path");
|
|
565449
565923
|
var import_node_url = require("node:url");
|
|
565450
565924
|
|
|
565451
565925
|
// src/main/services/seed-apply.ts
|
|
@@ -565535,25 +566009,25 @@ function loadSeedData() {
|
|
|
565535
566009
|
const fileName = "seed-course.json";
|
|
565536
566010
|
const candidates = [
|
|
565537
566011
|
// 便携束(手机/serve):seed-course.json 与 server.cjs 并排(buildServerBundle 复制)
|
|
565538
|
-
(0,
|
|
566012
|
+
(0, import_node_path16.join)(__dirname, fileName),
|
|
565539
566013
|
// tsx 直跑(verify 脚本):__dirname = .../src/main/services
|
|
565540
|
-
(0,
|
|
566014
|
+
(0, import_node_path16.join)(__dirname, "..", "assets", fileName),
|
|
565541
566015
|
// dev/prod vite 构建:__dirname = .../dist-electron/main → 项目根 → src/main/assets
|
|
565542
|
-
(0,
|
|
566016
|
+
(0, import_node_path16.join)(__dirname, "..", "..", "src", "main", "assets", fileName),
|
|
565543
566017
|
// 打包后:__dirname 在 resources/app/dist-electron/main → 需把 assets 复制到 dist
|
|
565544
|
-
(0,
|
|
566018
|
+
(0, import_node_path16.join)(__dirname, "assets", fileName)
|
|
565545
566019
|
];
|
|
565546
566020
|
let lastErr = null;
|
|
565547
566021
|
for (const p of candidates) {
|
|
565548
566022
|
try {
|
|
565549
|
-
return JSON.parse((0,
|
|
566023
|
+
return JSON.parse((0, import_node_fs14.readFileSync)(p, "utf8"));
|
|
565550
566024
|
} catch (e) {
|
|
565551
566025
|
lastErr = e;
|
|
565552
566026
|
}
|
|
565553
566027
|
}
|
|
565554
566028
|
try {
|
|
565555
|
-
const here = (0,
|
|
565556
|
-
return JSON.parse((0,
|
|
566029
|
+
const here = (0, import_node_path16.dirname)((0, import_node_url.fileURLToPath)(import_meta5.url));
|
|
566030
|
+
return JSON.parse((0, import_node_fs14.readFileSync)((0, import_node_path16.join)(here, "..", "assets", fileName), "utf8"));
|
|
565557
566031
|
} catch {
|
|
565558
566032
|
}
|
|
565559
566033
|
throw new Error(
|
|
@@ -565587,16 +566061,16 @@ var stubDialog = {
|
|
|
565587
566061
|
}
|
|
565588
566062
|
};
|
|
565589
566063
|
function loadOrCreateToken(dataDir) {
|
|
565590
|
-
const tokenPath = (0,
|
|
566064
|
+
const tokenPath = (0, import_node_path17.join)(dataDir, "serve-token");
|
|
565591
566065
|
try {
|
|
565592
|
-
const existing = (0,
|
|
566066
|
+
const existing = (0, import_node_fs15.readFileSync)(tokenPath, "utf8").trim();
|
|
565593
566067
|
if (existing.length >= 16)
|
|
565594
566068
|
return existing;
|
|
565595
566069
|
} catch {
|
|
565596
566070
|
}
|
|
565597
|
-
const token = (0,
|
|
565598
|
-
(0,
|
|
565599
|
-
(0,
|
|
566071
|
+
const token = (0, import_node_crypto27.randomBytes)(24).toString("hex");
|
|
566072
|
+
(0, import_node_fs15.mkdirSync)(dataDir, { recursive: true });
|
|
566073
|
+
(0, import_node_fs15.writeFileSync)(tokenPath, token, "utf8");
|
|
565600
566074
|
return token;
|
|
565601
566075
|
}
|
|
565602
566076
|
var MIME2 = {
|
|
@@ -565618,9 +566092,9 @@ var MIME2 = {
|
|
|
565618
566092
|
".webmanifest": "application/manifest+json"
|
|
565619
566093
|
};
|
|
565620
566094
|
async function startServe(opts) {
|
|
565621
|
-
(0,
|
|
565622
|
-
setAssetsRoot((0,
|
|
565623
|
-
setAttachmentsRoot((0,
|
|
566095
|
+
(0, import_node_fs15.mkdirSync)(opts.dataDir, { recursive: true });
|
|
566096
|
+
setAssetsRoot((0, import_node_path17.join)(opts.dataDir, "assets"));
|
|
566097
|
+
setAttachmentsRoot((0, import_node_path17.join)(opts.dataDir, "attachments"));
|
|
565624
566098
|
await initDb({ dataDir: opts.dataDir });
|
|
565625
566099
|
ensureSeedCourse();
|
|
565626
566100
|
const { patched } = ensureExamNodesForExistingCourses(getDb());
|
|
@@ -565630,7 +566104,7 @@ async function startServe(opts) {
|
|
|
565630
566104
|
const { ensurePrefLang: ensurePrefLang2 } = await Promise.resolve().then(() => (init_lang_pref(), lang_pref_exports));
|
|
565631
566105
|
ensurePrefLang2(getDb(), Intl.DateTimeFormat().resolvedOptions().locale || "zh-CN");
|
|
565632
566106
|
const token = opts.skipAuth ? "" : loadOrCreateToken(opts.dataDir);
|
|
565633
|
-
const webRoot = (0,
|
|
566107
|
+
const webRoot = (0, import_node_path17.resolve)(opts.webDir);
|
|
565634
566108
|
const clients = /* @__PURE__ */ new Set();
|
|
565635
566109
|
const emitter2 = {
|
|
565636
566110
|
send(channel, ...args) {
|
|
@@ -565653,22 +566127,22 @@ async function startServe(opts) {
|
|
|
565653
566127
|
const dummyEvent = { sender: null };
|
|
565654
566128
|
const requestHandler = (req, res) => {
|
|
565655
566129
|
const urlPath = decodeURIComponent((req.url ?? "/").split("?")[0]);
|
|
565656
|
-
let filePath = (0,
|
|
566130
|
+
let filePath = (0, import_node_path17.normalize)((0, import_node_path17.join)(webRoot, urlPath));
|
|
565657
566131
|
if (!filePath.startsWith(webRoot)) {
|
|
565658
566132
|
res.writeHead(403).end();
|
|
565659
566133
|
return;
|
|
565660
566134
|
}
|
|
565661
|
-
if (urlPath === "/" || !(0,
|
|
565662
|
-
filePath = (0,
|
|
566135
|
+
if (urlPath === "/" || !(0, import_node_fs15.existsSync)(filePath) || !filePath.includes(".")) {
|
|
566136
|
+
filePath = (0, import_node_path17.join)(webRoot, "index.html");
|
|
565663
566137
|
}
|
|
565664
|
-
const mime = MIME2[(0,
|
|
566138
|
+
const mime = MIME2[(0, import_node_path17.extname)(filePath)] ?? "application/octet-stream";
|
|
565665
566139
|
res.writeHead(200, { "content-type": mime, "cache-control": "no-cache" });
|
|
565666
|
-
(0,
|
|
566140
|
+
(0, import_node_fs15.createReadStream)(filePath).pipe(res);
|
|
565667
566141
|
};
|
|
565668
566142
|
let httpServer;
|
|
565669
566143
|
if (opts.tlsCert && opts.tlsKey) {
|
|
565670
566144
|
httpServer = (0, import_node_https3.createServer)(
|
|
565671
|
-
{ cert: (0,
|
|
566145
|
+
{ cert: (0, import_node_fs15.readFileSync)(opts.tlsCert), key: (0, import_node_fs15.readFileSync)(opts.tlsKey) },
|
|
565672
566146
|
requestHandler
|
|
565673
566147
|
);
|
|
565674
566148
|
} else {
|
|
@@ -565757,11 +566231,11 @@ function argvHas(name19) {
|
|
|
565757
566231
|
return process.argv.includes(`--${name19}`);
|
|
565758
566232
|
}
|
|
565759
566233
|
async function main() {
|
|
565760
|
-
const dataDir = (0,
|
|
565761
|
-
const webDir = (0,
|
|
566234
|
+
const dataDir = (0, import_node_path18.resolve)(arg("data", (0, import_node_path18.join)((0, import_node_os4.homedir)(), ".lookatstudy")));
|
|
566235
|
+
const webDir = (0, import_node_path18.resolve)(arg("web", (0, import_node_path18.join)(__dirname, "web")));
|
|
565762
566236
|
const port = Number(arg("port", "17890"));
|
|
565763
|
-
const tlsCert = argvHas("tls-cert") ? (0,
|
|
565764
|
-
const tlsKey = argvHas("tls-key") ? (0,
|
|
566237
|
+
const tlsCert = argvHas("tls-cert") ? (0, import_node_path18.resolve)(arg("tls-cert", "")) : void 0;
|
|
566238
|
+
const tlsKey = argvHas("tls-key") ? (0, import_node_path18.resolve)(arg("tls-key", "")) : void 0;
|
|
565765
566239
|
if (tlsCert !== void 0 !== (tlsKey !== void 0)) {
|
|
565766
566240
|
throw new Error("--tls-cert \u4E0E --tls-key \u5FC5\u987B\u6210\u5BF9\u63D0\u4F9B(PEM \u6587\u4EF6\u8DEF\u5F84)");
|
|
565767
566241
|
}
|