storybook 10.1.0-alpha.10 → 10.1.0-alpha.11

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 (192) hide show
  1. package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
  2. package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
  3. package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
  4. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  5. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  6. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  7. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  8. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  9. package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-74YHFU5B.js} +44 -109
  10. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  11. package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
  12. package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
  13. package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
  14. package/dist/_browser-chunks/chunk-BE2DAXKJ.js +2966 -0
  15. package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  16. package/dist/_browser-chunks/chunk-EBHB6RPS.js +61 -0
  17. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  18. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  19. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  20. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  21. package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
  22. package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
  23. package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
  24. package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
  25. package/dist/_browser-chunks/{chunk-QMY4G4R2.js → chunk-L4RMQ7D7.js} +17 -64
  26. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  27. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  28. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  29. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  30. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  31. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
  32. package/dist/_browser-chunks/chunk-WXP2XJ3O.js +950 -0
  33. package/dist/_browser-chunks/chunk-X3DUQ5RA.js +47 -0
  34. package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
  35. package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
  36. package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
  37. package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
  38. package/dist/_browser-chunks/{syntaxhighlighter-RJZASWHL.js → syntaxhighlighter-WKBQ5RC7.js} +704 -1848
  39. package/dist/_node-chunks/{builder-manager-HA7CYFCK.js → builder-manager-PMPHOSM2.js} +475 -1013
  40. package/dist/_node-chunks/camelcase-K3IOOFQW.js +18 -0
  41. package/dist/_node-chunks/{chunk-X4XU27M6.js → chunk-32NE3UE3.js} +15 -24
  42. package/dist/_node-chunks/chunk-4GZCFQFG.js +58 -0
  43. package/dist/_node-chunks/chunk-5QK5MSOI.js +943 -0
  44. package/dist/_node-chunks/{chunk-VPR5IBMG.js → chunk-6ZOLETQK.js} +8 -10
  45. package/dist/_node-chunks/chunk-7I22Y76Z.js +1047 -0
  46. package/dist/_node-chunks/chunk-AKTRSR3O.js +72 -0
  47. package/dist/_node-chunks/chunk-BBOP3XCK.js +119 -0
  48. package/dist/_node-chunks/chunk-C2GQVDWI.js +34 -0
  49. package/dist/_node-chunks/{chunk-ZHSCUGNP.js → chunk-GG2WQZSG.js} +3799 -7849
  50. package/dist/_node-chunks/chunk-GQJOWVVR.js +3214 -0
  51. package/dist/_node-chunks/chunk-JCRM2YVK.js +3009 -0
  52. package/dist/_node-chunks/chunk-KK4AT5F3.js +1029 -0
  53. package/dist/_node-chunks/chunk-L7MYXJUM.js +1114 -0
  54. package/dist/_node-chunks/{chunk-F3XOPI6H.js → chunk-LCZO45L7.js} +469 -983
  55. package/dist/_node-chunks/chunk-LR3QITDI.js +209 -0
  56. package/dist/_node-chunks/chunk-LXG4DK35.js +3171 -0
  57. package/dist/_node-chunks/chunk-MJ3WOS6F.js +37 -0
  58. package/dist/_node-chunks/chunk-PHOZWZZO.js +61 -0
  59. package/dist/_node-chunks/chunk-QECOQWRJ.js +936 -0
  60. package/dist/_node-chunks/chunk-QH4V5YDB.js +20 -0
  61. package/dist/_node-chunks/chunk-R6HWGZWD.js +26 -0
  62. package/dist/_node-chunks/chunk-SPQXMU2Q.js +759 -0
  63. package/dist/_node-chunks/chunk-TXZY6V6O.js +1564 -0
  64. package/dist/_node-chunks/chunk-UGDPX5LE.js +756 -0
  65. package/dist/_node-chunks/chunk-UY26MQLT.js +603 -0
  66. package/dist/_node-chunks/chunk-WK3EMYK6.js +61 -0
  67. package/dist/_node-chunks/{chunk-OVXB5GGT.js → chunk-WLHMN7AP.js} +292 -688
  68. package/dist/_node-chunks/chunk-XGVLB4UJ.js +54 -0
  69. package/dist/_node-chunks/{chunk-RMHAL25C.js → chunk-YHRFI6BE.js} +87 -227
  70. package/dist/_node-chunks/chunk-YK4KVMFW.js +18 -0
  71. package/dist/_node-chunks/chunk-ZZALGOA6.js +4523 -0
  72. package/dist/_node-chunks/chunk-ZZPBSYA5.js +301 -0
  73. package/dist/_node-chunks/chunk-ZZSRFAC6.js +45571 -0
  74. package/dist/_node-chunks/dist-4DWOCZUD.js +121 -0
  75. package/dist/_node-chunks/globby-AAARUKEU.js +3452 -0
  76. package/dist/_node-chunks/lib-HEUKGL62.js +366 -0
  77. package/dist/_node-chunks/mdx-N42X6CFJ-DCVRPS6N.js +14329 -0
  78. package/dist/_node-chunks/p-limit-F5ZKJ6WZ.js +116 -0
  79. package/dist/_node-chunks/plugin-7YY7JXCH.js +123 -0
  80. package/dist/_node-chunks/{plugin-6ZPCS4LI.js → plugin-SZP3CW6W.js} +36 -56
  81. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-TGKNDPO6.js +46623 -0
  82. package/dist/_node-chunks/webpack-mock-plugin-LNTZZFBE.js +92 -0
  83. package/dist/actions/decorator.js +21 -42
  84. package/dist/actions/index.js +3 -3
  85. package/dist/babel/index.d.ts +671 -335
  86. package/dist/babel/index.js +11 -11
  87. package/dist/bin/core.js +592 -1546
  88. package/dist/bin/dispatcher.js +26 -37
  89. package/dist/bin/loader.js +23 -34
  90. package/dist/channels/index.js +98 -234
  91. package/dist/cli/index.js +1951 -5308
  92. package/dist/client-logger/index.js +31 -61
  93. package/dist/common/index.js +20 -20
  94. package/dist/components/index.js +4211 -8586
  95. package/dist/core-events/index.js +2 -66
  96. package/dist/core-server/index.js +3054 -7290
  97. package/dist/core-server/presets/common-manager.css +2 -2
  98. package/dist/core-server/presets/common-manager.js +1806 -3427
  99. package/dist/core-server/presets/common-override-preset.js +31 -60
  100. package/dist/core-server/presets/common-preset.js +434 -924
  101. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +15 -19
  102. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +12 -17
  103. package/dist/csf/index.js +534 -1179
  104. package/dist/csf-tools/index.js +9 -9
  105. package/dist/docs-tools/index.js +6 -6
  106. package/dist/highlight/index.js +2 -2
  107. package/dist/instrumenter/index.js +199 -415
  108. package/dist/manager/globals-runtime.js +24150 -47364
  109. package/dist/manager/globals.js +2 -3
  110. package/dist/manager/runtime.js +3961 -8373
  111. package/dist/manager-api/index.js +1231 -2425
  112. package/dist/manager-errors.d.ts +3 -0
  113. package/dist/manager-errors.js +3 -3
  114. package/dist/node-logger/index.js +1253 -2601
  115. package/dist/preview/globals.js +2 -3
  116. package/dist/preview/runtime.js +10364 -21990
  117. package/dist/preview-api/index.d.ts +67 -68
  118. package/dist/preview-api/index.js +13 -13
  119. package/dist/preview-errors.d.ts +3 -0
  120. package/dist/preview-errors.js +4 -4
  121. package/dist/router/index.js +347 -899
  122. package/dist/server-errors.d.ts +3 -0
  123. package/dist/server-errors.js +10 -10
  124. package/dist/telemetry/index.js +24 -24
  125. package/dist/test/index.js +5860 -11645
  126. package/dist/theming/create.js +4 -4
  127. package/dist/theming/index.d.ts +3363 -2597
  128. package/dist/theming/index.js +490 -1086
  129. package/dist/types/index.js +2 -11
  130. package/dist/viewport/index.js +3 -3
  131. package/package.json +5 -5
  132. package/dist/_browser-chunks/Color-FQNEU7YS.js +0 -1695
  133. package/dist/_browser-chunks/WithTooltip-6NHN2GXF.js +0 -2343
  134. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  135. package/dist/_browser-chunks/chunk-AW46NMGV.js +0 -1308
  136. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  137. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  138. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  139. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  140. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  141. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  142. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  143. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  144. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  145. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  146. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  147. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  148. package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
  149. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  150. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  151. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  152. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  153. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  154. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  155. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  156. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  157. package/dist/_node-chunks/camelcase-QALD4XFE.js +0 -18
  158. package/dist/_node-chunks/chunk-2XY53ALL.js +0 -420
  159. package/dist/_node-chunks/chunk-3CBQMG2A.js +0 -6712
  160. package/dist/_node-chunks/chunk-3WDAPZYQ.js +0 -28
  161. package/dist/_node-chunks/chunk-4ZB555EJ.js +0 -697
  162. package/dist/_node-chunks/chunk-52DXKXY3.js +0 -4272
  163. package/dist/_node-chunks/chunk-5OVB4A6F.js +0 -69
  164. package/dist/_node-chunks/chunk-AGHGNXGH.js +0 -18
  165. package/dist/_node-chunks/chunk-B23X5ZCK.js +0 -1531
  166. package/dist/_node-chunks/chunk-B2DAHWJK.js +0 -220
  167. package/dist/_node-chunks/chunk-CC4PW5MJ.js +0 -34
  168. package/dist/_node-chunks/chunk-D7NIZELR.js +0 -2256
  169. package/dist/_node-chunks/chunk-DO5Q3H4L.js +0 -1250
  170. package/dist/_node-chunks/chunk-ECK7WVFX.js +0 -304
  171. package/dist/_node-chunks/chunk-EUH3NHXA.js +0 -79
  172. package/dist/_node-chunks/chunk-FOQHPHCV.js +0 -1657
  173. package/dist/_node-chunks/chunk-G6EL47NS.js +0 -111
  174. package/dist/_node-chunks/chunk-GFLS4TJB.js +0 -90
  175. package/dist/_node-chunks/chunk-J3XZKWHE.js +0 -1586
  176. package/dist/_node-chunks/chunk-LE63EHJ5.js +0 -1518
  177. package/dist/_node-chunks/chunk-M47XA42S.js +0 -4741
  178. package/dist/_node-chunks/chunk-OOI74AL3.js +0 -61
  179. package/dist/_node-chunks/chunk-PRJHT3GJ.js +0 -61
  180. package/dist/_node-chunks/chunk-Q52PVUSU.js +0 -101
  181. package/dist/_node-chunks/chunk-SDCF5RNN.js +0 -1198
  182. package/dist/_node-chunks/chunk-UJ5SJ23M.js +0 -5029
  183. package/dist/_node-chunks/chunk-UPHK4ETU.js +0 -64658
  184. package/dist/_node-chunks/chunk-V7VURIPB.js +0 -1544
  185. package/dist/_node-chunks/dist-6TXHNR5C.js +0 -175
  186. package/dist/_node-chunks/globby-PBTV6PX6.js +0 -5222
  187. package/dist/_node-chunks/lib-4RTDZVGX.js +0 -518
  188. package/dist/_node-chunks/mdx-N42X6CFJ-COWEH7KR.js +0 -22017
  189. package/dist/_node-chunks/p-limit-PBVZQOFY.js +0 -168
  190. package/dist/_node-chunks/plugin-EOZKYZAG.js +0 -159
  191. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-35HMSMR5.js +0 -69102
  192. package/dist/_node-chunks/webpack-mock-plugin-GT3MA5E2.js +0 -124
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_8vqew0zn9si from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_8vqew0zn9si from "node:module";
1
+ import CJS_COMPAT_NODE_URL_843v2rliy1 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_843v2rliy1 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_843v2rliy1 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_8vqew0zn9si.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_843v2rliy1.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_843v2rliy1.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_843v2rliy1.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -13,30 +13,29 @@ import {
13
13
  BROWSER_TARGETS,
14
14
  NODE_TARGET,
15
15
  SUPPORTED_FEATURES
16
- } from "./chunk-VPR5IBMG.js";
16
+ } from "./chunk-6ZOLETQK.js";
17
17
  import {
18
18
  require_build
19
- } from "./chunk-4ZB555EJ.js";
19
+ } from "./chunk-UY26MQLT.js";
20
20
  import {
21
21
  resolveModulePath,
22
22
  resolvePackageDir
23
- } from "./chunk-V7VURIPB.js";
23
+ } from "./chunk-SPQXMU2Q.js";
24
24
  import {
25
25
  join,
26
26
  parse
27
- } from "./chunk-B2DAHWJK.js";
27
+ } from "./chunk-BBOP3XCK.js";
28
28
  import {
29
29
  slash
30
- } from "./chunk-3WDAPZYQ.js";
30
+ } from "./chunk-QH4V5YDB.js";
31
31
  import {
32
32
  __commonJS,
33
33
  __esm,
34
34
  __export,
35
- __name,
36
35
  __require,
37
36
  __toCommonJS,
38
37
  __toESM
39
- } from "./chunk-OOI74AL3.js";
38
+ } from "./chunk-XGVLB4UJ.js";
40
39
 
41
40
  // ../node_modules/tslib/tslib.es6.mjs
42
41
  var tslib_es6_exports = {};
@@ -76,30 +75,26 @@ __export(tslib_es6_exports, {
76
75
  default: () => tslib_es6_default
77
76
  });
78
77
  function __extends(d, b) {
79
- if (typeof b !== "function" && b !== null)
78
+ if (typeof b != "function" && b !== null)
80
79
  throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
81
80
  extendStatics(d, b);
82
81
  function __() {
83
82
  this.constructor = d;
84
83
  }
85
- __name(__, "__");
86
84
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
87
85
  }
88
86
  function __rest(s, e) {
89
87
  var t = {};
90
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
91
- t[p] = s[p];
92
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
93
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
94
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
95
- t[p[i]] = s[p[i]];
96
- }
88
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
89
+ if (s != null && typeof Object.getOwnPropertySymbols == "function")
90
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
91
+ e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
97
92
  return t;
98
93
  }
99
94
  function __decorate(decorators, target, key, desc) {
100
95
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
101
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
102
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
96
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(decorators, target, key, desc);
97
+ else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
103
98
  return c > 3 && r && Object.defineProperty(target, key, r), r;
104
99
  }
