@emailmaker/emailmaker 1.0.107-dev.3 → 1.0.107-dev.5

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.
Files changed (325) hide show
  1. package/README.md +1 -1
  2. package/cli/dist/lib/cli/project.js +2 -16
  3. package/cli/dist/lib/config.js +20 -29
  4. package/cli/dist/lib/local-test.js +3 -19
  5. package/cli/dist/lib/paths.js +11 -0
  6. package/cli/dist/lib/resolveNpmSpawn.d.ts +20 -0
  7. package/cli/dist/lib/resolveNpmSpawn.js +71 -0
  8. package/cli/dist/lib/template-engine/context/pluginPackageJsonData.js +21 -19
  9. package/cli/dist/lib/template-engine/context/standVitePackageJsonData.js +7 -8
  10. package/cli/dist/lib/template-engine/resolveVariantDir.d.ts +5 -1
  11. package/cli/dist/lib/template-engine/resolveVariantDir.js +22 -0
  12. package/cli/dist/lib/templates/shared/i18n.js +2 -2
  13. package/cli/dist/lib/templates/shared/paths.js +3 -4
  14. package/cli/dist/lib/types/package-config.d.ts +1 -0
  15. package/cli/lib/cli/project.ts +2 -18
  16. package/cli/lib/config.ts +19 -30
  17. package/cli/lib/local-test.ts +3 -22
  18. package/cli/lib/paths.ts +15 -0
  19. package/cli/lib/resolveNpmSpawn.ts +72 -0
  20. package/cli/lib/template-engine/buildStandIndexHtml.test.ts +1 -0
  21. package/cli/lib/template-engine/context/pluginPackageJsonData.ts +23 -23
  22. package/cli/lib/template-engine/context/standVitePackageJsonData.ts +7 -12
  23. package/cli/lib/template-engine/pluginEtaParity.test.ts +1 -0
  24. package/cli/lib/template-engine/resolveVariantDir.ts +22 -0
  25. package/cli/lib/template-engine/standAdvancedViteDevHostEta.test.ts +4 -3
  26. package/cli/lib/template-engine/standWebpackDevHostEta.test.ts +7 -6
  27. package/cli/lib/templates/shared/i18n.ts +2 -2
  28. package/cli/lib/templates/shared/paths.ts +3 -4
  29. package/cli/lib/types/package-config.ts +1 -0
  30. package/cli/package.json +1 -1
  31. package/cli/project-templates/plugin/assets/vite/{plugin-build.config.mjs → plugin-build.config.ts} +7 -5
  32. package/cli/project-templates/plugin/assets/vite/{sandbox-build.config.mjs → sandbox-build.config.ts} +7 -5
  33. package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.module.cjs → plugin-build.legacy.module.ts} +20 -7
  34. package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.umd.cjs → plugin-build.legacy.umd.ts} +20 -7
  35. package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.module.cjs → plugin-build.modern.module.ts} +9 -4
  36. package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.umd.cjs → plugin-build.modern.umd.ts} +9 -4
  37. package/cli/project-templates/plugin/assets/webpack/{sandbox-build.config.cjs → sandbox-build.config.ts} +13 -3
  38. package/cli/project-templates/plugin/bundler-vite/release.html.eta +1 -0
  39. package/cli/project-templates/plugin/bundler-webpack/public/release.html.eta +1 -0
  40. package/cli/project-templates/plugin/shared-base/public/demo/product-1.svg +10 -0
  41. package/cli/project-templates/plugin/shared-base/public/demo/product-2.svg +10 -0
  42. package/cli/project-templates/plugin/shared-base/scripts/build-runner.ts +22 -0
  43. package/cli/project-templates/plugin/shared-base/scripts/build-types.ts +17 -0
  44. package/cli/project-templates/plugin/shared-base/scripts/clean.ts +16 -0
  45. package/cli/project-templates/plugin/shared-base/scripts/dev-runner.ts +52 -0
  46. package/cli/project-templates/plugin/shared-base/scripts/npmRun.ts +61 -0
  47. package/cli/project-templates/plugin/shared-base/scripts/release-runner.ts +18 -0
  48. package/cli/project-templates/plugin/shared-base/scripts/scriptRuntime.ts +10 -0
  49. package/cli/project-templates/plugin/shared-base/src/dev/hostApp.tsx.eta +1 -0
  50. package/cli/project-templates/plugin/shared-base/src/dev-release.tsx.eta +1 -0
  51. package/cli/project-templates/plugin/shared-base/src/dev.tsx.eta +1 -1
  52. package/cli/project-templates/shared/partials/plugin-dev-host-app-advanced.eta +93 -0
  53. package/cli/project-templates/shared/partials/plugin-dev-host-app-minimal.eta +54 -0
  54. package/cli/project-templates/shared/partials/plugin-dev-tsx-advanced.eta +3 -2
  55. package/cli/project-templates/shared/partials/plugin-dev-tsx-debug.eta +18 -0
  56. package/cli/project-templates/shared/partials/plugin-dev-tsx-release.eta +33 -0
  57. package/cli/project-templates/shared/partials/plugin-dev-tsx-runtime-helpers.eta +8 -8
  58. package/cli/project-templates/shared/partials/plugin-index-ts.eta +0 -1
  59. package/cli/project-templates/shared/partials/plugin-vite-dev-host.eta +9 -5
  60. package/cli/project-templates/shared/partials/plugin-vite-plugin-build.eta +7 -5
  61. package/cli/project-templates/shared/partials/plugin-vite-release-html.eta +12 -0
  62. package/cli/project-templates/shared/partials/plugin-vite-sandbox-build.eta +7 -5
  63. package/cli/project-templates/shared/partials/plugin-webpack-dev-host-legacy.eta +12 -5
  64. package/cli/project-templates/shared/partials/plugin-webpack-dev-host-modern.eta +13 -6
  65. package/cli/project-templates/shared/partials/plugin-webpack-release-html.eta +12 -0
  66. package/cli/project-templates/shared/partials/plugin-webpack-sandbox-build.eta +13 -3
  67. package/cli/project-templates/shared/partials/plugin-wp-legacy-module.eta +28 -10
  68. package/cli/project-templates/shared/partials/plugin-wp-legacy-umd.eta +28 -10
  69. package/cli/project-templates/shared/partials/plugin-wp-modern-module.eta +9 -4
  70. package/cli/project-templates/shared/partials/plugin-wp-modern-umd.eta +9 -4
  71. package/cli/project-templates/shared/partials/stand-dev-host-vite-memory.eta +3 -3
  72. package/cli/project-templates/shared/partials/stand-dev-host-vite-subpath.eta +8 -4
  73. package/cli/project-templates/shared/partials/stand-dev-host-vite-umd.eta +5 -5
  74. package/cli/project-templates/shared/partials/stand-dev-host-vite.eta +3 -3
  75. package/cli/project-templates/shared/partials/stand-dev-host-webpack-subpath.eta +8 -4
  76. package/cli/project-templates/shared/partials/stand-dev-host-webpack-umd.eta +9 -3
  77. package/cli/project-templates/shared/partials/stand-dev-host-webpack.eta +8 -4
  78. package/cli/project-templates/shared/partials/stand-dev-storage-middleware.eta +370 -0
  79. package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.ts +80 -0
  80. package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.ts.eta +1 -0
  81. package/cli/project-templates/shared/stand-webpack-base/config/lib/{createWebpackStandConfig.cjs → createWebpackStandConfig.ts} +31 -19
  82. package/cli/project-templates/{stand/advanced/umd/vite/config/lib/umdServeMiddleware.mjs → shared/stand-webpack-base/config/lib/umdServeMiddleware.ts} +19 -11
  83. package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.ts.eta +1 -0
  84. package/cli/project-templates/stand/advanced/memory-usage/vite/config/lib/{createMemoryUsageStandConfig.mjs → createMemoryUsageStandConfig.ts} +25 -20
  85. package/cli/project-templates/stand/advanced/umd/vite/config/lib/umdServeMiddleware.ts +68 -0
  86. package/cli/project-templates/stand/react-adapter/webpack/README.md.eta +1 -0
  87. package/cli/project-templates/stand/react-adapter/webpack/config/dev-host.ts.eta +1 -0
  88. package/cli/project-templates/stand/react-adapter/webpack/package.json.eta +1 -0
  89. package/cli/project-templates/stand/react-adapter/webpack/public/index.html.eta +1 -0
  90. package/cli/project-templates/stand/react-adapter/webpack/src/dev/editorConfig.ts.eta +1 -0
  91. package/cli/project-templates/stand/react-adapter/webpack/src/dev/email.html.eta +1 -0
  92. package/cli/project-templates/stand/react-adapter/webpack/src/dev/getAuthToken.ts.eta +1 -0
  93. package/cli/project-templates/stand/react-adapter/webpack/src/dev/oauthCredentials.ts +9 -0
  94. package/cli/project-templates/stand/react-adapter/webpack/src/dev/storageProvider.ts.eta +1 -0
  95. package/cli/project-templates/stand/react-adapter/webpack/src/index.tsx.eta +1 -0
  96. package/cli/scripts/cli-matrix-smoke.ts +19 -10
  97. package/cli/scripts/verify-global-cli.ts +1 -1
  98. package/cli/scripts/vite-plugin-version-matrix.ts +299 -0
  99. package/cli/tsconfig.json +2 -2
  100. package/emailmaker-core.ed344c04.js +1 -0
  101. package/emailmaker-esm.js +788 -153
  102. package/emailmaker.d.ts +32 -0
  103. package/emailmaker.js +4 -4
  104. package/iframe/js/amp.BGJMqoms.js +1 -1
  105. package/iframe/js/chunk.oX6nCJbK.js +1 -1
  106. package/iframe/js/iframe-eblock.js +1 -1
  107. package/iframe/js/iframe.js +1 -1
  108. package/iframe/js/rules.BSaCN7eK.js +1 -1
  109. package/iframe/js/sanitize-html.Dy7Uwo8P.js +1 -1
  110. package/images/integrations/activecampaign.svg +4 -0
  111. package/images/integrations/bento.svg +9 -0
  112. package/images/integrations/brevo.svg +7 -0
  113. package/images/integrations/campaign_monitor.svg +10 -0
  114. package/images/integrations/constant_contact.svg +24 -0
  115. package/images/integrations/dotdigital.svg +144 -0
  116. package/images/integrations/getresponse.svg +23 -0
  117. package/images/integrations/hubspot.svg +3 -0
  118. package/images/integrations/klaviyo.svg +10 -0
  119. package/images/integrations/mailchimp.svg +9 -0
  120. package/images/integrations/salesforce.svg +20 -0
  121. package/js/browser-image-compression.js +9 -0
  122. package/package.json +2 -5
  123. package/runtime/@ant-design/cssinjs/index.js +1 -1
  124. package/runtime/@ant-design/icons/index.js +1 -1
  125. package/runtime/@ant-design/pro-layout/index.js +1 -1
  126. package/runtime/README.md +13 -13
  127. package/runtime/antd/index.js +1 -1
  128. package/runtime/app-core/index.js +1 -2
  129. package/runtime/classnames/index.js +1 -1
  130. package/runtime/core/index.js +6 -6
  131. package/runtime/dayjs/index.js +1 -1
  132. package/runtime/di/index.js +1 -2
  133. package/runtime/disposable/index.js +1 -2
  134. package/runtime/errors-runtime/index.js +1 -2
  135. package/runtime/guid/index.js +1 -2
  136. package/runtime/index.js +2 -4
  137. package/runtime/package.json +2 -3
  138. package/runtime/prop-types/index.js +1 -1
  139. package/runtime/react/index.js +1 -1
  140. package/runtime/react/jsx-dev-runtime/index.js +1 -1
  141. package/runtime/react/jsx-runtime/index.js +1 -1
  142. package/runtime/react-dom/client/index.js +1 -1
  143. package/runtime/react-dom/index.js +1 -1
  144. package/runtime/react-router-dom/index.js +1 -1
  145. package/runtime/uuid/index.js +1 -1
  146. package/static/amd/{8fc2a596.js → 19aeb269.js} +88 -88
  147. package/static/core/192ec827.js +1 -0
  148. package/static/core/22c1de2e2.js +1 -0
  149. package/static/core/24faedf0.js +1 -0
  150. package/static/core/29231645.js +1 -0
  151. package/static/core/2a3177fc2.js +1 -0
  152. package/static/core/346aabd2.js +3 -0
  153. package/static/core/3b800ed6.js +1 -0
  154. package/static/core/3e840e90.js +1 -0
  155. package/static/core/40cc9fd7.js +1 -0
  156. package/static/core/421bdec22.js +1 -0
  157. package/static/core/50ff48bc.js +4 -0
  158. package/static/core/5282795d2.js +6 -0
  159. package/static/core/555e2e2f2.js +903 -0
  160. package/static/core/563a283d.js +1 -0
  161. package/static/core/5d47e095.js +47 -0
  162. package/static/core/5f574386.js +1 -0
  163. package/static/core/67a41193.js +1 -0
  164. package/static/core/698dace4.js +7 -0
  165. package/static/core/6b648e2d.js +1 -0
  166. package/static/core/7629adfd.js +1 -0
  167. package/static/core/7717f2932.js +3 -0
  168. package/static/core/776cb34a.js +1 -0
  169. package/static/core/78a1e31e.js +1 -0
  170. package/static/core/7d56d643.js +1 -0
  171. package/static/core/841752212.js +40 -0
  172. package/static/core/8477e97e.js +1 -0
  173. package/static/core/8756d562.js +1 -0
  174. package/static/core/91d328d8.js +1 -0
  175. package/static/core/9270dbb6.js +6 -0
  176. package/static/core/96371334.js +566 -0
  177. package/static/core/9b9ddaef2.js +168 -0
  178. package/static/core/af1da4b4.js +1 -0
  179. package/static/core/b5096b152.js +471 -0
  180. package/static/core/bde6775a.js +1 -0
  181. package/static/core/bf1b888c.js +4 -0
  182. package/static/core/c3747df72.js +598 -0
  183. package/static/core/cec8d739.js +11 -0
  184. package/static/core/cfac3d32.js +1 -0
  185. package/static/core/d21c95cf2.js +1 -0
  186. package/static/core/dbd9ca52.js +1 -0
  187. package/static/core/dc590181.js +1 -0
  188. package/static/core/e0039d55.js +1 -0
  189. package/static/core/e4071c1a.js +4 -0
  190. package/static/core/ef87b75c.js +41 -0
  191. package/static/core/f47701f32.js +20 -0
  192. package/static/core/f83d7ac42.js +3 -0
  193. package/static/core/fcc67e6b.js +1 -0
  194. package/static/core/fd40d85c.js +1 -0
  195. package/static/core/fe638847.js +1 -0
  196. package/static/esm/{e8401d17.js → 203c9644.js} +3 -3
  197. package/static/esm/4b679053.js +27 -0
  198. package/static/esm/{b273a6c2.js → f31a26c6.js} +1 -1
  199. package/static/runtime/disposable-CD74igiJ.js +1 -0
  200. package/static/runtime/guid-C0wuVR8v.js +1 -0
  201. package/vite/index.d.ts +17 -6
  202. package/vite/index.js +315 -270
  203. package/vite/pluginDev/index.d.ts +10 -19
  204. package/vite/pluginDev/index.js +251 -204
  205. package/webpack/index.d.ts +24 -5
  206. package/webpack/index.js +168 -144
  207. package/webpack/pluginDev/index.d.ts +21 -22
  208. package/webpack/pluginDev/index.js +242 -177
  209. package/cli/dist/lib/template-engine/buildStandIndexHtml.test.d.ts +0 -2
  210. package/cli/dist/lib/template-engine/buildStandIndexHtml.test.js +0 -89
  211. package/cli/dist/lib/template-engine/emitEtaTree.test.d.ts +0 -2
  212. package/cli/dist/lib/template-engine/emitEtaTree.test.js +0 -34
  213. package/cli/dist/lib/template-engine/pluginEtaParity.test.d.ts +0 -2
  214. package/cli/dist/lib/template-engine/pluginEtaParity.test.js +0 -105
  215. package/cli/dist/lib/template-engine/resolveVariantDir.test.d.ts +0 -2
  216. package/cli/dist/lib/template-engine/resolveVariantDir.test.js +0 -52
  217. package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.d.ts +0 -2
  218. package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.js +0 -67
  219. package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.d.ts +0 -2
  220. package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.js +0 -83
  221. package/cli/dist/lib/template-engine/storageProviderEta.test.d.ts +0 -2
  222. package/cli/dist/lib/template-engine/storageProviderEta.test.js +0 -26
  223. package/cli/project-templates/plugin/shared-base/scripts/build-types.cjs +0 -8
  224. package/cli/project-templates/plugin/shared-base/scripts/clean.cjs +0 -6
  225. package/cli/project-templates/plugin/shared-base/scripts/dev-runner.cjs +0 -48
  226. package/cli/project-templates/plugin/shared-base/scripts/release-runner.cjs +0 -63
  227. package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.mjs +0 -80
  228. package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.cjs +0 -235
  229. package/cli/project-templates/shared/stand-webpack-base/config/lib/umdServeMiddleware.cjs +0 -38
  230. package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.cjs +0 -235
  231. package/emailmaker-core.80d62b88.js +0 -569
  232. package/runtime/_core/app-core/index.js +0 -1
  233. package/runtime/_core/chunks/app-core-DphKKh8f.js +0 -1
  234. package/runtime/_core/chunks/chunk-oqAt0Dze.js +0 -1
  235. package/runtime/_core/chunks/di-BHUzE57z.js +0 -1
  236. package/runtime/_core/chunks/disposable-PhM3rJkj.js +0 -1
  237. package/runtime/_core/chunks/errors-runtime-VjCOXaQX.js +0 -1
  238. package/runtime/_core/chunks/guid-D2-FTZQG.js +0 -1
  239. package/runtime/_core/di/index.js +0 -1
  240. package/runtime/_core/disposable/index.js +0 -1
  241. package/runtime/_core/errors-runtime/index.js +0 -1
  242. package/runtime/_core/guid/index.js +0 -1
  243. package/runtime/_core/index.js +0 -1
  244. package/shared/hostBootstrap.js +0 -47
  245. package/shared/pluginDevOptions.js +0 -31
  246. package/shared/runtimeManifest.js +0 -72
  247. package/shared/stringCase.js +0 -16
  248. package/static/core/2360f32a.js +0 -3
  249. package/static/core/2687db56.js +0 -3
  250. package/static/core/2b250af6.js +0 -1261
  251. package/static/core/3469930c.js +0 -302
  252. package/static/core/34ce9042.js +0 -201
  253. package/static/core/4091ba5b.js +0 -25
  254. package/static/core/41ce3a6a.js +0 -173
  255. package/static/core/4ac4908c.js +0 -2213
  256. package/static/core/519096c1.js +0 -2597
  257. package/static/core/5fa1772b.js +0 -116550
  258. package/static/core/61312909.js +0 -3
  259. package/static/core/62a98c07.js +0 -75301
  260. package/static/core/6309c0f2.js +0 -3
  261. package/static/core/68d9f440.js +0 -3
  262. package/static/core/73b645ab.js +0 -2
  263. package/static/core/81019351.js +0 -280
  264. package/static/core/835b37ef.js +0 -591
  265. package/static/core/91242fb3.js +0 -3
  266. package/static/core/972b15b0.js +0 -92399
  267. package/static/core/974ef468.js +0 -493
  268. package/static/core/a17614422.js +0 -38078
  269. package/static/core/a2fa7b5b.js +0 -4232
  270. package/static/core/a513adfd.js +0 -89857
  271. package/static/core/a7c73a9b.js +0 -3813
  272. package/static/core/b64c7c90.js +0 -228
  273. package/static/core/cdc9ba92.js +0 -4711
  274. package/static/core/d1db685d.js +0 -2193
  275. package/static/core/d661febc.js +0 -3
  276. package/static/core/d6d2d2d0.js +0 -23
  277. package/static/core/df1a1225.js +0 -607
  278. package/static/core/e5bff179.js +0 -1302
  279. package/static/core/e5d602f5.js +0 -2
  280. package/static/core/eb029366.js +0 -1532
  281. package/static/core/f46c035a.js +0 -2
  282. package/static/core/f8b9d89a.js +0 -461
  283. package/static/core/fd897ad7.js +0 -3
  284. package/static/core/fdd890c7.js +0 -6168
  285. package/static/esm/29eb18ff.js +0 -164
  286. package/vite/mime-types.js +0 -179
  287. package/vite/utils.js +0 -44
  288. /package/cli/project-templates/plugin/bundler-vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  289. /package/cli/project-templates/plugin/bundler-vite/config/{plugin-build.mjs.eta → plugin-build.ts.eta} +0 -0
  290. /package/cli/project-templates/plugin/bundler-vite/config/{sandbox-build.mjs.eta → sandbox-build.ts.eta} +0 -0
  291. /package/cli/project-templates/plugin/bundler-webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  292. /package/cli/project-templates/plugin/bundler-webpack/config/{plugin-build.cjs.eta → plugin-build.ts.eta} +0 -0
  293. /package/cli/project-templates/plugin/bundler-webpack/config/{sandbox-build.cjs.eta → sandbox-build.ts.eta} +0 -0
  294. /package/cli/project-templates/stand/advanced/memory-usage/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  295. /package/cli/project-templates/stand/advanced/shadow-dom/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  296. /package/cli/project-templates/stand/advanced/shadow-dom/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  297. /package/cli/project-templates/stand/advanced/subpath/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  298. /package/cli/project-templates/stand/advanced/subpath/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  299. /package/cli/project-templates/stand/advanced/umd/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  300. /package/cli/project-templates/stand/advanced/umd/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  301. /package/cli/project-templates/stand/closed-loop/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  302. /package/cli/project-templates/stand/closed-loop/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  303. /package/cli/project-templates/stand/oauth/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  304. /package/cli/project-templates/stand/oauth/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  305. /package/cli/project-templates/stand/react-adapter/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  306. /package/iframe/{iframe-eblock.80d62b88.html → iframe-eblock.ed344c04.html} +0 -0
  307. /package/iframe/{iframe.80d62b88.html → iframe.ed344c04.html} +0 -0
  308. /package/{runtime/chunks → static/runtime}/DownloadOutlined-a2ZUz7zB.js +0 -0
  309. /package/{runtime/chunks → static/runtime}/chunk-D-iEO58U.js +0 -0
  310. /package/{runtime/chunks → static/runtime}/classnames-DBEldvch.js +0 -0
  311. /package/{runtime/chunks → static/runtime}/client-5XqXGmAI.js +0 -0
  312. /package/{runtime/chunks → static/runtime}/dayjs.min-CO3mzOeV.js +0 -0
  313. /package/{runtime/_core/chunks/defineProperty-BGJFuFMq.js → static/runtime/defineProperty-CGNmw-jw.js} +0 -0
  314. /package/{runtime/chunks → static/runtime}/dist-Cns8cA2n.js +0 -0
  315. /package/{runtime/chunks → static/runtime}/dist-Ct0xRt3Y.js +0 -0
  316. /package/{runtime/chunks → static/runtime}/es-0FFT3fCz.js +0 -0
  317. /package/{runtime/chunks → static/runtime}/es-BwJ3eGbx.js +0 -0
  318. /package/{runtime/chunks → static/runtime}/es-D8EsVtRL.js +0 -0
  319. /package/{runtime/chunks → static/runtime}/es-Da4O25Kw.js +0 -0
  320. /package/{runtime/chunks → static/runtime}/jsx-dev-runtime-V4_MuHNS.js +0 -0
  321. /package/{runtime/chunks → static/runtime}/jsx-runtime-DBeCoE0b.js +0 -0
  322. /package/{runtime/chunks → static/runtime}/objectWithoutProperties-Bk0EDksJ.js +0 -0
  323. /package/{runtime/chunks → static/runtime}/prop-types-DxD5wgQ0.js +0 -0
  324. /package/{runtime/chunks → static/runtime}/react-TEeeBWTl.js +0 -0
  325. /package/{runtime/chunks → static/runtime}/react-dom-BKKa1g6U.js +0 -0
