@aussieljk/forkbook 0.0.0-stage → 0.0.1-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +77 -2
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +36 -0
- package/assets/browser/favicon-wrapper.svg +46 -0
- package/assets/browser/favicon.svg +1 -0
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/assets/builder-vite/iframe.html +99 -0
- package/assets/create/rendererAssets/.eslintrc.json +16 -0
- package/assets/create/rendererAssets/common/Configure.mdx +388 -0
- package/assets/create/rendererAssets/common/assets/accessibility.png +0 -0
- package/assets/create/rendererAssets/common/assets/accessibility.svg +1 -0
- package/assets/create/rendererAssets/common/assets/addon-library.png +0 -0
- package/assets/create/rendererAssets/common/assets/assets.png +0 -0
- package/assets/create/rendererAssets/common/assets/avif-test-image.avif +0 -0
- package/assets/create/rendererAssets/common/assets/context.png +0 -0
- package/assets/create/rendererAssets/common/assets/discord.svg +1 -0
- package/assets/create/rendererAssets/common/assets/docs.png +0 -0
- package/assets/create/rendererAssets/common/assets/figma-plugin.png +0 -0
- package/assets/create/rendererAssets/common/assets/github.svg +1 -0
- package/assets/create/rendererAssets/common/assets/share.png +0 -0
- package/assets/create/rendererAssets/common/assets/styling.png +0 -0
- package/assets/create/rendererAssets/common/assets/testing.png +0 -0
- package/assets/create/rendererAssets/common/assets/theming.png +0 -0
- package/assets/create/rendererAssets/common/assets/tutorials.svg +1 -0
- package/assets/create/rendererAssets/common/assets/youtube.svg +1 -0
- package/assets/create/rendererAssets/common/button.css +30 -0
- package/assets/create/rendererAssets/common/header.css +32 -0
- package/assets/create/rendererAssets/common/page.css +68 -0
- package/assets/create/templates/react-native/index.expo.js +20 -0
- package/assets/create/templates/react-native/index.js +25 -0
- package/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/assets/docs/message-reference.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/react-native/metro-env.d.ts +69 -0
- package/assets/server/addon.tsconfig.json +6 -0
- package/assets/server/base-preview-body.html +116 -0
- package/assets/server/base-preview-head.html +494 -0
- package/assets/server/openBrowser.applescript +94 -0
- package/assets/server/template.ejs +87 -0
- package/dist/.build-stamp +0 -0
- package/dist/_browser-chunks/Color-PCLE2J36.js +1025 -0
- package/dist/_browser-chunks/DocsRenderer-JXND3PVQ.js +10 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +1619 -0
- package/dist/_browser-chunks/chunk-2JDQ35OA.js +247 -0
- package/dist/_browser-chunks/chunk-2JT76G3E.js +104 -0
- package/dist/_browser-chunks/chunk-2MEPHP35.js +17 -0
- package/dist/_browser-chunks/chunk-2SCZVUKW.js +24 -0
- package/dist/_browser-chunks/chunk-46Z7NGAS.js +41 -0
- package/dist/_browser-chunks/chunk-4ATQOMJB.js +30 -0
- package/dist/_browser-chunks/chunk-52CW7FF7.js +49 -0
- package/dist/_browser-chunks/chunk-5I7E4GMO.js +62 -0
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +20 -0
- package/dist/_browser-chunks/chunk-5WMXI5GW.js +816 -0
- package/dist/_browser-chunks/chunk-66OCZ54D.js +2604 -0
- package/dist/_browser-chunks/chunk-6SXYJQST.js +253 -0
- package/dist/_browser-chunks/chunk-AYRF6EJB.js +36 -0
- package/dist/_browser-chunks/chunk-B4AUNNU4.js +156 -0
- package/dist/_browser-chunks/chunk-BCP2FFXF.js +369 -0
- package/dist/_browser-chunks/chunk-C3D4HEFY.js +3396 -0
- package/dist/_browser-chunks/chunk-CFAOWGL7.js +43 -0
- package/dist/_browser-chunks/chunk-CFWWCCZV.js +223 -0
- package/dist/_browser-chunks/chunk-CNED6RYH.js +18 -0
- package/dist/_browser-chunks/chunk-DRQKCCAG.js +136 -0
- package/dist/_browser-chunks/chunk-ECQ75MKQ.js +0 -0
- package/dist/_browser-chunks/chunk-EIYAKDGP.js +302 -0
- package/dist/_browser-chunks/chunk-ENKK74N4.js +12 -0
- package/dist/_browser-chunks/chunk-FENFYI4X.js +698 -0
- package/dist/_browser-chunks/chunk-FJGWSWL5.js +155 -0
- package/dist/_browser-chunks/chunk-FVSEPWWX.js +2810 -0
- package/dist/_browser-chunks/chunk-GNZY6LOW.js +10116 -0
- package/dist/_browser-chunks/chunk-IE4ULIOQ.js +14 -0
- package/dist/_browser-chunks/chunk-IMSF75WX.js +42 -0
- package/dist/_browser-chunks/chunk-IWQGIXJS.js +14 -0
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +108 -0
- package/dist/_browser-chunks/chunk-JPUOQJUI.js +8 -0
- package/dist/_browser-chunks/chunk-JSBKXXXF.js +218 -0
- package/dist/_browser-chunks/chunk-JWSKPMPC.js +73 -0
- package/dist/_browser-chunks/chunk-JYVGARBG.js +2943 -0
- package/dist/_browser-chunks/chunk-KBK7GKBN.js +35 -0
- package/dist/_browser-chunks/chunk-KQ7CRO2B.js +108 -0
- package/dist/_browser-chunks/chunk-LAWXTSXK.js +18 -0
- package/dist/_browser-chunks/chunk-LE2LTDW3.js +14 -0
- package/dist/_browser-chunks/chunk-LEVSOOLQ.js +48 -0
- package/dist/_browser-chunks/chunk-LV5PIKV4.js +93 -0
- package/dist/_browser-chunks/chunk-MDOL7KML.js +56 -0
- package/dist/_browser-chunks/chunk-MFMDGWP6.js +34 -0
- package/dist/_browser-chunks/chunk-MLBOOZL4.js +67 -0
- package/dist/_browser-chunks/chunk-NQUD4B7H.js +91 -0
- package/dist/_browser-chunks/chunk-NULBREPZ.js +43 -0
- package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
- package/dist/_browser-chunks/chunk-OD6IBQCC.js +117 -0
- package/dist/_browser-chunks/chunk-ODVJ3XZJ.js +157 -0
- package/dist/_browser-chunks/chunk-OQWFVDIN.js +386 -0
- package/dist/_browser-chunks/chunk-OVH3USFB.js +20 -0
- package/dist/_browser-chunks/chunk-OZZPSYQR.js +14 -0
- package/dist/_browser-chunks/chunk-P6PK47TQ.js +1970 -0
- package/dist/_browser-chunks/chunk-PFRNG3UC.js +22 -0
- package/dist/_browser-chunks/chunk-PJSMZ27A.js +13 -0
- package/dist/_browser-chunks/chunk-QC4HFS6K.js +41 -0
- package/dist/_browser-chunks/chunk-QDXFODK4.js +274 -0
- package/dist/_browser-chunks/chunk-RBCHTR7C.js +28 -0
- package/dist/_browser-chunks/chunk-RMYQ3QN3.js +294 -0
- package/dist/_browser-chunks/chunk-RNTIV5CE.js +411 -0
- package/dist/_browser-chunks/chunk-RSPAQWVJ.js +80 -0
- package/dist/_browser-chunks/chunk-S6TK43XQ.js +836 -0
- package/dist/_browser-chunks/chunk-SC67XZST.js +18 -0
- package/dist/_browser-chunks/chunk-SFVA4SBT.js +683 -0
- package/dist/_browser-chunks/chunk-SZYFOQMT.js +25 -0
- package/dist/_browser-chunks/chunk-TBJCJXK4.js +18 -0
- package/dist/_browser-chunks/chunk-UMDO3KB7.js +205 -0
- package/dist/_browser-chunks/chunk-V2G23FV7.js +11 -0
- package/dist/_browser-chunks/chunk-V5M7Q4HT.js +88 -0
- package/dist/_browser-chunks/chunk-W5M6NPS3.js +198 -0
- package/dist/_browser-chunks/chunk-W7NE2JXW.js +84 -0
- package/dist/_browser-chunks/chunk-WGVAAM43.js +1110 -0
- package/dist/_browser-chunks/chunk-WHQRNHXD.js +8 -0
- package/dist/_browser-chunks/chunk-WOSOWBCA.js +12 -0
- package/dist/_browser-chunks/chunk-WZ7KR7SH.js +85 -0
- package/dist/_browser-chunks/chunk-YEKO6BHJ.js +20 -0
- package/dist/_browser-chunks/chunk-YI2IBIQS.js +7 -0
- package/dist/_browser-chunks/chunk-YTIT5NA5.js +1966 -0
- package/dist/_browser-chunks/chunk-ZEHRUHTA.js +6 -0
- package/dist/_browser-chunks/chunk-ZTQ5MEJ5.js +203 -0
- package/dist/_browser-chunks/matchers-YLBYSYAF.js +1263 -0
- package/dist/_browser-chunks/react-dom-client-4OHE3QDV.js +9 -0
- package/dist/_node-chunks/attached-runtime-I2G4WLJI.js +282 -0
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +1661 -0
- package/dist/_node-chunks/chunk-2BUPBPFB.js +82 -0
- package/dist/_node-chunks/chunk-2DSIDINN.js +884 -0
- package/dist/_node-chunks/chunk-2RU7BKEW.js +23 -0
- package/dist/_node-chunks/chunk-34EO2PUT.js +26 -0
- package/dist/_node-chunks/chunk-3BKIBF5S.js +3008 -0
- package/dist/_node-chunks/chunk-3SDUYDXH.js +98 -0
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +662 -0
- package/dist/_node-chunks/chunk-3W7F2B7P.js +79 -0
- package/dist/_node-chunks/chunk-3Y6AAY5H.js +80 -0
- package/dist/_node-chunks/chunk-42UWAGPW.js +1193 -0
- package/dist/_node-chunks/chunk-4FEANXWU.js +1986 -0
- package/dist/_node-chunks/chunk-5DQFEZEA.js +40 -0
- package/dist/_node-chunks/chunk-6KEHV53S.js +1218 -0
- package/dist/_node-chunks/chunk-6LMWA44H.js +3837 -0
- package/dist/_node-chunks/chunk-6YKBRP72.js +20 -0
- package/dist/_node-chunks/chunk-7GUDZVRQ.js +110 -0
- package/dist/_node-chunks/chunk-B5J7Q7J4.js +21 -0
- package/dist/_node-chunks/chunk-BS2WMZMR.js +90 -0
- package/dist/_node-chunks/chunk-BSKFCWQD.js +47 -0
- package/dist/_node-chunks/chunk-BXVYT7SB.js +36 -0
- package/dist/_node-chunks/chunk-CCOTJ4FC.js +688 -0
- package/dist/_node-chunks/chunk-CQKMLL5J.js +33 -0
- package/dist/_node-chunks/chunk-CXRU72ET.js +63 -0
- package/dist/_node-chunks/chunk-DC7DKR5K.js +20 -0
- package/dist/_node-chunks/chunk-DHJFTB4K.js +25 -0
- package/dist/_node-chunks/chunk-DUR55DJJ.js +1094 -0
- package/dist/_node-chunks/chunk-E6YESGLX.js +7032 -0
- package/dist/_node-chunks/chunk-EHUNOMDD.js +52345 -0
- package/dist/_node-chunks/chunk-ET7PWEO7.js +298 -0
- package/dist/_node-chunks/chunk-EWOX7HPJ.js +20 -0
- package/dist/_node-chunks/chunk-F3ZFKBHY.js +844 -0
- package/dist/_node-chunks/chunk-FK7KGTV7.js +26 -0
- package/dist/_node-chunks/chunk-FPZB5OI7.js +35 -0
- package/dist/_node-chunks/chunk-FW2HQUBQ.js +25 -0
- package/dist/_node-chunks/chunk-FY6UXW6G.js +11 -0
- package/dist/_node-chunks/chunk-GEFQN7K3.js +499 -0
- package/dist/_node-chunks/chunk-GRBLDJCR.js +989 -0
- package/dist/_node-chunks/chunk-H32DYT6P.js +87 -0
- package/dist/_node-chunks/chunk-H4PPVMP5.js +23 -0
- package/dist/_node-chunks/chunk-HMP2G23X.js +25 -0
- package/dist/_node-chunks/chunk-ICPBH3E7.js +59 -0
- package/dist/_node-chunks/chunk-IDEL2J23.js +23 -0
- package/dist/_node-chunks/chunk-IK4FGZLR.js +223 -0
- package/dist/_node-chunks/chunk-JDXXX6LB.js +68 -0
- package/dist/_node-chunks/chunk-JGGFYIG5.js +5468 -0
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +29 -0
- package/dist/_node-chunks/chunk-JZOO7GGC.js +48 -0
- package/dist/_node-chunks/chunk-KISMCCP5.js +4744 -0
- package/dist/_node-chunks/chunk-LCK4ZQKG.js +115 -0
- package/dist/_node-chunks/chunk-LO56I6E2.js +132 -0
- package/dist/_node-chunks/chunk-LXBD4UL4.js +104 -0
- package/dist/_node-chunks/chunk-MA24JW6C.js +7162 -0
- package/dist/_node-chunks/chunk-MK2KYAI6.js +5414 -0
- package/dist/_node-chunks/chunk-NDWKJ4CL.js +2102 -0
- package/dist/_node-chunks/chunk-NIBT7XDZ.js +168 -0
- package/dist/_node-chunks/chunk-NPO45IMH.js +33 -0
- package/dist/_node-chunks/chunk-OISX4AGQ.js +414 -0
- package/dist/_node-chunks/chunk-OUW6R7C3.js +26 -0
- package/dist/_node-chunks/chunk-OWNFOGTA.js +194 -0
- package/dist/_node-chunks/chunk-Q7QNUM5H.js +49 -0
- package/dist/_node-chunks/chunk-QEQLR22M.js +1877 -0
- package/dist/_node-chunks/chunk-RRN2V55B.js +45 -0
- package/dist/_node-chunks/chunk-RWFIFGO5.js +144 -0
- package/dist/_node-chunks/chunk-RXNJDRGO.js +209 -0
- package/dist/_node-chunks/chunk-RZMQ7S3L.js +92 -0
- package/dist/_node-chunks/chunk-SIEXZVCR.js +51 -0
- package/dist/_node-chunks/chunk-SLWQNBGO.js +2034 -0
- package/dist/_node-chunks/chunk-SVTBJ7Q3.js +35 -0
- package/dist/_node-chunks/chunk-SWO5CDYU.js +32 -0
- package/dist/_node-chunks/chunk-TD5PLLQG.js +121 -0
- package/dist/_node-chunks/chunk-TEQGGSP7.js +33 -0
- package/dist/_node-chunks/chunk-TFCEV2XX.js +155 -0
- package/dist/_node-chunks/chunk-TFEWM4E3.js +1073 -0
- package/dist/_node-chunks/chunk-TINO74G5.js +21 -0
- package/dist/_node-chunks/chunk-TNJIXE37.js +40 -0
- package/dist/_node-chunks/chunk-TWI4GVH7.js +19 -0
- package/dist/_node-chunks/chunk-U5W53R2J.js +1011 -0
- package/dist/_node-chunks/chunk-UBOGWBEA.js +148 -0
- package/dist/_node-chunks/chunk-UMUBKI6E.js +3787 -0
- package/dist/_node-chunks/chunk-UVINFLGY.js +56 -0
- package/dist/_node-chunks/chunk-V2DY426G.js +1133 -0
- package/dist/_node-chunks/chunk-VLOXOXXE.js +45 -0
- package/dist/_node-chunks/chunk-W4OMYLSP.js +1297 -0
- package/dist/_node-chunks/chunk-WAXVSN3O.js +18 -0
- package/dist/_node-chunks/chunk-WCULS5TP.js +3767 -0
- package/dist/_node-chunks/chunk-WNZ2UMFM.js +153 -0
- package/dist/_node-chunks/chunk-WZJF2OUH.js +74 -0
- package/dist/_node-chunks/chunk-XGIUVY52.js +611 -0
- package/dist/_node-chunks/chunk-XHL2LVBM.js +415 -0
- package/dist/_node-chunks/chunk-XI6B6P47.js +59 -0
- package/dist/_node-chunks/chunk-XLP2ZKXV.js +60 -0
- package/dist/_node-chunks/chunk-YCMRA6RX.js +95 -0
- package/dist/_node-chunks/chunk-YZFWBA5L.js +2700 -0
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +4731 -0
- package/dist/_node-chunks/chunk-ZWBCQ4MJ.js +110 -0
- package/dist/_node-chunks/dist-VTSTZKUB.js +16 -0
- package/dist/_node-chunks/globby-OEMHPBFY.js +2884 -0
- package/dist/_node-chunks/jiti-NFX6UU74.js +3848 -0
- package/dist/_node-chunks/lib-MDVARD7W.js +366 -0
- package/dist/_node-chunks/local-runtime-NTKIN2QT.js +78 -0
- package/dist/_node-chunks/mdx-plugin-MWISDWDQ.js +5680 -0
- package/dist/_node-chunks/monorepo-LIRFMQXE.js +121 -0
- package/dist/_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js +121 -0
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +22 -0
- package/dist/_node-chunks/pattern-copy-play-EKHIUAU2.js +807 -0
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +20 -0
- package/dist/_node-chunks/rehype-external-links-BUN3HUCO.js +121 -0
- package/dist/_node-chunks/rehype-slug-PLADX223.js +52 -0
- package/dist/_node-chunks/relaxed-limits-GBHW6KIQ.js +117 -0
- package/dist/_node-chunks/run-KDTIZNSY.js +103 -0
- package/dist/_node-chunks/run-NL66VTNR.js +4532 -0
- package/dist/_node-chunks/session-id-KIIVOQLR.js +23 -0
- package/dist/_node-chunks/setup-MGC7BQO6.js +278 -0
- package/dist/_node-chunks/vitest.config.4.template-JH2THZFG.js +54 -0
- package/dist/actions/decorator.d.ts +7 -0
- package/dist/actions/decorator.js +43 -0
- package/dist/actions/index.d.ts +67 -0
- package/dist/actions/index.js +28 -0
- package/dist/addon-a11y/index.d.ts +52 -0
- package/dist/addon-a11y/index.js +16 -0
- package/dist/addon-a11y/manager.js +1429 -0
- package/dist/addon-a11y/preset.js +18 -0
- package/dist/addon-a11y/preview.d.ts +17 -0
- package/dist/addon-a11y/preview.js +15 -0
- package/dist/addon-docs/blocks.d.ts +1061 -0
- package/dist/addon-docs/blocks.js +2461 -0
- package/dist/addon-docs/index.d.ts +236 -0
- package/dist/addon-docs/index.js +16 -0
- package/dist/addon-docs/manager.js +90 -0
- package/dist/addon-docs/mdx-react-shim.d.ts +1 -0
- package/dist/addon-docs/mdx-react-shim.js +2 -0
- package/dist/addon-docs/preset.js +378 -0
- package/dist/addon-docs/preview.d.ts +4 -0
- package/dist/addon-docs/preview.js +7 -0
- package/dist/addon-links/index.d.ts +22 -0
- package/dist/addon-links/index.js +20 -0
- package/dist/addon-links/manager.js +14 -0
- package/dist/addon-links/preview.d.ts +6 -0
- package/dist/addon-links/preview.js +9 -0
- package/dist/addon-links/react/index.d.ts +25 -0
- package/dist/addon-links/react/index.js +52 -0
- package/dist/addon-mcp/preset.js +1345 -0
- package/dist/addon-mcp/preview.js +29 -0
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +1153 -0
- package/dist/addon-ondevice-actions/index.d.ts +4 -0
- package/dist/addon-ondevice-actions/index.js +7 -0
- package/dist/addon-ondevice-actions/register.js +7 -0
- package/dist/addon-ondevice-controls/index.d.ts +6 -0
- package/dist/addon-ondevice-controls/index.js +14 -0
- package/dist/addon-ondevice-controls/register.js +10 -0
- package/dist/addon-pseudo-states/index.d.ts +35 -0
- package/dist/addon-pseudo-states/index.js +15 -0
- package/dist/addon-pseudo-states/manager.js +53 -0
- package/dist/addon-pseudo-states/preview.d.ts +9 -0
- package/dist/addon-pseudo-states/preview.js +10 -0
- package/dist/addon-themes/index.d.ts +80 -0
- package/dist/addon-themes/index.js +104 -0
- package/dist/addon-themes/manager.js +97 -0
- package/dist/addon-themes/postinstall.js +33 -0
- package/dist/addon-themes/preview.d.ts +6 -0
- package/dist/addon-themes/preview.js +8 -0
- package/dist/addon-vitest/constants.d.ts +132 -0
- package/dist/addon-vitest/constants.js +66 -0
- package/dist/addon-vitest/index.d.ts +4 -0
- package/dist/addon-vitest/index.js +8 -0
- package/dist/addon-vitest/manager.js +665 -0
- package/dist/addon-vitest/node/coverage-reporter.js +1284 -0
- package/dist/addon-vitest/node/vitest.js +674 -0
- package/dist/addon-vitest/postinstall.js +24 -0
- package/dist/addon-vitest/preset.js +943 -0
- package/dist/addon-vitest/vitest-plugin/global-setup.js +162 -0
- package/dist/addon-vitest/vitest-plugin/index.d.ts +56 -0
- package/dist/addon-vitest/vitest-plugin/index.js +463 -0
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +9 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.browser.4.js +20 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.js +50 -0
- package/dist/addon-vitest/vitest-plugin/test-utils.js +128 -0
- package/dist/babel/index.d.ts +2301 -0
- package/dist/babel/index.js +61 -0
- package/dist/backgrounds/index.d.ts +6 -0
- package/dist/backgrounds/index.js +15 -0
- package/dist/bin/core.js +1705 -0
- package/dist/bin/dispatcher.js +43 -0
- package/dist/bin/loader.js +115 -0
- package/dist/builder-vite/index.d.ts +50 -0
- package/dist/builder-vite/index.js +245 -0
- package/dist/builder-vite/preset.js +27 -0
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.js +352 -0
- package/dist/chunk-B2t1tGRh.d.ts +284 -0
- package/dist/chunk-BCoJQE-f.d.ts +602 -0
- package/dist/chunk-BGkgZp-H.d.ts +214 -0
- package/dist/chunk-BTVrWliM.d.ts +115 -0
- package/dist/chunk-BXLImeLy.d.ts +197 -0
- package/dist/chunk-BfBzpgct.d.ts +916 -0
- package/dist/chunk-Bpi2tz-6.d.ts +511 -0
- package/dist/chunk-BxWufQms.d.ts +142 -0
- package/dist/chunk-C-bavsOH.d.ts +34 -0
- package/dist/chunk-C2p5r3Vt.d.ts +13001 -0
- package/dist/chunk-C6PAgHLT.d.ts +12 -0
- package/dist/chunk-CMeX4WRe.d.ts +179 -0
- package/dist/chunk-Ct9xd6IM.d.ts +65 -0
- package/dist/chunk-CwQKNaYL.d.ts +15 -0
- package/dist/chunk-D7DwV41f.d.ts +3622 -0
- package/dist/chunk-DEVFdzxR.d.ts +253 -0
- package/dist/chunk-DaVb55-_.d.ts +124 -0
- package/dist/chunk-DgRNfmj_.d.ts +40 -0
- package/dist/chunk-DoIGKY33.d.ts +666 -0
- package/dist/chunk-Dr3R0DXk.d.ts +40 -0
- package/dist/chunk-DtHByo32.d.ts +55 -0
- package/dist/chunk-Dw1z1Pki.d.ts +933 -0
- package/dist/chunk-DzuY9DXg.d.ts +79 -0
- package/dist/chunk-FjDVzZTj.d.ts +62 -0
- package/dist/chunk-Kt1tW-D1.d.ts +59 -0
- package/dist/chunk-XP8oHzpE.d.ts +6 -0
- package/dist/chunk-gCX81nOr.d.ts +61 -0
- package/dist/chunk-pcFXCimE.d.ts +741 -0
- package/dist/cli/index.d.ts +1174 -0
- package/dist/cli/index.js +5613 -0
- package/dist/cli/skills/content/index.d.ts +72 -0
- package/dist/cli/skills/content/index.js +335 -0
- package/dist/cli/tools/sdk/child-host.d.ts +61 -0
- package/dist/cli/tools/sdk/child-host.js +131 -0
- package/dist/cli/tools/sdk/index.d.ts +137 -0
- package/dist/cli/tools/sdk/index.js +44 -0
- package/dist/cli-commands/bin/index.js +25 -0
- package/dist/client-logger/index.d.ts +31 -0
- package/dist/client-logger/index.js +63 -0
- package/dist/common/index.d.ts +1103 -0
- package/dist/common/index.js +364 -0
- package/dist/components/index.d.ts +1924 -0
- package/dist/components/index.js +13759 -0
- package/dist/core-events/index.d.ts +155 -0
- package/dist/core-events/index.js +136 -0
- package/dist/core-server/index.d.ts +2200 -0
- package/dist/core-server/index.js +4165 -0
- package/dist/core-server/presets/common-manager.css +170 -0
- package/dist/core-server/presets/common-manager.js +4168 -0
- package/dist/core-server/presets/common-override-preset.js +81 -0
- package/dist/core-server/presets/common-preset.js +2187 -0
- package/dist/create/bin/index.js +23 -0
- package/dist/create/index.js +25 -0
- package/dist/csf/csf-utils.d.ts +2 -0
- package/dist/csf/csf-utils.js +19 -0
- package/dist/csf/index.d.ts +7 -0
- package/dist/csf/index.js +2142 -0
- package/dist/csf-tools/index.d.ts +1157 -0
- package/dist/csf-tools/index.js +736 -0
- package/dist/docs-tools/index.d.ts +197 -0
- package/dist/docs-tools/index.js +61 -0
- package/dist/highlight/index.d.ts +10 -0
- package/dist/highlight/index.js +15 -0
- package/dist/instrumenter/index.d.ts +113 -0
- package/dist/instrumenter/index.js +2595 -0
- package/dist/manager/_manager-chunks/globals-runtime-8HkdnU2F.js +6144 -0
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +3389 -0
- package/dist/manager/_manager-chunks/globals-runtime-BdGkqNEt.js +45 -0
- package/dist/manager/_manager-chunks/globals-runtime-BmphMP6z.js +1190 -0
- package/dist/manager/_manager-chunks/globals-runtime-BvM-NY2g.js +13307 -0
- package/dist/manager/_manager-chunks/globals-runtime-C02fvgcd.js +9243 -0
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +9766 -0
- package/dist/manager/_manager-chunks/globals-runtime-DpNYC-qi.js +5564 -0
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +5357 -0
- package/dist/manager/_manager-chunks/globals-runtime-DwFqpqya.js +722 -0
- package/dist/manager/_manager-chunks/globals-runtime-FC201B7s.js +6837 -0
- package/dist/manager/_manager-chunks/globals-runtime-Rp_zjGnh.js +121 -0
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +10463 -0
- package/dist/manager/_manager-chunks/globals-runtime-eLPTIfX-.js +7759 -0
- package/dist/manager/_manager-chunks/globals-runtime-qKvCZHFY.js +4468 -0
- package/dist/manager/_manager-chunks/globals-runtime-sGpNlIJ1.js +5102 -0
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +452 -0
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +22 -0
- package/dist/manager/_manager-chunks/runtime-BhkT2CXl.js +1408 -0
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +998 -0
- package/dist/manager/_manager-chunks/runtime-D0UOWx0U.js +979 -0
- package/dist/manager/_manager-chunks/runtime-D94Vq3oR.js +4014 -0
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +77 -0
- package/dist/manager/_manager-chunks/runtime-EITvVbkG.js +46 -0
- package/dist/manager/_manager-chunks/runtime-cp5pazY2.js +8936 -0
- package/dist/manager/_manager-chunks/runtime-eDVAYF7N.js +6860 -0
- package/dist/manager/_manager-chunks/runtime-i-PDAHLR.js +2493 -0
- package/dist/manager/globals-runtime.js +2 -0
- package/dist/manager/globals.d.ts +23 -0
- package/dist/manager/globals.js +26 -0
- package/dist/manager/manager-stores.d.ts +2 -0
- package/dist/manager/manager-stores.js +19 -0
- package/dist/manager/runtime.js +2 -0
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +3257 -0
- package/dist/manager-errors.d.ts +89 -0
- package/dist/manager-errors.js +20 -0
- package/dist/mcp/index.d.ts +270 -0
- package/dist/mcp/index.js +305 -0
- package/dist/mocking-utils/index.d.ts +689 -0
- package/dist/mocking-utils/index.js +521 -0
- package/dist/mocking-utils/mocker-runtime.js +1254 -0
- package/dist/nextjs-vite/config/preview.js +3 -0
- package/dist/nextjs-vite/export-mocks/cache/index.d.ts +25 -0
- package/dist/nextjs-vite/export-mocks/cache/index.js +29 -0
- package/dist/nextjs-vite/export-mocks/headers/index.d.ts +37 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +54 -0
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +9 -0
- package/dist/nextjs-vite/export-mocks/link/index.js +59 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +28 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.js +58 -0
- package/dist/nextjs-vite/export-mocks/router/index.d.ts +34 -0
- package/dist/nextjs-vite/export-mocks/router/index.js +63 -0
- package/dist/nextjs-vite/index.d.ts +92 -0
- package/dist/nextjs-vite/index.js +58 -0
- package/dist/nextjs-vite/node/index.d.ts +6 -0
- package/dist/nextjs-vite/node/index.js +20 -0
- package/dist/nextjs-vite/preset.js +648 -0
- package/dist/nextjs-vite/preview.d.ts +20 -0
- package/dist/nextjs-vite/preview.js +11 -0
- package/dist/nextjs-vite/vite-plugin/index.d.ts +6 -0
- package/dist/nextjs-vite/vite-plugin/index.js +19 -0
- package/dist/nextjs-vite-plugin/index.d.ts +28 -0
- package/dist/nextjs-vite-plugin/index.js +923 -0
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-context.js +8 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-default-loader.js +23 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +28 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +17 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/cache/index.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/dynamic/index.js +40 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/headers/index.js +55 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/link/index.js +63 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/navigation/index.js +71 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +74 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/rsc/server-only.js +7 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/safe-stable-stringify/index.js +13 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/compatibility/draft-mode.compat.js +7 -0
- package/dist/node-logger/index.d.ts +495 -0
- package/dist/node-logger/index.js +42 -0
- package/dist/oxc-parser/index.d.ts +99 -0
- package/dist/oxc-parser/index.js +275 -0
- package/dist/oxc-parser/worker.js +37 -0
- package/dist/preview/_chunks/runtime-BIzIdDbb.js +10263 -0
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +1102 -0
- package/dist/preview/_chunks/runtime-BZSnICCg.js +8484 -0
- package/dist/preview/_chunks/runtime-BdGkqNEt.js +45 -0
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +63 -0
- package/dist/preview/_chunks/runtime-CqHxptiK.js +6143 -0
- package/dist/preview/_chunks/runtime-CsV4HZPV.js +5064 -0
- package/dist/preview/_chunks/runtime-CxZK_Ln3.js +284 -0
- package/dist/preview/_chunks/runtime-DZToXfvO.js +9767 -0
- package/dist/preview/_chunks/runtime-DrTjJkPY.js +3872 -0
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +387 -0
- package/dist/preview/_chunks/runtime-iXdo8CR8.js +3635 -0
- package/dist/preview/_chunks/runtime-q3wt0e_N.js +6838 -0
- package/dist/preview/globals.d.ts +16 -0
- package/dist/preview/globals.js +20 -0
- package/dist/preview/runtime.js +6 -0
- package/dist/preview-api/index.d.ts +4 -0
- package/dist/preview-api/index.js +147 -0
- package/dist/preview-errors.d.ts +186 -0
- package/dist/preview-errors.js +56 -0
- package/dist/react/docgen/docgen-worker.js +38 -0
- package/dist/react/entry-preview-argtypes.js +9 -0
- package/dist/react/entry-preview-docs.js +12 -0
- package/dist/react/entry-preview-rsc.js +11 -0
- package/dist/react/entry-preview.js +21 -0
- package/dist/react/index.d.ts +119 -0
- package/dist/react/index.js +26 -0
- package/dist/react/preset.js +301 -0
- package/dist/react/preview.d.ts +2 -0
- package/dist/react/preview.js +11 -0
- package/dist/react-native/bin/get-stories.js +34 -0
- package/dist/react-native/index.d.ts +160 -0
- package/dist/react-native/index.js +1547 -0
- package/dist/react-native/metro/node.d.ts +83 -0
- package/dist/react-native/metro/node.js +21 -0
- package/dist/react-native/metro/withStorybook.d.ts +2269 -0
- package/dist/react-native/metro/withStorybook.js +138 -0
- package/dist/react-native/preview.d.ts +6 -0
- package/dist/react-native/preview.js +20 -0
- package/dist/react-native/scripts/generate.d.ts +22 -0
- package/dist/react-native/scripts/generate.js +18 -0
- package/dist/react-native/stub.js +20 -0
- package/dist/react-native-theming/index.d.ts +175 -0
- package/dist/react-native-theming/index.js +2591 -0
- package/dist/react-native-ui/index.d.ts +130 -0
- package/dist/react-native-ui/index.js +1448 -0
- package/dist/react-native-ui-common/index.d.ts +230 -0
- package/dist/react-native-ui-common/index.js +514 -0
- package/dist/react-vite/index.d.ts +4 -0
- package/dist/react-vite/index.js +8 -0
- package/dist/react-vite/node/index.d.ts +6 -0
- package/dist/react-vite/node/index.js +20 -0
- package/dist/react-vite/preset.d.ts +6 -0
- package/dist/react-vite/preset.js +21 -0
- package/dist/router/index.d.ts +141 -0
- package/dist/router/index.js +1217 -0
- package/dist/server-errors.d.ts +2 -0
- package/dist/server-errors.js +149 -0
- package/dist/shared/open-service/index.d.ts +3 -0
- package/dist/shared/open-service/index.js +115 -0
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +75 -0
- package/dist/shared/open-service/toolsets/docs/public.d.ts +1296 -0
- package/dist/shared/open-service/toolsets/docs/public.js +991 -0
- package/dist/telemetry/index.d.ts +314 -0
- package/dist/telemetry/index.js +103 -0
- package/dist/test/index.d.ts +158 -0
- package/dist/test/index.js +19421 -0
- package/dist/theming/create.d.ts +15 -0
- package/dist/theming/create.js +11 -0
- package/dist/theming/index.d.ts +54 -0
- package/dist/theming/index.js +511 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +48 -0
- package/dist/viewport/index.d.ts +275 -0
- package/dist/viewport/index.js +21 -0
- package/package.json +1054 -4
- package/template/nextjs-vite/cli/.eslintrc.json +6 -0
- package/template/nextjs-vite/cli/js/Button.jsx +42 -0
- package/template/nextjs-vite/cli/js/Button.stories.js +49 -0
- package/template/nextjs-vite/cli/js/Configure.mdx +470 -0
- package/template/nextjs-vite/cli/js/Header.jsx +58 -0
- package/template/nextjs-vite/cli/js/Header.stories.js +30 -0
- package/template/nextjs-vite/cli/js/Page.jsx +68 -0
- package/template/nextjs-vite/cli/js/Page.stories.js +28 -0
- package/template/nextjs-vite/cli/ts/Button.stories.ts +54 -0
- package/template/nextjs-vite/cli/ts/Button.tsx +39 -0
- package/template/nextjs-vite/cli/ts/Configure.mdx +446 -0
- package/template/nextjs-vite/cli/ts/Header.stories.ts +34 -0
- package/template/nextjs-vite/cli/ts/Header.tsx +54 -0
- package/template/nextjs-vite/cli/ts/Page.stories.ts +33 -0
- package/template/nextjs-vite/cli/ts/Page.tsx +73 -0
- package/template/react/cli/.eslintrc.json +5 -0
- package/template/react/cli/js/Button.jsx +39 -0
- package/template/react/cli/js/Button.stories.js +49 -0
- package/template/react/cli/js/Header.jsx +56 -0
- package/template/react/cli/js/Header.stories.js +29 -0
- package/template/react/cli/js/Page.jsx +69 -0
- package/template/react/cli/js/Page.stories.js +28 -0
- package/template/react/cli/ts/Button.stories.ts +54 -0
- package/template/react/cli/ts/Button.tsx +37 -0
- package/template/react/cli/ts/Header.stories.ts +34 -0
- package/template/react/cli/ts/Header.tsx +56 -0
- package/template/react/cli/ts/Page.stories.ts +33 -0
- package/template/react/cli/ts/Page.tsx +73 -0
- package/template/react-vite/cli/.eslintrc.json +5 -0
- package/template/react-vite/cli/js/Button.jsx +39 -0
- package/template/react-vite/cli/js/Button.stories.js +49 -0
- package/template/react-vite/cli/js/Header.jsx +56 -0
- package/template/react-vite/cli/js/Header.stories.js +29 -0
- package/template/react-vite/cli/js/Page.jsx +69 -0
- package/template/react-vite/cli/js/Page.stories.js +28 -0
- package/template/react-vite/cli/ts/Button.stories.ts +54 -0
- package/template/react-vite/cli/ts/Button.tsx +37 -0
- package/template/react-vite/cli/ts/Header.stories.ts +34 -0
- package/template/react-vite/cli/ts/Header.tsx +56 -0
- package/template/react-vite/cli/ts/Page.stories.ts +33 -0
- package/template/react-vite/cli/ts/Page.tsx +73 -0
|
@@ -0,0 +1,1254 @@
|
|
|
1
|
+
// ../../node_modules/@vitest/mocker/dist/chunk-registry.js
|
|
2
|
+
var MockerRegistry = class {
|
|
3
|
+
registryByUrl = /* @__PURE__ */ new Map();
|
|
4
|
+
registryById = /* @__PURE__ */ new Map();
|
|
5
|
+
clear() {
|
|
6
|
+
this.registryByUrl.clear(), this.registryById.clear();
|
|
7
|
+
}
|
|
8
|
+
keys() {
|
|
9
|
+
return this.registryByUrl.keys();
|
|
10
|
+
}
|
|
11
|
+
add(mock) {
|
|
12
|
+
this.registryByUrl.set(mock.url, mock), this.registryById.set(mock.id, mock);
|
|
13
|
+
}
|
|
14
|
+
register(typeOrEvent, raw, id, url, factoryOrRedirect) {
|
|
15
|
+
let type = typeof typeOrEvent == "object" ? typeOrEvent.type : typeOrEvent;
|
|
16
|
+
if (typeof typeOrEvent == "object") {
|
|
17
|
+
let event = typeOrEvent;
|
|
18
|
+
if (event instanceof AutomockedModule || event instanceof AutospiedModule || event instanceof ManualMockedModule || event instanceof RedirectedModule)
|
|
19
|
+
throw new TypeError(`[vitest] Cannot register a mock that is already defined. Expected a JSON representation from \`MockedModule.toJSON\`, instead got "${event.type}". Use "registry.add()" to update a mock instead.`);
|
|
20
|
+
if (event.type === "automock") {
|
|
21
|
+
let module = AutomockedModule.fromJSON(event);
|
|
22
|
+
return this.add(module), module;
|
|
23
|
+
} else if (event.type === "autospy") {
|
|
24
|
+
let module = AutospiedModule.fromJSON(event);
|
|
25
|
+
return this.add(module), module;
|
|
26
|
+
} else if (event.type === "redirect") {
|
|
27
|
+
let module = RedirectedModule.fromJSON(event);
|
|
28
|
+
return this.add(module), module;
|
|
29
|
+
} else throw event.type === "manual" ? new Error("Cannot set serialized manual mock. Define a factory function manually with `ManualMockedModule.fromJSON()`.") : new Error(`Unknown mock type: ${event.type}`);
|
|
30
|
+
}
|
|
31
|
+
if (typeof raw != "string")
|
|
32
|
+
throw new TypeError("[vitest] Mocks require a raw string.");
|
|
33
|
+
if (typeof url != "string")
|
|
34
|
+
throw new TypeError("[vitest] Mocks require a url string.");
|
|
35
|
+
if (typeof id != "string")
|
|
36
|
+
throw new TypeError("[vitest] Mocks require an id string.");
|
|
37
|
+
if (type === "manual") {
|
|
38
|
+
if (typeof factoryOrRedirect != "function")
|
|
39
|
+
throw new TypeError("[vitest] Manual mocks require a factory function.");
|
|
40
|
+
let mock = new ManualMockedModule(raw, id, url, factoryOrRedirect);
|
|
41
|
+
return this.add(mock), mock;
|
|
42
|
+
} else if (type === "automock" || type === "autospy") {
|
|
43
|
+
let mock = type === "automock" ? new AutomockedModule(raw, id, url) : new AutospiedModule(raw, id, url);
|
|
44
|
+
return this.add(mock), mock;
|
|
45
|
+
} else if (type === "redirect") {
|
|
46
|
+
if (typeof factoryOrRedirect != "string")
|
|
47
|
+
throw new TypeError("[vitest] Redirect mocks require a redirect string.");
|
|
48
|
+
let mock = new RedirectedModule(raw, id, url, factoryOrRedirect);
|
|
49
|
+
return this.add(mock), mock;
|
|
50
|
+
} else
|
|
51
|
+
throw new Error(`[vitest] Unknown mock type: ${type}`);
|
|
52
|
+
}
|
|
53
|
+
delete(id) {
|
|
54
|
+
this.registryByUrl.delete(id);
|
|
55
|
+
}
|
|
56
|
+
get(id) {
|
|
57
|
+
return this.registryByUrl.get(id);
|
|
58
|
+
}
|
|
59
|
+
getById(id) {
|
|
60
|
+
return this.registryById.get(id);
|
|
61
|
+
}
|
|
62
|
+
has(id) {
|
|
63
|
+
return this.registryByUrl.has(id);
|
|
64
|
+
}
|
|
65
|
+
}, AutomockedModule = class {
|
|
66
|
+
type = "automock";
|
|
67
|
+
constructor(raw, id, url) {
|
|
68
|
+
this.raw = raw, this.id = id, this.url = url;
|
|
69
|
+
}
|
|
70
|
+
static fromJSON(data) {
|
|
71
|
+
return new AutospiedModule(data.raw, data.id, data.url);
|
|
72
|
+
}
|
|
73
|
+
toJSON() {
|
|
74
|
+
return {
|
|
75
|
+
type: this.type,
|
|
76
|
+
url: this.url,
|
|
77
|
+
raw: this.raw,
|
|
78
|
+
id: this.id
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}, AutospiedModule = class _AutospiedModule {
|
|
82
|
+
type = "autospy";
|
|
83
|
+
constructor(raw, id, url) {
|
|
84
|
+
this.raw = raw, this.id = id, this.url = url;
|
|
85
|
+
}
|
|
86
|
+
static fromJSON(data) {
|
|
87
|
+
return new _AutospiedModule(data.raw, data.id, data.url);
|
|
88
|
+
}
|
|
89
|
+
toJSON() {
|
|
90
|
+
return {
|
|
91
|
+
type: this.type,
|
|
92
|
+
url: this.url,
|
|
93
|
+
id: this.id,
|
|
94
|
+
raw: this.raw
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}, RedirectedModule = class _RedirectedModule {
|
|
98
|
+
type = "redirect";
|
|
99
|
+
constructor(raw, id, url, redirect) {
|
|
100
|
+
this.raw = raw, this.id = id, this.url = url, this.redirect = redirect;
|
|
101
|
+
}
|
|
102
|
+
static fromJSON(data) {
|
|
103
|
+
return new _RedirectedModule(data.raw, data.id, data.url, data.redirect);
|
|
104
|
+
}
|
|
105
|
+
toJSON() {
|
|
106
|
+
return {
|
|
107
|
+
type: this.type,
|
|
108
|
+
url: this.url,
|
|
109
|
+
raw: this.raw,
|
|
110
|
+
id: this.id,
|
|
111
|
+
redirect: this.redirect
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}, ManualMockedModule = class _ManualMockedModule {
|
|
115
|
+
cache;
|
|
116
|
+
type = "manual";
|
|
117
|
+
constructor(raw, id, url, factory) {
|
|
118
|
+
this.raw = raw, this.id = id, this.url = url, this.factory = factory;
|
|
119
|
+
}
|
|
120
|
+
async resolve() {
|
|
121
|
+
if (this.cache)
|
|
122
|
+
return this.cache;
|
|
123
|
+
let exports;
|
|
124
|
+
try {
|
|
125
|
+
exports = await this.factory();
|
|
126
|
+
} catch (err) {
|
|
127
|
+
let vitestError = new Error('[vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock');
|
|
128
|
+
throw vitestError.cause = err, vitestError;
|
|
129
|
+
}
|
|
130
|
+
if (exports === null || typeof exports != "object" || Array.isArray(exports))
|
|
131
|
+
throw new TypeError(`[vitest] vi.mock("${this.raw}", factory?: () => unknown) is not returning an object. Did you mean to return an object with a "default" key?`);
|
|
132
|
+
return this.cache = exports;
|
|
133
|
+
}
|
|
134
|
+
static fromJSON(data, factory) {
|
|
135
|
+
return new _ManualMockedModule(data.raw, data.id, data.url, factory);
|
|
136
|
+
}
|
|
137
|
+
toJSON() {
|
|
138
|
+
return {
|
|
139
|
+
type: this.type,
|
|
140
|
+
url: this.url,
|
|
141
|
+
id: this.id,
|
|
142
|
+
raw: this.raw
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// ../../node_modules/@vitest/mocker/dist/index.js
|
|
148
|
+
function mockObject(options, object, mockExports = {}) {
|
|
149
|
+
let finalizers = new Array(), refs = new RefTracker(), define = (container, key, value) => {
|
|
150
|
+
try {
|
|
151
|
+
return container[key] = value, !0;
|
|
152
|
+
} catch {
|
|
153
|
+
return !1;
|
|
154
|
+
}
|
|
155
|
+
}, mockPropertiesOf = (container, newContainer) => {
|
|
156
|
+
let containerType = getType(container), isModule = containerType === "Module" || !!container.__esModule;
|
|
157
|
+
for (let { key: property, descriptor } of getAllMockableProperties(container, isModule, options.globalConstructors)) {
|
|
158
|
+
if (!isModule && descriptor.get) {
|
|
159
|
+
try {
|
|
160
|
+
Object.defineProperty(newContainer, property, descriptor);
|
|
161
|
+
} catch {
|
|
162
|
+
}
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (isSpecialProp(property, containerType))
|
|
166
|
+
continue;
|
|
167
|
+
let value = container[property], refId = refs.getId(value);
|
|
168
|
+
if (refId !== void 0) {
|
|
169
|
+
finalizers.push(() => define(newContainer, property, refs.getMockedValue(refId)));
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
let type = getType(value);
|
|
173
|
+
if (Array.isArray(value)) {
|
|
174
|
+
define(newContainer, property, []);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
let isFunction = type.includes("Function") && typeof value == "function";
|
|
178
|
+
if ((!isFunction || value._isMockFunction) && type !== "Object" && type !== "Module") {
|
|
179
|
+
define(newContainer, property, value);
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
if (define(newContainer, property, isFunction ? value : {})) {
|
|
183
|
+
if (isFunction) {
|
|
184
|
+
let mockFunction = function() {
|
|
185
|
+
if (this instanceof newContainer[property])
|
|
186
|
+
for (let { key, descriptor: descriptor2 } of getAllMockableProperties(this, !1, options.globalConstructors)) {
|
|
187
|
+
if (descriptor2.get)
|
|
188
|
+
continue;
|
|
189
|
+
let value2 = this[key];
|
|
190
|
+
if (getType(value2).includes("Function") && typeof value2 == "function") {
|
|
191
|
+
let original = this[key], mock2 = spyOn(this, key).mockImplementation(original), origMockReset = mock2.mockReset;
|
|
192
|
+
mock2.mockRestore = mock2.mockReset = () => (origMockReset.call(mock2), mock2.mockImplementation(original), mock2);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
if (!options.spyOn)
|
|
197
|
+
throw new Error("[@vitest/mocker] `spyOn` is not defined. This is a Vitest error. Please open a new issue with reproduction.");
|
|
198
|
+
let spyOn = options.spyOn, mock = spyOn(newContainer, property);
|
|
199
|
+
if (options.type === "automock") {
|
|
200
|
+
mock.mockImplementation(mockFunction);
|
|
201
|
+
let origMockReset = mock.mockReset;
|
|
202
|
+
mock.mockRestore = mock.mockReset = () => (origMockReset.call(mock), mock.mockImplementation(mockFunction), mock);
|
|
203
|
+
}
|
|
204
|
+
Object.defineProperty(newContainer[property], "length", { value: 0 });
|
|
205
|
+
}
|
|
206
|
+
refs.track(value, newContainer[property]), mockPropertiesOf(value, newContainer[property]);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}, mockedObject = mockExports;
|
|
210
|
+
mockPropertiesOf(object, mockedObject);
|
|
211
|
+
for (let finalizer of finalizers)
|
|
212
|
+
finalizer();
|
|
213
|
+
return mockedObject;
|
|
214
|
+
}
|
|
215
|
+
var RefTracker = class {
|
|
216
|
+
idMap = /* @__PURE__ */ new Map();
|
|
217
|
+
mockedValueMap = /* @__PURE__ */ new Map();
|
|
218
|
+
getId(value) {
|
|
219
|
+
return this.idMap.get(value);
|
|
220
|
+
}
|
|
221
|
+
getMockedValue(id) {
|
|
222
|
+
return this.mockedValueMap.get(id);
|
|
223
|
+
}
|
|
224
|
+
track(originalValue, mockedValue) {
|
|
225
|
+
let newId = this.idMap.size;
|
|
226
|
+
return this.idMap.set(originalValue, newId), this.mockedValueMap.set(newId, mockedValue), newId;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
function getType(value) {
|
|
230
|
+
return Object.prototype.toString.apply(value).slice(8, -1);
|
|
231
|
+
}
|
|
232
|
+
function isSpecialProp(prop, parentType) {
|
|
233
|
+
return parentType.includes("Function") && typeof prop == "string" && [
|
|
234
|
+
"arguments",
|
|
235
|
+
"callee",
|
|
236
|
+
"caller",
|
|
237
|
+
"length",
|
|
238
|
+
"name"
|
|
239
|
+
].includes(prop);
|
|
240
|
+
}
|
|
241
|
+
function getAllMockableProperties(obj, isModule, constructors) {
|
|
242
|
+
let { Map: Map2, Object: Object2, Function: Function2, RegExp: RegExp2, Array: Array2 } = constructors, allProps = new Map2(), curr = obj;
|
|
243
|
+
do {
|
|
244
|
+
if (curr === Object2.prototype || curr === Function2.prototype || curr === RegExp2.prototype)
|
|
245
|
+
break;
|
|
246
|
+
collectOwnProperties(curr, (key) => {
|
|
247
|
+
let descriptor = Object2.getOwnPropertyDescriptor(curr, key);
|
|
248
|
+
descriptor && allProps.set(key, {
|
|
249
|
+
key,
|
|
250
|
+
descriptor
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
} while (curr = Object2.getPrototypeOf(curr));
|
|
254
|
+
if (isModule && !allProps.has("default") && "default" in obj) {
|
|
255
|
+
let descriptor = Object2.getOwnPropertyDescriptor(obj, "default");
|
|
256
|
+
descriptor && allProps.set("default", {
|
|
257
|
+
key: "default",
|
|
258
|
+
descriptor
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
return Array2.from(allProps.values());
|
|
262
|
+
}
|
|
263
|
+
function collectOwnProperties(obj, collector) {
|
|
264
|
+
let collect = typeof collector == "function" ? collector : (key) => collector.add(key);
|
|
265
|
+
Object.getOwnPropertyNames(obj).forEach(collect), Object.getOwnPropertySymbols(obj).forEach(collect);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// ../../node_modules/@vitest/mocker/dist/chunk-pathe.M-eThtNZ.js
|
|
269
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
270
|
+
function normalizeWindowsPath(input = "") {
|
|
271
|
+
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
272
|
+
}
|
|
273
|
+
var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, normalize = function(path) {
|
|
274
|
+
if (path.length === 0)
|
|
275
|
+
return ".";
|
|
276
|
+
path = normalizeWindowsPath(path);
|
|
277
|
+
let isUNCPath = path.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path), trailingSeparator = path[path.length - 1] === "/";
|
|
278
|
+
return path = normalizeString(path, !isPathAbsolute), path.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path += "/"), _DRIVE_LETTER_RE.test(path) && (path += "/"), isUNCPath ? isPathAbsolute ? `//${path}` : `//./${path}` : isPathAbsolute && !isAbsolute(path) ? `/${path}` : path);
|
|
279
|
+
}, join = function(...segments) {
|
|
280
|
+
let path = "";
|
|
281
|
+
for (let seg of segments)
|
|
282
|
+
if (seg)
|
|
283
|
+
if (path.length > 0) {
|
|
284
|
+
let pathTrailing = path[path.length - 1] === "/", segLeading = seg[0] === "/";
|
|
285
|
+
pathTrailing && segLeading ? path += seg.slice(1) : path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
286
|
+
} else
|
|
287
|
+
path += seg;
|
|
288
|
+
return normalize(path);
|
|
289
|
+
};
|
|
290
|
+
function normalizeString(path, allowAboveRoot) {
|
|
291
|
+
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
|
292
|
+
for (let index2 = 0; index2 <= path.length; ++index2) {
|
|
293
|
+
if (index2 < path.length)
|
|
294
|
+
char = path[index2];
|
|
295
|
+
else {
|
|
296
|
+
if (char === "/")
|
|
297
|
+
break;
|
|
298
|
+
char = "/";
|
|
299
|
+
}
|
|
300
|
+
if (char === "/") {
|
|
301
|
+
if (!(lastSlash === index2 - 1 || dots === 1)) if (dots === 2) {
|
|
302
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
303
|
+
if (res.length > 2) {
|
|
304
|
+
let lastSlashIndex = res.lastIndexOf("/");
|
|
305
|
+
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index2, dots = 0;
|
|
306
|
+
continue;
|
|
307
|
+
} else if (res.length > 0) {
|
|
308
|
+
res = "", lastSegmentLength = 0, lastSlash = index2, dots = 0;
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
|
313
|
+
} else
|
|
314
|
+
res.length > 0 ? res += `/${path.slice(lastSlash + 1, index2)}` : res = path.slice(lastSlash + 1, index2), lastSegmentLength = index2 - lastSlash - 1;
|
|
315
|
+
lastSlash = index2, dots = 0;
|
|
316
|
+
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
|
317
|
+
}
|
|
318
|
+
return res;
|
|
319
|
+
}
|
|
320
|
+
var isAbsolute = function(p2) {
|
|
321
|
+
return _IS_ABSOLUTE_RE.test(p2);
|
|
322
|
+
}, extname = function(p2) {
|
|
323
|
+
if (p2 === "..") return "";
|
|
324
|
+
let match = _EXTNAME_RE.exec(normalizeWindowsPath(p2));
|
|
325
|
+
return match && match[1] || "";
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
// ../../node_modules/@vitest/mocker/dist/chunk-mocker.js
|
|
329
|
+
var f = {
|
|
330
|
+
reset: [0, 0],
|
|
331
|
+
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
332
|
+
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
333
|
+
italic: [3, 23],
|
|
334
|
+
underline: [4, 24],
|
|
335
|
+
inverse: [7, 27],
|
|
336
|
+
hidden: [8, 28],
|
|
337
|
+
strikethrough: [9, 29],
|
|
338
|
+
black: [30, 39],
|
|
339
|
+
red: [31, 39],
|
|
340
|
+
green: [32, 39],
|
|
341
|
+
yellow: [33, 39],
|
|
342
|
+
blue: [34, 39],
|
|
343
|
+
magenta: [35, 39],
|
|
344
|
+
cyan: [36, 39],
|
|
345
|
+
white: [37, 39],
|
|
346
|
+
gray: [90, 39],
|
|
347
|
+
bgBlack: [40, 49],
|
|
348
|
+
bgRed: [41, 49],
|
|
349
|
+
bgGreen: [42, 49],
|
|
350
|
+
bgYellow: [43, 49],
|
|
351
|
+
bgBlue: [44, 49],
|
|
352
|
+
bgMagenta: [45, 49],
|
|
353
|
+
bgCyan: [46, 49],
|
|
354
|
+
bgWhite: [47, 49],
|
|
355
|
+
blackBright: [90, 39],
|
|
356
|
+
redBright: [91, 39],
|
|
357
|
+
greenBright: [92, 39],
|
|
358
|
+
yellowBright: [93, 39],
|
|
359
|
+
blueBright: [94, 39],
|
|
360
|
+
magentaBright: [95, 39],
|
|
361
|
+
cyanBright: [96, 39],
|
|
362
|
+
whiteBright: [97, 39],
|
|
363
|
+
bgBlackBright: [100, 49],
|
|
364
|
+
bgRedBright: [101, 49],
|
|
365
|
+
bgGreenBright: [102, 49],
|
|
366
|
+
bgYellowBright: [103, 49],
|
|
367
|
+
bgBlueBright: [104, 49],
|
|
368
|
+
bgMagentaBright: [105, 49],
|
|
369
|
+
bgCyanBright: [106, 49],
|
|
370
|
+
bgWhiteBright: [107, 49]
|
|
371
|
+
}, h = Object.entries(f);
|
|
372
|
+
function a(n) {
|
|
373
|
+
return String(n);
|
|
374
|
+
}
|
|
375
|
+
a.open = "";
|
|
376
|
+
a.close = "";
|
|
377
|
+
function C(n = !1) {
|
|
378
|
+
let e = typeof process < "u" ? process : void 0, i = e?.env || {}, g = e?.argv || [];
|
|
379
|
+
return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || e?.platform === "win32" || n && i.TERM !== "dumb" || "CI" in i) || typeof window < "u" && !!window.chrome;
|
|
380
|
+
}
|
|
381
|
+
function p(n = !1) {
|
|
382
|
+
let e = C(n), i = (r, t, c, o) => {
|
|
383
|
+
let l = "", s = 0;
|
|
384
|
+
do
|
|
385
|
+
l += r.substring(s, o) + c, s = o + t.length, o = r.indexOf(t, s);
|
|
386
|
+
while (~o);
|
|
387
|
+
return l + r.substring(s);
|
|
388
|
+
}, g = (r, t, c = r) => {
|
|
389
|
+
let o = (l) => {
|
|
390
|
+
let s = String(l), b = s.indexOf(t, r.length);
|
|
391
|
+
return ~b ? r + i(s, t, c, b) + t : r + s + t;
|
|
392
|
+
};
|
|
393
|
+
return o.open = r, o.close = t, o;
|
|
394
|
+
}, u = {
|
|
395
|
+
isColorSupported: e
|
|
396
|
+
}, d = (r) => `\x1B[${r}m`;
|
|
397
|
+
for (let [r, t] of h)
|
|
398
|
+
u[r] = e ? g(
|
|
399
|
+
d(t[0]),
|
|
400
|
+
d(t[1]),
|
|
401
|
+
t[2]
|
|
402
|
+
) : a;
|
|
403
|
+
return u;
|
|
404
|
+
}
|
|
405
|
+
p();
|
|
406
|
+
function _mergeNamespaces(n, m) {
|
|
407
|
+
return m.forEach(function(e) {
|
|
408
|
+
e && typeof e != "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
|
|
409
|
+
if (k !== "default" && !(k in n)) {
|
|
410
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
411
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
412
|
+
enumerable: !0,
|
|
413
|
+
get: function() {
|
|
414
|
+
return e[k];
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
}), Object.freeze(n);
|
|
420
|
+
}
|
|
421
|
+
function getDefaultExportFromCjs(x) {
|
|
422
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
|
|
423
|
+
}
|
|
424
|
+
var reactIs$1 = { exports: {} }, reactIs_production = {};
|
|
425
|
+
var hasRequiredReactIs_production;
|
|
426
|
+
function requireReactIs_production() {
|
|
427
|
+
if (hasRequiredReactIs_production) return reactIs_production;
|
|
428
|
+
hasRequiredReactIs_production = 1;
|
|
429
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference");
|
|
430
|
+
function typeOf(object) {
|
|
431
|
+
if (typeof object == "object" && object !== null) {
|
|
432
|
+
var $$typeof = object.$$typeof;
|
|
433
|
+
switch ($$typeof) {
|
|
434
|
+
case REACT_ELEMENT_TYPE:
|
|
435
|
+
switch (object = object.type, object) {
|
|
436
|
+
case REACT_FRAGMENT_TYPE:
|
|
437
|
+
case REACT_PROFILER_TYPE:
|
|
438
|
+
case REACT_STRICT_MODE_TYPE:
|
|
439
|
+
case REACT_SUSPENSE_TYPE:
|
|
440
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
441
|
+
case REACT_VIEW_TRANSITION_TYPE:
|
|
442
|
+
return object;
|
|
443
|
+
default:
|
|
444
|
+
switch (object = object && object.$$typeof, object) {
|
|
445
|
+
case REACT_CONTEXT_TYPE:
|
|
446
|
+
case REACT_FORWARD_REF_TYPE:
|
|
447
|
+
case REACT_LAZY_TYPE:
|
|
448
|
+
case REACT_MEMO_TYPE:
|
|
449
|
+
return object;
|
|
450
|
+
case REACT_CONSUMER_TYPE:
|
|
451
|
+
return object;
|
|
452
|
+
default:
|
|
453
|
+
return $$typeof;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
case REACT_PORTAL_TYPE:
|
|
457
|
+
return $$typeof;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
return reactIs_production.ContextConsumer = REACT_CONSUMER_TYPE, reactIs_production.ContextProvider = REACT_CONTEXT_TYPE, reactIs_production.Element = REACT_ELEMENT_TYPE, reactIs_production.ForwardRef = REACT_FORWARD_REF_TYPE, reactIs_production.Fragment = REACT_FRAGMENT_TYPE, reactIs_production.Lazy = REACT_LAZY_TYPE, reactIs_production.Memo = REACT_MEMO_TYPE, reactIs_production.Portal = REACT_PORTAL_TYPE, reactIs_production.Profiler = REACT_PROFILER_TYPE, reactIs_production.StrictMode = REACT_STRICT_MODE_TYPE, reactIs_production.Suspense = REACT_SUSPENSE_TYPE, reactIs_production.SuspenseList = REACT_SUSPENSE_LIST_TYPE, reactIs_production.isContextConsumer = function(object) {
|
|
462
|
+
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
463
|
+
}, reactIs_production.isContextProvider = function(object) {
|
|
464
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
465
|
+
}, reactIs_production.isElement = function(object) {
|
|
466
|
+
return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
467
|
+
}, reactIs_production.isForwardRef = function(object) {
|
|
468
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
469
|
+
}, reactIs_production.isFragment = function(object) {
|
|
470
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
471
|
+
}, reactIs_production.isLazy = function(object) {
|
|
472
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
473
|
+
}, reactIs_production.isMemo = function(object) {
|
|
474
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
475
|
+
}, reactIs_production.isPortal = function(object) {
|
|
476
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
477
|
+
}, reactIs_production.isProfiler = function(object) {
|
|
478
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
479
|
+
}, reactIs_production.isStrictMode = function(object) {
|
|
480
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
481
|
+
}, reactIs_production.isSuspense = function(object) {
|
|
482
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
483
|
+
}, reactIs_production.isSuspenseList = function(object) {
|
|
484
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
485
|
+
}, reactIs_production.isValidElementType = function(type) {
|
|
486
|
+
return typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0);
|
|
487
|
+
}, reactIs_production.typeOf = typeOf, reactIs_production;
|
|
488
|
+
}
|
|
489
|
+
var hasRequiredReactIs$1;
|
|
490
|
+
function requireReactIs$1() {
|
|
491
|
+
return hasRequiredReactIs$1 || (hasRequiredReactIs$1 = 1, reactIs$1.exports = requireReactIs_production()), reactIs$1.exports;
|
|
492
|
+
}
|
|
493
|
+
var reactIsExports$1 = requireReactIs$1(), index$1 = getDefaultExportFromCjs(reactIsExports$1), ReactIs19 = _mergeNamespaces({
|
|
494
|
+
__proto__: null,
|
|
495
|
+
default: index$1
|
|
496
|
+
}, [reactIsExports$1]), reactIs = { exports: {} }, reactIs_production_min = {};
|
|
497
|
+
var hasRequiredReactIs_production_min;
|
|
498
|
+
function requireReactIs_production_min() {
|
|
499
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
500
|
+
hasRequiredReactIs_production_min = 1;
|
|
501
|
+
var b = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), e = /* @__PURE__ */ Symbol.for("react.strict_mode"), f2 = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.provider"), h2 = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.server_context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), m = /* @__PURE__ */ Symbol.for("react.suspense"), n = /* @__PURE__ */ Symbol.for("react.suspense_list"), p2 = /* @__PURE__ */ Symbol.for("react.memo"), q = /* @__PURE__ */ Symbol.for("react.lazy"), t = /* @__PURE__ */ Symbol.for("react.offscreen"), u;
|
|
502
|
+
u = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
503
|
+
function v(a2) {
|
|
504
|
+
if (typeof a2 == "object" && a2 !== null) {
|
|
505
|
+
var r = a2.$$typeof;
|
|
506
|
+
switch (r) {
|
|
507
|
+
case b:
|
|
508
|
+
switch (a2 = a2.type, a2) {
|
|
509
|
+
case d:
|
|
510
|
+
case f2:
|
|
511
|
+
case e:
|
|
512
|
+
case m:
|
|
513
|
+
case n:
|
|
514
|
+
return a2;
|
|
515
|
+
default:
|
|
516
|
+
switch (a2 = a2 && a2.$$typeof, a2) {
|
|
517
|
+
case k:
|
|
518
|
+
case h2:
|
|
519
|
+
case l:
|
|
520
|
+
case q:
|
|
521
|
+
case p2:
|
|
522
|
+
case g:
|
|
523
|
+
return a2;
|
|
524
|
+
default:
|
|
525
|
+
return r;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
case c:
|
|
529
|
+
return r;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return reactIs_production_min.ContextConsumer = h2, reactIs_production_min.ContextProvider = g, reactIs_production_min.Element = b, reactIs_production_min.ForwardRef = l, reactIs_production_min.Fragment = d, reactIs_production_min.Lazy = q, reactIs_production_min.Memo = p2, reactIs_production_min.Portal = c, reactIs_production_min.Profiler = f2, reactIs_production_min.StrictMode = e, reactIs_production_min.Suspense = m, reactIs_production_min.SuspenseList = n, reactIs_production_min.isAsyncMode = function() {
|
|
534
|
+
return !1;
|
|
535
|
+
}, reactIs_production_min.isConcurrentMode = function() {
|
|
536
|
+
return !1;
|
|
537
|
+
}, reactIs_production_min.isContextConsumer = function(a2) {
|
|
538
|
+
return v(a2) === h2;
|
|
539
|
+
}, reactIs_production_min.isContextProvider = function(a2) {
|
|
540
|
+
return v(a2) === g;
|
|
541
|
+
}, reactIs_production_min.isElement = function(a2) {
|
|
542
|
+
return typeof a2 == "object" && a2 !== null && a2.$$typeof === b;
|
|
543
|
+
}, reactIs_production_min.isForwardRef = function(a2) {
|
|
544
|
+
return v(a2) === l;
|
|
545
|
+
}, reactIs_production_min.isFragment = function(a2) {
|
|
546
|
+
return v(a2) === d;
|
|
547
|
+
}, reactIs_production_min.isLazy = function(a2) {
|
|
548
|
+
return v(a2) === q;
|
|
549
|
+
}, reactIs_production_min.isMemo = function(a2) {
|
|
550
|
+
return v(a2) === p2;
|
|
551
|
+
}, reactIs_production_min.isPortal = function(a2) {
|
|
552
|
+
return v(a2) === c;
|
|
553
|
+
}, reactIs_production_min.isProfiler = function(a2) {
|
|
554
|
+
return v(a2) === f2;
|
|
555
|
+
}, reactIs_production_min.isStrictMode = function(a2) {
|
|
556
|
+
return v(a2) === e;
|
|
557
|
+
}, reactIs_production_min.isSuspense = function(a2) {
|
|
558
|
+
return v(a2) === m;
|
|
559
|
+
}, reactIs_production_min.isSuspenseList = function(a2) {
|
|
560
|
+
return v(a2) === n;
|
|
561
|
+
}, reactIs_production_min.isValidElementType = function(a2) {
|
|
562
|
+
return typeof a2 == "string" || typeof a2 == "function" || a2 === d || a2 === f2 || a2 === e || a2 === m || a2 === n || a2 === t || typeof a2 == "object" && a2 !== null && (a2.$$typeof === q || a2.$$typeof === p2 || a2.$$typeof === g || a2.$$typeof === h2 || a2.$$typeof === l || a2.$$typeof === u || a2.getModuleId !== void 0);
|
|
563
|
+
}, reactIs_production_min.typeOf = v, reactIs_production_min;
|
|
564
|
+
}
|
|
565
|
+
var hasRequiredReactIs;
|
|
566
|
+
function requireReactIs() {
|
|
567
|
+
return hasRequiredReactIs || (hasRequiredReactIs = 1, reactIs.exports = requireReactIs_production_min()), reactIs.exports;
|
|
568
|
+
}
|
|
569
|
+
var reactIsExports = requireReactIs(), index = getDefaultExportFromCjs(reactIsExports), ReactIs18 = _mergeNamespaces({
|
|
570
|
+
__proto__: null,
|
|
571
|
+
default: index
|
|
572
|
+
}, [reactIsExports]), reactIsMethods = [
|
|
573
|
+
"isAsyncMode",
|
|
574
|
+
"isConcurrentMode",
|
|
575
|
+
"isContextConsumer",
|
|
576
|
+
"isContextProvider",
|
|
577
|
+
"isElement",
|
|
578
|
+
"isForwardRef",
|
|
579
|
+
"isFragment",
|
|
580
|
+
"isLazy",
|
|
581
|
+
"isMemo",
|
|
582
|
+
"isPortal",
|
|
583
|
+
"isProfiler",
|
|
584
|
+
"isStrictMode",
|
|
585
|
+
"isSuspense",
|
|
586
|
+
"isSuspenseList",
|
|
587
|
+
"isValidElementType"
|
|
588
|
+
];
|
|
589
|
+
Object.fromEntries(reactIsMethods.map((m) => [m, (v) => ReactIs18[m](v) || ReactIs19[m](v)]));
|
|
590
|
+
var getPromiseValue = () => "Promise{\u2026}";
|
|
591
|
+
try {
|
|
592
|
+
let { getPromiseDetails, kPending, kRejected } = process.binding("util");
|
|
593
|
+
Array.isArray(getPromiseDetails(Promise.resolve())) && (getPromiseValue = (value, options) => {
|
|
594
|
+
let [state, innerValue] = getPromiseDetails(value);
|
|
595
|
+
return state === kPending ? "Promise{<pending>}" : `Promise${state === kRejected ? "!" : ""}{${options.inspect(innerValue, options)}}`;
|
|
596
|
+
});
|
|
597
|
+
} catch {
|
|
598
|
+
}
|
|
599
|
+
function createSimpleStackTrace(options) {
|
|
600
|
+
let { message = "$$stack trace error", stackTraceLimit = 1 } = options || {}, limit = Error.stackTraceLimit, prepareStackTrace = Error.prepareStackTrace;
|
|
601
|
+
Error.stackTraceLimit = stackTraceLimit, Error.prepareStackTrace = (e) => e.stack;
|
|
602
|
+
let stackTrace = new Error(message).stack || "";
|
|
603
|
+
return Error.prepareStackTrace = prepareStackTrace, Error.stackTraceLimit = limit, stackTrace;
|
|
604
|
+
}
|
|
605
|
+
var jsTokens_1, hasRequiredJsTokens;
|
|
606
|
+
function requireJsTokens() {
|
|
607
|
+
if (hasRequiredJsTokens) return jsTokens_1;
|
|
608
|
+
hasRequiredJsTokens = 1;
|
|
609
|
+
var Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
|
|
610
|
+
return RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy, Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y, Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/uy, StringLiteral = /(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y, NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y, Template = /[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y, WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/uy, LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y, MultiLineComment = /\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y, SingleLineComment = /\/\/.*/y, JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y, JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/uy, JSXString = /(['"])(?:(?!\1)[^])*(\1)?/y, JSXText = /[^<>{}]+/y, TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/, TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/, KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/, KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/, Newline = RegExp(LineTerminatorSequence.source), jsTokens_1 = function* (input, { jsx = !1 } = {}) {
|
|
611
|
+
var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
|
|
612
|
+
for ({ length } = input, lastIndex = 0, lastSignificantToken = "", stack = [{ tag: "JS" }], braces = [], parenNesting = 0, postfixIncDec = !1; lastIndex < length; ) {
|
|
613
|
+
switch (mode = stack[stack.length - 1], mode.tag) {
|
|
614
|
+
case "JS":
|
|
615
|
+
case "JSNonExpressionParen":
|
|
616
|
+
case "InterpolationInTemplate":
|
|
617
|
+
case "InterpolationInJSX":
|
|
618
|
+
if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken)) && (RegularExpressionLiteral.lastIndex = lastIndex, match = RegularExpressionLiteral.exec(input))) {
|
|
619
|
+
lastIndex = RegularExpressionLiteral.lastIndex, lastSignificantToken = match[0], postfixIncDec = !0, yield {
|
|
620
|
+
type: "RegularExpressionLiteral",
|
|
621
|
+
value: match[0],
|
|
622
|
+
closed: match[1] !== void 0 && match[1] !== "\\"
|
|
623
|
+
};
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
if (Punctuator.lastIndex = lastIndex, match = Punctuator.exec(input)) {
|
|
627
|
+
switch (punctuator = match[0], nextLastIndex = Punctuator.lastIndex, nextLastSignificantToken = punctuator, punctuator) {
|
|
628
|
+
case "(":
|
|
629
|
+
lastSignificantToken === "?NonExpressionParenKeyword" && stack.push({
|
|
630
|
+
tag: "JSNonExpressionParen",
|
|
631
|
+
nesting: parenNesting
|
|
632
|
+
}), parenNesting++, postfixIncDec = !1;
|
|
633
|
+
break;
|
|
634
|
+
case ")":
|
|
635
|
+
parenNesting--, postfixIncDec = !0, mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting && (stack.pop(), nextLastSignificantToken = "?NonExpressionParenEnd", postfixIncDec = !1);
|
|
636
|
+
break;
|
|
637
|
+
case "{":
|
|
638
|
+
Punctuator.lastIndex = 0, isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken)), braces.push(isExpression), postfixIncDec = !1;
|
|
639
|
+
break;
|
|
640
|
+
case "}":
|
|
641
|
+
switch (mode.tag) {
|
|
642
|
+
case "InterpolationInTemplate":
|
|
643
|
+
if (braces.length === mode.nesting) {
|
|
644
|
+
Template.lastIndex = lastIndex, match = Template.exec(input), lastIndex = Template.lastIndex, lastSignificantToken = match[0], match[1] === "${" ? (lastSignificantToken = "?InterpolationInTemplate", postfixIncDec = !1, yield {
|
|
645
|
+
type: "TemplateMiddle",
|
|
646
|
+
value: match[0]
|
|
647
|
+
}) : (stack.pop(), postfixIncDec = !0, yield {
|
|
648
|
+
type: "TemplateTail",
|
|
649
|
+
value: match[0],
|
|
650
|
+
closed: match[1] === "`"
|
|
651
|
+
});
|
|
652
|
+
continue;
|
|
653
|
+
}
|
|
654
|
+
break;
|
|
655
|
+
case "InterpolationInJSX":
|
|
656
|
+
if (braces.length === mode.nesting) {
|
|
657
|
+
stack.pop(), lastIndex += 1, lastSignificantToken = "}", yield {
|
|
658
|
+
type: "JSXPunctuator",
|
|
659
|
+
value: "}"
|
|
660
|
+
};
|
|
661
|
+
continue;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
postfixIncDec = braces.pop(), nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
|
|
665
|
+
break;
|
|
666
|
+
case "]":
|
|
667
|
+
postfixIncDec = !0;
|
|
668
|
+
break;
|
|
669
|
+
case "++":
|
|
670
|
+
case "--":
|
|
671
|
+
nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
|
|
672
|
+
break;
|
|
673
|
+
case "<":
|
|
674
|
+
if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
|
|
675
|
+
stack.push({ tag: "JSXTag" }), lastIndex += 1, lastSignificantToken = "<", yield {
|
|
676
|
+
type: "JSXPunctuator",
|
|
677
|
+
value: punctuator
|
|
678
|
+
};
|
|
679
|
+
continue;
|
|
680
|
+
}
|
|
681
|
+
postfixIncDec = !1;
|
|
682
|
+
break;
|
|
683
|
+
default:
|
|
684
|
+
postfixIncDec = !1;
|
|
685
|
+
}
|
|
686
|
+
lastIndex = nextLastIndex, lastSignificantToken = nextLastSignificantToken, yield {
|
|
687
|
+
type: "Punctuator",
|
|
688
|
+
value: punctuator
|
|
689
|
+
};
|
|
690
|
+
continue;
|
|
691
|
+
}
|
|
692
|
+
if (Identifier.lastIndex = lastIndex, match = Identifier.exec(input)) {
|
|
693
|
+
switch (lastIndex = Identifier.lastIndex, nextLastSignificantToken = match[0], match[0]) {
|
|
694
|
+
case "for":
|
|
695
|
+
case "if":
|
|
696
|
+
case "while":
|
|
697
|
+
case "with":
|
|
698
|
+
lastSignificantToken !== "." && lastSignificantToken !== "?." && (nextLastSignificantToken = "?NonExpressionParenKeyword");
|
|
699
|
+
}
|
|
700
|
+
lastSignificantToken = nextLastSignificantToken, postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]), yield {
|
|
701
|
+
type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
|
|
702
|
+
value: match[0]
|
|
703
|
+
};
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
if (StringLiteral.lastIndex = lastIndex, match = StringLiteral.exec(input)) {
|
|
707
|
+
lastIndex = StringLiteral.lastIndex, lastSignificantToken = match[0], postfixIncDec = !0, yield {
|
|
708
|
+
type: "StringLiteral",
|
|
709
|
+
value: match[0],
|
|
710
|
+
closed: match[2] !== void 0
|
|
711
|
+
};
|
|
712
|
+
continue;
|
|
713
|
+
}
|
|
714
|
+
if (NumericLiteral.lastIndex = lastIndex, match = NumericLiteral.exec(input)) {
|
|
715
|
+
lastIndex = NumericLiteral.lastIndex, lastSignificantToken = match[0], postfixIncDec = !0, yield {
|
|
716
|
+
type: "NumericLiteral",
|
|
717
|
+
value: match[0]
|
|
718
|
+
};
|
|
719
|
+
continue;
|
|
720
|
+
}
|
|
721
|
+
if (Template.lastIndex = lastIndex, match = Template.exec(input)) {
|
|
722
|
+
lastIndex = Template.lastIndex, lastSignificantToken = match[0], match[1] === "${" ? (lastSignificantToken = "?InterpolationInTemplate", stack.push({
|
|
723
|
+
tag: "InterpolationInTemplate",
|
|
724
|
+
nesting: braces.length
|
|
725
|
+
}), postfixIncDec = !1, yield {
|
|
726
|
+
type: "TemplateHead",
|
|
727
|
+
value: match[0]
|
|
728
|
+
}) : (postfixIncDec = !0, yield {
|
|
729
|
+
type: "NoSubstitutionTemplate",
|
|
730
|
+
value: match[0],
|
|
731
|
+
closed: match[1] === "`"
|
|
732
|
+
});
|
|
733
|
+
continue;
|
|
734
|
+
}
|
|
735
|
+
break;
|
|
736
|
+
case "JSXTag":
|
|
737
|
+
case "JSXTagEnd":
|
|
738
|
+
if (JSXPunctuator.lastIndex = lastIndex, match = JSXPunctuator.exec(input)) {
|
|
739
|
+
switch (lastIndex = JSXPunctuator.lastIndex, nextLastSignificantToken = match[0], match[0]) {
|
|
740
|
+
case "<":
|
|
741
|
+
stack.push({ tag: "JSXTag" });
|
|
742
|
+
break;
|
|
743
|
+
case ">":
|
|
744
|
+
stack.pop(), lastSignificantToken === "/" || mode.tag === "JSXTagEnd" ? (nextLastSignificantToken = "?JSX", postfixIncDec = !0) : stack.push({ tag: "JSXChildren" });
|
|
745
|
+
break;
|
|
746
|
+
case "{":
|
|
747
|
+
stack.push({
|
|
748
|
+
tag: "InterpolationInJSX",
|
|
749
|
+
nesting: braces.length
|
|
750
|
+
}), nextLastSignificantToken = "?InterpolationInJSX", postfixIncDec = !1;
|
|
751
|
+
break;
|
|
752
|
+
case "/":
|
|
753
|
+
lastSignificantToken === "<" && (stack.pop(), stack[stack.length - 1].tag === "JSXChildren" && stack.pop(), stack.push({ tag: "JSXTagEnd" }));
|
|
754
|
+
}
|
|
755
|
+
lastSignificantToken = nextLastSignificantToken, yield {
|
|
756
|
+
type: "JSXPunctuator",
|
|
757
|
+
value: match[0]
|
|
758
|
+
};
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
761
|
+
if (JSXIdentifier.lastIndex = lastIndex, match = JSXIdentifier.exec(input)) {
|
|
762
|
+
lastIndex = JSXIdentifier.lastIndex, lastSignificantToken = match[0], yield {
|
|
763
|
+
type: "JSXIdentifier",
|
|
764
|
+
value: match[0]
|
|
765
|
+
};
|
|
766
|
+
continue;
|
|
767
|
+
}
|
|
768
|
+
if (JSXString.lastIndex = lastIndex, match = JSXString.exec(input)) {
|
|
769
|
+
lastIndex = JSXString.lastIndex, lastSignificantToken = match[0], yield {
|
|
770
|
+
type: "JSXString",
|
|
771
|
+
value: match[0],
|
|
772
|
+
closed: match[2] !== void 0
|
|
773
|
+
};
|
|
774
|
+
continue;
|
|
775
|
+
}
|
|
776
|
+
break;
|
|
777
|
+
case "JSXChildren":
|
|
778
|
+
if (JSXText.lastIndex = lastIndex, match = JSXText.exec(input)) {
|
|
779
|
+
lastIndex = JSXText.lastIndex, lastSignificantToken = match[0], yield {
|
|
780
|
+
type: "JSXText",
|
|
781
|
+
value: match[0]
|
|
782
|
+
};
|
|
783
|
+
continue;
|
|
784
|
+
}
|
|
785
|
+
switch (input[lastIndex]) {
|
|
786
|
+
case "<":
|
|
787
|
+
stack.push({ tag: "JSXTag" }), lastIndex++, lastSignificantToken = "<", yield {
|
|
788
|
+
type: "JSXPunctuator",
|
|
789
|
+
value: "<"
|
|
790
|
+
};
|
|
791
|
+
continue;
|
|
792
|
+
case "{":
|
|
793
|
+
stack.push({
|
|
794
|
+
tag: "InterpolationInJSX",
|
|
795
|
+
nesting: braces.length
|
|
796
|
+
}), lastIndex++, lastSignificantToken = "?InterpolationInJSX", postfixIncDec = !1, yield {
|
|
797
|
+
type: "JSXPunctuator",
|
|
798
|
+
value: "{"
|
|
799
|
+
};
|
|
800
|
+
continue;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
if (WhiteSpace.lastIndex = lastIndex, match = WhiteSpace.exec(input)) {
|
|
804
|
+
lastIndex = WhiteSpace.lastIndex, yield {
|
|
805
|
+
type: "WhiteSpace",
|
|
806
|
+
value: match[0]
|
|
807
|
+
};
|
|
808
|
+
continue;
|
|
809
|
+
}
|
|
810
|
+
if (LineTerminatorSequence.lastIndex = lastIndex, match = LineTerminatorSequence.exec(input)) {
|
|
811
|
+
lastIndex = LineTerminatorSequence.lastIndex, postfixIncDec = !1, KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken) && (lastSignificantToken = "?NoLineTerminatorHere"), yield {
|
|
812
|
+
type: "LineTerminatorSequence",
|
|
813
|
+
value: match[0]
|
|
814
|
+
};
|
|
815
|
+
continue;
|
|
816
|
+
}
|
|
817
|
+
if (MultiLineComment.lastIndex = lastIndex, match = MultiLineComment.exec(input)) {
|
|
818
|
+
lastIndex = MultiLineComment.lastIndex, Newline.test(match[0]) && (postfixIncDec = !1, KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken) && (lastSignificantToken = "?NoLineTerminatorHere")), yield {
|
|
819
|
+
type: "MultiLineComment",
|
|
820
|
+
value: match[0],
|
|
821
|
+
closed: match[1] !== void 0
|
|
822
|
+
};
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
if (SingleLineComment.lastIndex = lastIndex, match = SingleLineComment.exec(input)) {
|
|
826
|
+
lastIndex = SingleLineComment.lastIndex, postfixIncDec = !1, yield {
|
|
827
|
+
type: "SingleLineComment",
|
|
828
|
+
value: match[0]
|
|
829
|
+
};
|
|
830
|
+
continue;
|
|
831
|
+
}
|
|
832
|
+
firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex)), lastIndex += firstCodePoint.length, lastSignificantToken = firstCodePoint, postfixIncDec = !1, yield {
|
|
833
|
+
type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
|
|
834
|
+
value: firstCodePoint
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
}, jsTokens_1;
|
|
838
|
+
}
|
|
839
|
+
requireJsTokens();
|
|
840
|
+
var reservedWords = {
|
|
841
|
+
keyword: [
|
|
842
|
+
"break",
|
|
843
|
+
"case",
|
|
844
|
+
"catch",
|
|
845
|
+
"continue",
|
|
846
|
+
"debugger",
|
|
847
|
+
"default",
|
|
848
|
+
"do",
|
|
849
|
+
"else",
|
|
850
|
+
"finally",
|
|
851
|
+
"for",
|
|
852
|
+
"function",
|
|
853
|
+
"if",
|
|
854
|
+
"return",
|
|
855
|
+
"switch",
|
|
856
|
+
"throw",
|
|
857
|
+
"try",
|
|
858
|
+
"var",
|
|
859
|
+
"const",
|
|
860
|
+
"while",
|
|
861
|
+
"with",
|
|
862
|
+
"new",
|
|
863
|
+
"this",
|
|
864
|
+
"super",
|
|
865
|
+
"class",
|
|
866
|
+
"extends",
|
|
867
|
+
"export",
|
|
868
|
+
"import",
|
|
869
|
+
"null",
|
|
870
|
+
"true",
|
|
871
|
+
"false",
|
|
872
|
+
"in",
|
|
873
|
+
"instanceof",
|
|
874
|
+
"typeof",
|
|
875
|
+
"void",
|
|
876
|
+
"delete"
|
|
877
|
+
],
|
|
878
|
+
strict: [
|
|
879
|
+
"implements",
|
|
880
|
+
"interface",
|
|
881
|
+
"let",
|
|
882
|
+
"package",
|
|
883
|
+
"private",
|
|
884
|
+
"protected",
|
|
885
|
+
"public",
|
|
886
|
+
"static",
|
|
887
|
+
"yield"
|
|
888
|
+
]
|
|
889
|
+
};
|
|
890
|
+
new Set(reservedWords.keyword);
|
|
891
|
+
new Set(reservedWords.strict);
|
|
892
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
|
|
893
|
+
for (let i = 0; i < chars.length; i++) {
|
|
894
|
+
let c = chars.charCodeAt(i);
|
|
895
|
+
intToChar[i] = c, charToInt[c] = i;
|
|
896
|
+
}
|
|
897
|
+
var UrlType;
|
|
898
|
+
(function(UrlType2) {
|
|
899
|
+
UrlType2[UrlType2.Empty = 1] = "Empty", UrlType2[UrlType2.Hash = 2] = "Hash", UrlType2[UrlType2.Query = 3] = "Query", UrlType2[UrlType2.RelativePath = 4] = "RelativePath", UrlType2[UrlType2.AbsolutePath = 5] = "AbsolutePath", UrlType2[UrlType2.SchemeRelative = 6] = "SchemeRelative", UrlType2[UrlType2.Absolute = 7] = "Absolute";
|
|
900
|
+
})(UrlType || (UrlType = {}));
|
|
901
|
+
var _DRIVE_LETTER_START_RE2 = /^[A-Za-z]:\//;
|
|
902
|
+
function normalizeWindowsPath2(input = "") {
|
|
903
|
+
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE2, (r) => r.toUpperCase());
|
|
904
|
+
}
|
|
905
|
+
var _IS_ABSOLUTE_RE2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
906
|
+
function cwd() {
|
|
907
|
+
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
908
|
+
}
|
|
909
|
+
var resolve = function(...arguments_) {
|
|
910
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath2(argument));
|
|
911
|
+
let resolvedPath = "", resolvedAbsolute = !1;
|
|
912
|
+
for (let index2 = arguments_.length - 1; index2 >= -1 && !resolvedAbsolute; index2--) {
|
|
913
|
+
let path = index2 >= 0 ? arguments_[index2] : cwd();
|
|
914
|
+
!path || path.length === 0 || (resolvedPath = `${path}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path));
|
|
915
|
+
}
|
|
916
|
+
return resolvedPath = normalizeString2(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
|
|
917
|
+
};
|
|
918
|
+
function normalizeString2(path, allowAboveRoot) {
|
|
919
|
+
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
|
920
|
+
for (let index2 = 0; index2 <= path.length; ++index2) {
|
|
921
|
+
if (index2 < path.length)
|
|
922
|
+
char = path[index2];
|
|
923
|
+
else {
|
|
924
|
+
if (char === "/")
|
|
925
|
+
break;
|
|
926
|
+
char = "/";
|
|
927
|
+
}
|
|
928
|
+
if (char === "/") {
|
|
929
|
+
if (!(lastSlash === index2 - 1 || dots === 1)) if (dots === 2) {
|
|
930
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
931
|
+
if (res.length > 2) {
|
|
932
|
+
let lastSlashIndex = res.lastIndexOf("/");
|
|
933
|
+
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index2, dots = 0;
|
|
934
|
+
continue;
|
|
935
|
+
} else if (res.length > 0) {
|
|
936
|
+
res = "", lastSegmentLength = 0, lastSlash = index2, dots = 0;
|
|
937
|
+
continue;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
|
941
|
+
} else
|
|
942
|
+
res.length > 0 ? res += `/${path.slice(lastSlash + 1, index2)}` : res = path.slice(lastSlash + 1, index2), lastSegmentLength = index2 - lastSlash - 1;
|
|
943
|
+
lastSlash = index2, dots = 0;
|
|
944
|
+
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
|
945
|
+
}
|
|
946
|
+
return res;
|
|
947
|
+
}
|
|
948
|
+
var isAbsolute2 = function(p2) {
|
|
949
|
+
return _IS_ABSOLUTE_RE2.test(p2);
|
|
950
|
+
}, CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m, SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
|
|
951
|
+
function extractLocation(urlLike) {
|
|
952
|
+
if (!urlLike.includes(":"))
|
|
953
|
+
return [urlLike];
|
|
954
|
+
let parts = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec(urlLike.replace(/^\(|\)$/g, ""));
|
|
955
|
+
if (!parts)
|
|
956
|
+
return [urlLike];
|
|
957
|
+
let url = parts[1];
|
|
958
|
+
if (url.startsWith("async ") && (url = url.slice(6)), url.startsWith("http:") || url.startsWith("https:")) {
|
|
959
|
+
let urlObj = new URL(url);
|
|
960
|
+
urlObj.searchParams.delete("import"), urlObj.searchParams.delete("browserv"), url = urlObj.pathname + urlObj.hash + urlObj.search;
|
|
961
|
+
}
|
|
962
|
+
if (url.startsWith("/@fs/")) {
|
|
963
|
+
let isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
|
|
964
|
+
url = url.slice(isWindows ? 5 : 4);
|
|
965
|
+
}
|
|
966
|
+
return [
|
|
967
|
+
url,
|
|
968
|
+
parts[2] || void 0,
|
|
969
|
+
parts[3] || void 0
|
|
970
|
+
];
|
|
971
|
+
}
|
|
972
|
+
function parseSingleFFOrSafariStack(raw) {
|
|
973
|
+
let line = raw.trim();
|
|
974
|
+
if (SAFARI_NATIVE_CODE_REGEXP.test(line) || (line.includes(" > eval") && (line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), !line.includes("@") && !line.includes(":")))
|
|
975
|
+
return null;
|
|
976
|
+
let functionNameRegex = /((.*".+"[^@]*)?[^@]*)(@)/, matches = line.match(functionNameRegex), functionName = matches && matches[1] ? matches[1] : void 0, [url, lineNumber, columnNumber] = extractLocation(line.replace(functionNameRegex, ""));
|
|
977
|
+
return !url || !lineNumber || !columnNumber ? null : {
|
|
978
|
+
file: url,
|
|
979
|
+
method: functionName || "",
|
|
980
|
+
line: Number.parseInt(lineNumber),
|
|
981
|
+
column: Number.parseInt(columnNumber)
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
function parseSingleStack(raw) {
|
|
985
|
+
let line = raw.trim();
|
|
986
|
+
return CHROME_IE_STACK_REGEXP.test(line) ? parseSingleV8Stack(line) : parseSingleFFOrSafariStack(line);
|
|
987
|
+
}
|
|
988
|
+
function parseSingleV8Stack(raw) {
|
|
989
|
+
let line = raw.trim();
|
|
990
|
+
if (!CHROME_IE_STACK_REGEXP.test(line))
|
|
991
|
+
return null;
|
|
992
|
+
line.includes("(eval ") && (line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
|
|
993
|
+
let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), location2 = sanitizedLine.match(/ (\(.+\)$)/);
|
|
994
|
+
sanitizedLine = location2 ? sanitizedLine.replace(location2[0], "") : sanitizedLine;
|
|
995
|
+
let [url, lineNumber, columnNumber] = extractLocation(location2 ? location2[1] : sanitizedLine), method = location2 && sanitizedLine || "", file = url && ["eval", "<anonymous>"].includes(url) ? void 0 : url;
|
|
996
|
+
return !file || !lineNumber || !columnNumber ? null : (method.startsWith("async ") && (method = method.slice(6)), file.startsWith("file://") && (file = file.slice(7)), file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve(file), method && (method = method.replace(/__vite_ssr_import_\d+__\./g, "")), {
|
|
997
|
+
method,
|
|
998
|
+
file,
|
|
999
|
+
line: Number.parseInt(lineNumber),
|
|
1000
|
+
column: Number.parseInt(columnNumber)
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
function createCompilerHints(options) {
|
|
1004
|
+
let globalThisAccessor = options?.globalThisKey || "__vitest_mocker__";
|
|
1005
|
+
function _mocker() {
|
|
1006
|
+
return typeof globalThis[globalThisAccessor] < "u" ? globalThis[globalThisAccessor] : new Proxy({}, { get(_, name) {
|
|
1007
|
+
throw new Error(`Vitest mocker was not initialized in this environment. vi.${String(name)}() is forbidden.`);
|
|
1008
|
+
} });
|
|
1009
|
+
}
|
|
1010
|
+
return {
|
|
1011
|
+
hoisted(factory) {
|
|
1012
|
+
if (typeof factory != "function")
|
|
1013
|
+
throw new TypeError(`vi.hoisted() expects a function, but received a ${typeof factory}`);
|
|
1014
|
+
return factory();
|
|
1015
|
+
},
|
|
1016
|
+
mock(path, factory) {
|
|
1017
|
+
if (typeof path != "string")
|
|
1018
|
+
throw new TypeError(`vi.mock() expects a string path, but received a ${typeof path}`);
|
|
1019
|
+
let importer = getImporter("mock");
|
|
1020
|
+
_mocker().queueMock(path, importer, typeof factory == "function" ? () => factory(() => _mocker().importActual(path, importer)) : factory);
|
|
1021
|
+
},
|
|
1022
|
+
unmock(path) {
|
|
1023
|
+
if (typeof path != "string")
|
|
1024
|
+
throw new TypeError(`vi.unmock() expects a string path, but received a ${typeof path}`);
|
|
1025
|
+
_mocker().queueUnmock(path, getImporter("unmock"));
|
|
1026
|
+
},
|
|
1027
|
+
doMock(path, factory) {
|
|
1028
|
+
if (typeof path != "string")
|
|
1029
|
+
throw new TypeError(`vi.doMock() expects a string path, but received a ${typeof path}`);
|
|
1030
|
+
let importer = getImporter("doMock");
|
|
1031
|
+
_mocker().queueMock(path, importer, typeof factory == "function" ? () => factory(() => _mocker().importActual(path, importer)) : factory);
|
|
1032
|
+
},
|
|
1033
|
+
doUnmock(path) {
|
|
1034
|
+
if (typeof path != "string")
|
|
1035
|
+
throw new TypeError(`vi.doUnmock() expects a string path, but received a ${typeof path}`);
|
|
1036
|
+
_mocker().queueUnmock(path, getImporter("doUnmock"));
|
|
1037
|
+
},
|
|
1038
|
+
async importActual(path) {
|
|
1039
|
+
return _mocker().importActual(path, getImporter("importActual"));
|
|
1040
|
+
},
|
|
1041
|
+
async importMock(path) {
|
|
1042
|
+
return _mocker().importMock(path, getImporter("importMock"));
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
function getImporter(name) {
|
|
1047
|
+
let stackArray = createSimpleStackTrace({ stackTraceLimit: 5 }).split(`
|
|
1048
|
+
`), importerStackIndex = stackArray.findIndex((stack2) => stack2.includes(` at Object.${name}`) || stack2.includes(`${name}@`)), stack = parseSingleStack(stackArray[importerStackIndex + 1]);
|
|
1049
|
+
return stack?.file || "";
|
|
1050
|
+
}
|
|
1051
|
+
var hot = import.meta.hot || {
|
|
1052
|
+
on: warn,
|
|
1053
|
+
off: warn,
|
|
1054
|
+
send: warn
|
|
1055
|
+
};
|
|
1056
|
+
function warn() {
|
|
1057
|
+
console.warn("Vitest mocker cannot work if Vite didn't establish WS connection.");
|
|
1058
|
+
}
|
|
1059
|
+
var { now } = Date, ModuleMocker = class {
|
|
1060
|
+
registry = new MockerRegistry();
|
|
1061
|
+
queue = /* @__PURE__ */ new Set();
|
|
1062
|
+
mockedIds = /* @__PURE__ */ new Set();
|
|
1063
|
+
constructor(interceptor, rpc3, spyOn, config) {
|
|
1064
|
+
this.interceptor = interceptor, this.rpc = rpc3, this.spyOn = spyOn, this.config = config;
|
|
1065
|
+
}
|
|
1066
|
+
async prepare() {
|
|
1067
|
+
this.queue.size && await Promise.all([...this.queue.values()]);
|
|
1068
|
+
}
|
|
1069
|
+
async resolveFactoryModule(id) {
|
|
1070
|
+
let mock = this.registry.get(id);
|
|
1071
|
+
if (!mock || mock.type !== "manual")
|
|
1072
|
+
throw new Error(`Mock ${id} wasn't registered. This is probably a Vitest error. Please, open a new issue with reproduction.`);
|
|
1073
|
+
return await mock.resolve();
|
|
1074
|
+
}
|
|
1075
|
+
getFactoryModule(id) {
|
|
1076
|
+
let mock = this.registry.get(id);
|
|
1077
|
+
if (!mock || mock.type !== "manual")
|
|
1078
|
+
throw new Error(`Mock ${id} wasn't registered. This is probably a Vitest error. Please, open a new issue with reproduction.`);
|
|
1079
|
+
if (!mock.cache)
|
|
1080
|
+
throw new Error(`Mock ${id} wasn't resolved. This is probably a Vitest error. Please, open a new issue with reproduction.`);
|
|
1081
|
+
return mock.cache;
|
|
1082
|
+
}
|
|
1083
|
+
async invalidate() {
|
|
1084
|
+
let ids = Array.from(this.mockedIds);
|
|
1085
|
+
ids.length && (await this.rpc.invalidate(ids), await this.interceptor.invalidate(), this.registry.clear());
|
|
1086
|
+
}
|
|
1087
|
+
async importActual(id, importer) {
|
|
1088
|
+
let resolved = await this.rpc.resolveId(id, importer);
|
|
1089
|
+
if (resolved == null)
|
|
1090
|
+
throw new Error(`[vitest] Cannot resolve "${id}" imported from "${importer}"`);
|
|
1091
|
+
let ext = extname(resolved.id), url = new URL(resolved.url, location.href), query = `_vitest_original&ext${ext}`, actualUrl = `${url.pathname}${url.search ? `${url.search}&${query}` : `?${query}`}${url.hash}`;
|
|
1092
|
+
return this.wrapDynamicImport(() => import(
|
|
1093
|
+
/* @vite-ignore */
|
|
1094
|
+
actualUrl
|
|
1095
|
+
)).then((mod) => {
|
|
1096
|
+
if (!resolved.optimized || typeof mod.default > "u")
|
|
1097
|
+
return mod;
|
|
1098
|
+
let m = mod.default;
|
|
1099
|
+
return m?.__esModule ? m : {
|
|
1100
|
+
...typeof m == "object" && !Array.isArray(m) || typeof m == "function" ? m : {},
|
|
1101
|
+
default: m
|
|
1102
|
+
};
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
async importMock(rawId, importer) {
|
|
1106
|
+
await this.prepare();
|
|
1107
|
+
let { resolvedId, resolvedUrl, redirectUrl } = await this.rpc.resolveMock(rawId, importer, { mock: "auto" }), mockUrl = this.resolveMockPath(cleanVersion(resolvedUrl)), mock = this.registry.get(mockUrl);
|
|
1108
|
+
if (!mock)
|
|
1109
|
+
if (redirectUrl) {
|
|
1110
|
+
let resolvedRedirect = new URL(this.resolveMockPath(cleanVersion(redirectUrl)), location.href).toString();
|
|
1111
|
+
mock = new RedirectedModule(rawId, resolvedId, mockUrl, resolvedRedirect);
|
|
1112
|
+
} else
|
|
1113
|
+
mock = new AutomockedModule(rawId, resolvedId, mockUrl);
|
|
1114
|
+
if (mock.type === "manual")
|
|
1115
|
+
return await mock.resolve();
|
|
1116
|
+
if (mock.type === "automock" || mock.type === "autospy") {
|
|
1117
|
+
let url = new URL(`/@id/${resolvedId}`, location.href), query = url.search ? `${url.search}&t=${now()}` : `?t=${now()}`, moduleObject = await import(
|
|
1118
|
+
/* @vite-ignore */
|
|
1119
|
+
`${url.pathname}${query}&mock=${mock.type}${url.hash}`
|
|
1120
|
+
);
|
|
1121
|
+
return this.mockObject(moduleObject, mock.type);
|
|
1122
|
+
}
|
|
1123
|
+
return import(
|
|
1124
|
+
/* @vite-ignore */
|
|
1125
|
+
mock.redirect
|
|
1126
|
+
);
|
|
1127
|
+
}
|
|
1128
|
+
mockObject(object, moduleType = "automock") {
|
|
1129
|
+
return mockObject({
|
|
1130
|
+
globalConstructors: {
|
|
1131
|
+
Object,
|
|
1132
|
+
Function,
|
|
1133
|
+
Array,
|
|
1134
|
+
Map,
|
|
1135
|
+
RegExp
|
|
1136
|
+
},
|
|
1137
|
+
spyOn: this.spyOn,
|
|
1138
|
+
type: moduleType
|
|
1139
|
+
}, object);
|
|
1140
|
+
}
|
|
1141
|
+
queueMock(rawId, importer, factoryOrOptions) {
|
|
1142
|
+
let promise = this.rpc.resolveMock(rawId, importer, { mock: typeof factoryOrOptions == "function" ? "factory" : factoryOrOptions?.spy ? "spy" : "auto" }).then(async ({ redirectUrl, resolvedId, resolvedUrl, needsInterop, mockType }) => {
|
|
1143
|
+
let mockUrl = this.resolveMockPath(cleanVersion(resolvedUrl));
|
|
1144
|
+
this.mockedIds.add(resolvedId);
|
|
1145
|
+
let factory = typeof factoryOrOptions == "function" ? async () => {
|
|
1146
|
+
let data = await factoryOrOptions();
|
|
1147
|
+
return needsInterop ? { default: data } : data;
|
|
1148
|
+
} : void 0, mockRedirect = typeof redirectUrl == "string" ? new URL(this.resolveMockPath(cleanVersion(redirectUrl)), location.href).toString() : null, module;
|
|
1149
|
+
mockType === "manual" ? module = this.registry.register("manual", rawId, resolvedId, mockUrl, factory) : mockType === "autospy" ? module = this.registry.register("autospy", rawId, resolvedId, mockUrl) : mockType === "redirect" ? module = this.registry.register("redirect", rawId, resolvedId, mockUrl, mockRedirect) : module = this.registry.register("automock", rawId, resolvedId, mockUrl), await this.interceptor.register(module);
|
|
1150
|
+
}).finally(() => {
|
|
1151
|
+
this.queue.delete(promise);
|
|
1152
|
+
});
|
|
1153
|
+
this.queue.add(promise);
|
|
1154
|
+
}
|
|
1155
|
+
queueUnmock(id, importer) {
|
|
1156
|
+
let promise = this.rpc.resolveId(id, importer).then(async (resolved) => {
|
|
1157
|
+
if (!resolved)
|
|
1158
|
+
return;
|
|
1159
|
+
let mockUrl = this.resolveMockPath(cleanVersion(resolved.url));
|
|
1160
|
+
this.mockedIds.add(resolved.id), this.registry.delete(mockUrl), await this.interceptor.delete(mockUrl);
|
|
1161
|
+
}).finally(() => {
|
|
1162
|
+
this.queue.delete(promise);
|
|
1163
|
+
});
|
|
1164
|
+
this.queue.add(promise);
|
|
1165
|
+
}
|
|
1166
|
+
// We need to await mock registration before importing the actual module
|
|
1167
|
+
// In case there is a mocked module in the import chain
|
|
1168
|
+
wrapDynamicImport(moduleFactory) {
|
|
1169
|
+
return typeof moduleFactory == "function" ? new Promise((resolve2, reject) => {
|
|
1170
|
+
this.prepare().finally(() => {
|
|
1171
|
+
moduleFactory().then(resolve2, reject);
|
|
1172
|
+
});
|
|
1173
|
+
}) : moduleFactory;
|
|
1174
|
+
}
|
|
1175
|
+
resolveMockPath(path) {
|
|
1176
|
+
let config = this.config, fsRoot = join("/@fs/", config.root);
|
|
1177
|
+
return path.startsWith(config.root) ? path.slice(config.root.length) : path.startsWith(fsRoot) ? path.slice(fsRoot.length) : path;
|
|
1178
|
+
}
|
|
1179
|
+
}, versionRegexp = /(\?|&)v=\w{8}/;
|
|
1180
|
+
function cleanVersion(url) {
|
|
1181
|
+
return url.replace(versionRegexp, "");
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
// src/mocking-utils/mocker-runtime.js
|
|
1185
|
+
var ModuleMockerInterceptor = class {
|
|
1186
|
+
// A registry for runtime mocks (e.g., `sb.mock('path', () => ({}))`)
|
|
1187
|
+
mocks = new MockerRegistry();
|
|
1188
|
+
constructor() {
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* Called by ModuleMocker when `sb.mock()` is executed. We just store the mock in our registry.
|
|
1192
|
+
* The dynamic MSW handler will pick it up on the next relevant network request. Currently, we
|
|
1193
|
+
* don't use this.mocks in any way. Mocks will be registered in the user's preview file and live
|
|
1194
|
+
* until the end. There is no way to invalidate or delete them.
|
|
1195
|
+
*/
|
|
1196
|
+
async register(module) {
|
|
1197
|
+
this.mocks.add(module);
|
|
1198
|
+
}
|
|
1199
|
+
async delete(url) {
|
|
1200
|
+
this.mocks.delete(url);
|
|
1201
|
+
}
|
|
1202
|
+
async invalidate() {
|
|
1203
|
+
this.mocks.clear();
|
|
1204
|
+
}
|
|
1205
|
+
}, rpc2 = (method) => {
|
|
1206
|
+
switch (method) {
|
|
1207
|
+
case "resolveId":
|
|
1208
|
+
return Promise.resolve({
|
|
1209
|
+
id: "",
|
|
1210
|
+
url: "",
|
|
1211
|
+
optimized: !1
|
|
1212
|
+
});
|
|
1213
|
+
case "resolveMock":
|
|
1214
|
+
return Promise.resolve({
|
|
1215
|
+
mockType: "dummy",
|
|
1216
|
+
resolvedId: "",
|
|
1217
|
+
resolvedUrl: "",
|
|
1218
|
+
redirectUrl: "",
|
|
1219
|
+
needsInterop: !1
|
|
1220
|
+
});
|
|
1221
|
+
case "invalidate":
|
|
1222
|
+
return Promise.resolve();
|
|
1223
|
+
}
|
|
1224
|
+
}, BuildModuleMocker = class extends ModuleMocker {
|
|
1225
|
+
queueMock() {
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
function registerModuleMocker(interceptor) {
|
|
1229
|
+
let mocker = new BuildModuleMocker(
|
|
1230
|
+
interceptor("__vitest_mocker__"),
|
|
1231
|
+
{
|
|
1232
|
+
resolveId(id, importer) {
|
|
1233
|
+
return rpc2("resolveId", { id, importer });
|
|
1234
|
+
},
|
|
1235
|
+
resolveMock(id, importer, options) {
|
|
1236
|
+
return rpc2("resolveMock", { id, importer, options });
|
|
1237
|
+
},
|
|
1238
|
+
async invalidate(ids) {
|
|
1239
|
+
return rpc2("invalidate", { ids });
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
(...args) => globalThis.__STORYBOOK_MODULE_TEST__.spyOn(...args),
|
|
1243
|
+
{
|
|
1244
|
+
root: ""
|
|
1245
|
+
}
|
|
1246
|
+
);
|
|
1247
|
+
return globalThis.__vitest_mocker__ = mocker, createCompilerHints({
|
|
1248
|
+
globalThisKey: "__vitest_mocker__"
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
globalThis.__STORYBOOK_MOCKER__ = registerModuleMocker(() => new ModuleMockerInterceptor());
|
|
1252
|
+
export {
|
|
1253
|
+
ModuleMockerInterceptor
|
|
1254
|
+
};
|