105
100
  function __param(paramIndex, decorator) {
@@ -109,15 +104,10 @@ function __param(paramIndex, decorator) {
109
104
  }
110
105
  function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
111
106
  function accept(f) {
112
- if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
107
+ if (f !== void 0 && typeof f != "function") throw new TypeError("Function expected");
113
108
  return f;
114
109
  }
115
- __name(accept, "accept");
116
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
117
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
118
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
119
- var _, done = false;
120
- for (var i = decorators.length - 1; i >= 0; i--) {
110
+ for (var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value", target = !descriptorIn && ctor ? contextIn.static ? ctor : ctor.prototype : null, descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}), _, done = !1, i = decorators.length - 1; i >= 0; i--) {
121
111
  var context = {};
122
112
  for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
123
113
  for (var p in contextIn.access) context.access[p] = contextIn.access[p];
@@ -128,34 +118,25 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
128
118
  var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
129
119
  if (kind === "accessor") {
130
120
  if (result === void 0) continue;
131
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
132
- if (_ = accept(result.get)) descriptor.get = _;
133
- if (_ = accept(result.set)) descriptor.set = _;
134
- if (_ = accept(result.init)) initializers.unshift(_);
135
- } else if (_ = accept(result)) {
136
- if (kind === "field") initializers.unshift(_);
137
- else descriptor[key] = _;
138
- }
121
+ if (result === null || typeof result != "object") throw new TypeError("Object expected");
122
+ (_ = accept(result.get)) && (descriptor.get = _), (_ = accept(result.set)) && (descriptor.set = _), (_ = accept(result.init)) && initializers.unshift(_);
123
+ } else (_ = accept(result)) && (kind === "field" ? initializers.unshift(_) : descriptor[key] = _);
139
124
  }
140
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
141
- done = true;
125
+ target && Object.defineProperty(target, contextIn.name, descriptor), done = !0;
142
126
  }
143
127
  function __runInitializers(thisArg, initializers, value) {
144
- var useValue = arguments.length > 2;
145
- for (var i = 0; i < initializers.length; i++) {
128
+ for (var useValue = arguments.length > 2, i = 0; i < initializers.length; i++)
146
129
  value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
147
- }
148
130
  return useValue ? value : void 0;
149
131
  }
150
132
  function __propKey(x) {
151
- return typeof x === "symbol" ? x : "".concat(x);
133
+ return typeof x == "symbol" ? x : "".concat(x);
152
134
  }
153
135
  function __setFunctionName(f, name, prefix) {
154
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
155
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
136
+ return typeof name == "symbol" && (name = name.description ? "[".concat(name.description, "]") : ""), Object.defineProperty(f, "name", { configurable: !0, value: prefix ? "".concat(prefix, " ", name) : name });
156
137
  }
157
138
  function __metadata(metadataKey, metadataValue) {
158
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
139
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(metadataKey, metadataValue);
159
140
  }
160
141
  function __awaiter(thisArg, _arguments, P, generator) {
161
142
  function adopt(value) {
@@ -163,7 +144,6 @@ function __awaiter(thisArg, _arguments, P, generator) {
163
144
  resolve(value);
164
145
  });
165
146
  }
166
- __name(adopt, "adopt");
167
147
  return new (P || (P = Promise))(function(resolve, reject) {
168
148
  function fulfilled(value) {
169
149
  try {
@@ -172,28 +152,25 @@ function __awaiter(thisArg, _arguments, P, generator) {
172
152
  reject(e);
173
153
  }
174
154
  }
175
- __name(fulfilled, "fulfilled");
176
155
  function rejected(value) {
177
156
  try {
178
- step(generator["throw"](value));
157
+ step(generator.throw(value));
179
158
  } catch (e) {
180
159
  reject(e);
181
160
  }
182
161
  }
183
- __name(rejected, "rejected");
184
162
  function step(result) {
185
163
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
186
164
  }
187
- __name(step, "step");
188
165
  step((generator = generator.apply(thisArg, _arguments || [])).next());
189
166
  });
190
167
  }
191
168
  function __generator(thisArg, body) {
192
- var _ = { label: 0, sent: /* @__PURE__ */ __name(function() {
169
+ var _ = { label: 0, sent: function() {
193
170
  if (t[0] & 1) throw t[1];
194
171
  return t[1];
195
- }, "sent"), trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
196
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
172
+ }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
173
+ return g.next = verb(0), g.throw = verb(1), g.return = verb(2), typeof Symbol == "function" && (g[Symbol.iterator] = function() {
197
174
  return this;
198
175
  }), g;
199
176
  function verb(n) {
@@ -201,31 +178,25 @@ function __generator(thisArg, body) {
201
178
  return step([n, v]);
202
179
  };
203
180
  }
204
- __name(verb, "verb");
205
181
  function step(op) {
206
182
  if (f) throw new TypeError("Generator is already executing.");
207
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
208
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
209
- if (y = 0, t) op = [op[0] & 2, t.value];
210
- switch (op[0]) {
183
+ for (; g && (g = 0, op[0] && (_ = 0)), _; ) try {
184
+ if (f = 1, y && (t = op[0] & 2 ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
185
+ switch (y = 0, t && (op = [op[0] & 2, t.value]), op[0]) {
211
186
  case 0:
212
187
  case 1:
213
188
  t = op;
214
189
  break;
215
190
  case 4:
216
- _.label++;
217
- return { value: op[1], done: false };
191
+ return _.label++, { value: op[1], done: !1 };
218
192
  case 5:
219
- _.label++;
220
- y = op[1];
221
- op = [0];
193
+ _.label++, y = op[1], op = [0];
222
194
  continue;
223
195
  case 7:
224
- op = _.ops.pop();
225
- _.trys.pop();
196
+ op = _.ops.pop(), _.trys.pop();
226
197
  continue;
227
198
  default:
228
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
199
+ if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
229
200
  _ = 0;
230
201
  continue;
231
202
  }
@@ -234,56 +205,50 @@ function __generator(thisArg, body) {
234
205
  break;
235
206
  }
236
207
  if (op[0] === 6 && _.label < t[1]) {
237
- _.label = t[1];
238
- t = op;
208
+ _.label = t[1], t = op;
239
209
  break;
240
210
  }
241
211
  if (t && _.label < t[2]) {
242
- _.label = t[2];
243
- _.ops.push(op);
212
+ _.label = t[2], _.ops.push(op);
244
213
  break;
245
214
  }
246
- if (t[2]) _.ops.pop();
247
- _.trys.pop();
215
+ t[2] && _.ops.pop(), _.trys.pop();
248
216
  continue;
249
217
  }
250
218
  op = body.call(thisArg, _);
251
219
  } catch (e) {
252
- op = [6, e];
253
- y = 0;
220
+ op = [6, e], y = 0;
254
221
  } finally {
255
222
  f = t = 0;
256
223
  }
257
224
  if (op[0] & 5) throw op[1];
258
- return { value: op[0] ? op[1] : void 0, done: true };
225
+ return { value: op[0] ? op[1] : void 0, done: !0 };
259
226
  }
260
- __name(step, "step");
261
227
  }
262
228
  function __exportStar(m, o) {
263
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
229
+ for (var p in m) p !== "default" && !Object.prototype.hasOwnProperty.call(o, p) && __createBinding(o, m, p);
264
230
  }
265
231
  function __values(o) {
266
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
232
+ var s = typeof Symbol == "function" && Symbol.iterator, m = s && o[s], i = 0;
267
233
  if (m) return m.call(o);
268
- if (o && typeof o.length === "number") return {
269
- next: /* @__PURE__ */ __name(function() {
270
- if (o && i >= o.length) o = void 0;
271
- return { value: o && o[i++], done: !o };
272
- }, "next")
234
+ if (o && typeof o.length == "number") return {
235
+ next: function() {
236
+ return o && i >= o.length && (o = void 0), { value: o && o[i++], done: !o };
237
+ }
273
238
  };
274
239
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
275
240
  }
276
241
  function __read(o, n) {
277
- var m = typeof Symbol === "function" && o[Symbol.iterator];
242
+ var m = typeof Symbol == "function" && o[Symbol.iterator];
278
243
  if (!m) return o;
279
244
  var i = m.call(o), r, ar = [], e;
280
245
  try {
281
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
246
+ for (; (n === void 0 || n-- > 0) && !(r = i.next()).done; ) ar.push(r.value);
282
247
  } catch (error) {
283
248
  e = { error };
284
249
  } finally {
285
250
  try {
286
- if (r && !r.done && (m = i["return"])) m.call(i);
251
+ r && !r.done && (m = i.return) && m.call(i);
287
252
  } finally {
288
253
  if (e) throw e.error;
289
254
  }
@@ -303,12 +268,8 @@ function __spreadArrays() {
303
268
  return r;
304
269
  }
305
270
  function __spreadArray(to, from, pack) {
306
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
307
- if (ar || !(i in from)) {
308
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
309
- ar[i] = from[i];
310
- }
311
- }
271
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++)
272
+ (ar || !(i in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
312
273
  return to.concat(ar || Array.prototype.slice.call(from));
313
274
  }
314
275
  function __await(v) {
@@ -317,7 +278,7 @@ function __await(v) {
317
278
  function __asyncGenerator(thisArg, _arguments, generator) {
318
279
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
319
280
  var g = generator.apply(thisArg, _arguments || []), i, q = [];
320
- return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
281
+ return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
321
282
  return this;
322
283
  }, i;
323
284
  function awaitReturn(f) {
@@ -325,18 +286,13 @@ function __asyncGenerator(thisArg, _arguments, generator) {
325
286
  return Promise.resolve(v).then(f, reject);
326
287
  };
327
288
  }
328
- __name(awaitReturn, "awaitReturn");
329
289
  function verb(n, f) {
330
- if (g[n]) {
331
- i[n] = function(v) {
332
- return new Promise(function(a, b) {
333
- q.push([n, v, a, b]) > 1 || resume(n, v);
334
- });
335
- };
336
- if (f) i[n] = f(i[n]);
337
- }
290
+ g[n] && (i[n] = function(v) {
291
+ return new Promise(function(a, b) {
292
+ q.push([n, v, a, b]) > 1 || resume(n, v);
293
+ });
294
+ }, f && (i[n] = f(i[n])));
338
295
  }
339
- __name(verb, "verb");
340
296
  function resume(n, v) {
341
297
  try {
342
298
  step(g[n](v));
@@ -344,23 +300,18 @@ function __asyncGenerator(thisArg, _arguments, generator) {
344
300
  settle(q[0][3], e);
345
301
  }
346
302
  }
347
- __name(resume, "resume");
348
303
  function step(r) {
349
304
  r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
350
305
  }
351
- __name(step, "step");
352
306
  function fulfill(value) {
353
307
  resume("next", value);
354
308
  }
355
- __name(fulfill, "fulfill");
356
309
  function reject(value) {
357
310
  resume("throw", value);
358
311
  }
359
- __name(reject, "reject");
360
312
  function settle(f, v) {
361
- if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
313
+ f(v), q.shift(), q.length && resume(q[0][0], q[0][1]);
362
314
  }
363
- __name(settle, "settle");
364
315
  }
365
316
  function __asyncDelegator(o) {
366
317
  var i, p;
@@ -371,15 +322,14 @@ function __asyncDelegator(o) {
371
322
  }, i;
372
323
  function verb(n, f) {
373
324
  i[n] = o[n] ? function(v) {
374
- return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
325
+ return (p = !p) ? { value: __await(o[n](v)), done: !1 } : f ? f(v) : v;
375
326
  } : f;
376
327
  }
377
- __name(verb, "verb");
378
328
  }
379
329
  function __asyncValues(o) {
380
330
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
381
331
  var m = o[Symbol.asyncIterator], i;
382
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
332
+ return m ? m.call(o) : (o = typeof __values == "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
383
333
  return this;
384
334
  }, i);
385
335
  function verb(n) {
@@ -389,52 +339,42 @@ function __asyncValues(o) {
389
339
  });
390
340
  };
391
341
  }
392
- __name(verb, "verb");
393
342
  function settle(resolve, reject, d, v) {
394
343
  Promise.resolve(v).then(function(v2) {
395
344
  resolve({ value: v2, done: d });
396
345
  }, reject);
397
346
  }
398
- __name(settle, "settle");
399
347
  }
400
348
  function __makeTemplateObject(cooked, raw) {
401
- if (Object.defineProperty) {
402
- Object.defineProperty(cooked, "raw", { value: raw });
403
- } else {
404
- cooked.raw = raw;
405
- }
406
- return cooked;
349
+ return Object.defineProperty ? Object.defineProperty(cooked, "raw", { value: raw }) : cooked.raw = raw, cooked;
407
350
  }
408
351
  function __importStar(mod) {
409
352
  if (mod && mod.__esModule) return mod;
410
353
  var result = {};
411
- if (mod != null) {
412
- for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
413
- }
414
- __setModuleDefault(result, mod);
415
- return result;
354
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) k[i] !== "default" && __createBinding(result, mod, k[i]);
355
+ return __setModuleDefault(result, mod), result;
416
356
  }
417
357
  function __importDefault(mod) {
418
358
  return mod && mod.__esModule ? mod : { default: mod };
419
359
  }
420
360
  function __classPrivateFieldGet(receiver, state, kind, f) {
421
361
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
422
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
362
+ if (typeof state == "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
423
363
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
424
364
  }
425
365
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
426
366
  if (kind === "m") throw new TypeError("Private method is not writable");
427
367
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
428
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
368
+ if (typeof state == "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
429
369
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
430
370
  }
431
371
  function __classPrivateFieldIn(state, receiver) {
432
- if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
433
- return typeof state === "function" ? receiver === state : state.has(receiver);
372
+ if (receiver === null || typeof receiver != "object" && typeof receiver != "function") throw new TypeError("Cannot use 'in' operator on non-object");
373
+ return typeof state == "function" ? receiver === state : state.has(receiver);
434
374
  }
435
375
  function __addDisposableResource(env, value, async) {
436
- if (value !== null && value !== void 0) {
437
- if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
376
+ if (value != null) {
377
+ if (typeof value != "object" && typeof value != "function") throw new TypeError("Object expected.");
438
378
  var dispose, inner;
439
379
  if (async) {
440
380
  if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
@@ -442,140 +382,89 @@ function __addDisposableResource(env, value, async) {
442
382
  }
443
383
  if (dispose === void 0) {
444
384
  if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
445
- dispose = value[Symbol.dispose];
446
- if (async) inner = dispose;
385
+ dispose = value[Symbol.dispose], async && (inner = dispose);
447
386
  }
448
- if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
449
- if (inner) dispose = /* @__PURE__ */ __name(function() {
387
+ if (typeof dispose != "function") throw new TypeError("Object not disposable.");
388
+ inner && (dispose = function() {
450
389
  try {
451
390
  inner.call(this);
452
391
  } catch (e) {
453
392
  return Promise.reject(e);
454
393
  }
455
- }, "dispose");
456
- env.stack.push({ value, dispose, async });
457
- } else if (async) {
458
- env.stack.push({ async: true });
459
- }
394
+ }), env.stack.push({ value, dispose, async });
395
+ } else async && env.stack.push({ async: !0 });
460
396
  return value;
461
397
  }
462
398
  function __disposeResources(env) {
463
399
  function fail(e) {
464
- env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
465
- env.hasError = true;
400
+ env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e, env.hasError = !0;
466
401
  }
467
- __name(fail, "fail");
468
402
  var r, s = 0;
469
403
  function next() {
470
- while (r = env.stack.pop()) {
404
+ for (; r = env.stack.pop(); )
471
405
  try {
472
406
  if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
473
407
  if (r.dispose) {
474
408
  var result = r.dispose.call(r.value);
475
409
  if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
476
- fail(e);
477
- return next();
410
+ return fail(e), next();
478
411
  });
479
412
  } else s |= 1;
480
413
  } catch (e) {
481
414
  fail(e);
482
415
  }
483
- }
484
416
  if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
485
417
  if (env.hasError) throw env.error;
486
418
  }
487
- __name(next, "next");
488
419
  return next();
489
420
  }
490
421
  function __rewriteRelativeImportExtension(path, preserveJsx) {
491
- if (typeof path === "string" && /^\.\.?\//.test(path)) {
492
- return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
493
- return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
494
- });
495
- }
496
- return path;
422
+ return typeof path == "string" && /^\.\.?\//.test(path) ? path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
423
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
424
+ }) : path;
497
425
  }
498
- var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
499
- var init_tslib_es6 = __esm({
426
+ var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default, init_tslib_es6 = __esm({
500
427
  "../node_modules/tslib/tslib.es6.mjs"() {
501
- extendStatics = /* @__PURE__ */ __name(function(d, b) {
502
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
428
+ extendStatics = function(d, b) {
429
+ return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
503
430
  d2.__proto__ = b2;
504
431
  } || function(d2, b2) {
505
- for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
506
- };
507
- return extendStatics(d, b);
508
- }, "extendStatics");
509
- __name(__extends, "__extends");
510
- __assign = /* @__PURE__ */ __name(function() {
511
- __assign = Object.assign || /* @__PURE__ */ __name(function __assign2(t) {
432
+ for (var p in b2) Object.prototype.hasOwnProperty.call(b2, p) && (d2[p] = b2[p]);
433
+ }, extendStatics(d, b);
434
+ };
435
+ __assign = function() {
436
+ return __assign = Object.assign || function(t) {
512
437
  for (var s, i = 1, n = arguments.length; i < n; i++) {
513
438
  s = arguments[i];
514
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
439
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
515
440
  }
516
441
  return t;
517
- }, "__assign");
518
- return __assign.apply(this, arguments);
519
- }, "__assign");
520
- __name(__rest, "__rest");
521
- __name(__decorate, "__decorate");
522
- __name(__param, "__param");
523
- __name(__esDecorate, "__esDecorate");
524
- __name(__runInitializers, "__runInitializers");
525
- __name(__propKey, "__propKey");
526
- __name(__setFunctionName, "__setFunctionName");
527
- __name(__metadata, "__metadata");
528
- __name(__awaiter, "__awaiter");
529
- __name(__generator, "__generator");
530
- __createBinding = Object.create ? function(o, m, k, k2) {
531
- if (k2 === void 0) k2 = k;
532
- var desc = Object.getOwnPropertyDescriptor(m, k);
533
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
534
- desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
535
- return m[k];
536
- }, "get") };
537
- }
538
- Object.defineProperty(o, k2, desc);
539
- } : function(o, m, k, k2) {
540
- if (k2 === void 0) k2 = k;
541
- o[k2] = m[k];
442
+ }, __assign.apply(this, arguments);
542
443
  };
543
- __name(__exportStar, "__exportStar");
544
- __name(__values, "__values");
545
- __name(__read, "__read");
546
- __name(__spread, "__spread");
547
- __name(__spreadArrays, "__spreadArrays");
548
- __name(__spreadArray, "__spreadArray");
549
- __name(__await, "__await");
550
- __name(__asyncGenerator, "__asyncGenerator");
551
- __name(__asyncDelegator, "__asyncDelegator");
552
- __name(__asyncValues, "__asyncValues");
553
- __name(__makeTemplateObject, "__makeTemplateObject");
554
- __setModuleDefault = Object.create ? function(o, v) {
555
- Object.defineProperty(o, "default", { enumerable: true, value: v });
556
- } : function(o, v) {
557
- o["default"] = v;
558
- };
559
- ownKeys = /* @__PURE__ */ __name(function(o) {
560
- ownKeys = Object.getOwnPropertyNames || function(o2) {
444
+ __createBinding = Object.create ? (function(o, m, k, k2) {
445
+ k2 === void 0 && (k2 = k);
446
+ var desc = Object.getOwnPropertyDescriptor(m, k);
447
+ (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
448
+ return m[k];
449
+ } }), Object.defineProperty(o, k2, desc);
450
+ }) : (function(o, m, k, k2) {
451
+ k2 === void 0 && (k2 = k), o[k2] = m[k];
452
+ });
453
+ __setModuleDefault = Object.create ? (function(o, v) {
454
+ Object.defineProperty(o, "default", { enumerable: !0, value: v });
455
+ }) : function(o, v) {
456
+ o.default = v;
457
+ }, ownKeys = function(o) {
458
+ return ownKeys = Object.getOwnPropertyNames || function(o2) {
561
459
  var ar = [];
562
- for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
460
+ for (var k in o2) Object.prototype.hasOwnProperty.call(o2, k) && (ar[ar.length] = k);
563
461
  return ar;
564
- };
565
- return ownKeys(o);
566
- }, "ownKeys");
567
- __name(__importStar, "__importStar");
568
- __name(__importDefault, "__importDefault");
569
- __name(__classPrivateFieldGet, "__classPrivateFieldGet");
570
- __name(__classPrivateFieldSet, "__classPrivateFieldSet");
571
- __name(__classPrivateFieldIn, "__classPrivateFieldIn");
572
- __name(__addDisposableResource, "__addDisposableResource");
573
- _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
462
+ }, ownKeys(o);
463
+ };
464
+ _SuppressedError = typeof SuppressedError == "function" ? SuppressedError : function(error, suppressed, message) {
574
465
  var e = new Error(message);
575
466
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
576
467
  };