@@ -1,1532 +0,0 @@
1
- import { s as e } from "./d6d2d2d0.js";
2
- import { Jt as t, Ut as n, Vt as r, t as i } from "./cdc9ba92.js";
3
- import { f as a } from "./972b15b0.js";
4
- import { Sn as o, bn as s, xn as c } from "./5fa1772b.js";
5
- //#region packages/escaping/rules.ts
6
- function l(e) {
7
- let t = /[<>&]/g;
8
- for (; t.exec(e) !== null;) return !0;
9
- return !1;
10
- }
11
- function u(e, t) {
12
- let n = e.length;
13
- for (let r = 0; r < n; r++) {
14
- let n = e.charCodeAt(r);
15
- if (n === 0 || t === "\"" && n === 34 || t === "'" && n === 39 || t === "" && (n === 32 || n === 9 || n === 10 || n === 13 || n === 12 || n === 34 || n === 39 || n === 60 || n === 62 || n === 61 || n === 96)) return !1;
16
- }
17
- return !0;
18
- }
19
- function d(e) {
20
- let t = new Uint8Array(e);
21
- crypto.getRandomValues(t);
22
- let n = "";
23
- for (let r = 0; r < e; r++) {
24
- let e = t[r] % 62;
25
- n += "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(e);
26
- }
27
- return n;
28
- }
29
- var f = 8, p = new class {
30
- _byKey = Object.create(null);
31
- _byValue = Object.create(null);
32
- getOrCreateByKey(e) {
33
- let t = this._byKey[e];
34
- return t === void 0 && (t = d(f), this._byKey[e] = t, this._byValue[t] = e), t;
35
- }
36
- getByValue(e) {
37
- return this._byValue[e];
38
- }
39
- }();
40
- function m(e, t) {
41
- return t !== void 0 && !u(e, t) ? `%|{${p.getOrCreateByKey(e)}}|%` : e;
42
- }
43
- function h(e) {
44
- let t = p.getByValue(e.slice(3, e.length - 3));
45
- return t === void 0 ? e : t;
46
- }
47
- function g(e, t, n) {
48
- return t === void 0 ? `<!--${e}-->` : u(e, t) ? e : `%|{${p.getOrCreateByKey(e)}}|%`;
49
- }
50
- function ee(e) {
51
- return e.replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&amp;/g, "&");
52
- }
53
- function _(e) {
54
- return e.startsWith("<!--") && e.endsWith("-->") ? ee(e.slice(4, -3).trim()) : e;
55
- }
56
- function te(e) {
57
- let t = /^(IF|ELSE|ELSIF|ELSEIF|END|FOREACH|WHILE|NEXT|LAST|BREAK|DO|UNLESS|CONTINUE|SET|UNSET|DEFINE|INCLUDE)\b/i, n = /\w+\s*\(/, r = e, i = e.match(/\[%\s*([^%]*?)\s*%\]/);
58
- i && (r = i[1]);
59
- let a = r.trim();
60
- return t.test(a) || n.test(a);
61
- }
62
- function ne(e, t, n) {
63
- return t === void 0 ? n || l(e) || te(e) ? `<!--${e}-->` : e : u(e, t) ? e : `%|{${p.getOrCreateByKey(e)}}|%`;
64
- }
65
- var re = /#set\s*\(\s*.*=.*\)/gm, ie = /<!--#set\s*\(\s*.*=.*\)-->/gm, ae = (e) => {
66
- e.escape("<!--", "-->", (e) => e, !1), e.escape("<style", "</style>", (e) => e, !1), e.escape("<script", "<\/script>", (e) => e, !1), e.unescape("%|{", "}|%", h), e.escape("@{", "}", g, !0).unescape("<!--@{", "}-->", _, !0), e.unescape("<!--%%%{{{", "}}}%%%-->", (e) => e.substring(10, e.length - 9), !1), e.escape("${", "}", m, !0), e.escape("{{", "}}", m, !0), e.escape("{%", "%}", g).unescape("<!--{%", "%}-->", _), e.escape("{#", "#}", g).unescape("<!--{#", "#}-->", _), e.escape("[%", "%]", ne, !0).unescape("<!--[%", "%]-->", _, !0), e.createSyntax("getresponse").escape("[[IF", "]]", g).escape("[[if", "]]", g).escape("[[ELSE]]", "", g).escape("[[else]]", "", g).escape("[[ENDIF]]", "", g).escape("[[endif]]", "", g).unescape("<!--[[IF", "]]-->", _).unescape("<!--[[if", "]]-->", _).unescape("<!--[[ELSE]]", "-->", _).unescape("<!--[[else]]", "-->", _).unescape("<!--[[ENDIF]]", "-->", _).unescape("<!--[[endif]]", "-->", _), e.createSyntax("ExpertSender").escape("<if", ">", g).escape("</if", ">", g).escape("<else", ">", g).escape("</else", ">", g).escape("<var ", ">", g, !0).unescape("<!--<if ", ">-->", _).unescape("<!--</if", ">-->", _).unescape("<!--<else ", ">-->", _).unescape("<!--</else", ">-->", _).unescape("<!--<var", ">-->", _, !0), e.createSyntax("velocity").escape("#if", ")", g).escape("#elseif", ")", g).escape("#else", "", g).escape("#foreach", ")", g).escape("#macro", ")", g).escape("#set", ")", (e, t, n) => e.match(re) ? g(e, t, n) : !1, !0).escape("#parse", ")", g).escape("#include", ")", g).escape("#evaluate", ")", g).escape("#end", "", g).escape("#break", "", g).escape("#stop", "", g).unescape("<!--#macro", ")-->", _).unescape("<!--#if", ")-->", _).unescape("<!--#elseif", ")-->", _).unescape("<!--#else", "-->", _).unescape("<!--#foreach", ")-->", _).unescape("<!--#parse", ")-->", _).unescape("<!--#include", ")-->", _).unescape("<!--#evaluate", ")-->", _).unescape("<!--#end", "-->", _).unescape("<!--#break", "-->", _).unescape("<!--#stop", "-->", _).unescape("<!--#set", ")-->", (e) => e.match(ie) ? _(e) : !1, !0), e.escape("*|", "|*", g).unescape("<!--*|", "|*-->", _), e.escape("{%", "%}", g).unescape("<!--{%", "%}-->", _);
67
- };
68
- //#endregion
69
- //#region packages/escaping/index.ts
70
- function oe(e, t) {
71
- let n = t.reduce((e, { mapFn: t, start: n, end: r, syntax: i }) => (e[n] || (e[n] = []), e[n].push({
72
- value: r,
73
- mapFn: t,
74
- syntax: i
75
- }), e), Object.create(null)), r = Object.keys(n).map((e) => e.replace(/[-[\]{}()*+?.,\\^$|]/g, "\\$&")).join("|"), i = new RegExp(r, "g"), a = [], o;
76
- for (; (o = i.exec(e)) !== null;) {
77
- let e = o[0];
78
- a.push({
79
- start: o.index,
80
- startToken: e,
81
- endTokens: n[e]
82
- });
83
- }
84
- return a;
85
- }
86
- function se(e, t, n, r) {
87
- let i = [];
88
- if (n && (t = t.filter((e) => e.isVariable)), !t.length) return i;
89
- let a = oe(e, t), o = !1, s = !1, c, l = !1, u = 0;
90
- for (let t = 0; t < a.length; t++) {
91
- let { start: n, startToken: d, endTokens: f } = a[t];
92
- if (r) s = !0, c = "\"";
93
- else for (let t = u; t < n; t++) {
94
- let n = e[t];
95
- s ? c === "\"" || c === "'" ? n === c && (s = !1, c = void 0) : l && /[\s>]/.test(n) && (s = !1, c = void 0, l = !1) : n === "<" ? o = !0 : n === ">" ? o = !1 : o && (n === "\"" || n === "'") ? (s = !0, c = n, l = !1) : o && /\S/.test(n) && c === void 0 && e[t - 1] === "=" && ![
96
- "\"",
97
- "'",
98
- "`"
99
- ].includes(n) && (s = !0, c = "", l = !0);
100
- }
101
- u = n;
102
- let p = s ? c ?? "" : void 0;
103
- for (let { mapFn: r, value: s } of f) {
104
- let c = e.indexOf(s, n + d.length), l = n + d.length, u = 0;
105
- for (; c !== -1;) {
106
- let t = e.indexOf(d, l);
107
- if (t !== -1 && t < c) u++, l = t + d.length, c = e.indexOf(s, l);
108
- else if (u > 0) u--, l = c + s.length, c = e.indexOf(s, l);
109
- else break;
110
- }
111
- if (c >= 0) {
112
- let l = c + s.length, u = e.substring(n, l), d = r(u, p, o);
113
- d !== !1 && d !== u && i.push({
114
- range: {
115
- start: n,
116
- end: l
117
- },
118
- text: d
119
- });
120
- let f = a.findIndex(({ start: e }) => e >= l);
121
- t = f > t ? f - 1 : a.length;
122
- break;
123
- }
124
- }
125
- }
126
- return i;
127
- }
128
- function ce(e, t) {
129
- if (!t.length) return e;
130
- let n = t.slice().sort((e, t) => t.range.start - e.range.start), r = e;
131
- for (let { text: e, range: t } of n) r = r.slice(0, t.start) + e + r.slice(t.end);
132
- return r;
133
- }
134
- var le = class {
135
- _disposables = [];
136
- _escapes = [];
137
- _unescapes = [];
138
- constructor(e = ae) {
139
- let { _escapes: t, _unescapes: n } = this;
140
- e({
141
- createSyntax(e) {
142
- return {
143
- ...this,
144
- syntax: e
145
- };
146
- },
147
- escape(e, n, r, i) {
148
- return t.push({
149
- start: e,
150
- end: n,
151
- mapFn: r,
152
- isVariable: i,
153
- syntax: this.syntax || e
154
- }), this;
155
- },
156
- unescape(e, t, r, i) {
157
- return n.push({
158
- start: e,
159
- end: t,
160
- mapFn: r,
161
- isVariable: i,
162
- syntax: this.syntax || e
163
- }), this;
164
- }
165
- });
166
- }
167
- getMappings(e, t, n) {
168
- return se(e, this._escapes, t, n);
169
- }
170
- getRevertMappings(e, t) {
171
- return se(e, this._unescapes, t);
172
- }
173
- getEscapedText(e, t) {
174
- return ce(e, this.getMappings(e, t));
175
- }
176
- getUnescapedText(e, t) {
177
- return ce(e, this.getRevertMappings(e, t));
178
- }
179
- addDisposable(e) {
180
- this._disposables.push(e);
181
- }
182
- dispose() {
183
- for (let e of this._disposables) e.dispose();
184
- }
185
- }, v = /* @__PURE__ */ function(e) {
186
- return e[e.HTML = 0] = "HTML", e[e.ELEMENT = 1] = "ELEMENT", e[e.ROOT = 2] = "ROOT", e[e.COMMENT = 3] = "COMMENT", e[e.DOCTYPE = 4] = "DOCTYPE", e[e.ADVANCED = 5] = "ADVANCED", e;
187
- }({}), y = (e) => e.type === v.HTML ? e.start - 1 : e.start, ue = (e) => e.type === v.HTML ? e.end + 1 : e.end, b = class e {
188
- content;
189
- type = v.ELEMENT;
190
- tag;
191
- closed = !1;
192
- startTagEnd;
193
- endTagStart;
194
- attributes;
195
- get attributeNames() {
196
- return this.attributes ? Object.keys(this.attributes) : [];
197
- }
198
- createdBy;
199
- isDirty;
200
- get root() {
201
- return this.parent ? this.parent.root : this;
202
- }
203
- constructor(e, t, n, r) {
204
- this.start = e, this.end = t, this.children = n, this.parent = r;
205
- }
206
- isSameTag(e) {
207
- return this.tag === void 0 ? e === void 0 : e !== void 0 && this.tag.length === e.length && this.tag.toLowerCase() === e;
208
- }
209
- get firstChild() {
210
- return this.children[0];
211
- }
212
- get lastChild() {
213
- return this.children.length ? this.children[this.children.length - 1] : void 0;
214
- }
215
- findNodeBefore(e) {
216
- let t = _e(this.children, (t) => e <= y(t)) - 1;
217
- if (t >= 0) {
218
- let n = this.children[t];
219
- if (e > y(n)) {
220
- if (e < n.end) return n.findNodeBefore(e);
221
- let t = n.lastChild;
222
- return t && t.end === n.end ? n.findNodeBefore(e) : n;
223
- }
224
- }
225
- return this;
226
- }
227
- findNodeAt(e) {
228
- let t = _e(this.children, (t) => e <= y(t)) - 1;
229
- if (t >= 0) {
230
- let n = this.children[t];
231
- if (e >= y(n) && e <= ue(n)) return n.findNodeAt(e);
232
- }
233
- return this;
234
- }
235
- find(e) {
236
- if (e(this)) return this;
237
- for (let t of this.children) {
238
- let n = t.find(e);
239
- if (n) return n;
240
- }
241
- }
242
- closest(e) {
243
- let t = this;
244
- do
245
- if (e(t)) return t;
246
- while (t = t.parent);
247
- }
248
- parents() {
249
- return this.parent ? [this.parent, ...this.parent.parents()] : [];
250
- }
251
- closestFromRoot(e, t = !0) {
252
- let n = t ? [this, ...this.parents()] : this.parents();
253
- for (let t = n.length - 1; t >= 0; t--) {
254
- let r = n[t];
255
- if (e(r)) return r;
256
- }
257
- }
258
- contains(e) {
259
- return !!e.closest((e) => e === this);
260
- }
261
- clone(t = this.parent, n = this.start, r = !0) {
262
- let i = this.start - n, a = new e(n, this.end - i, [], t);
263
- return a.children = r ? this.children.map((e) => e.clone(a, e.start - i)) : [], a.attributes = { ...this.attributes }, a.closed = this.closed, a.content = this.content, a.startTagEnd = this.startTagEnd, a.endTagStart = this.endTagStart, a.tag = this.tag, a.type = this.type, a;
264
- }
265
- }, de = new Set([
266
- "area",
267
- "br",
268
- "col",
269
- "embed",
270
- "hr",
271
- "img",
272
- "input",
273
- "link",
274
- "meta",
275
- "param",
276
- "vk-snippet-end"
277
- ]);
278
- function fe(e) {
279
- return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (e, t) => t.toUpperCase());
280
- }
281
- var pe = Object.create(null);
282
- function me(e, t) {
283
- let n = pe[e] || (pe[e] = Object.create(null)), r = n[t];
284
- if (typeof r != "boolean") {
285
- let i = document.createElement(e)[fe(t)];
286
- r = n[t] = i !== void 0 && typeof i != "boolean";
287
- }
288
- return r;
289
- }
290
- function he(e) {
291
- let t = e.tag?.toLowerCase(), n = "";
292
- if (t) {
293
- let r = e.attributes;
294
- if (r) {
295
- let e = Object.keys(r);
296
- for (let i of e) {
297
- let e = r[i] === null ? "" : r[i];
298
- typeof e == "string" && (n += e === "" && i !== "em" && !me(t, i) ? ` ${i}` : ` ${i}="${e.replaceAll("\"", "'")}"`);
299
- }
300
- }
301
- }
302
- return n;
303
- }
304
- function ge(e, t) {
305
- if (e.start !== e.startTagEnd || t) {
306
- let t = e.tag?.toLowerCase() || "div", n = he(e);
307
- return t === "vk-snippet-end" ? `<${t}${n}/>` : `<${t}${n}>`;
308
- }
309
- return "";
310
- }
311
- function _e(e, t) {
312
- let n = 0, r = e.length;
313
- if (r === 0) return 0;
314
- for (; n < r;) {
315
- let i = Math.floor((n + r) / 2);
316
- t(e[i]) ? r = i : n = i + 1;
317
- }
318
- return n;
319
- }
320
- //#endregion
321
- //#region packages/dom2Html/index.ts
322
- function ve(e) {
323
- return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (e, t) => t.toUpperCase());
324
- }
325
- function ye(e) {
326
- return "<!DOCTYPE " + e.name + (e.publicId ? " PUBLIC \"" + e.publicId + "\"" : "") + (!e.publicId && e.systemId ? " SYSTEM" : "") + (e.systemId ? " \"" + e.systemId + "\"" : "") + ">";
327
- }
328
- var be = Object.create(null);
329
- function xe(e, t) {
330
- let n = be[e] || (be[e] = Object.create(null)), r = n[t];
331
- if (typeof r != "boolean") {
332
- let i = document.createElement(e)[ve(t)];
333
- r = n[t] = i !== void 0 && typeof i != "boolean";
334
- }
335
- return r;
336
- }
337
- function x(e) {
338
- return e.nodeType === Node.ELEMENT_NODE;
339
- }
340
- function Se(e) {
341
- return x(e) && !e.ownerSVGElement;
342
- }
343
- function Ce(e) {
344
- return e.tagName === "IMG";
345
- }
346
- function we(e) {
347
- return e.tagName === "AMP-IMG";
348
- }
349
- function Te(e) {
350
- return e.tagName === "BODY";
351
- }
352
- function Ee(e) {
353
- return e.tagName === "FORM";
354
- }
355
- function De(e) {
356
- return e.tagName === "HTML";
357
- }
358
- function Oe(e) {
359
- return e.tagName === "STYLE";
360
- }
361
- function S(e) {
362
- return e.nodeType === Node.DOCUMENT_NODE;
363
- }
364
- function ke(e) {
365
- return e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
366
- }
367
- function Ae(e) {
368
- return e.nodeType === Node.DOCUMENT_TYPE_NODE;
369
- }
370
- var je;
371
- (function(e) {
372
- function t(e) {
373
- return e.constructor.name === "CSSStyleRule";
374
- }
375
- e.isStyleRule = t;
376
- function n(e) {
377
- return e.constructor.name === "CSSImportRule";
378
- }
379
- e.isImportRule = n;
380
- function r(e) {
381
- return e.constructor.name === "CSSMediaRule";
382
- }
383
- e.isMediaRule = r;
384
- function i(e) {
385
- return e.constructor.name === "CSSFontFaceRule";
386
- }
387
- e.isFontFaceRule = i;
388
- function a(e) {
389
- return e.constructor.name === "CSSPageRule";
390
- }
391
- e.isPageRule = a;
392
- function o(e) {
393
- return e.constructor.name === "CSSKeyframesRule";
394
- }
395
- e.isKeyframesRule = o;
396
- function s(e) {
397
- return e.constructor.name === "CSSKeyframeRule";
398
- }
399
- e.isKeyframeRuleRule = s;
400
- function c(e) {
401
- return e.constructor.name === "CSSNamespaceRule";
402
- }
403
- e.isNamespaceRule = c;
404
- function l(e) {
405
- return e.constructor.name === "CSSCounterStyleRule";
406
- }
407
- e.isCounterStyleRule = l;
408
- function u(e) {
409
- return e.constructor.name === "CSSSupportsRule";
410
- }
411
- e.isSupportsRule = u;
412
- function d(e) {
413
- return e.constructor.name === "CSSFontFeatureValuesRule";
414
- }
415
- e.isFontFeatureValuesRuleRule = d;
416
- })(je ||= {});
417
- function C(e) {
418
- return e.nodeType === Node.COMMENT_NODE;
419
- }
420
- function Me(e) {
421
- return e && !!e.host && !!e.mode;
422
- }
423
- function Ne(e) {
424
- let t = e.getRootNode() || window.document;
425
- return Me(t) ? t : null;
426
- }
427
- var Pe = /(<!(--)?\[if\s[()\w\s|&!]+\]>(?:<!--+>)?)((?:.|\r|\n)*?)((?:<!--)?<!\[endif\]\2>)/gi;
428
- function Fe(e) {
429
- let t = E(e).matchAll(Pe);
430
- if (t) for (let e of t) {
431
- let [, t, , n, r] = e;
432
- return {
433
- open: t,
434
- close: r,
435
- content: n
436
- };
437
- }
438
- }
439
- function w(e) {
440
- return e.nodeType === Node.TEXT_NODE;
441
- }
442
- function Ie(e) {
443
- return e.tagName === "TABLE";
444
- }
445
- async function T(e, t = 5e3) {
446
- return e.complete !== void 0 && !e.complete ? new Promise((n, r) => {
447
- setTimeout(n, t), e.onload = () => n(getComputedStyle(e)), e.onerror = (e) => console.log(e);
448
- }) : getComputedStyle(e);
449
- }
450
- function E(e) {
451
- if (x(e)) return Re(e);
452
- if (S(e)) return [...e.childNodes].map((e) => E(e)).join("");
453
- if (Ae(e)) return ye(e);
454
- let t = document.createElement("div");
455
- return t.appendChild(e.cloneNode(!0)), t.innerHTML;
456
- }
457
- function Le(e) {
458
- let t = e.tagName.toLowerCase(), n = "";
459
- for (let r of e.attributes) {
460
- let e = r.name, i = r.value;
461
- n += i === "" && e !== "em" && !xe(t, e) ? ` ${e}` : ` ${e}="${i.replaceAll("\"", "'")}"`;
462
- }
463
- return n;
464
- }
465
- function D(e) {
466
- let t = "";
467
- for (let n of e.childNodes) t += E(n);
468
- return t;
469
- }
470
- function Re(e) {
471
- let t = Object.getOwnPropertyDescriptor(e, "$$tagName")?.value || e.tagName.toLowerCase(), n = Le(e);
472
- return de.has(t.toLowerCase()) ? t === "vk-snippet-end" ? `<${t}${n}/>` : `<${t}${n}>` : Oe(e) ? `<${t}${n}>${e.innerHTML}</${t}>` : `<${t}${n}>${D(e)}</${t}>`;
473
- }
474
- function O(e, t) {
475
- for (let t of [...e.childNodes]) t.remove();
476
- let n = t.find((e) => De(e)), r = t.find((e) => Te(e)), i = e;
477
- n || (n = document.createElement("html"), e.appendChild(n), i = n, r || (r = document.createElement("body"), n.appendChild(r), i = r));
478
- for (let n of t) {
479
- if (i === e && w(n)) {
480
- i.appendChild(document.createComment(`%%%{{{${n.data}}}}%%%`));
481
- continue;
482
- }
483
- i.appendChild(n);
484
- }
485
- }
486
- //#endregion
487
- //#region packages/htmlParser/htmlDataManager.ts
488
- var ze = class {
489
- _voidElements;
490
- constructor(e) {
491
- this._voidElements = new Set(e);
492
- }
493
- isVoidElement(e) {
494
- return this._voidElements.has(e.toLowerCase());
495
- }
496
- }, k = /* @__PURE__ */ function(e) {
497
- return e[e.StartCommentTag = 0] = "StartCommentTag", e[e.Comment = 1] = "Comment", e[e.EndCommentTag = 2] = "EndCommentTag", e[e.StartTagOpen = 3] = "StartTagOpen", e[e.StartTagClose = 4] = "StartTagClose", e[e.StartTagSelfClose = 5] = "StartTagSelfClose", e[e.StartTag = 6] = "StartTag", e[e.EndTagOpen = 7] = "EndTagOpen", e[e.EndTagClose = 8] = "EndTagClose", e[e.EndTag = 9] = "EndTag", e[e.DelimiterAssign = 10] = "DelimiterAssign", e[e.AttributeName = 11] = "AttributeName", e[e.AttributeValue = 12] = "AttributeValue", e[e.StartDoctypeTag = 13] = "StartDoctypeTag", e[e.Doctype = 14] = "Doctype", e[e.EndDoctypeTag = 15] = "EndDoctypeTag", e[e.Content = 16] = "Content", e[e.Whitespace = 17] = "Whitespace", e[e.Unknown = 18] = "Unknown", e[e.Script = 19] = "Script", e[e.Styles = 20] = "Styles", e[e.EOS = 21] = "EOS", e[e.AdvancedStart = 100] = "AdvancedStart", e[e.AdvancedEnd = 101] = "AdvancedEnd", e;
498
- }({}), Be = class {
499
- source;
500
- len;
501
- position;
502
- constructor(e, t) {
503
- this.source = e, this.len = e.length, this.position = t;
504
- }
505
- eos() {
506
- return this.len <= this.position;
507
- }
508
- getSource() {
509
- return this.source;
510
- }
511
- pos() {
512
- return this.position;
513
- }
514
- goBackTo(e) {
515
- this.position = e;
516
- }
517
- goBack(e) {
518
- this.position -= e;
519
- }
520
- advance(e) {
521
- this.position += e;
522
- }
523
- goToEnd() {
524
- this.position = this.source.length;
525
- }
526
- nextChar() {
527
- return this.source.charCodeAt(this.position++) || 0;
528
- }
529
- peekChar(e = 0) {
530
- return this.source.charCodeAt(this.position + e) || 0;
531
- }
532
- advanceIfChar(e) {
533
- return e === this.source.charCodeAt(this.position) ? (this.position++, !0) : !1;
534
- }
535
- advanceIfChars(e) {
536
- let t;
537
- if (this.position + e.length > this.source.length) return !1;
538
- for (t = 0; t < e.length; t++) if (this.source.charCodeAt(this.position + t) !== e[t]) return !1;
539
- return this.advance(t), !0;
540
- }
541
- advanceIfRegExp(e) {
542
- let t = this.source.substr(this.position).match(e);
543
- return t ? (this.position = this.position + t.index + t[0].length, t[0]) : "";
544
- }
545
- advanceUntilRegExp(e) {
546
- let t = this.source.substr(this.position).match(e);
547
- return t ? (this.position += t.index, t[0]) : (this.goToEnd(), "");
548
- }
549
- advanceUntilChar(e) {
550
- for (; this.position < this.source.length;) {
551
- if (this.source.charCodeAt(this.position) === e) return !0;
552
- this.advance(1);
553
- }
554
- return !1;
555
- }
556
- advanceUntilChars(e) {
557
- for (; this.position + e.length <= this.source.length;) {
558
- let t = 0;
559
- for (; t < e.length && this.source.charCodeAt(this.position + t) === e[t]; t++);
560
- if (t === e.length) return !0;
561
- this.advance(1);
562
- }
563
- return this.goToEnd(), !1;
564
- }
565
- skipWhitespace() {
566
- return this.advanceWhileChar((e) => e === Je || e === Ye || e === Ge || e === qe || e === Ke) > 0;
567
- }
568
- advanceWhileChar(e) {
569
- let t = this.position;
570
- for (; this.position < this.len && e(this.source.charCodeAt(this.position));) this.position++;
571
- return this.position - t;
572
- }
573
- }, Ve = 33, A = 45, j = 60, M = 62, N = 47, He = 61, Ue = 34, We = 39, Ge = 10, Ke = 13, qe = 12, Je = 32, Ye = 9, Xe = {
574
- "text/x-handlebars-template": !0,
575
- "text/html": !0
576
- };
577
- function Ze(e, t = 0, n = c.WithinContent, r = !1) {
578
- let i = new Be(e, t), a = n, o = 0, s = k.Unknown, l, u, d, f, p;
579
- function m() {
580
- return i.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase();
581
- }
582
- function h() {
583
- return i.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase();
584
- }
585
- function g(e, t, n) {
586
- return s = t, o = e, l = n, t;
587
- }
588
- function ee() {
589
- let e = i.pos(), t = a, n = _();
590
- return n !== k.EOS && e === i.pos() && !(r && (n === k.StartTagClose || n === k.EndTagClose)) ? ("" + e + t + a, i.advance(1), g(e, k.Unknown)) : n;
591
- }
592
- function _() {
593
- let e = i.pos();
594
- if (i.eos()) return g(e, k.EOS);
595
- let t;
596
- switch (a) {
597
- case c.WithinComment: return i.advanceIfChars([
598
- A,
599
- A,
600
- M
601
- ]) ? (a = c.WithinContent, g(e, k.EndCommentTag)) : (i.advanceUntilChars([
602
- A,
603
- A,
604
- M
605
- ]), g(e, k.Comment));
606
- case c.WithinDoctype: return i.advanceIfChar(M) ? (a = c.WithinContent, g(e, k.EndDoctypeTag)) : (i.advanceUntilChar(M), g(e, k.Doctype));
607
- case c.WithinContent:
608
- if (i.advanceIfChar(j)) {
609
- if (!i.eos() && i.peekChar() === Ve) {
610
- if (i.advanceIfChars([
611
- Ve,
612
- A,
613
- A
614
- ])) return a = c.WithinComment, g(e, k.StartCommentTag);
615
- if (i.advanceIfRegExp(/^!doctype/i)) return a = c.WithinDoctype, g(e, k.StartDoctypeTag);
616
- }
617
- return i.advanceIfChar(N) ? (a = c.AfterOpeningEndTag, g(e, k.EndTagOpen)) : (a = c.AfterOpeningStartTag, g(e, k.StartTagOpen));
618
- }
619
- return i.advanceUntilChar(j), g(e, k.Content);
620
- case c.AfterOpeningEndTag: return m().length > 0 ? (a = c.WithinEndTag, g(e, k.EndTag)) : i.skipWhitespace() ? g(e, k.Whitespace, "Tag name must directly follow the open bracket.") : (a = c.WithinEndTag, i.advanceUntilChar(M), e < i.pos() ? g(e, k.Unknown, "End tag name expected.") : _());
621
- case c.WithinEndTag:
622
- if (i.skipWhitespace()) return g(e, k.Whitespace);
623
- if (i.advanceIfChar(M)) return a = c.WithinContent, g(e, k.EndTagClose);
624
- if (r && i.peekChar() === j) return a = c.WithinContent, g(e, k.EndTagClose, "Closing bracket missing.");
625
- t = "Closing bracket expected.";
626
- break;
627
- case c.AfterOpeningStartTag: return d = m(), p = void 0, f = void 0, d.length > 0 ? (u = !1, a = c.WithinTag, g(e, k.StartTag)) : i.skipWhitespace() ? g(e, k.Whitespace, "Tag name must directly follow the open bracket.") : (a = c.WithinTag, i.advanceUntilChar(M), e < i.pos() ? g(e, k.Unknown, "Start tag name expected.") : _());
628
- case c.WithinTag: return i.skipWhitespace() ? (u = !0, g(e, k.Whitespace)) : u && (f = h(), f.length > 0) ? (a = c.AfterAttributeName, u = !1, g(e, k.AttributeName)) : i.advanceIfChars([N, M]) ? (a = c.WithinContent, g(e, k.StartTagSelfClose)) : i.advanceIfChar(M) ? (a = d === "script" ? p && Xe[p] ? c.WithinContent : c.WithinScriptContent : d === "style" ? c.WithinStyleContent : c.WithinContent, g(e, k.StartTagClose)) : r && i.peekChar() === j ? (a = c.WithinContent, g(e, k.StartTagClose, "Closing bracket missing.")) : (i.advance(1), g(e, k.Unknown, "Unexpected character in tag."));
629
- case c.AfterAttributeName: return i.skipWhitespace() ? (u = !0, g(e, k.Whitespace)) : i.advanceIfChar(He) ? (a = c.BeforeAttributeValue, g(e, k.DelimiterAssign)) : (a = c.WithinTag, _());
630
- case c.BeforeAttributeValue:
631
- if (i.skipWhitespace()) return g(e, k.Whitespace);
632
- let n = i.advanceIfRegExp(/^[^\s"'`=<>]+/);
633
- if (n.length > 0) return i.peekChar() === M && i.peekChar(-1) === N && (i.goBack(1), n = n.substr(0, n.length - 1)), f === "type" && (p = n), a = c.WithinTag, u = !1, g(e, k.AttributeValue);
634
- let o = i.peekChar();
635
- return o === We || o === Ue ? (i.advance(1), i.advanceUntilChar(o) && i.advance(1), f === "type" && (p = i.getSource().substring(e + 1, i.pos() - 1)), a = c.WithinTag, u = !1, g(e, k.AttributeValue)) : (a = c.WithinTag, u = !1, _());
636
- case c.WithinScriptContent:
637
- let s = 1;
638
- for (; !i.eos();) {
639
- let t = i.advanceIfRegExp(/<!--|-->|<\/?script\s*\/?>?/i);
640
- if (t.length === 0) return i.goToEnd(), g(e, k.Script);
641
- if (t === "<!--") s === 1 && (s = 2);
642
- else if (t === "-->") s = 1;
643
- else if (t[1] !== "/") s === 2 && (s = 3);
644
- else if (s === 3) s = 2;
645
- else {
646
- i.goBack(t.length);
647
- break;
648
- }
649
- }
650
- return a = c.WithinContent, e < i.pos() ? g(e, k.Script) : _();
651
- case c.WithinStyleContent: return i.advanceUntilRegExp(/<\/style/i), a = c.WithinContent, e < i.pos() ? g(e, k.Styles) : _();
652
- }
653
- return i.advance(1), a = c.WithinContent, g(e, k.Unknown, t);
654
- }
655
- return {
656
- scan: ee,
657
- getTokenType: () => s,
658
- getTokenOffset: () => o,
659
- getTokenLength: () => i.pos() - o,
660
- getTokenEnd: () => i.pos(),
661
- getTokenText: () => i.getSource().substring(o, i.pos()),
662
- getScannerState: () => a,
663
- getTokenError: () => l
664
- };
665
- }
666
- //#endregion
667
- //#region packages/htmlParser/htmlParser.ts
668
- function Qe(e) {
669
- if (typeof e == "string") {
670
- let t = e.startsWith("'") || e.startsWith("\"") ? 1 : 0, n = e.endsWith("'") || e.endsWith("\"") ? e.length - 1 : e.length;
671
- return e.substring(t, n);
672
- }
673
- return e;
674
- }
675
- var P = class {
676
- node = void 0;
677
- replaces = void 0;
678
- constructor(e, t) {
679
- this.text = e, this.type = t;
680
- }
681
- get hasNode() {
682
- return !!this.node;
683
- }
684
- addReplace(e) {
685
- this.replaces?.push(e);
686
- }
687
- start(e, t, n) {
688
- if (!this.node) {
689
- let r = this.node = new b(e, this.text.length, [], n);
690
- r.type = this.type, r.startTagEnd = t, this.replaces = [];
691
- }
692
- }
693
- finish(e, t) {
694
- let n = this.replaces, r = this.node, i = e + (t || 0);
695
- if (n) {
696
- for (let e of n) {
697
- let t = e.parent;
698
- if (!t) throw Error("parent not defined");
699
- let n = t.children.indexOf(e);
700
- t.children.splice(n, 1);
701
- }
702
- this.replaces = void 0;
703
- }
704
- if (r) {
705
- let n = r.parent;
706
- if (!n) throw Error("parent not defined");
707
- n.children.push(r), r.closed = t !== void 0, r.endTagStart = e, r.end = i, r.content = this.text.substring(r.startTagEnd, e), this.node = void 0;
708
- }
709
- }
710
- }, F = class {
711
- constructor(e) {
712
- this.dataManager = e;
713
- }
714
- parse(e, t = []) {
715
- let n = Ze(e, void 0, void 0, !0), r = new b(0, e.length, [], void 0);
716
- r.type = v.ROOT;
717
- let i = r, a = -1, o, s = null, c = n.scan(), l = () => {
718
- if (!i.tag) {
719
- let t = i.parent.children, n = t[t.length - 2], r = e.substring(i.start, i.end);
720
- n?.type === v.HTML ? (n.content = (n.content || "") + r, n.end = i.end, t.splice(t.length - 1, 1)) : (i.type = v.HTML, i.content = r, i.children = []), i.type = v.HTML;
721
- }
722
- i = i.parent;
723
- }, u = new P(e, v.COMMENT), d = new P(e, v.DOCTYPE), f = (e) => {
724
- i.children.push(e);
725
- };
726
- for (; c !== k.EOS;) {
727
- switch (c) {
728
- case k.StartDoctypeTag:
729
- d.start(n.getTokenOffset(), n.getTokenEnd(), i);
730
- break;
731
- case k.EndDoctypeTag: {
732
- let t = i.lastChild, r = d.node;
733
- if (!r) throw Error("");
734
- let a = t ? t.end : i.startTagEnd === void 0 ? i.start : i.startTagEnd;
735
- if (a !== r.start) {
736
- let t = e.substring(a, r.start);
737
- if (t) {
738
- let e = new b(a, r.start, [], i);
739
- e.type = v.HTML, e.content = t, f(e);
740
- }
741
- }
742
- d.finish(n.getTokenOffset(), n.getTokenLength());
743
- break;
744
- }
745
- case k.StartCommentTag:
746
- u.start(n.getTokenOffset(), n.getTokenEnd(), i);
747
- break;
748
- case k.EndCommentTag: {
749
- let t = i.lastChild, r = u.node;
750
- if (!r) throw Error("");
751
- let a = t ? t.end : i.startTagEnd === void 0 ? i.start : i.startTagEnd;
752
- if (a !== r.start) {
753
- let t = e.substring(a, r.start);
754
- if (t) {
755
- let e = new b(a, r.start, [], i);
756
- e.type = v.HTML, e.content = t, f(e);
757
- }
758
- }
759
- u.finish(n.getTokenOffset(), n.getTokenLength());
760
- break;
761
- }
762
- case k.StartTagOpen:
763
- let t = i.lastChild, r = new b(n.getTokenOffset(), e.length, [], i), c = t ? t.end : i.startTagEnd === void 0 ? i.start : i.startTagEnd;
764
- if (c !== r.start) {
765
- let t = e.substring(c, r.start);
766
- if (t) {
767
- let e = new b(c, r.start, [], i);
768
- e.type = v.HTML, e.content = t, f(e);
769
- }
770
- }
771
- f(r), i = r;
772
- break;
773
- case k.StartTag:
774
- i.tag = n.getTokenText();
775
- break;
776
- case k.StartTagClose:
777
- i.parent && (i.end = n.getTokenEnd(), n.getTokenLength() ? (i.startTagEnd = n.getTokenEnd(), i.tag && this.dataManager.isVoidElement(i.tag) && (i.closed = !0, l())) : l());
778
- break;
779
- case k.StartTagSelfClose:
780
- i.parent && (i.closed = !0, i.end = n.getTokenEnd(), i.startTagEnd = n.getTokenEnd(), l());
781
- break;
782
- case k.EndTagOpen:
783
- a = n.getTokenOffset(), o = void 0;
784
- break;
785
- case k.EndTag:
786
- o = n.getTokenText().toLowerCase();
787
- break;
788
- case k.EndTagClose:
789
- let p = i;
790
- for (; !p.isSameTag(o) && p.parent;) p = p.parent;
791
- if (p.parent) {
792
- let t = i.lastChild, r = t ? t.end : i.startTagEnd === void 0 ? i.start : i.startTagEnd;
793
- if (r !== a) {
794
- let t = e.substring(r, a);
795
- if (t) {
796
- let e = new b(r, a, [], i);
797
- e.type = v.HTML, e.content = t, f(e);
798
- }
799
- }
800
- for (; i !== p;) i.end = a, i.closed = !1, l();
801
- i.closed = !0, i.endTagStart = a, i.end = n.getTokenEnd(), l();
802
- }
803
- break;
804
- case k.AttributeName: {
805
- s = n.getTokenText();
806
- let e = i.attributes;
807
- e || (i.attributes = e = {}), e[s] = null;
808
- break;
809
- }
810
- case k.AttributeValue: {
811
- let e = n.getTokenText(), t = i.attributes;
812
- t && s && (t[s] = Qe(e), s = null);
813
- break;
814
- }
815
- }
816
- c = n.scan();
817
- }
818
- for (; i.parent;) i.end = e.length, i.closed = !1, l();
819
- u.hasNode, u.finish(e.length);
820
- let p = r.lastChild?.end || 0;
821
- if (p < e.length) {
822
- let t = e.substring(p);
823
- if (t) {
824
- let n = new b(p, e.length, [], r);
825
- n.type = v.HTML, n.content = t, f(n);
826
- }
827
- }
828
- return {
829
- roots: r.children,
830
- findNodeBefore: r.findNodeBefore.bind(r),
831
- findNodeAt: r.findNodeAt.bind(r)
832
- };
833
- }
834
- };
835
- new F(new ze([
836
- "area",
837
- "base",
838
- "br",
839
- "col",
840
- "embed",
841
- "hr",
842
- "img",
843
- "input",
844
- "link",
845
- "meta",
846
- "source",
847
- "track",
848
- "wbr",
849
- "vk-snippet-end"
850
- ]));
851
- //#endregion
852
- //#region packages/htmlParser/index.ts
853
- var $e = new F(new ze([
854
- "area",
855
- "base",
856
- "br",
857
- "col",
858
- "embed",
859
- "hr",
860
- "img",
861
- "input",
862
- "link",
863
- "meta",
864
- "source",
865
- "track",
866
- "wbr",
867
- "vk-snippet-end"
868
- ]));
869
- function et(e) {
870
- return $e.parse(e);
871
- }
872
- //#endregion
873
- //#region packages/html2Dom/index.ts
874
- function tt(e) {
875
- if (e) {
876
- let t = document.createElement("div");
877
- return t.insertAdjacentHTML("afterbegin", e), t.firstChild || document.createTextNode("");
878
- } else return document.createTextNode("");
879
- }
880
- function nt(e) {
881
- let t;
882
- switch (e?.toLowerCase()) {
883
- case "tr":
884
- t = document.createElement("table");
885
- break;
886
- case "td":
887
- t = document.createElement("tr");
888
- break;
889
- case "head":
890
- case "body":
891
- t = document.createElement("html");
892
- break;
893
- case "documenttype":
894
- case "html": {
895
- let e = document.implementation.createHTMLDocument();
896
- for (let t of [...e.childNodes]) t.remove();
897
- return e;
898
- }
899
- default: t = document.createElement("div");
900
- }
901
- return t;
902
- }
903
- var rt = new Set([
904
- "onclick",
905
- "onload",
906
- "onchange",
907
- "onsubmit",
908
- "onmouseover",
909
- "onkeydown",
910
- "onerror"
911
- ]), it = new Set([
912
- "script",
913
- "style",
914
- "xmp"
915
- ]);
916
- function at(e, t) {
917
- return !(t && it.has(t.toLowerCase()) || rt.has(e.toLowerCase()));
918
- }
919
- var ot = (e) => {
920
- let t = e.indexOf("&");
921
- for (; t !== -1;) {
922
- if (e.indexOf(";", t) !== -1) return !0;
923
- t = e.indexOf("&", t + 1);
924
- }
925
- return !1;
926
- };
927
- function I(e, t, n) {
928
- let r = e.tagName.toLowerCase();
929
- r === "html" && (r = "div");
930
- let i = `<${r} ${t}="${n}"/>`, a = nt(r);
931
- if (a instanceof Document) return;
932
- a.innerHTML = i;
933
- let o = a.querySelector(r);
934
- if (!o) throw Error("targetElement is not defined");
935
- let s = o.getAttributeNode(t);
936
- s && e.setAttributeNode(s.cloneNode());
937
- }
938
- function L(e, t, n) {
939
- try {
940
- at(t, e.tagName) && !ot(n) ? e.setAttribute(t, n) : I(e, t, n);
941
- } catch {
942
- I(e, t, n);
943
- }
944
- }
945
- function R(e, t = !0) {
946
- let n = e.content;
947
- switch (e.type) {
948
- case v.ROOT: {
949
- let n = document.implementation.createHTMLDocument();
950
- for (let e of [...n.childNodes]) n.removeChild(e);
951
- if (t) for (let t of e.children) n.appendChild(R(t));
952
- return n;
953
- }
954
- case v.DOCTYPE: return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`, "text/html").doctype;
955
- case v.COMMENT: return document.createComment(n || "");
956
- case v.ELEMENT:
957
- if (e.tag) {
958
- let n = document.createElement(e.tag);
959
- if (Object.defineProperty(n, "$$tagName", {
960
- enumerable: !1,
961
- configurable: !1,
962
- value: e.tag
963
- }), e.attributes) for (let t of e.attributeNames) {
964
- let r = e.attributes[t];
965
- try {
966
- L(n, t, typeof r == "string" ? r : "");
967
- } catch {}
968
- }
969
- if (t) for (let t of e.children) n.appendChild(R(t));
970
- return n;
971
- }
972
- return document.createTextNode("<");
973
- case v.HTML: return tt(n || "");
974
- default: throw Error("unsupported node");
975
- }
976
- }
977
- function z(e) {
978
- return et(e).roots.map((e) => R(e));
979
- }
980
- //#endregion
981
- //#region src/helpers/utils/promise.ts
982
- var B = Symbol("Error");
983
- function V(e) {
984
- return Promise.all(e.map((e) => e instanceof Promise ? e.catch((e) => B) : e)).then((e) => e.filter((e) => e !== B));
985
- }
986
- //#endregion
987
- //#region packages/normalizeUrl/index.ts
988
- var H = (e, t) => t.some((t) => t instanceof RegExp ? t.test(e) : t === e), st = new Set([
989
- "https:",
990
- "http:",
991
- "file:"
992
- ]), ct = (e) => {
993
- let t = e.indexOf(":");
994
- if (t <= 0) return !1;
995
- let n = e.substring(0, t + 1);
996
- return /^[a-zA-Z][a-zA-Z0-9+\-.]*:$/.test(n) ? n.endsWith(":") && !n.includes(".") && !st.has(n) : !1;
997
- };
998
- function lt(e, t) {
999
- if (t = {
1000
- defaultProtocol: "http",
1001
- normalizeProtocol: !0,
1002
- forceHttp: !1,
1003
- forceHttps: !1,
1004
- stripAuthentication: !0,
1005
- stripHash: !1,
1006
- stripTextFragment: !0,
1007
- stripWWW: !0,
1008
- removeQueryParameters: [/^utm_\w+/i],
1009
- removeTrailingSlash: !0,
1010
- removeSingleSlash: !0,
1011
- removeDirectoryIndex: !1,
1012
- removeExplicitPort: !1,
1013
- sortQueryParameters: !0,
1014
- ...t
1015
- }, !e) return "";
1016
- if (ut(e) && (e = U(e)), typeof t.defaultProtocol == "string" && !t.defaultProtocol.endsWith(":") && (t.defaultProtocol = `${t.defaultProtocol}:`), e = e.trim(), /^data:/i.test(e) || ct(e)) return e;
1017
- let n = e.startsWith("//"), r = !n && /^\.*\//.test(e), i;
1018
- try {
1019
- i = r ? new URL(e, typeof document < "u" ? document.baseURI : "http://localhost/").toString() : e;
1020
- } catch {
1021
- i = e;
1022
- }
1023
- let a;
1024
- try {
1025
- a = new URL(i);
1026
- } catch {
1027
- let t = document.createElement("a");
1028
- t.href = e, a = new URL(t.href);
1029
- }
1030
- if (t.forceHttp && t.forceHttps) throw Error("The `forceHttp` and `forceHttps` options cannot be used together");
1031
- if (t.forceHttp && a.protocol === "https:" && (a.protocol = "http:"), t.forceHttps && a.protocol === "http:" && (a.protocol = "https:"), t.stripAuthentication && (a.username = "", a.password = ""), t.stripHash ? a.hash = "" : t.stripTextFragment && (a.hash = a.hash.replace(/#?:~:text.*?$/i, "")), a.pathname) {
1032
- let e = /\b[a-z][a-z\d+\-.]{1,50}:\/\//g, t = 0, n = "";
1033
- for (;;) {
1034
- let r = e.exec(a.pathname);
1035
- if (!r) break;
1036
- let i = r.index, o = a.pathname.slice(t, i);
1037
- n += o.replace(/\/{2,}/g, "/"), n += r[0], t = i + r[0].length;
1038
- }
1039
- let r = a.pathname.slice(t);
1040
- n += r.replace(/\/{2,}/g, "/"), a.pathname = n;
1041
- try {
1042
- a.pathname = decodeURI(a.pathname);
1043
- } catch {}
1044
- }
1045
- if (t.removeDirectoryIndex) {
1046
- let e = a.pathname.split("/"), n = e[e.length - 1];
1047
- Array.isArray(t.removeDirectoryIndex) && H(n, t.removeDirectoryIndex) && (e = e.slice(0, -1), a.pathname = e.join("/") + "/");
1048
- }
1049
- if (t.stripWWW && /^www\.(?!www\.)[a-z\d\-]+(\.[a-z.\-]{2,63})+$/.test(a.hostname || "") && (a.hostname = a.hostname.replace(/^www\./, "")), Array.isArray(t.removeQueryParameters)) for (let e of [...a.searchParams.keys()]) H(e, t.removeQueryParameters) && a.searchParams.delete(e);
1050
- if (t.sortQueryParameters) {
1051
- a.searchParams.sort();
1052
- try {
1053
- a.search = decodeURIComponent(a.search);
1054
- } catch {}
1055
- }
1056
- t.removeTrailingSlash && (a.pathname = a.pathname.replace(/\/$/, "")), t.removeExplicitPort && a.port && (a.port = "");
1057
- let o = a.toString();
1058
- return !t.removeSingleSlash && a.pathname === "/" && !e.endsWith("/") && a.hash === "" && (o = o.replace(/\/$/, "")), (t.removeTrailingSlash || a.pathname === "/") && a.hash === "" && t.removeSingleSlash && (o = o.replace(/\/$/, "")), n && !t.normalizeProtocol && (o = o.replace(/^https?:\/\//, "//")), o;
1059
- }
1060
- function ut(e) {
1061
- if (!e) return !1;
1062
- let t = e[0];
1063
- return e.startsWith("/") || e.startsWith("./") || e.startsWith("../") || dt(t);
1064
- }
1065
- function dt(e) {
1066
- let t = e.charCodeAt(0);
1067
- return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122;
1068
- }
1069
- function ft(e) {
1070
- return /^(mailto:|tel:|fax:|sms:|geo:|blob:|data:|javascript:)/i.test(e);
1071
- }
1072
- function U(e) {
1073
- if (e.startsWith("http://") || e.startsWith("https://") || e.startsWith("//") || !ut(e) || ft(e)) return e;
1074
- if (e.startsWith("/")) return window.location.origin + e;
1075
- let t = window.location.href, n = t.lastIndexOf("/");
1076
- return (n === -1 ? t + "/" : t.slice(0, n + 1)) + e;
1077
- }
1078
- //#endregion
1079
- //#region packages/nextTick/index.ts
1080
- var W = 0, G = Array(1e3);
1081
- function pt() {
1082
- for (let e = 0; e < W; e += 2) {
1083
- let t = G[e], n = G[e + 1];
1084
- t(...n), G[e] = void 0, G[e + 1] = void 0;
1085
- }
1086
- W = 0;
1087
- }
1088
- function mt(e, ...t) {
1089
- G[W] = e, G[W + 1] = t, W += 2, W === 2 && gt();
1090
- }
1091
- function ht() {
1092
- let e = 0, t = new MutationObserver(pt), n = document.createTextNode("");
1093
- return t.observe(n, { characterData: !0 }), () => {
1094
- n.data = String(e = ++e % 2);
1095
- };
1096
- }
1097
- var gt = ht();
1098
- function _t() {
1099
- mt(() => {
1100
- K.hasListeners() && (K.fire(), _t());
1101
- });
1102
- }
1103
- var K = new n({ onFirstListenerAdd: _t }), q = K.once, vt = s(), yt = t(), bt = class extends n {
1104
- _mutationSummary;
1105
- constructor(e = {}) {
1106
- super(), this._mutationSummary = new vt.MutationSummary({
1107
- ...e,
1108
- observeOwnChanges: !0,
1109
- callback: (e) => this.fire(e),
1110
- queries: [{ all: !0 }]
1111
- });
1112
- }
1113
- dispose() {
1114
- this._mutationSummary.disconnect(), super.dispose();
1115
- }
1116
- trigger(e) {
1117
- let t = this._mutationSummary.takeSummaries();
1118
- return (e || t?.length) && this.fire(t || []), t;
1119
- }
1120
- }, xt = class extends yt.Disposable {
1121
- _mutationEmitter;
1122
- _innerEmitter = this.addDisposable(new n({ onFirstListenerAdd: () => {
1123
- this._nextTickHandler();
1124
- } }));
1125
- _lostEmitter = this.addDisposable(new n());
1126
- _paused = 0;
1127
- _stopped = 0;
1128
- _summaries = [];
1129
- _nextTickHandler() {
1130
- q(() => {
1131
- this.trigger(), this._summaries.length && (this._innerEmitter.hasListeners() ? this._innerEmitter.fire(this._summaries) : this._lostEmitter.fire(this._summaries), this._summaries = []);
1132
- }, Number.MAX_VALUE);
1133
- }
1134
- constructor(e = {}) {
1135
- super(), this._mutationEmitter = this.addDisposable(new bt(e)), this.onNativeMutate = this._mutationEmitter.event, this.addDisposable(this._mutationEmitter.event((e) => {
1136
- this._stopped || (this._paused ? this._lostEmitter.fire(e) : (this._summaries.push(...e), q(() => {
1137
- this._summaries.length && !this._innerEmitter.hasListeners() && (this._lostEmitter.fire(this._summaries), this._summaries = []);
1138
- }, Number.MAX_VALUE)));
1139
- }));
1140
- }
1141
- get isStoped() {
1142
- return this._paused > 0 || this._stopped > 0;
1143
- }
1144
- stop() {
1145
- this._mutationEmitter.trigger(), this._stopped++;
1146
- }
1147
- start() {
1148
- this._mutationEmitter.trigger(), this._stopped--;
1149
- }
1150
- pause() {
1151
- this._mutationEmitter.trigger(), this._paused++;
1152
- }
1153
- resume() {
1154
- this._mutationEmitter.trigger(), this._paused--;
1155
- }
1156
- trigger() {
1157
- this._mutationEmitter.trigger(!0);
1158
- }
1159
- onMutate = this._innerEmitter.event;
1160
- onLost = this._lostEmitter.event;
1161
- onNativeMutate;
1162
- };
1163
- //#endregion
1164
- //#region packages/mutationCollector/undoSummaries.ts
1165
- function St(e) {
1166
- for (let t of e) {
1167
- if (t.removed) for (let e of t.removed) {
1168
- let n = t.getOldParentNode(e), r = t.getOldPreviousSibling(e);
1169
- if (n) {
1170
- let t = r?.nextSibling ?? null;
1171
- n.insertBefore(e, t);
1172
- }
1173
- }
1174
- if (t.added) for (let e of t.added) e.parentNode && e.parentNode.removeChild(e);
1175
- if (t.reordered) for (let e of t.reordered) {
1176
- let n = t.getOldParentNode(e), r = t.getOldPreviousSibling(e);
1177
- if (n) {
1178
- let t = r?.nextSibling ?? null;
1179
- n.insertBefore(e, t);
1180
- }
1181
- }
1182
- if (t.attributeChanged) for (let e of Object.keys(t.attributeChanged)) for (let n of t.attributeChanged[e]) {
1183
- let r = t.getOldAttribute(n, e);
1184
- r == null ? n.removeAttribute(e) : n.setAttribute(e, r);
1185
- }
1186
- if (t.characterDataChanged) for (let e of t.characterDataChanged) (w(e) || C(e) || C(e)) && (e.data = t.getOldCharacterData(e));
1187
- }
1188
- }
1189
- //#endregion
1190
- //#region src/helpers/utils/managedNodeController.ts
1191
- var Ct = class extends yt.Disposable {
1192
- _commitPromise;
1193
- _mutationCollector;
1194
- _onLostSummaries = (e) => {
1195
- try {
1196
- this._mutationCollector.stop(), St(e);
1197
- } finally {
1198
- this._mutationCollector.start();
1199
- }
1200
- };
1201
- constructor(e) {
1202
- super(), this._mutationCollector = this.addDisposable(new xt({
1203
- rootNode: e,
1204
- oldPreviousSibling: !0
1205
- })), this._mutationCollector.onLost(this._onLostSummaries);
1206
- }
1207
- commit() {
1208
- return this._commitPromise ? this._commitPromise : this._commitPromise = new Promise((e) => {
1209
- let t = this._mutationCollector.onMutate((n) => {
1210
- this._commitPromise = void 0, e(), t.dispose();
1211
- });
1212
- q(() => {
1213
- this._commitPromise = void 0, e(), t.dispose();
1214
- });
1215
- }).catch((e) => console.log(e));
1216
- }
1217
- };
1218
- //#endregion
1219
- //#region src/helpers/export/createIframe.ts
1220
- function wt(e, t) {
1221
- let n = new r(), i = new r();
1222
- try {
1223
- let r = z(e), a = document.implementation.createHTMLDocument();
1224
- return O(a, r), {
1225
- document: a,
1226
- handleRender: i.event,
1227
- handleReadHtml: n.event,
1228
- async run() {
1229
- if (i.hasListeners()) {
1230
- let e = document.createElement("iframe");
1231
- e.style.position = "absolute", e.style.left = "-10000px", document.body.appendChild(e);
1232
- let r = e.contentWindow.document, o = new Ct(e.contentDocument);
1233
- try {
1234
- if (t) {
1235
- let [n, r] = t;
1236
- n !== void 0 && e.setAttribute("width", String(n)), r !== void 0 && e.setAttribute("height", String(r));
1237
- }
1238
- O(r, [...a.childNodes]), o.commit();
1239
- } catch (e) {
1240
- throw e;
1241
- } finally {
1242
- try {
1243
- try {
1244
- await i.fire({
1245
- managedNodeController: o,
1246
- contentDocument: r
1247
- });
1248
- } catch {}
1249
- let e = {
1250
- contentDocument: r,
1251
- html: E(r)
1252
- };
1253
- try {
1254
- await n.fire(e);
1255
- } finally {
1256
- return e.html;
1257
- }
1258
- } finally {
1259
- e.parentNode === document.body && document.body.removeChild(e);
1260
- }
1261
- }
1262
- } else {
1263
- let e = {
1264
- contentDocument: a,
1265
- html: E(a)
1266
- };
1267
- try {
1268
- await n.fire(e);
1269
- } finally {
1270
- return e.html;
1271
- }
1272
- }
1273
- }
1274
- };
1275
- } catch (e) {
1276
- throw e;
1277
- }
1278
- }
1279
- //#endregion
1280
- //#region src/helpers/export.ts
1281
- var Tt = /* @__PURE__ */ e(a()), Et = /url(?:\((['|"]?))(.*?\.(png|jpg|gif|jpeg|tiff){1})(?:['|"]?\))/gi, Dt = "data:message/rfc822 eml,";
1282
- function J(e) {
1283
- return e.replaceAll(/[\\\/:*?"<>|]/g, "_");
1284
- }
1285
- async function Ot(e, t, n, r, i) {
1286
- let a = {
1287
- Subject: e,
1288
- "X-Unsent": 1,
1289
- "Content-Type": typeof i == "function" ? "text/html;charset=utf-8" : "multipart/alternative; boundary=\"boundary-string\""
1290
- };
1291
- return `${Object.keys(a).reduce((e, t) => `${e}${t}:${a[t]}\n`, Dt)}\n${typeof i == "function" ? await Lt(t, n, r, i) : (await V(Object.keys(i).map(async (e) => `\n--boundary-string
1292
- Content-Type: ${e}\n\n${await Lt(t, n, r, i[e])}\n\n
1293
- `))).join("") + "----boundary_string--"}`;
1294
- }
1295
- function kt(e, t = !0) {
1296
- let n = e.replace("\\", "/").split("/"), r = n[n.length - 1];
1297
- return t ? J(r) : r;
1298
- }
1299
- function At(e) {
1300
- return !(e.length > 8 || e.length < 1 || /[^\x00-\x7F]/.test(e) || /[\\\/:*?"<>|&=%]/.test(e) || !/[a-zA-Z]/.test(e) || /^\d+$/.test(e));
1301
- }
1302
- function jt(e) {
1303
- let t = e.replace("\\", "/").split("/"), n = t[t.length - 1], r = n.lastIndexOf("."), i = n.slice(r + 1);
1304
- return r === -1 || !At(i) ? [J(n), ""] : [J(n.slice(0, r)), i];
1305
- }
1306
- function Mt(e) {
1307
- return Ut(e).then((e) => Wt(e));
1308
- }
1309
- function Nt(e) {
1310
- return e.replace("<script", "<___script").replace("<\/script>", "</___script>");
1311
- }
1312
- var Y = new le((e) => {
1313
- e.escape("<script", "<\/script>", (e) => Nt(e)).unescape("<___script", "</___script>", (e) => e.replace("<___script", "<script").replace("</___script>", "<\/script>")), e.escape("<script", "/>", (e) => Nt(e)).unescape("<___script", "/>", (e) => e.replace("<___script", "<script")), ae(e);
1314
- });
1315
- async function X(e, t, n) {
1316
- e = Y.getEscapedText(e);
1317
- let r = wt(e, n);
1318
- try {
1319
- let n = r.document, i = n.querySelectorAll("tbody");
1320
- for (let e of i) e.replaceWith(...e.childNodes);
1321
- n.querySelectorAll("em-replace").forEach((e) => {
1322
- if (e.hasAttribute("text") && (e.insertAdjacentHTML("beforebegin", e.getAttribute("text")), e.parentNode.removeChild(e)), e.hasAttribute("src")) {
1323
- let t = e.querySelector("img");
1324
- t.setAttribute("src", e.getAttribute("src")), e.replaceWith(t);
1325
- }
1326
- });
1327
- try {
1328
- await t(r, e);
1329
- } catch {}
1330
- e = await r.run();
1331
- } catch (e) {
1332
- throw e;
1333
- }
1334
- return Y.getUnescapedText(e);
1335
- }
1336
- function Z(e, t, n) {
1337
- try {
1338
- if (typeof n == "function") {
1339
- let r = [];
1340
- return String.prototype.replace.call(e, t, function() {
1341
- return r.push(n.apply(void 0, arguments)), "";
1342
- }), V(r).then(function(n) {
1343
- return String.prototype.replace.call(e, t, function() {
1344
- return n.shift();
1345
- });
1346
- });
1347
- } else return Promise.resolve(String.prototype.replace.call(e, t, n));
1348
- } catch (e) {
1349
- return Promise.reject(e);
1350
- }
1351
- }
1352
- async function Pt(e, t, n = /* @__PURE__ */ new Map(), r) {
1353
- let i = (e) => {
1354
- let r = n.get(e);
1355
- return r || (r = t(e), n.set(e, r)), r instanceof Promise ? r : Promise.resolve(r);
1356
- };
1357
- function a(e) {
1358
- return Z(e, Et, async (e, t = "", n) => `url(${t}${await i(n)}${t})`);
1359
- }
1360
- async function o(e) {
1361
- let t = e.getAttribute("style");
1362
- if (t) {
1363
- let n = await a(t);
1364
- t !== n && (e.setAttribute("style", n), r && r());
1365
- }
1366
- }
1367
- let s = document.createNodeIterator(e, NodeFilter.SHOW_ALL), c = [];
1368
- for (;;) {
1369
- let e = s.nextNode();
1370
- if (e === null) break;
1371
- if (x(e)) {
1372
- c.push(o(e));
1373
- let t = e.getAttribute("background");
1374
- if (t && c.push(i(t).then((n) => {
1375
- e.setAttribute("background", n || t), r && r();
1376
- })), Ce(e) || we(e)) {
1377
- let t = e.src;
1378
- t && c.push(i(t).then((n) => {
1379
- n ||= t, e.setAttribute("src", n), r && r();
1380
- }));
1381
- }
1382
- if (Oe(e)) {
1383
- let t = e.innerHTML;
1384
- t && c.push(a(t).then((n) => {
1385
- n !== t && (e.innerHTML = n, r && r());
1386
- }));
1387
- }
1388
- } else if (C(e)) {
1389
- let t = Fe(e), n = t?.content;
1390
- n && c.push(Z(n, /<v:fill.*>/gi, async (e) => Z(await Z(e, /src="([^"]*)"/gi, async (e, t) => `src="${await i(t) || t}"`), /src='([^']*)'/gi, async (e, t) => `src='${await i(t) || t}'`)).then((i) => {
1391
- n !== i && (e.replaceWith(z(`${t.open}${i}${t.close}`)[0]), r && r());
1392
- }));
1393
- }
1394
- }
1395
- return V(c);
1396
- }
1397
- async function Q(e, t, n = /* @__PURE__ */ new Map(), r) {
1398
- await Pt(e, t, n, r);
1399
- }
1400
- function Ft(e) {
1401
- let t = /* @__PURE__ */ new Map(), n = 0;
1402
- for (; n >= 0;) if (n = e.indexOf("<!--", n), n >= 0) {
1403
- let r = e.indexOf("-->", n);
1404
- t.set(e.substring(n, r + 3), i()), n = r;
1405
- }
1406
- return t;
1407
- }
1408
- function $(e, t, n) {
1409
- let r = e.href;
1410
- if (r = U(r), r && e.protocol.startsWith("http")) {
1411
- let i = Ft(r);
1412
- i.forEach((e, t) => {
1413
- r = r.replaceAll(t, e);
1414
- });
1415
- let a = r.indexOf("#"), o = a >= 0 ? r.substring(0, a) : r, s = a >= 0 ? r.substring(a + 1) : "", c = r.indexOf("?"), l = c >= 0 ? o.substring(c + 1) : "";
1416
- if (o = c >= 0 ? o.substring(0, c) : o, e.host !== document.location.host) {
1417
- let a = new Map(l.split("&").filter((e) => e.indexOf("=") >= 0).map((e) => e.split("="))), c = l;
1418
- if (t) {
1419
- let e = Object.keys(t);
1420
- for (let n of e) t[n] && !a.has(n) && (c = c + (c ? "&" : "") + `${n}=${t[n]}`);
1421
- }
1422
- c !== l && (r = o + (c ? `?${c}` : "") + (s ? `#${s}` : ""), i.forEach((e, t) => {
1423
- r = r.replaceAll(e, t);
1424
- }), e.setAttribute("href", r), n && n());
1425
- }
1426
- }
1427
- }
1428
- async function It(e, t, n, r) {
1429
- let [i, a] = t || [800];
1430
- return typeof i == "number" && (i += "px"), typeof a == "number" && (a += "px"), e = await X(e, async (e) => {
1431
- let t = e.document;
1432
- await Q(t, (e) => Y.getEscapedText(e) === e ? U(e) : e);
1433
- let i = t.querySelectorAll("a");
1434
- for (let e of i) $(e, n);
1435
- if (r) return r(e);
1436
- }, [i, a]), e;
1437
- }
1438
- async function Lt(e, t, n, r) {
1439
- let [i, a] = t || [800];
1440
- return typeof i == "number" && (i += "px"), typeof a == "number" && (a += "px"), e = await X(e, async (e) => {
1441
- let t = e.document;
1442
- if (await Q(t, (e) => Y.getEscapedText(e) === e ? U(e) : e), e.handleRender(async ({ contentDocument: e, managedNodeController: t }) => {
1443
- let r = e.querySelectorAll("*");
1444
- for (let e of r) if (Ce(e)) {
1445
- let n = await T(e);
1446
- if (n) {
1447
- let t = parseInt(n.height), r = parseInt(n.width);
1448
- isNaN(t) || e.setAttribute("height", String(t)), !isNaN(r) && !e.getAttribute("width") && e.setAttribute("width", String(r));
1449
- }
1450
- t.commit();
1451
- } else if (Ie(e)) {
1452
- let n = parseInt(getComputedStyle(e).width);
1453
- !isNaN(n) && e.parentElement.tagName !== "BODY" && e.setAttribute("width", String(n)), t.commit();
1454
- } else e.tagName === "TD" || e.tagName === "A" && $(e, n, () => t.commit());
1455
- }), r) return r(e);
1456
- }, [i, a]), e = e.replaceAll(/<tbody>/gi, "").replaceAll(/<\/tbody>/gi, ""), e;
1457
- }
1458
- var Rt = "images", zt = 40;
1459
- function Bt() {
1460
- let e = /* @__PURE__ */ new Date();
1461
- return `${e.toISOString().slice(2, 10).replace(/-/g, "").concat("_", e.toTimeString().slice(0, 5).replace(/:/g, ""))}_${Array.from({ length: 8 }, () => "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random() * 62))).join("")}`;
1462
- }
1463
- async function Vt(e, t, n, r = Mt, i) {
1464
- let a = Object.create(null), [s, c] = t || [800];
1465
- typeof s == "number" && (s += "px"), typeof c == "number" && (c += "px");
1466
- let l = /* @__PURE__ */ new Set(), u = await X(e, async (e) => {
1467
- let t = e.document;
1468
- await Q(t, async (e) => {
1469
- Y.getEscapedText(e) === e && (e = U(e));
1470
- let t = await r(e), [n, i] = jt(e);
1471
- if (n.length > zt && (n = Bt()), !i || !o.getType(i)) try {
1472
- i = o.getExtension(t.type);
1473
- } catch {}
1474
- let s = `${n}.${i}`, c = 1;
1475
- for (; l.has(s);) s = `${n}(${++c}).${i}`;
1476
- l.add(s);
1477
- let u = `${Rt}/${s}`;
1478
- return a[u] = t, u;
1479
- });
1480
- let s = t.querySelectorAll("a");
1481
- for (let e of s) $(e, n);
1482
- if (i) return i(e);
1483
- }, [s, c]);
1484
- return a["index.html"] = new Blob([u], { type: "text/html;charset=utf-8" }), a;
1485
- }
1486
- function Ht(e) {
1487
- let t = new Tt.default();
1488
- for (let n of Object.keys(e)) {
1489
- let r = t, i = n.split("/"), a = i.length - 1;
1490
- for (let e = 0; e < a; e++) r = t.folder(i[e]);
1491
- r.file(i[a], e[n]);
1492
- }
1493
- return t.generateAsync({
1494
- type: "blob",
1495
- compression: "DEFLATE"
1496
- });
1497
- }
1498
- function Ut(e) {
1499
- let t = new Image();
1500
- return t.crossOrigin = "anonymous", new Promise((n, r) => {
1501
- t.onload = () => n(t), t.onerror = r, t.src = e;
1502
- });
1503
- }
1504
- function Wt(e, t = "image/png", n) {
1505
- let r = document.createElement("canvas");
1506
- return r.width = e.width, r.height = e.height, r.getContext("2d").drawImage(e, 0, 0), new Promise((e, i) => r.toBlob((t) => t ? e(t) : i("blob is null"), t, Number(n) || 0));
1507
- }
1508
- function Gt(e, t) {
1509
- do {
1510
- if (e === t) return !0;
1511
- e = e.parentNode;
1512
- } while (e);
1513
- return !1;
1514
- }
1515
- function Kt(e) {
1516
- let t = e.ownerDocument?.body;
1517
- if (t && Gt(e, t)) {
1518
- if (x(e) && (e.tagName === "IMG" || e.tagName === "SPAN" && e.classList.contains("preheader"))) return "";
1519
- if (e.nodeName === "#text") return e.textContent;
1520
- }
1521
- return e.childNodes ? [...e.childNodes].map(Kt).join("") : "";
1522
- }
1523
- function qt(e) {
1524
- let { document: t } = wt(e);
1525
- try {
1526
- return Kt(t).replace(/\u2800/g, "").replace(/(\r\n|\r|\n){2,}/g, "\n").trim();
1527
- } catch {
1528
- return "";
1529
- }
1530
- }
1531
- //#endregion
1532
- export { S as C, Se as D, Ee as E, w as O, E as S, x as T, je as _, kt as a, ye as b, Vt as c, It as d, Q as f, L as g, z as h, jt as i, ge as k, Wt as l, U as m, qt as n, Ut as o, lt as p, Ot as r, Ht as s, X as t, Y as u, Ne as v, ke as w, D as x, T as y };