577
- __name(__disposeResources, "__disposeResources");
578
- __name(__rewriteRelativeImportExtension, "__rewriteRelativeImportExtension");
579
468
  tslib_es6_default = {
580
469
  __extends,
581
470
  __assign,
@@ -617,45 +506,28 @@ var init_tslib_es6 = __esm({
617
506
  var require_lib = __commonJS({
618
507
  "../node_modules/@yarnpkg/esbuild-plugin-pnp/lib/index.js"(exports) {
619
508
  "use strict";
620
- Object.defineProperty(exports, "__esModule", { value: true });
509
+ Object.defineProperty(exports, "__esModule", { value: !0 });
621
510
  exports.pnpPlugin = void 0;
622
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
623
- var fs = tslib_1.__importStar(__require("fs"));
624
- var path_1 = tslib_1.__importDefault(__require("path"));
625
- var matchAll = /()/;
626
- var defaultExtensions = [`.tsx`, `.ts`, `.jsx`, `.mjs`, `.cjs`, `.js`, `.css`, `.json`];
511
+ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)), fs = tslib_1.__importStar(__require("fs")), path_1 = tslib_1.__importDefault(__require("path")), matchAll = /()/, defaultExtensions = [".tsx", ".ts", ".jsx", ".mjs", ".cjs", ".js", ".css", ".json"];
627
512
  function parseExternals(externals) {
628
513
  return externals.map((external) => {
629
- const wildcardIdx = external.indexOf(`*`);
630
- if (wildcardIdx !== -1)
631
- return { prefix: external.slice(0, wildcardIdx), suffix: external.slice(wildcardIdx + 1) };
632
- return external;
514
+ let wildcardIdx = external.indexOf("*");
515
+ return wildcardIdx !== -1 ? { prefix: external.slice(0, wildcardIdx), suffix: external.slice(wildcardIdx + 1) } : external;
633
516
  });
634
517
  }
635
- __name(parseExternals, "parseExternals");
636
518
  function isExternal(path, externals) {
637
- for (const external of externals) {
638
- if (typeof external === `object`) {
639
- if (path.length >= external.prefix.length + external.suffix.length && path.startsWith(external.prefix) && path.endsWith(external.suffix)) {
640
- return true;
641
- }
642
- } else {
643
- if (path === external)
644
- return true;
645
- if (!external.startsWith(`/`) && !external.startsWith(`./`) && !external.startsWith(`../`) && external !== `.` && external !== `..`) {
646
- if (path.startsWith(`${external}/`)) {
647
- return true;
648
- }
649
- }
650
- }
651
- }
652
- return false;
519
+ for (let external of externals)
520
+ if (typeof external == "object") {
521
+ if (path.length >= external.prefix.length + external.suffix.length && path.startsWith(external.prefix) && path.endsWith(external.suffix))
522
+ return !0;
523
+ } else if (path === external || !external.startsWith("/") && !external.startsWith("./") && !external.startsWith("../") && external !== "." && external !== ".." && path.startsWith(`${external}/`))
524
+ return !0;
525
+ return !1;
653
526
  }
654
- __name(isExternal, "isExternal");
655
527
  async function defaultOnLoad(args) {
656
528
  return {
657
529
  contents: await fs.promises.readFile(args.path),
658
- loader: `default`,
530
+ loader: "default",
659
531
  // For regular imports in the `file` namespace, resolveDir is the directory the
660
532
  // file being resolved lives in. For all other virtual modules, this defaults to
661
533
  // empty string: ""
@@ -664,65 +536,43 @@ var require_lib = __commonJS({
664
536
  resolveDir: path_1.default.dirname(args.path)
665
537
  };
666
538
  }
667
- __name(defaultOnLoad, "defaultOnLoad");
668
539
  async function defaultOnResolve(args, { resolvedPath, error, watchFiles }) {
669
- const problems = error ? [{ text: error.message }] : [];
670
- let mergeWith;
540
+ let problems = error ? [{ text: error.message }] : [], mergeWith;
671
541
  switch (args.kind) {
672
- case `require-call`:
673
- case `require-resolve`:
674
- case `dynamic-import`:
675
- {
676
- mergeWith = { warnings: problems };
677
- }
542
+ case "require-call":
543
+ case "require-resolve":
544
+ case "dynamic-import":
545
+ mergeWith = { warnings: problems };
678
546
  break;
679
547
  default:
680
- {
681
- mergeWith = { errors: problems };
682
- }
548
+ mergeWith = { errors: problems };
683
549
  break;
684
550
  }
685
- if (resolvedPath !== null) {
686
- return { namespace: `pnp`, path: resolvedPath, watchFiles };
687
- } else {
688
- return { external: true, ...mergeWith, watchFiles };
689
- }
551
+ return resolvedPath !== null ? { namespace: "pnp", path: resolvedPath, watchFiles } : { external: !0, ...mergeWith, watchFiles };
690
552
  }
691
- __name(defaultOnResolve, "defaultOnResolve");
692
553
  function pnpPlugin2({ baseDir = process.cwd(), extensions = defaultExtensions, filter = matchAll, onResolve = defaultOnResolve, onLoad = defaultOnLoad } = {}) {
693
554
  return {
694
- name: `@yarnpkg/esbuild-plugin-pnp`,
555
+ name: "@yarnpkg/esbuild-plugin-pnp",
695
556
  setup(build2) {
696
557
  var _a, _b;
697
- const { findPnpApi } = __require("module");
698
- if (typeof findPnpApi === `undefined`)
558
+ let { findPnpApi } = __require("module");
559
+ if (typeof findPnpApi > "u")
699
560
  return;
700
- const externals = parseExternals((_a = build2.initialOptions.external) !== null && _a !== void 0 ? _a : []);
701
- const platform = (_b = build2.initialOptions.platform) !== null && _b !== void 0 ? _b : `browser`;
702
- const isPlatformNode = platform === `node`;
703
- const conditionsDefault = new Set(build2.initialOptions.conditions);
704
- conditionsDefault.add(`default`);
705
- if (platform === `browser` || platform === `node`)
706
- conditionsDefault.add(platform);
707
- const conditionsImport = new Set(conditionsDefault);
708
- conditionsImport.add(`import`);
709
- const conditionsRequire = new Set(conditionsDefault);
710
- conditionsRequire.add(`require`);
711
- build2.onResolve({ filter }, (args) => {
561
+ let externals = parseExternals((_a = build2.initialOptions.external) !== null && _a !== void 0 ? _a : []), platform = (_b = build2.initialOptions.platform) !== null && _b !== void 0 ? _b : "browser", isPlatformNode = platform === "node", conditionsDefault = new Set(build2.initialOptions.conditions);
562
+ conditionsDefault.add("default"), (platform === "browser" || platform === "node") && conditionsDefault.add(platform);
563
+ let conditionsImport = new Set(conditionsDefault);
564
+ conditionsImport.add("import");
565
+ let conditionsRequire = new Set(conditionsDefault);
566
+ conditionsRequire.add("require"), build2.onResolve({ filter }, (args) => {
712
567
  var _a2, _b2;
713
568
  if (isExternal(args.path, externals))
714
- return { external: true };
569
+ return { external: !0 };
715
570
  let conditions = conditionsDefault;
716
- if (args.kind === `dynamic-import` || args.kind === `import-statement`)
717
- conditions = conditionsImport;
718
- else if (args.kind === `require-call` || args.kind === `require-resolve`)
719
- conditions = conditionsRequire;
720
- const effectiveImporter = args.resolveDir ? `${args.resolveDir}/` : args.importer ? args.importer : `${baseDir}/`;
721
- const pnpApi = findPnpApi(effectiveImporter);
571
+ args.kind === "dynamic-import" || args.kind === "import-statement" ? conditions = conditionsImport : (args.kind === "require-call" || args.kind === "require-resolve") && (conditions = conditionsRequire);
572
+ let effectiveImporter = args.resolveDir ? `${args.resolveDir}/` : args.importer ? args.importer : `${baseDir}/`, pnpApi = findPnpApi(effectiveImporter);
722
573
  if (!pnpApi)
723
- return void 0;
724
- let path = null;
725
- let error;
574
+ return;
575
+ let path = null, error;
726
576
  try {
727
577
  path = pnpApi.resolveRequest(args.path, effectiveImporter, {
728
578
  conditions,
@@ -732,25 +582,19 @@ var require_lib = __commonJS({
732
582
  } catch (e) {
733
583
  error = e;
734
584
  }
735
- const watchFiles = [pnpApi.resolveRequest(`pnpapi`, null)];
585
+ let watchFiles = [pnpApi.resolveRequest("pnpapi", null)];
736
586
  if (path) {
737
- const locator = pnpApi.findPackageLocator(path);
587
+ let locator = pnpApi.findPackageLocator(path);
738
588
  if (locator) {
739
- const info = pnpApi.getPackageInformation(locator);
740
- if ((info === null || info === void 0 ? void 0 : info.linkType) === `SOFT`) {
741
- watchFiles.push((_b2 = (_a2 = pnpApi.resolveVirtual) === null || _a2 === void 0 ? void 0 : _a2.call(pnpApi, path)) !== null && _b2 !== void 0 ? _b2 : path);
742
- }
589
+ let info = pnpApi.getPackageInformation(locator);
590
+ info?.linkType === "SOFT" && watchFiles.push((_b2 = (_a2 = pnpApi.resolveVirtual) === null || _a2 === void 0 ? void 0 : _a2.call(pnpApi, path)) !== null && _b2 !== void 0 ? _b2 : path);
743
591
  }
744
592
  }
745
593
  return onResolve(args, { resolvedPath: path, error, watchFiles });
746
- });
747
- if (build2.onLoad !== null) {
748
- build2.onLoad({ filter }, onLoad);
749
- }
594
+ }), build2.onLoad !== null && build2.onLoad({ filter }, onLoad);
750
595
  }
751
596
  };
752
597
  }
753
- __name(pnpPlugin2, "pnpPlugin");
754
598
  exports.pnpPlugin = pnpPlugin2;
755
599
  }
756
600
  });
@@ -759,16 +603,11 @@ var require_lib = __commonJS({
759
603
  var require_utils = __commonJS({
760
604
  "../node_modules/ejs/lib/utils.js"(exports) {
761
605
  "use strict";
762
- var regExpChars = /[|\\{}()[\]^$+*?.]/g;
763
- var hasOwnProperty = Object.prototype.hasOwnProperty;
764
- var hasOwn = /* @__PURE__ */ __name(function(obj, key) {
606
+ var regExpChars = /[|\\{}()[\]^$+*?.]/g, hasOwnProperty = Object.prototype.hasOwnProperty, hasOwn = function(obj, key) {
765
607
  return hasOwnProperty.apply(obj, [key]);
766
- }, "hasOwn");
608
+ };
767
609
  exports.escapeRegExpChars = function(string) {
768
- if (!string) {
769
- return "";
770
- }
771
- return String(string).replace(regExpChars, "\\$&");
610
+ return string ? String(string).replace(regExpChars, "\\$&") : "";
772
611
  };
773
612
  var _ENCODE_HTML_RULES = {
774
613
  "&": "&amp;",
@@ -776,12 +615,10 @@ var require_utils = __commonJS({
776
615
  ">": "&gt;",
777
616
  '"': "&#34;",
778
617
  "'": "&#39;"
779
- };
780
- var _MATCH_HTML = /[&<>'"]/g;
618
+ }, _MATCH_HTML = /[&<>'"]/g;
781
619
  function encode_char(c) {
782
620
  return _ENCODE_HTML_RULES[c] || c;
783
621
  }
784
- __name(encode_char, "encode_char");
785
622
  var escapeFuncStr = `var _ENCODE_HTML_RULES = {
786
623
  "&": "&amp;"
787
624
  , "<": "&lt;"
@@ -795,97 +632,68 @@ function encode_char(c) {
795
632
  };
796
633
  `;
797
634
  exports.escapeXML = function(markup) {
798
- return markup == void 0 ? "" : String(markup).replace(_MATCH_HTML, encode_char);
635
+ return markup == null ? "" : String(markup).replace(_MATCH_HTML, encode_char);
799
636
  };
800
637
  function escapeXMLToString() {
801
- return Function.prototype.toString.call(this) + ";\n" + escapeFuncStr;
638
+ return Function.prototype.toString.call(this) + `;
639
+ ` + escapeFuncStr;
802
640
  }
803
- __name(escapeXMLToString, "escapeXMLToString");
804
641
  try {
805
- if (typeof Object.defineProperty === "function") {
806
- Object.defineProperty(exports.escapeXML, "toString", { value: escapeXMLToString });
807
- } else {
808
- exports.escapeXML.toString = escapeXMLToString;
809
- }
810
- } catch (err) {
642
+ typeof Object.defineProperty == "function" ? Object.defineProperty(exports.escapeXML, "toString", { value: escapeXMLToString }) : exports.escapeXML.toString = escapeXMLToString;
643
+ } catch {
811
644
  console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)");
812
645
  }
813
646
  exports.shallowCopy = function(to, from) {
814
- from = from || {};
815
- if (to !== null && to !== void 0) {
816
- for (var p in from) {
817
- if (!hasOwn(from, p)) {
818
- continue;
819
- }
820
- if (p === "__proto__" || p === "constructor") {
821
- continue;
822
- }
823
- to[p] = from[p];
824
- }
825
- }
647
+ if (from = from || {}, to != null)
648
+ for (var p in from)
649
+ hasOwn(from, p) && (p === "__proto__" || p === "constructor" || (to[p] = from[p]));
826
650
  return to;
827
651
  };
828
652
  exports.shallowCopyFromList = function(to, from, list) {
829
- list = list || [];
830
- from = from || {};
831
- if (to !== null && to !== void 0) {
653
+ if (list = list || [], from = from || {}, to != null)
832
654
  for (var i = 0; i < list.length; i++) {
833
655
  var p = list[i];
834
- if (typeof from[p] != "undefined") {
835
- if (!hasOwn(from, p)) {
836
- continue;
837
- }
838
- if (p === "__proto__" || p === "constructor") {
656
+ if (typeof from[p] < "u") {
657
+ if (!hasOwn(from, p) || p === "__proto__" || p === "constructor")
839
658
  continue;
840
- }
841
659
  to[p] = from[p];
842
660
  }
843
661
  }
844
- }
845
662
  return to;
846
663
  };
847
664
  exports.cache = {
848
665
  _data: {},
849
- set: /* @__PURE__ */ __name(function(key, val) {
666
+ set: function(key, val) {
850
667
  this._data[key] = val;
851
- }, "set"),
852
- get: /* @__PURE__ */ __name(function(key) {
668
+ },
669
+ get: function(key) {
853
670
  return this._data[key];
854
- }, "get"),
855
- remove: /* @__PURE__ */ __name(function(key) {
671
+ },
672
+ remove: function(key) {
856
673
  delete this._data[key];
857
- }, "remove"),
858
- reset: /* @__PURE__ */ __name(function() {
674
+ },
675
+ reset: function() {
859
676
  this._data = {};
860
- }, "reset")
677
+ }
861
678
  };
862
679
  exports.hyphenToCamel = function(str) {
863
680
  return str.replace(/-[a-z]/g, function(match) {
864
681
  return match[1].toUpperCase();
865
682
  });
866
683
  };
867
- exports.createNullProtoObjWherePossible = function() {
868
- if (typeof Object.create == "function") {
869
- return function() {
870
- return /* @__PURE__ */ Object.create(null);
871
- };
872
- }
873
- if (!({ __proto__: null } instanceof Object)) {
874
- return function() {
875
- return { __proto__: null };
876
- };
877
- }
878
- return function() {
684
+ exports.createNullProtoObjWherePossible = (function() {
685
+ return typeof Object.create == "function" ? function() {
686
+ return /* @__PURE__ */ Object.create(null);
687
+ } : { __proto__: null } instanceof Object ? function() {
879
688
  return {};
689
+ } : function() {
690
+ return { __proto__: null };
880
691
  };
881
- }();
692
+ })();
882
693
  exports.hasOwnOnlyObject = function(obj) {
883
694
  var o = exports.createNullProtoObjWherePossible();
884
- for (var p in obj) {
885
- if (hasOwn(obj, p)) {
886
- o[p] = obj[p];
887
- }
888
- }
695
+ for (var p in obj)
696
+ hasOwn(obj, p) && (o[p] = obj[p]);
889
697
  return o;
890
698
  };
891
699
  }
@@ -943,18 +751,7 @@ var require_package = __commonJS({
943
751
  var require_ejs = __commonJS({
944
752
  "../node_modules/ejs/lib/ejs.js"(exports) {
945
753
  "use strict";
946
- var fs = __require("fs");
947
- var path = __require("path");
948
- var utils = require_utils();
949
- var scopeOptionWarned = false;
950
- var _VERSION_STRING = require_package().version;
951
- var _DEFAULT_OPEN_DELIMITER = "<";
952
- var _DEFAULT_CLOSE_DELIMITER = ">";
953
- var _DEFAULT_DELIMITER = "%";
954
- var _DEFAULT_LOCALS_NAME = "locals";
955
- var _NAME = "ejs";
956
- var _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";
957
- var _OPTS_PASSABLE_WITH_DATA = [
754
+ var fs = __require("fs"), path = __require("path"), utils = require_utils(), scopeOptionWarned = !1, _VERSION_STRING = require_package().version, _DEFAULT_OPEN_DELIMITER = "<", _DEFAULT_CLOSE_DELIMITER = ">", _DEFAULT_DELIMITER = "%", _DEFAULT_LOCALS_NAME = "locals", _NAME = "ejs", _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)", _OPTS_PASSABLE_WITH_DATA = [
958
755
  "delimiter",
959
756
  "scope",
960
757
  "context",
@@ -966,255 +763,113 @@ var require_ejs = __commonJS({
966
763
  "strict",
967
764
  "filename",
968
765
  "async"
969
- ];
970
- var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache");
971
- var _BOM = /^\uFEFF/;
972
- var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
766
+ ], _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache"), _BOM = /^\uFEFF/, _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
973
767
  exports.cache = utils.cache;
974
768
  exports.fileLoader = fs.readFileSync;
975
769
  exports.localsName = _DEFAULT_LOCALS_NAME;
976
770
  exports.promiseImpl = new Function("return this;")().Promise;
977
771
  exports.resolveInclude = function(name, filename, isDir) {
978
- var dirname3 = path.dirname;
979
- var extname = path.extname;
980
- var resolve = path.resolve;
981
- var includePath = resolve(isDir ? filename : dirname3(filename), name);
982
- var ext = extname(name);
983
- if (!ext) {
984
- includePath += ".ejs";
985
- }
986
- return includePath;
772
+ var dirname3 = path.dirname, extname = path.extname, resolve = path.resolve, includePath = resolve(isDir ? filename : dirname3(filename), name), ext = extname(name);
773
+ return ext || (includePath += ".ejs"), includePath;
987
774
  };
988
775
  function resolvePaths(name, paths) {
989
776
  var filePath;
990
777
  if (paths.some(function(v) {
991
- filePath = exports.resolveInclude(name, v, true);
992
- return fs.existsSync(filePath);
993
- })) {
778
+ return filePath = exports.resolveInclude(name, v, !0), fs.existsSync(filePath);
779
+ }))
994
780
  return filePath;
995
- }
996
781
  }
997
- __name(resolvePaths, "resolvePaths");
998
782
  function getIncludePath(path2, options) {
999
- var includePath;
1000
- var filePath;
1001
- var views = options.views;
1002
- var match = /^[A-Za-z]+:\\|^\//.exec(path2);
1003
- if (match && match.length) {
1004
- path2 = path2.replace(/^\/*/, "");
1005
- if (Array.isArray(options.root)) {
1006
- includePath = resolvePaths(path2, options.root);
1007
- } else {
1008
- includePath = exports.resolveInclude(path2, options.root || "/", true);
1009
- }
1010
- } else {
1011
- if (options.filename) {
1012
- filePath = exports.resolveInclude(path2, options.filename);
1013
- if (fs.existsSync(filePath)) {
1014
- includePath = filePath;
1015
- }
1016
- }
1017
- if (!includePath && Array.isArray(views)) {
1018
- includePath = resolvePaths(path2, views);
1019
- }
1020
- if (!includePath && typeof options.includer !== "function") {
1021
- throw new Error('Could not find the include file "' + options.escapeFunction(path2) + '"');
1022
- }
1023
- }
783
+ var includePath, filePath, views = options.views, match = /^[A-Za-z]+:\\|^\//.exec(path2);
784
+ if (match && match.length)
785
+ path2 = path2.replace(/^\/*/, ""), Array.isArray(options.root) ? includePath = resolvePaths(path2, options.root) : includePath = exports.resolveInclude(path2, options.root || "/", !0);
786
+ else if (options.filename && (filePath = exports.resolveInclude(path2, options.filename), fs.existsSync(filePath) && (includePath = filePath)), !includePath && Array.isArray(views) && (includePath = resolvePaths(path2, views)), !includePath && typeof options.includer != "function")
787
+ throw new Error('Could not find the include file "' + options.escapeFunction(path2) + '"');
1024
788
  return includePath;
1025
789
  }
1026
- __name(getIncludePath, "getIncludePath");
1027
790
  function handleCache(options, template) {
1028
- var func;
1029
- var filename = options.filename;
1030
- var hasTemplate = arguments.length > 1;
791
+ var func, filename = options.filename, hasTemplate = arguments.length > 1;
1031
792
  if (options.cache) {
1032
- if (!filename) {
793
+ if (!filename)
1033
794
  throw new Error("cache option requires a filename");
1034
- }
1035
- func = exports.cache.get(filename);
1036
- if (func) {
795
+ if (func = exports.cache.get(filename), func)
1037
796
  return func;
1038
- }
1039
- if (!hasTemplate) {
1040
- template = fileLoader(filename).toString().replace(_BOM, "");
1041
- }
797
+ hasTemplate || (template = fileLoader(filename).toString().replace(_BOM, ""));
1042
798
  } else if (!hasTemplate) {
1043
- if (!filename) {
799
+ if (!filename)
1044
800
  throw new Error("Internal EJS error: no file name or template provided");
1045
- }
1046
801
  template = fileLoader(filename).toString().replace(_BOM, "");
1047
802
  }
1048
- func = exports.compile(template, options);
1049
- if (options.cache) {
1050
- exports.cache.set(filename, func);
1051
- }
1052
- return func;
803
+ return func = exports.compile(template, options), options.cache && exports.cache.set(filename, func), func;
1053
804
  }
1054
- __name(handleCache, "handleCache");
1055
805
  function tryHandleCache(options, data, cb) {
1056
806
  var result;
1057
- if (!cb) {
1058
- if (typeof exports.promiseImpl == "function") {
1059
- return new exports.promiseImpl(function(resolve, reject) {
1060
- try {
1061
- result = handleCache(options)(data);
1062
- resolve(result);
1063
- } catch (err) {
1064
- reject(err);
1065
- }
1066
- });
1067
- } else {
1068
- throw new Error("Please provide a callback function");
1069
- }
1070
- } else {
807
+ if (cb) {
1071
808
  try {
1072
809
  result = handleCache(options)(data);
1073
810
  } catch (err) {
1074
811
  return cb(err);
1075
812
  }
1076
813
  cb(null, result);
814
+ } else {
815
+ if (typeof exports.promiseImpl == "function")
816
+ return new exports.promiseImpl(function(resolve, reject) {
817
+ try {
818
+ result = handleCache(options)(data), resolve(result);
819
+ } catch (err) {
820
+ reject(err);
821
+ }
822
+ });
823
+ throw new Error("Please provide a callback function");
1077
824
  }
1078
825
  }
1079
- __name(tryHandleCache, "tryHandleCache");
1080
826
  function fileLoader(filePath) {
1081
827
  return exports.fileLoader(filePath);
1082
828
  }
1083
- __name(fileLoader, "fileLoader");
1084
829
  function includeFile(path2, options) {
1085
830
  var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
1086
- opts.filename = getIncludePath(path2, opts);
1087
- if (typeof options.includer === "function") {
831
+ if (opts.filename = getIncludePath(path2, opts), typeof options.includer == "function") {
1088
832
  var includerResult = options.includer(path2, opts.filename);
1089
- if (includerResult) {
1090
- if (includerResult.filename) {
1091
- opts.filename = includerResult.filename;
1092
- }
1093
- if (includerResult.template) {
1094
- return handleCache(opts, includerResult.template);
1095
- }
1096
- }
833
+ if (includerResult && (includerResult.filename && (opts.filename = includerResult.filename), includerResult.template))
834
+ return handleCache(opts, includerResult.template);
1097
835
  }
1098
836
  return handleCache(opts);
1099
837
  }
1100
- __name(includeFile, "includeFile");
1101
838
  function rethrow(err, str, flnm, lineno, esc) {
1102
- var lines = str.split("\n");
1103
- var start2 = Math.max(lineno - 3, 0);
1104
- var end = Math.min(lines.length, lineno + 3);
1105
- var filename = esc(flnm);
1106
- var context = lines.slice(start2, end).map(function(line, i) {
839
+ var lines = str.split(`
840
+ `), start2 = Math.max(lineno - 3, 0), end = Math.min(lines.length, lineno + 3), filename = esc(flnm), context = lines.slice(start2, end).map(function(line, i) {
1107
841
  var curr = i + start2 + 1;
1108
842
  return (curr == lineno ? " >> " : " ") + curr + "| " + line;
1109
- }).join("\n");
1110
- err.path = filename;
1111
- err.message = (filename || "ejs") + ":" + lineno + "\n" + context + "\n\n" + err.message;
1112
- throw err;
843
+ }).join(`
844
+ `);
845
+ throw err.path = filename, err.message = (filename || "ejs") + ":" + lineno + `
846
+ ` + context + `
847
+
848
+ ` + err.message, err;
1113
849
  }
1114
- __name(rethrow, "rethrow");
1115
850
  function stripSemi(str) {
1116
851
  return str.replace(/;(\s*$)/, "$1");
1117
852
  }
1118
- __name(stripSemi, "stripSemi");
1119
- exports.compile = /* @__PURE__ */ __name(function compile(template, opts) {
853
+ exports.compile = function(template, opts) {
1120
854
  var templ;
1121
- if (opts && opts.scope) {
1122
- if (!scopeOptionWarned) {
1123
- console.warn("`scope` option is deprecated and will be removed in EJS 3");
1124
- scopeOptionWarned = true;
1125
- }
1126
- if (!opts.context) {
1127
- opts.context = opts.scope;
1128
- }
1129
- delete opts.scope;
1130
- }
1131
- templ = new Template(template, opts);
1132
- return templ.compile();
1133
- }, "compile");
855
+ return opts && opts.scope && (scopeOptionWarned || (console.warn("`scope` option is deprecated and will be removed in EJS 3"), scopeOptionWarned = !0), opts.context || (opts.context = opts.scope), delete opts.scope), templ = new Template(template, opts), templ.compile();
856
+ };
1134
857
  exports.render = function(template, d, o) {
1135
- var data = d || utils.createNullProtoObjWherePossible();
1136
- var opts = o || utils.createNullProtoObjWherePossible();
1137
- if (arguments.length == 2) {
1138
- utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);
1139
- }
1140
- return handleCache(opts, template)(data);
858
+ var data = d || utils.createNullProtoObjWherePossible(), opts = o || utils.createNullProtoObjWherePossible();
859
+ return arguments.length == 2 && utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA), handleCache(opts, template)(data);
1141
860
  };
1142
861
  exports.renderFile = function() {
1143
- var args = Array.prototype.slice.call(arguments);
1144
- var filename = args.shift();
1145
- var cb;
1146
- var opts = { filename };
1147
- var data;
1148
- var viewOpts;
1149
- if (typeof arguments[arguments.length - 1] == "function") {
1150
- cb = args.pop();
1151
- }
1152
- if (args.length) {
1153
- data = args.shift();
1154
- if (args.length) {
1155
- utils.shallowCopy(opts, args.pop());
1156
- } else {
1157
- if (data.settings) {
1158
- if (data.settings.views) {
1159
- opts.views = data.settings.views;
1160
- }
1161
- if (data.settings["view cache"]) {
1162
- opts.cache = true;
1163
- }
1164
- viewOpts = data.settings["view options"];
1165
- if (viewOpts) {
1166
- utils.shallowCopy(opts, viewOpts);
1167
- }
1168
- }
1169
- utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);
1170
- }
1171
- opts.filename = filename;
1172
- } else {
1173
- data = utils.createNullProtoObjWherePossible();
1174
- }
1175
- return tryHandleCache(opts, data, cb);
862
+ var args = Array.prototype.slice.call(arguments), filename = args.shift(), cb, opts = { filename }, data, viewOpts;
863
+ return typeof arguments[arguments.length - 1] == "function" && (cb = args.pop()), args.length ? (data = args.shift(), args.length ? utils.shallowCopy(opts, args.pop()) : (data.settings && (data.settings.views && (opts.views = data.settings.views), data.settings["view cache"] && (opts.cache = !0), viewOpts = data.settings["view options"], viewOpts && utils.shallowCopy(opts, viewOpts)), utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS)), opts.filename = filename) : data = utils.createNullProtoObjWherePossible(), tryHandleCache(opts, data, cb);
1176
864
  };
1177
865
  exports.Template = Template;
1178
866
  exports.clearCache = function() {
1179
867
  exports.cache.reset();
1180
868
  };
1181
869
  function Template(text, optsParam) {
1182
- var opts = utils.hasOwnOnlyObject(optsParam);
1183
- var options = utils.createNullProtoObjWherePossible();
1184
- this.templateText = text;
1185
- this.mode = null;
1186
- this.truncate = false;
1187
- this.currentLine = 1;
1188
- this.source = "";
1189
- options.client = opts.client || false;
1190
- options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;
1191
- options.compileDebug = opts.compileDebug !== false;
1192
- options.debug = !!opts.debug;
1193
- options.filename = opts.filename;
1194
- options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER;
1195
- options.closeDelimiter = opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
1196
- options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;
1197
- options.strict = opts.strict || false;
1198
- options.context = opts.context;
1199
- options.cache = opts.cache || false;
1200
- options.rmWhitespace = opts.rmWhitespace;
1201
- options.root = opts.root;
1202
- options.includer = opts.includer;
1203
- options.outputFunctionName = opts.outputFunctionName;
1204
- options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME;
1205
- options.views = opts.views;
1206
- options.async = opts.async;
1207
- options.destructuredLocals = opts.destructuredLocals;
1208
- options.legacyInclude = typeof opts.legacyInclude != "undefined" ? !!opts.legacyInclude : true;
1209
- if (options.strict) {
1210
- options._with = false;
1211
- } else {
1212
- options._with = typeof opts._with != "undefined" ? opts._with : true;
1213
- }
1214
- this.opts = options;
1215
- this.regex = this.createRegex();
870
+ var opts = utils.hasOwnOnlyObject(optsParam), options = utils.createNullProtoObjWherePossible();
871
+ this.templateText = text, this.mode = null, this.truncate = !1, this.currentLine = 1, this.source = "", options.client = opts.client || !1, options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML, options.compileDebug = opts.compileDebug !== !1, options.debug = !!opts.debug, options.filename = opts.filename, options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER, options.closeDelimiter = opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER, options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER, options.strict = opts.strict || !1, options.context = opts.context, options.cache = opts.cache || !1, options.rmWhitespace = opts.rmWhitespace, options.root = opts.root, options.includer = opts.includer, options.outputFunctionName = opts.outputFunctionName, options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME, options.views = opts.views, options.async = opts.async, options.destructuredLocals = opts.destructuredLocals, options.legacyInclude = typeof opts.legacyInclude < "u" ? !!opts.legacyInclude : !0, options.strict ? options._with = !1 : options._with = typeof opts._with < "u" ? opts._with : !0, this.opts = options, this.regex = this.createRegex();
1216
872
  }
1217
- __name(Template, "Template");
1218
873
  Template.modes = {
1219
874
  EVAL: "eval",
1220
875
  ESCAPED: "escaped",
@@ -1223,201 +878,121 @@ var require_ejs = __commonJS({
1223
878
  LITERAL: "literal"
1224
879
  };
1225
880
  Template.prototype = {
1226
- createRegex: /* @__PURE__ */ __name(function() {
1227
- var str = _REGEX_STRING;
1228
- var delim = utils.escapeRegExpChars(this.opts.delimiter);
1229
- var open = utils.escapeRegExpChars(this.opts.openDelimiter);
1230
- var close = utils.escapeRegExpChars(this.opts.closeDelimiter);
1231
- str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);
1232
- return new RegExp(str);
1233
- }, "createRegex"),
1234
- compile: /* @__PURE__ */ __name(function() {
1235
- var src;
1236
- var fn;
1237
- var opts = this.opts;
1238
- var prepended = "";
1239
- var appended = "";
1240
- var escapeFn = opts.escapeFunction;
1241
- var ctor;
1242
- var sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
881
+ createRegex: function() {
882
+ var str = _REGEX_STRING, delim = utils.escapeRegExpChars(this.opts.delimiter), open = utils.escapeRegExpChars(this.opts.openDelimiter), close = utils.escapeRegExpChars(this.opts.closeDelimiter);
883
+ return str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close), new RegExp(str);
884
+ },
885
+ compile: function() {
886
+ var src, fn, opts = this.opts, prepended = "", appended = "", escapeFn = opts.escapeFunction, ctor, sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
1243
887
  if (!this.source) {
1244
- this.generateSource();
1245
- prepended += ' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n';
1246
- if (opts.outputFunctionName) {
1247
- if (!_JS_IDENTIFIER.test(opts.outputFunctionName)) {
888
+ if (this.generateSource(), prepended += ` var __output = "";
889
+ function __append(s) { if (s !== undefined && s !== null) __output += s }
890
+ `, opts.outputFunctionName) {
891
+ if (!_JS_IDENTIFIER.test(opts.outputFunctionName))
1248
892
  throw new Error("outputFunctionName is not a valid JS identifier.");
1249
- }
1250
- prepended += " var " + opts.outputFunctionName + " = __append;\n";
893
+ prepended += " var " + opts.outputFunctionName + ` = __append;
894
+ `;
1251
895
  }
1252
- if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName)) {
896
+ if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName))
1253
897
  throw new Error("localsName is not a valid JS identifier.");
1254
- }
1255
898
  if (opts.destructuredLocals && opts.destructuredLocals.length) {
1256
- var destructuring = " var __locals = (" + opts.localsName + " || {}),\n";
1257
- for (var i = 0; i < opts.destructuredLocals.length; i++) {
899
+ for (var destructuring = " var __locals = (" + opts.localsName + ` || {}),
900
+ `, i = 0; i < opts.destructuredLocals.length; i++) {
1258
901
  var name = opts.destructuredLocals[i];
1259
- if (!_JS_IDENTIFIER.test(name)) {
902
+ if (!_JS_IDENTIFIER.test(name))
1260
903
  throw new Error("destructuredLocals[" + i + "] is not a valid JS identifier.");
1261
- }
1262
- if (i > 0) {
1263
- destructuring += ",\n ";
1264
- }
1265
- destructuring += name + " = __locals." + name;
904
+ i > 0 && (destructuring += `,
905
+ `), destructuring += name + " = __locals." + name;
1266
906
  }
1267
- prepended += destructuring + ";\n";
1268
- }
1269
- if (opts._with !== false) {
1270
- prepended += " with (" + opts.localsName + " || {}) {\n";
1271
- appended += " }\n";
1272
- }
1273
- appended += " return __output;\n";
1274
- this.source = prepended + this.source + appended;
1275
- }
1276
- if (opts.compileDebug) {
1277
- src = "var __line = 1\n , __lines = " + JSON.stringify(this.templateText) + "\n , __filename = " + sanitizedFilename + ";\ntry {\n" + this.source + "} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n";
1278
- } else {
1279
- src = this.source;
1280
- }
1281
- if (opts.client) {
1282
- src = "escapeFn = escapeFn || " + escapeFn.toString() + ";\n" + src;
1283
- if (opts.compileDebug) {
1284
- src = "rethrow = rethrow || " + rethrow.toString() + ";\n" + src;
907
+ prepended += destructuring + `;
908
+ `;
1285
909
  }
910
+ opts._with !== !1 && (prepended += " with (" + opts.localsName + ` || {}) {
911
+ `, appended += ` }
912
+ `), appended += ` return __output;
913
+ `, this.source = prepended + this.source + appended;
1286
914
  }
1287
- if (opts.strict) {
1288
- src = '"use strict";\n' + src;
1289
- }
1290
- if (opts.debug) {
1291
- console.log(src);
1292
- }
1293
- if (opts.compileDebug && opts.filename) {
1294
- src = src + "\n//# sourceURL=" + sanitizedFilename + "\n";
1295
- }
915
+ opts.compileDebug ? src = `var __line = 1
916
+ , __lines = ` + JSON.stringify(this.templateText) + `
917
+ , __filename = ` + sanitizedFilename + `;
918
+ try {
919
+ ` + this.source + `} catch (e) {
920
+ rethrow(e, __lines, __filename, __line, escapeFn);
921
+ }
922
+ ` : src = this.source, opts.client && (src = "escapeFn = escapeFn || " + escapeFn.toString() + `;
923
+ ` + src, opts.compileDebug && (src = "rethrow = rethrow || " + rethrow.toString() + `;
924
+ ` + src)), opts.strict && (src = `"use strict";
925
+ ` + src), opts.debug && console.log(src), opts.compileDebug && opts.filename && (src = src + `
926
+ //# sourceURL=` + sanitizedFilename + `
927
+ `);
1296
928
  try {
1297
- if (opts.async) {
929
+ if (opts.async)
1298
930
  try {
1299
931
  ctor = new Function("return (async function(){}).constructor;")();
1300
932
  } catch (e) {
1301
- if (e instanceof SyntaxError) {
1302
- throw new Error("This environment does not support async/await");
1303
- } else {
1304
- throw e;
1305
- }
933
+ throw e instanceof SyntaxError ? new Error("This environment does not support async/await") : e;
1306
934
  }
1307
- } else {
935
+ else
1308
936
  ctor = Function;
1309
- }
1310
937
  fn = new ctor(opts.localsName + ", escapeFn, include, rethrow", src);
1311
938
  } catch (e) {
1312
- if (e instanceof SyntaxError) {
1313
- if (opts.filename) {
1314
- e.message += " in " + opts.filename;
1315
- }
1316
- e.message += " while compiling ejs\n\n";
1317
- e.message += "If the above error is not helpful, you may want to try EJS-Lint:\n";
1318
- e.message += "https://github.com/RyanZim/EJS-Lint";
1319
- if (!opts.async) {
1320
- e.message += "\n";
1321
- e.message += "Or, if you meant to create an async function, pass `async: true` as an option.";
1322
- }
1323
- }
1324
- throw e;
939
+ throw e instanceof SyntaxError && (opts.filename && (e.message += " in " + opts.filename), e.message += ` while compiling ejs
940
+
941
+ `, e.message += `If the above error is not helpful, you may want to try EJS-Lint:
942
+ `, e.message += "https://github.com/RyanZim/EJS-Lint", opts.async || (e.message += `
943
+ `, e.message += "Or, if you meant to create an async function, pass `async: true` as an option.")), e;
1325
944
  }
1326
- var returnedFn = opts.client ? fn : /* @__PURE__ */ __name(function anonymous(data) {
1327
- var include = /* @__PURE__ */ __name(function(path2, includeData) {
945
+ var returnedFn = opts.client ? fn : function(data) {
946
+ var include = function(path2, includeData) {
1328
947
  var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
1329
- if (includeData) {
1330
- d = utils.shallowCopy(d, includeData);
1331
- }
1332
- return includeFile(path2, opts)(d);
1333
- }, "include");
948
+ return includeData && (d = utils.shallowCopy(d, includeData)), includeFile(path2, opts)(d);
949
+ };
1334
950
  return fn.apply(
1335
951
  opts.context,
1336
952
  [data || utils.createNullProtoObjWherePossible(), escapeFn, include, rethrow]
1337
953
  );
1338
- }, "anonymous");
1339
- if (opts.filename && typeof Object.defineProperty === "function") {
1340
- var filename = opts.filename;
1341
- var basename2 = path.basename(filename, path.extname(filename));
954
+ };
955
+ if (opts.filename && typeof Object.defineProperty == "function") {
956
+ var filename = opts.filename, basename2 = path.basename(filename, path.extname(filename));
1342
957
  try {
1343
958
  Object.defineProperty(returnedFn, "name", {
1344
959
  value: basename2,
1345
- writable: false,
1346
- enumerable: false,
1347
- configurable: true
960
+ writable: !1,
961
+ enumerable: !1,
962
+ configurable: !0
1348
963
  });
1349
- } catch (e) {
964
+ } catch {
1350
965
  }
1351
966
  }
1352
967
  return returnedFn;
1353
- }, "compile"),
1354
- generateSource: /* @__PURE__ */ __name(function() {
968
+ },
969
+ generateSource: function() {
1355
970
  var opts = this.opts;
1356
- if (opts.rmWhitespace) {
1357
- this.templateText = this.templateText.replace(/[\r\n]+/g, "\n").replace(/^\s+|\s+$/gm, "");
1358
- }
1359
- this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
1360
- var self = this;
1361
- var matches = this.parseTemplateText();
1362
- var d = this.opts.delimiter;
1363
- var o = this.opts.openDelimiter;
1364
- var c = this.opts.closeDelimiter;
1365
- if (matches && matches.length) {
1366
- matches.forEach(function(line, index) {
1367
- var closing;
1368
- if (line.indexOf(o + d) === 0 && line.indexOf(o + d + d) !== 0) {
1369
- closing = matches[index + 2];
1370
- if (!(closing == d + c || closing == "-" + d + c || closing == "_" + d + c)) {
1371
- throw new Error('Could not find matching close tag for "' + line + '".');
1372
- }
1373
- }
1374
- self.scanLine(line);
1375
- });
1376
- }
1377
- }, "generateSource"),
1378
- parseTemplateText: /* @__PURE__ */ __name(function() {
1379
- var str = this.templateText;
1380
- var pat = this.regex;
1381
- var result = pat.exec(str);
1382
- var arr = [];
1383
- var firstPos;
1384
- while (result) {
1385
- firstPos = result.index;
1386
- if (firstPos !== 0) {
1387
- arr.push(str.substring(0, firstPos));
1388
- str = str.slice(firstPos);
1389
- }
1390
- arr.push(result[0]);
1391
- str = str.slice(result[0].length);
1392
- result = pat.exec(str);
1393
- }
1394
- if (str) {
1395
- arr.push(str);
1396
- }
1397
- return arr;
1398
- }, "parseTemplateText"),
1399
- _addOutput: /* @__PURE__ */ __name(function(line) {
1400
- if (this.truncate) {
1401
- line = line.replace(/^(?:\r\n|\r|\n)/, "");
1402
- this.truncate = false;
1403
- }
1404
- if (!line) {
971
+ opts.rmWhitespace && (this.templateText = this.templateText.replace(/[\r\n]+/g, `
972
+ `).replace(/^\s+|\s+$/gm, "")), this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
973
+ var self = this, matches = this.parseTemplateText(), d = this.opts.delimiter, o = this.opts.openDelimiter, c = this.opts.closeDelimiter;
974
+ matches && matches.length && matches.forEach(function(line, index) {
975
+ var closing;
976
+ if (line.indexOf(o + d) === 0 && line.indexOf(o + d + d) !== 0 && (closing = matches[index + 2], !(closing == d + c || closing == "-" + d + c || closing == "_" + d + c)))
977
+ throw new Error('Could not find matching close tag for "' + line + '".');
978
+ self.scanLine(line);
979
+ });
980
+ },
981
+ parseTemplateText: function() {
982
+ for (var str = this.templateText, pat = this.regex, result = pat.exec(str), arr = [], firstPos; result; )
983
+ firstPos = result.index, firstPos !== 0 && (arr.push(str.substring(0, firstPos)), str = str.slice(firstPos)), arr.push(result[0]), str = str.slice(result[0].length), result = pat.exec(str);
984
+ return str && arr.push(str), arr;
985
+ },
986
+ _addOutput: function(line) {
987
+ if (this.truncate && (line = line.replace(/^(?:\r\n|\r|\n)/, ""), this.truncate = !1), !line)
1405
988
  return line;
1406
- }
1407
- line = line.replace(/\\/g, "\\\\");
1408
- line = line.replace(/\n/g, "\\n");
1409
- line = line.replace(/\r/g, "\\r");
1410
- line = line.replace(/"/g, '\\"');
1411
- this.source += ' ; __append("' + line + '")\n';
1412
- }, "_addOutput"),
1413
- scanLine: /* @__PURE__ */ __name(function(line) {
1414
- var self = this;
1415
- var d = this.opts.delimiter;
1416
- var o = this.opts.openDelimiter;
1417
- var c = this.opts.closeDelimiter;
1418
- var newLineCount = 0;
1419
- newLineCount = line.split("\n").length - 1;
1420
- switch (line) {
989
+ line = line.replace(/\\/g, "\\\\"), line = line.replace(/\n/g, "\\n"), line = line.replace(/\r/g, "\\r"), line = line.replace(/"/g, '\\"'), this.source += ' ; __append("' + line + `")
990
+ `;
991
+ },
992
+ scanLine: function(line) {
993
+ var self = this, d = this.opts.delimiter, o = this.opts.openDelimiter, c = this.opts.closeDelimiter, newLineCount = 0;
994
+ switch (newLineCount = line.split(`
995
+ `).length - 1, line) {
1421
996
  case o + d:
1422
997
  case o + d + "_":
1423
998
  this.mode = Template.modes.EVAL;
@@ -1432,21 +1007,17 @@ var require_ejs = __commonJS({
1432
1007
  this.mode = Template.modes.COMMENT;
1433
1008
  break;
1434
1009
  case o + d + d:
1435
- this.mode = Template.modes.LITERAL;
1436
- this.source += ' ; __append("' + line.replace(o + d + d, o + d) + '")\n';
1010
+ this.mode = Template.modes.LITERAL, this.source += ' ; __append("' + line.replace(o + d + d, o + d) + `")
1011
+ `;
1437
1012
  break;
1438
1013
  case d + d + c:
1439
- this.mode = Template.modes.LITERAL;
1440
- this.source += ' ; __append("' + line.replace(d + d + c, d + c) + '")\n';
1014
+ this.mode = Template.modes.LITERAL, this.source += ' ; __append("' + line.replace(d + d + c, d + c) + `")
1015
+ `;
1441
1016
  break;
1442
1017
  case d + c:
1443
1018
  case "-" + d + c:
1444
1019
  case "_" + d + c:
1445
- if (this.mode == Template.modes.LITERAL) {
1446
- this._addOutput(line);
1447
- }
1448
- this.mode = null;
1449
- this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
1020
+ this.mode == Template.modes.LITERAL && this._addOutput(line), this.mode = null, this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
1450
1021
  break;
1451
1022
  default:
1452
1023
  if (this.mode) {
@@ -1454,22 +1025,25 @@ var require_ejs = __commonJS({
1454
1025
  case Template.modes.EVAL:
1455
1026
  case Template.modes.ESCAPED:
1456
1027
  case Template.modes.RAW:
1457
- if (line.lastIndexOf("//") > line.lastIndexOf("\n")) {
1458
- line += "\n";
1459
- }
1028
+ line.lastIndexOf("//") > line.lastIndexOf(`
1029
+ `) && (line += `
1030
+ `);
1460
1031
  }
1461
1032
  switch (this.mode) {
1462
1033
  // Just executing code
1463
1034
  case Template.modes.EVAL:
1464
- this.source += " ; " + line + "\n";
1035
+ this.source += " ; " + line + `
1036
+ `;
1465
1037
  break;
1466
1038
  // Exec, esc, and output
1467
1039
  case Template.modes.ESCAPED:
1468
- this.source += " ; __append(escapeFn(" + stripSemi(line) + "))\n";
1040
+ this.source += " ; __append(escapeFn(" + stripSemi(line) + `))
1041
+ `;
1469
1042
  break;
1470
1043
  // Exec and output
1471
1044
  case Template.modes.RAW:
1472
- this.source += " ; __append(" + stripSemi(line) + ")\n";
1045
+ this.source += " ; __append(" + stripSemi(line) + `)
1046
+ `;
1473
1047
  break;
1474
1048
  case Template.modes.COMMENT:
1475
1049
  break;
@@ -1478,23 +1052,18 @@ var require_ejs = __commonJS({
1478
1052
  this._addOutput(line);
1479
1053
  break;
1480
1054
  }
1481
- } else {
1055
+ } else
1482
1056
  this._addOutput(line);
1483
- }
1484
1057
  }
1485
- if (self.opts.compileDebug && newLineCount) {
1486
- this.currentLine += newLineCount;
1487
- this.source += " ; __line = " + this.currentLine + "\n";
1488
- }
1489
- }, "scanLine")
1058
+ self.opts.compileDebug && newLineCount && (this.currentLine += newLineCount, this.source += " ; __line = " + this.currentLine + `
1059
+ `);
1060
+ }
1490
1061
  };
1491
1062
  exports.escapeXML = utils.escapeXML;
1492
1063
  exports.__express = exports.renderFile;
1493
1064
  exports.VERSION = _VERSION_STRING;
1494
1065
  exports.name = _NAME;
1495
- if (typeof window != "undefined") {
1496
- window.ejs = exports;
1497
- }
1066
+ typeof window < "u" && (window.ejs = exports);
1498
1067
  }
1499
1068
  });
1500
1069
 
@@ -1504,65 +1073,61 @@ import { stringifyProcessEnvs } from "storybook/internal/common";
1504
1073
  import { logger } from "storybook/internal/node-logger";
1505
1074
 
1506
1075
  // ../node_modules/@fal-works/esbuild-plugin-global-externals/lib/module-info.js
1507
- var normalizeModuleInfo = /* @__PURE__ */ __name((value) => {
1508
- const {
1076
+ var normalizeModuleInfo = (value) => {
1077
+ let {
1509
1078
  type = "esm",
1510
1079
  varName,
1511
1080
  namedExports = null,
1512
- defaultExport = true
1513
- } = typeof value === "string" ? { varName: value } : value;
1081
+ defaultExport = !0
1082
+ } = typeof value == "string" ? { varName: value } : value;
1514
1083
  return { type, varName, namedExports, defaultExport };
1515
- }, "normalizeModuleInfo");
1084
+ };
1516
1085
 
1517
1086
  // ../node_modules/@fal-works/esbuild-plugin-global-externals/lib/on-load.js
1518
- var createCjsContents = /* @__PURE__ */ __name((variableName) => `module.exports = ${variableName};`, "createCjsContents");
1519
- var createEsmContents = /* @__PURE__ */ __name((variableName, namedExports, defaultExport) => {
1520
- const codeElements = defaultExport ? [`export default ${variableName};`] : [];
1087
+ var createCjsContents = (variableName) => `module.exports = ${variableName};`;
1088
+ var createEsmContents = (variableName, namedExports, defaultExport) => {
1089
+ let codeElements = defaultExport ? [`export default ${variableName};`] : [];
1521
1090
  if (namedExports && namedExports.length) {
1522
- const exportNames = [...new Set(namedExports)].join(", ");
1523
- codeElements.push(`const { ${exportNames} } = ${variableName};`);
1524
- codeElements.push(`export { ${exportNames} };`);
1091
+ let exportNames = [...new Set(namedExports)].join(", ");
1092
+ codeElements.push(`const { ${exportNames} } = ${variableName};`), codeElements.push(`export { ${exportNames} };`);
1525
1093
  }
1526
- return codeElements.join("\n");
1527
- }, "createEsmContents");
1528
- var createContents = /* @__PURE__ */ __name((moduleInfo) => {
1529
- const { type, varName, namedExports, defaultExport } = moduleInfo;
1094
+ return codeElements.join(`
1095
+ `);
1096
+ }, createContents = (moduleInfo) => {
1097
+ let { type, varName, namedExports, defaultExport } = moduleInfo;
1530
1098
  switch (type) {
1531
1099
  case "esm":
1532
1100
  return createEsmContents(varName, namedExports, defaultExport);
1533
1101
  case "cjs":
1534
1102
  return createCjsContents(varName);
1535
1103
  }
1536
- }, "createContents");
1104
+ };
1537
1105
 
1538
1106
  // ../node_modules/@fal-works/esbuild-plugin-global-externals/lib/with-reg-exp.js
1539
- var PLUGIN_NAME = "global-externals";
1540
- var globalExternalsWithRegExp = /* @__PURE__ */ __name((globals) => {
1541
- const { modulePathFilter, getModuleInfo } = globals;
1107
+ var PLUGIN_NAME = "global-externals", globalExternalsWithRegExp = (globals) => {
1108
+ let { modulePathFilter, getModuleInfo } = globals;
1542
1109
  return {
1543
1110
  name: PLUGIN_NAME,
1544
1111
  setup(build2) {
1545
1112
  build2.onResolve({ filter: modulePathFilter }, (args) => ({
1546
1113
  path: args.path,
1547
1114
  namespace: PLUGIN_NAME
1548
- }));
1549
- build2.onLoad({ filter: /.*/, namespace: PLUGIN_NAME }, (args) => {
1550
- const modulePath = args.path;
1551
- const moduleInfo = normalizeModuleInfo(getModuleInfo(modulePath));
1115
+ })), build2.onLoad({ filter: /.*/, namespace: PLUGIN_NAME }, (args) => {
1116
+ let modulePath = args.path, moduleInfo = normalizeModuleInfo(getModuleInfo(modulePath));
1552
1117
  return { contents: createContents(moduleInfo) };
1553
1118
  });
1554
1119
  }
1555
1120
  };
1556
- }, "globalExternalsWithRegExp");
1121
+ };
1557
1122
 
1558
1123
  // ../node_modules/@fal-works/esbuild-plugin-global-externals/lib/with-object.js
1559
- var globalExternals = /* @__PURE__ */ __name((globals) => {
1560
- const normalizedGlobals = {
1124
+ var globalExternals = (globals) => {
1125
+ let normalizedGlobals = {
1561
1126
  modulePathFilter: new RegExp(`^(?:${Object.keys(globals).join("|")})$`),
1562
- getModuleInfo: /* @__PURE__ */ __name((modulePath) => globals[modulePath], "getModuleInfo")
1127
+ getModuleInfo: (modulePath) => globals[modulePath]
1563
1128
  };
1564
1129
  return globalExternalsWithRegExp(normalizedGlobals);
1565
- }, "globalExternals");
1130
+ };
1566
1131
 
1567
1132
  // src/builder-manager/index.ts
1568
1133
  var import_esbuild_plugin_pnp = __toESM(require_lib(), 1);
@@ -2236,8 +1801,7 @@ var globalsNameReferenceMap = {
2236
1801
  "storybook/internal/manager-errors": "__STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__",
2237
1802
  "storybook/internal/router": "__STORYBOOK_ROUTER__",
2238
1803
  "storybook/internal/types": "__STORYBOOK_TYPES__"
2239
- };
2240
- var globalPackages = Object.keys(globalsNameReferenceMap);
1804
+ }, globalPackages = Object.keys(globalsNameReferenceMap);
2241
1805
 
2242
1806
  // src/manager/globals/globals-module-info.ts
2243
1807
  var duplicatedKeys = [
@@ -2248,25 +1812,18 @@ var duplicatedKeys = [
2248
1812
  "storybook/actions",
2249
1813
  "storybook/highlight",
2250
1814
  "storybook/viewport"
2251
- ];
2252
- var globalsModuleInfoMap = globalPackages.reduce(
2253
- (acc, key) => {
2254
- acc[key] = {
2255
- type: "esm",
2256
- varName: globalsNameReferenceMap[key],
2257
- namedExports: exports_default[key],
2258
- defaultExport: true
2259
- };
2260
- if (duplicatedKeys.includes(key)) {
2261
- acc[key.replace("storybook", "storybook/internal")] = {
2262
- type: "esm",
2263
- varName: globalsNameReferenceMap[key],
2264
- namedExports: exports_default[key],
2265
- defaultExport: true
2266
- };
2267
- }
2268
- return acc;
2269
- },
1815
+ ], globalsModuleInfoMap = globalPackages.reduce(
1816
+ (acc, key) => (acc[key] = {
1817
+ type: "esm",
1818
+ varName: globalsNameReferenceMap[key],
1819
+ namedExports: exports_default[key],
1820
+ defaultExport: !0
1821
+ }, duplicatedKeys.includes(key) && (acc[key.replace("storybook", "storybook/internal")] = {
1822
+ type: "esm",
1823
+ varName: globalsNameReferenceMap[key],
1824
+ namedExports: exports_default[key],
1825
+ defaultExport: !0
1826
+ }), acc),
2270
1827
  {}
2271
1828
  );
2272
1829
 
@@ -2277,17 +1834,12 @@ import { getRefs } from "storybook/internal/common";
2277
1834
  // src/builder-manager/utils/template.ts
2278
1835
  var import_ejs = __toESM(require_ejs(), 1);
2279
1836
  import { readFile } from "node:fs/promises";
2280
- var getTemplatePath = /* @__PURE__ */ __name((template) => {
2281
- return join(resolvePackageDir("storybook"), "assets/server", template);
2282
- }, "getTemplatePath");
2283
- var readTemplate = /* @__PURE__ */ __name(async (template) => {
2284
- const path = getTemplatePath(template);
1837
+ var getTemplatePath = (template) => join(resolvePackageDir("storybook"), "assets/server", template), readTemplate = async (template) => {
1838
+ let path = getTemplatePath(template);
2285
1839
  return readFile(path, { encoding: "utf8" });
2286
- }, "readTemplate");
2287
- var renderHTML = /* @__PURE__ */ __name(async (template, title, favicon, customHead, cssFiles, jsFiles, features, refs, logLevel, docsOptions, tagsOptions, { versionCheck, previewUrl, configType, ignorePreview }, globals) => {
2288
- const titleRef = await title;
2289
- const templateRef = await template;
2290
- const stringifiedGlobals = Object.entries(globals).reduce(
1840
+ };
1841
+ var renderHTML = async (template, title, favicon, customHead, cssFiles, jsFiles, features, refs, logLevel, docsOptions, tagsOptions, { versionCheck, previewUrl, configType, ignorePreview }, globals) => {
1842
+ let titleRef = await title, templateRef = await template, stringifiedGlobals = Object.entries(globals).reduce(
2291
1843
  (transformed, [key, value]) => ({ ...transformed, [key]: JSON.stringify(value) }),
2292
1844
  {}
2293
1845
  );
@@ -2311,20 +1863,11 @@ var renderHTML = /* @__PURE__ */ __name(async (template, title, favicon, customH
2311
1863
  head: await customHead || "",
2312
1864
  ignorePreview
2313
1865
  });
2314
- }, "renderHTML");
1866
+ };
2315
1867
 
2316
1868
  // src/builder-manager/utils/data.ts
2317
- var getData = /* @__PURE__ */ __name(async (options) => {
2318
- const refs = getRefs(options);
2319
- const favicon = options.presets.apply("favicon").then((p) => basename(p));
2320
- const features = options.presets.apply("features");
2321
- const logLevel = options.presets.apply("logLevel");
2322
- const title = options.presets.apply("title");
2323
- const docsOptions = options.presets.apply("docs", {});
2324
- const tagsOptions = options.presets.apply("tags", {});
2325
- const template = readTemplate("template.ejs");
2326
- const customHead = options.presets.apply("managerHead");
2327
- const [instance, config] = await Promise.all([
1869
+ var getData = async (options) => {
1870
+ let refs = getRefs(options), favicon = options.presets.apply("favicon").then((p) => basename(p)), features = options.presets.apply("features"), logLevel = options.presets.apply("logLevel"), title = options.presets.apply("title"), docsOptions = options.presets.apply("docs", {}), tagsOptions = options.presets.apply("tags", {}), template = readTemplate("template.ejs"), customHead = options.presets.apply("managerHead"), [instance, config] = await Promise.all([
2328
1871
  //
2329
1872
  executor.get(),
2330
1873
  getConfig(options)
@@ -2342,36 +1885,29 @@ var getData = /* @__PURE__ */ __name(async (options) => {
2342
1885
  favicon,
2343
1886
  tagsOptions
2344
1887
  };
2345
- }, "getData");
1888
+ };
2346
1889
 
2347
1890
  // src/builder-manager/utils/files.ts
2348
1891
  import { existsSync } from "node:fs";
2349
1892
  import { mkdir, writeFile } from "node:fs/promises";
2350
1893
  import { dirname, join as join2, normalize, relative } from "node:path";
2351
1894
  async function readOrderedFiles(addonsDir, outputFiles) {
2352
- const files = await Promise.all(
1895
+ let files = await Promise.all(
2353
1896
  outputFiles?.map(async (file) => {
2354
- const { location, url } = sanitizePath(file, addonsDir);
1897
+ let { location, url } = sanitizePath(file, addonsDir);
2355
1898
  if (!existsSync(location)) {
2356
- const directory = dirname(location);
2357
- await mkdir(directory, { recursive: true });
1899
+ let directory = dirname(location);
1900
+ await mkdir(directory, { recursive: !0 });
2358
1901
  }
2359
- await writeFile(location, file.contents);
2360
- return url;
1902
+ return await writeFile(location, file.contents), url;
2361
1903
  }) || []
2362
- );
2363
- const jsFiles = files.filter((file) => file.endsWith(".js"));
2364
- const cssFiles = files.filter((file) => file.endsWith(".css"));
2365
- return { cssFiles, jsFiles };
1904
+ ), jsFiles = files.filter((file) => file.endsWith(".js"));
1905
+ return { cssFiles: files.filter((file) => file.endsWith(".css")), jsFiles };
2366
1906
  }
2367
- __name(readOrderedFiles, "readOrderedFiles");
2368
1907
  function sanitizePath(file, addonsDir) {
2369
- const filePath = relative(addonsDir, file.path);
2370
- const location = normalize(join2(addonsDir, filePath));
2371
- const url = `./sb-addons/${slash(filePath).split("/").map(encodeURIComponent).join("/")}`;
1908
+ let filePath = relative(addonsDir, file.path), location = normalize(join2(addonsDir, filePath)), url = `./sb-addons/${slash(filePath).split("/").map(encodeURIComponent).join("/")}`;
2372
1909
  return { location, url };
2373
1910
  }
2374
- __name(sanitizePath, "sanitizePath");
2375
1911
 
2376
1912
  // src/builder-manager/utils/framework.ts
2377
1913
  import { sep } from "node:path";
@@ -2379,99 +1915,66 @@ import {
2379
1915
  extractProperRendererNameFromFramework,
2380
1916
  getFrameworkName
2381
1917
  } from "storybook/internal/common";
2382
- var pluckNameFromConfigProperty = /* @__PURE__ */ __name((property) => {
2383
- if (!property) {
2384
- return void 0;
2385
- }
2386
- return typeof property === "string" ? property : property.name;
2387
- }, "pluckNameFromConfigProperty");
2388
- var normalizePath = /* @__PURE__ */ __name((packagePath) => packagePath.replaceAll(sep, "/"), "normalizePath");
2389
- var pluckStorybookPackageFromPath = /* @__PURE__ */ __name((packagePath) => normalizePath(packagePath).match(/(@storybook\/.*)$/)?.[1], "pluckStorybookPackageFromPath");
2390
- var pluckThirdPartyPackageFromPath = /* @__PURE__ */ __name((packagePath) => normalizePath(packagePath).split("node_modules/")[1] ?? packagePath, "pluckThirdPartyPackageFromPath");
2391
- var buildFrameworkGlobalsFromOptions = /* @__PURE__ */ __name(async (options) => {
2392
- const globals = {};
2393
- const { builder: builder2 } = await options.presets.apply("core");
2394
- const frameworkName = await getFrameworkName(options);
2395
- const rendererName = await extractProperRendererNameFromFramework(frameworkName);
2396
- if (rendererName) {
2397
- globals.STORYBOOK_RENDERER = await extractProperRendererNameFromFramework(frameworkName) ?? void 0;
2398
- }
2399
- const resolvedPreviewBuilder = pluckNameFromConfigProperty(builder2);
2400
- if (resolvedPreviewBuilder) {
2401
- globals.STORYBOOK_BUILDER = pluckStorybookPackageFromPath(resolvedPreviewBuilder) ?? pluckThirdPartyPackageFromPath(resolvedPreviewBuilder);
2402
- }
2403
- const framework = pluckNameFromConfigProperty(await options.presets.apply("framework"));
2404
- if (framework) {
2405
- globals.STORYBOOK_FRAMEWORK = framework;
2406
- }
2407
- if (options.networkAddress) {
2408
- globals.STORYBOOK_NETWORK_ADDRESS = options.networkAddress;
2409
- }
2410
- return globals;
2411
- }, "buildFrameworkGlobalsFromOptions");
1918
+ var pluckNameFromConfigProperty = (property) => {
1919
+ if (property)
1920
+ return typeof property == "string" ? property : property.name;
1921
+ }, normalizePath = (packagePath) => packagePath.replaceAll(sep, "/"), pluckStorybookPackageFromPath = (packagePath) => normalizePath(packagePath).match(/(@storybook\/.*)$/)?.[1], pluckThirdPartyPackageFromPath = (packagePath) => normalizePath(packagePath).split("node_modules/")[1] ?? packagePath, buildFrameworkGlobalsFromOptions = async (options) => {
1922
+ let globals = {}, { builder: builder2 } = await options.presets.apply("core"), frameworkName = await getFrameworkName(options);
1923
+ await extractProperRendererNameFromFramework(frameworkName) && (globals.STORYBOOK_RENDERER = await extractProperRendererNameFromFramework(frameworkName) ?? void 0);
1924
+ let resolvedPreviewBuilder = pluckNameFromConfigProperty(builder2);
1925
+ resolvedPreviewBuilder && (globals.STORYBOOK_BUILDER = pluckStorybookPackageFromPath(resolvedPreviewBuilder) ?? pluckThirdPartyPackageFromPath(resolvedPreviewBuilder));
1926
+ let framework = pluckNameFromConfigProperty(await options.presets.apply("framework"));
1927
+ return framework && (globals.STORYBOOK_FRAMEWORK = framework), options.networkAddress && (globals.STORYBOOK_NETWORK_ADDRESS = options.networkAddress), globals;
1928
+ };
2412
1929
 
2413
1930
  // src/builder-manager/utils/managerEntries.ts
2414
1931
  import { existsSync as existsSync2 } from "node:fs";
2415
1932
  import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
2416
1933
  import { dirname as dirname2, join as join3, parse as parse2, relative as relative2, sep as sep2 } from "node:path";
2417
1934
  import { resolvePathInStorybookCache } from "storybook/internal/common";
2418
- var sanitizeBase = /* @__PURE__ */ __name((path) => {
2419
- return path.replaceAll(".", "").replaceAll("@", "").replaceAll(sep2, "-").replaceAll("/", "-").replaceAll(new RegExp(/^(-)+/g), "");
2420
- }, "sanitizeBase");
2421
- var sanitizeFinal = /* @__PURE__ */ __name((path) => {
2422
- const sections = path.split(/-?node_modules-?/);
1935
+ var sanitizeBase = (path) => path.replaceAll(".", "").replaceAll("@", "").replaceAll(sep2, "-").replaceAll("/", "-").replaceAll(new RegExp(/^(-)+/g), ""), sanitizeFinal = (path) => {
1936
+ let sections = path.split(/-?node_modules-?/);
2423
1937
  return sections[sections.length - 1].replaceAll("storybook-addon-", "").replaceAll("dist-", "");
2424
- }, "sanitizeFinal");
1938
+ };
2425
1939
  async function wrapManagerEntries(entrypoints, uniqueId) {
2426
1940
  return Promise.all(
2427
1941
  entrypoints.map(async (entry, i) => {
2428
- const { name, dir } = parse2(entry);
2429
- const cacheLocation = resolvePathInStorybookCache("sb-manager", uniqueId);
2430
- if (!cacheLocation) {
1942
+ let { name, dir } = parse2(entry), cacheLocation = resolvePathInStorybookCache("sb-manager", uniqueId);
1943
+ if (!cacheLocation)
2431
1944
  throw new Error("Could not create/find cache directory");
2432
- }
2433
- const base = relative2(process.cwd(), dir);
2434
- const location = join3(
1945
+ let base = relative2(process.cwd(), dir), location = join3(
2435
1946
  cacheLocation,
2436
1947
  sanitizeFinal(join3(`${sanitizeBase(base)}-${i}`, `${sanitizeBase(name)}-bundle.js`))
2437
1948
  );
2438
1949
  if (!existsSync2(location)) {
2439
- const directory = dirname2(location);
2440
- await mkdir2(directory, { recursive: true });
1950
+ let directory = dirname2(location);
1951
+ await mkdir2(directory, { recursive: !0 });
2441
1952
  }
2442
- await writeFile2(location, `import '${slash(entry).replaceAll(/'/g, "\\'")}';`);
2443
- return location;
1953
+ return await writeFile2(location, `import '${slash(entry).replaceAll(/'/g, "\\'")}';`), location;
2444
1954
  })
2445
1955
  );
2446
1956
  }
2447
- __name(wrapManagerEntries, "wrapManagerEntries");
2448
1957
 
2449
1958
  // src/builder-manager/index.ts
2450
- var CORE_DIR_ORIGIN = join(resolvePackageDir("storybook"), "dist/manager");
2451
- var isRootPath = /^\/($|\?)/;
2452
- var compilation;
2453
- var asyncIterator;
2454
- var getConfig = /* @__PURE__ */ __name(async (options) => {
2455
- const [managerEntriesFromPresets, envs] = await Promise.all([
1959
+ var CORE_DIR_ORIGIN = join(resolvePackageDir("storybook"), "dist/manager"), isRootPath = /^\/($|\?)/, compilation, asyncIterator, getConfig = async (options) => {
1960
+ let [managerEntriesFromPresets, envs] = await Promise.all([
2456
1961
  options.presets.apply("managerEntries", []),
2457
1962
  options.presets.apply("env")
2458
- ]);
2459
- const tsconfigPath = getTemplatePath("addon.tsconfig.json");
2460
- let configDirManagerEntry;
1963
+ ]), tsconfigPath = getTemplatePath("addon.tsconfig.json"), configDirManagerEntry;
2461
1964
  try {
2462
1965
  configDirManagerEntry = resolveModulePath("./manager", {
2463
1966
  from: options.configDir,
2464
1967
  extensions: [".js", ".mjs", ".jsx", ".ts", ".mts", ".tsx"]
2465
1968
  });
2466
- } catch (e) {
1969
+ } catch {
2467
1970
  }
2468
- const entryPoints = configDirManagerEntry ? [...managerEntriesFromPresets, configDirManagerEntry] : managerEntriesFromPresets;
1971
+ let entryPoints = configDirManagerEntry ? [...managerEntriesFromPresets, configDirManagerEntry] : managerEntriesFromPresets;
2469
1972
  return {
2470
1973
  entryPoints: await wrapManagerEntries(entryPoints, options.cacheKey),
2471
1974
  outdir: join(options.outputDir || "./", "sb-addons"),
2472
1975
  format: "iife",
2473
- write: false,
2474
- ignoreAnnotations: true,
1976
+ write: !1,
1977
+ ignoreAnnotations: !0,
2475
1978
  resolveExtensions: [".ts", ".tsx", ".mjs", ".js", ".jsx"],
2476
1979
  outExtension: { ".js": ".js" },
2477
1980
  loader: {
@@ -2495,15 +1998,15 @@ var getConfig = /* @__PURE__ */ __name(async (options) => {
2495
1998
  target: BROWSER_TARGETS,
2496
1999
  supported: SUPPORTED_FEATURES,
2497
2000
  platform: "browser",
2498
- bundle: true,
2499
- minify: false,
2500
- minifyWhitespace: false,
2501
- minifyIdentifiers: false,
2502
- minifySyntax: true,
2503
- metafile: false,
2001
+ bundle: !0,
2002
+ minify: !1,
2003
+ minifyWhitespace: !1,
2004
+ minifyIdentifiers: !1,
2005
+ minifySyntax: !0,
2006
+ metafile: !1,
2504
2007
  // turn this on to assist with debugging the bundling of managerEntries
2505
2008
  // treeShaking: true,
2506
- sourcemap: false,
2009
+ sourcemap: !1,
2507
2010
  conditions: ["browser", "module", "default"],
2508
2011
  jsxFactory: "React.createElement",
2509
2012
  jsxFragment: "React.Fragment",
@@ -2525,22 +2028,18 @@ var getConfig = /* @__PURE__ */ __name(async (options) => {
2525
2028
  module: "{}"
2526
2029
  }
2527
2030
  };
2528
- }, "getConfig");
2529
- var executor = {
2530
- get: /* @__PURE__ */ __name(async () => {
2531
- const { build: build2 } = await import("esbuild");
2031
+ }, executor = {
2032
+ get: async () => {
2033
+ let { build: build2 } = await import("esbuild");
2532
2034
  return build2;
2533
- }, "get")
2534
- };
2535
- var starter = /* @__PURE__ */ __name(async function* starterGeneratorFn({
2035
+ }
2036
+ }, starter = async function* ({
2536
2037
  startTime,
2537
2038
  options,
2538
2039
  router
2539
2040
  }) {
2540
- if (!options.quiet) {
2541
- logger.info("=> Starting manager..");
2542
- }
2543
- const {
2041
+ options.quiet || logger.info("=> Starting manager..");
2042
+ let {
2544
2043
  config,
2545
2044
  favicon,
2546
2045
  customHead,
@@ -2554,39 +2053,32 @@ var starter = /* @__PURE__ */ __name(async function* starterGeneratorFn({
2554
2053
  tagsOptions
2555
2054
  } = await getData(options);
2556
2055
  yield;
2557
- const addonsDir = config.outdir;
2558
- await rm(addonsDir, { recursive: true, force: true });
2559
- yield;
2560
- compilation = await instance({
2056
+ let addonsDir = config.outdir;
2057
+ await rm(addonsDir, { recursive: !0, force: !0 }), yield, compilation = await instance({
2561
2058
  ...config
2562
- });
2563
- yield;
2564
- router.use(
2059
+ }), yield, router.use(
2565
2060
  "/sb-addons",
2566
2061
  (0, import_sirv.default)(addonsDir, {
2567
2062
  maxAge: 3e5,
2568
- dev: true,
2569
- immutable: true
2063
+ dev: !0,
2064
+ immutable: !0
2570
2065
  })
2571
- );
2572
- router.use(
2066
+ ), router.use(
2573
2067
  "/sb-manager",
2574
2068
  (0, import_sirv.default)(CORE_DIR_ORIGIN, {
2575
2069
  maxAge: 3e5,
2576
- dev: true,
2577
- immutable: true
2070
+ dev: !0,
2071
+ immutable: !0
2578
2072
  })
2579
2073
  );
2580
- const { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles);
2581
- if (compilation.metafile && options.outputDir) {
2582
- await writeFile3(
2583
- join(options.outputDir, "metafile.json"),
2584
- JSON.stringify(compilation.metafile, null, 2)
2585
- );
2586
- }
2587
- const globals = await buildFrameworkGlobalsFromOptions(options);
2074
+ let { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles);
2075
+ compilation.metafile && options.outputDir && await writeFile3(
2076
+ join(options.outputDir, "metafile.json"),
2077
+ JSON.stringify(compilation.metafile, null, 2)
2078
+ );
2079
+ let globals = await buildFrameworkGlobalsFromOptions(options);
2588
2080
  yield;
2589
- const html = await renderHTML(
2081
+ let html = await renderHTML(
2590
2082
  template,
2591
2083
  title,
2592
2084
  favicon,
@@ -2601,37 +2093,22 @@ var starter = /* @__PURE__ */ __name(async function* starterGeneratorFn({
2601
2093
  options,
2602
2094
  globals
2603
2095
  );
2604
- yield;
2605
- router.use("/", ({ url }, res, next) => {
2606
- if (url && isRootPath.test(url)) {
2607
- res.statusCode = 200;
2608
- res.setHeader("Content-Type", "text/html");
2609
- res.write(html);
2610
- res.end();
2611
- } else {
2612
- next();
2613
- }
2614
- });
2615
- router.use(`/index.html`, (req, res) => {
2616
- res.statusCode = 200;
2617
- res.setHeader("Content-Type", "text/html");
2618
- res.write(html);
2619
- res.end();
2620
- });
2621
- return {
2096
+ return yield, router.use("/", ({ url }, res, next) => {
2097
+ url && isRootPath.test(url) ? (res.statusCode = 200, res.setHeader("Content-Type", "text/html"), res.write(html), res.end()) : next();
2098
+ }), router.use("/index.html", (req, res) => {
2099
+ res.statusCode = 200, res.setHeader("Content-Type", "text/html"), res.write(html), res.end();
2100
+ }), {
2622
2101
  bail,
2623
2102
  stats: {
2624
- toJson: /* @__PURE__ */ __name(() => ({}), "toJson")
2103
+ toJson: () => ({})
2625
2104
  },
2626
2105
  totalTime: process.hrtime(startTime)
2627
2106
  };
2628
- }, "starterGeneratorFn");
2629
- var builder = /* @__PURE__ */ __name(async function* builderGeneratorFn({ startTime, options }) {
2630
- if (!options.outputDir) {
2107
+ }, builder = async function* ({ startTime, options }) {
2108
+ if (!options.outputDir)
2631
2109
  throw new Error("outputDir is required");
2632
- }
2633
2110
  logger.info("=> Building manager..");
2634
- const {
2111
+ let {
2635
2112
  config,
2636
2113
  customHead,
2637
2114
  favicon,
@@ -2645,27 +2122,20 @@ var builder = /* @__PURE__ */ __name(async function* builderGeneratorFn({ startT
2645
2122
  tagsOptions
2646
2123
  } = await getData(options);
2647
2124
  yield;
2648
- const addonsDir = config.outdir;
2649
- const coreDirTarget = join(options.outputDir, `sb-manager`);
2125
+ let addonsDir = config.outdir, coreDirTarget = join(options.outputDir, "sb-manager");
2650
2126
  compilation = await instance({
2651
2127
  ...config,
2652
- minify: true
2653
- });
2654
- yield;
2655
- const managerFiles = cp(CORE_DIR_ORIGIN, coreDirTarget, {
2656
- filter: /* @__PURE__ */ __name((src) => {
2657
- const { ext } = parse(src);
2658
- if (ext) {
2659
- return ext === ".js";
2660
- }
2661
- return true;
2662
- }, "filter"),
2663
- recursive: true
2664
- });
2665
- const { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles);
2666
- const globals = await buildFrameworkGlobalsFromOptions(options);
2128
+ minify: !0
2129
+ }), yield;
2130
+ let managerFiles = cp(CORE_DIR_ORIGIN, coreDirTarget, {
2131
+ filter: (src) => {
2132
+ let { ext } = parse(src);
2133
+ return ext ? ext === ".js" : !0;
2134
+ },
2135
+ recursive: !0
2136
+ }), { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles), globals = await buildFrameworkGlobalsFromOptions(options);
2667
2137
  yield;
2668
- const html = await renderHTML(
2138
+ let html = await renderHTML(
2669
2139
  template,
2670
2140
  title,
2671
2141
  favicon,
@@ -2680,38 +2150,30 @@ var builder = /* @__PURE__ */ __name(async function* builderGeneratorFn({ startT
2680
2150
  options,
2681
2151
  globals
2682
2152
  );
2683
- await Promise.all([writeFile3(join(options.outputDir, "index.html"), html), managerFiles]);
2684
- logger.trace({ message: "=> Manager built", time: process.hrtime(startTime) });
2685
- return {
2686
- toJson: /* @__PURE__ */ __name(() => ({}), "toJson")
2153
+ return await Promise.all([writeFile3(join(options.outputDir, "index.html"), html), managerFiles]), logger.trace({ message: "=> Manager built", time: process.hrtime(startTime) }), {
2154
+ toJson: () => ({})
2687
2155
  };
2688
- }, "builderGeneratorFn");
2689
- var bail = /* @__PURE__ */ __name(async () => {
2690
- if (asyncIterator) {
2156
+ }, bail = async () => {
2157
+ if (asyncIterator)
2691
2158
  try {
2692
2159
  await asyncIterator.throw(new Error());
2693
- } catch (e) {
2160
+ } catch {
2694
2161
  }
2695
- }
2696
- }, "bail");
2697
- var start = /* @__PURE__ */ __name(async (options) => {
2162
+ }, start = async (options) => {
2698
2163
  asyncIterator = starter(options);
2699
2164
  let result;
2700
- do {
2165
+ do
2701
2166
  result = await asyncIterator.next();
2702
- } while (!result.done);
2167
+ while (!result.done);
2703
2168
  return result.value;
2704
- }, "start");
2705
- var build = /* @__PURE__ */ __name(async (options) => {
2169
+ }, build = async (options) => {
2706
2170
  asyncIterator = builder(options);
2707
2171
  let result;
2708
- do {
2172
+ do
2709
2173
  result = await asyncIterator.next();
2710
- } while (!result.done);
2174
+ while (!result.done);
2711
2175
  return result.value;
2712
- }, "build");
2713
- var corePresets = [];
2714
- var overridePresets = [];
2176
+ }, corePresets = [], overridePresets = [];
2715
2177
  export {
2716
2178
  BROWSER_TARGETS,
2717
2179
  NODE_TARGET,