@qwik.dev/core 2.0.0-alpha.0 → 2.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/bindings/qwik.darwin-arm64.node +0 -0
  2. package/bindings/qwik.darwin-x64.node +0 -0
  3. package/bindings/qwik.linux-x64-gnu.node +0 -0
  4. package/bindings/qwik.wasm.cjs +259 -272
  5. package/bindings/qwik.wasm.mjs +259 -272
  6. package/bindings/qwik.win32-x64-msvc.node +0 -0
  7. package/bindings/qwik_wasm_bg.wasm +0 -0
  8. package/dist/build/index.cjs +3 -3
  9. package/dist/build/index.d.ts +22 -22
  10. package/dist/build/package.json +1 -1
  11. package/dist/cli.cjs +1453 -798
  12. package/dist/core-internal.d.ts +4368 -3895
  13. package/dist/core.cjs +6792 -6121
  14. package/dist/core.cjs.map +1 -1
  15. package/dist/core.min.mjs +1 -1
  16. package/dist/core.mjs +6765 -6117
  17. package/dist/core.mjs.map +1 -1
  18. package/dist/core.prod.cjs +3571 -3206
  19. package/dist/core.prod.mjs +3919 -3586
  20. package/dist/insights/index.qwik.cjs +1 -751
  21. package/dist/insights/index.qwik.mjs +62 -741
  22. package/dist/insights/vite/index.cjs +1 -82
  23. package/dist/insights/vite/index.mjs +65 -37
  24. package/dist/insights/vite.d.ts +22 -0
  25. package/dist/{insights/insights.d.ts → insights.d.ts} +33 -22
  26. package/dist/loader/index.cjs +2 -2
  27. package/dist/loader/index.mjs +2 -2
  28. package/dist/loader/package.json +1 -1
  29. package/dist/optimizer.cjs +693 -5851
  30. package/dist/optimizer.d.ts +741 -707
  31. package/dist/optimizer.mjs +679 -6276
  32. package/dist/preloader.cjs +243 -0
  33. package/dist/preloader.mjs +183 -0
  34. package/dist/qwikloader.debug.js +211 -220
  35. package/dist/qwikloader.js +1 -3
  36. package/dist/server.cjs +1371 -7273
  37. package/dist/server.d.ts +467 -402
  38. package/dist/server.mjs +1339 -7224
  39. package/dist/starters/adapters/aws-lambda/serverless.yml +15 -0
  40. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +0 -2
  41. package/dist/starters/adapters/azure-swa/public/staticwebapp.config.json +7 -0
  42. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +1 -2
  43. package/dist/starters/adapters/bun/src/entry.bun.ts +3 -2
  44. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +1 -3
  45. package/dist/starters/adapters/cloudflare-pages/public/_headers +2 -0
  46. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +1 -2
  47. package/dist/starters/adapters/deno/src/entry.deno.ts +3 -2
  48. package/dist/starters/adapters/express/src/entry.express.tsx +5 -2
  49. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +2 -1
  50. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +11 -1
  51. package/dist/starters/adapters/firebase/firebase.json +12 -1
  52. package/dist/starters/adapters/firebase/functions/index.js +2 -3
  53. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +1 -2
  54. package/dist/starters/adapters/netlify-edge/public/_headers +2 -0
  55. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +1 -2
  56. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +3 -2
  57. package/dist/starters/adapters/static/README.md +4 -0
  58. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +1 -2
  59. package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
  60. package/dist/starters/features/auth/package.json +3 -1
  61. package/dist/starters/features/bootstrap/src/routes/bootstrap/layout.tsx +0 -11
  62. package/dist/starters/features/cypress/package.json +1 -1
  63. package/dist/starters/features/drizzle/drizzle/schema.ts +6 -18
  64. package/dist/starters/features/drizzle/drizzle.config.ts +5 -4
  65. package/dist/starters/features/drizzle/package.json +16 -12
  66. package/dist/starters/features/localize/src/entry.ssr.tsx +0 -2
  67. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +1 -1
  68. package/dist/starters/features/pandacss/package.json +1 -1
  69. package/dist/starters/features/partytown/package.json +1 -1
  70. package/dist/starters/features/postcss/package.json +4 -1
  71. package/dist/starters/features/postcss/postcss.config.js +1 -1
  72. package/dist/starters/features/prisma/package.json +3 -2
  73. package/dist/starters/features/react/package.json +1 -1
  74. package/dist/starters/features/service-worker/package.json +13 -0
  75. package/dist/starters/features/service-worker/src/routes/service-worker.ts +14 -0
  76. package/dist/starters/features/storybook/package.json +1 -1
  77. package/dist/starters/features/styled-vanilla-extract/package.json +4 -2
  78. package/dist/starters/features/tailwind/package.json +19 -9
  79. package/dist/starters/features/tailwind/src/global.css +1 -7
  80. package/dist/starters/features/tailwind-v3/package.json +21 -0
  81. package/dist/starters/features/{tailwind → tailwind-v3}/postcss.config.cjs +1 -1
  82. package/dist/starters/features/tailwind-v3/src/global.css +7 -0
  83. package/dist/starters/features/{tailwind → tailwind-v3}/tailwind.config.js +1 -1
  84. package/dist/starters/features/turso/package.json +5 -2
  85. package/dist/starters/features/turso/src/utils/turso.ts +1 -1
  86. package/dist/starters/features/vitest/package.json +1 -1
  87. package/dist/testing/index.cjs +7568 -6858
  88. package/dist/testing/index.d.ts +141 -140
  89. package/dist/testing/index.mjs +7501 -6790
  90. package/dist/testing/package.json +1 -1
  91. package/handlers.mjs +9 -0
  92. package/package.json +32 -20
  93. package/public.d.ts +15 -0
  94. package/server.d.ts +1 -0
  95. package/dist/index.d.ts +0 -2
  96. package/dist/insights/index.d.ts +0 -1
  97. package/dist/insights/vite/index.d.ts +0 -1
  98. package/dist/insights/vite/insights-plugin.d.ts +0 -10
  99. package/dist/prefetch/index.cjs +0 -4
  100. package/dist/prefetch/index.d.ts +0 -2
  101. package/dist/prefetch/index.mjs +0 -3
  102. package/dist/prefetch/package.json +0 -8
  103. package/dist/qwik-prefetch.debug.js +0 -244
  104. package/dist/qwik-prefetch.js +0 -1
  105. /package/dist/starters/features/{tailwind → tailwind-v3}/.vscode/settings.json +0 -0
package/dist/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-alpha.0-dev+dd93926
3
+ * @qwik.dev/core/cli 2.0.0-alpha.10-dev+a588b48
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -12,6 +12,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
13
13
  var __getProtoOf = Object.getPrototypeOf;
14
14
  var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __esm = (fn, res) => function __init() {
16
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
+ };
15
18
  var __commonJS = (cb, mod) => function __require() {
16
19
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
20
  };
@@ -93,20 +96,19 @@ var require_src = __commonJS({
93
96
  }
94
97
  });
95
98
 
96
- // node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js
99
+ // node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
97
100
  var require_picocolors = __commonJS({
98
- "node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
99
- var argv = process.argv || [];
100
- var env = process.env;
101
- var isColorSupported = !("NO_COLOR" in env || argv.includes("--no-color")) && ("FORCE_COLOR" in env || argv.includes("--color") || process.platform === "win32" || require != null && require("tty").isatty(1) && env.TERM !== "dumb" || "CI" in env);
101
+ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
102
+ var p = process || {};
103
+ var argv = p.argv || [];
104
+ var env = p.env || {};
105
+ var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
102
106
  var formatter = (open, close, replace = open) => (input) => {
103
- let string = "" + input;
104
- let index = string.indexOf(close, open.length);
107
+ let string = "" + input, index = string.indexOf(close, open.length);
105
108
  return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
106
109
  };
107
110
  var replaceClose = (string, close, replace, index) => {
108
- let result = "";
109
- let cursor = 0;
111
+ let result = "", cursor = 0;
110
112
  do {
111
113
  result += string.substring(cursor, index) + replace;
112
114
  cursor = index + close.length;
@@ -115,34 +117,50 @@ var require_picocolors = __commonJS({
115
117
  return result + string.substring(cursor);
116
118
  };
117
119
  var createColors = (enabled = isColorSupported) => {
118
- let init2 = enabled ? formatter : () => String;
120
+ let f3 = enabled ? formatter : () => String;
119
121
  return {
120
122
  isColorSupported: enabled,
121
- reset: init2("\x1B[0m", "\x1B[0m"),
122
- bold: init2("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
123
- dim: init2("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
124
- italic: init2("\x1B[3m", "\x1B[23m"),
125
- underline: init2("\x1B[4m", "\x1B[24m"),
126
- inverse: init2("\x1B[7m", "\x1B[27m"),
127
- hidden: init2("\x1B[8m", "\x1B[28m"),
128
- strikethrough: init2("\x1B[9m", "\x1B[29m"),
129
- black: init2("\x1B[30m", "\x1B[39m"),
130
- red: init2("\x1B[31m", "\x1B[39m"),
131
- green: init2("\x1B[32m", "\x1B[39m"),
132
- yellow: init2("\x1B[33m", "\x1B[39m"),
133
- blue: init2("\x1B[34m", "\x1B[39m"),
134
- magenta: init2("\x1B[35m", "\x1B[39m"),
135
- cyan: init2("\x1B[36m", "\x1B[39m"),
136
- white: init2("\x1B[37m", "\x1B[39m"),
137
- gray: init2("\x1B[90m", "\x1B[39m"),
138
- bgBlack: init2("\x1B[40m", "\x1B[49m"),
139
- bgRed: init2("\x1B[41m", "\x1B[49m"),
140
- bgGreen: init2("\x1B[42m", "\x1B[49m"),
141
- bgYellow: init2("\x1B[43m", "\x1B[49m"),
142
- bgBlue: init2("\x1B[44m", "\x1B[49m"),
143
- bgMagenta: init2("\x1B[45m", "\x1B[49m"),
144
- bgCyan: init2("\x1B[46m", "\x1B[49m"),
145
- bgWhite: init2("\x1B[47m", "\x1B[49m")
123
+ reset: f3("\x1B[0m", "\x1B[0m"),
124
+ bold: f3("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
125
+ dim: f3("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
126
+ italic: f3("\x1B[3m", "\x1B[23m"),
127
+ underline: f3("\x1B[4m", "\x1B[24m"),
128
+ inverse: f3("\x1B[7m", "\x1B[27m"),
129
+ hidden: f3("\x1B[8m", "\x1B[28m"),
130
+ strikethrough: f3("\x1B[9m", "\x1B[29m"),
131
+ black: f3("\x1B[30m", "\x1B[39m"),
132
+ red: f3("\x1B[31m", "\x1B[39m"),
133
+ green: f3("\x1B[32m", "\x1B[39m"),
134
+ yellow: f3("\x1B[33m", "\x1B[39m"),
135
+ blue: f3("\x1B[34m", "\x1B[39m"),
136
+ magenta: f3("\x1B[35m", "\x1B[39m"),
137
+ cyan: f3("\x1B[36m", "\x1B[39m"),
138
+ white: f3("\x1B[37m", "\x1B[39m"),
139
+ gray: f3("\x1B[90m", "\x1B[39m"),
140
+ bgBlack: f3("\x1B[40m", "\x1B[49m"),
141
+ bgRed: f3("\x1B[41m", "\x1B[49m"),
142
+ bgGreen: f3("\x1B[42m", "\x1B[49m"),
143
+ bgYellow: f3("\x1B[43m", "\x1B[49m"),
144
+ bgBlue: f3("\x1B[44m", "\x1B[49m"),
145
+ bgMagenta: f3("\x1B[45m", "\x1B[49m"),
146
+ bgCyan: f3("\x1B[46m", "\x1B[49m"),
147
+ bgWhite: f3("\x1B[47m", "\x1B[49m"),
148
+ blackBright: f3("\x1B[90m", "\x1B[39m"),
149
+ redBright: f3("\x1B[91m", "\x1B[39m"),
150
+ greenBright: f3("\x1B[92m", "\x1B[39m"),
151
+ yellowBright: f3("\x1B[93m", "\x1B[39m"),
152
+ blueBright: f3("\x1B[94m", "\x1B[39m"),
153
+ magentaBright: f3("\x1B[95m", "\x1B[39m"),
154
+ cyanBright: f3("\x1B[96m", "\x1B[39m"),
155
+ whiteBright: f3("\x1B[97m", "\x1B[39m"),
156
+ bgBlackBright: f3("\x1B[100m", "\x1B[49m"),
157
+ bgRedBright: f3("\x1B[101m", "\x1B[49m"),
158
+ bgGreenBright: f3("\x1B[102m", "\x1B[49m"),
159
+ bgYellowBright: f3("\x1B[103m", "\x1B[49m"),
160
+ bgBlueBright: f3("\x1B[104m", "\x1B[49m"),
161
+ bgMagentaBright: f3("\x1B[105m", "\x1B[49m"),
162
+ bgCyanBright: f3("\x1B[106m", "\x1B[49m"),
163
+ bgWhiteBright: f3("\x1B[107m", "\x1B[49m")
146
164
  };
147
165
  };
148
166
  module2.exports = createColors();
@@ -150,6 +168,558 @@ var require_picocolors = __commonJS({
150
168
  }
151
169
  });
152
170
 
171
+ // node_modules/.pnpm/@clack+core@0.3.4/node_modules/@clack/core/dist/index.mjs
172
+ function q({ onlyFirst: t = false } = {}) {
173
+ const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
174
+ return new RegExp(u, t ? void 0 : "g");
175
+ }
176
+ function S(t) {
177
+ if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
178
+ return t.replace(q(), "");
179
+ }
180
+ function j(t) {
181
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
182
+ }
183
+ function A(t, u = {}) {
184
+ if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = S(t), t.length === 0)) return 0;
185
+ t = t.replace(DD(), " ");
186
+ const F = u.ambiguousIsNarrow ? 1 : 2;
187
+ let e2 = 0;
188
+ for (const s2 of t) {
189
+ const C2 = s2.codePointAt(0);
190
+ if (C2 <= 31 || C2 >= 127 && C2 <= 159 || C2 >= 768 && C2 <= 879) continue;
191
+ switch (Q.eastAsianWidth(s2)) {
192
+ case "F":
193
+ case "W":
194
+ e2 += 2;
195
+ break;
196
+ case "A":
197
+ e2 += F;
198
+ break;
199
+ default:
200
+ e2 += 1;
201
+ }
202
+ }
203
+ return e2;
204
+ }
205
+ function tD() {
206
+ const t = /* @__PURE__ */ new Map();
207
+ for (const [u, F] of Object.entries(r)) {
208
+ for (const [e2, s2] of Object.entries(F)) r[e2] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F[e2] = r[e2], t.set(s2[0], s2[1]);
209
+ Object.defineProperty(r, u, { value: F, enumerable: false });
210
+ }
211
+ return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T(), r.color.ansi256 = P(), r.color.ansi16m = W(), r.bgColor.ansi = T(m), r.bgColor.ansi256 = P(m), r.bgColor.ansi16m = W(m), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, e2) => u === F && F === e2 ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
212
+ const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
213
+ if (!F) return [0, 0, 0];
214
+ let [e2] = F;
215
+ e2.length === 3 && (e2 = [...e2].map((C2) => C2 + C2).join(""));
216
+ const s2 = Number.parseInt(e2, 16);
217
+ return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
218
+ }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
219
+ if (u < 8) return 30 + u;
220
+ if (u < 16) return 90 + (u - 8);
221
+ let F, e2, s2;
222
+ if (u >= 232) F = ((u - 232) * 10 + 8) / 255, e2 = F, s2 = F;
223
+ else {
224
+ u -= 16;
225
+ const i = u % 36;
226
+ F = Math.floor(u / 36) / 5, e2 = Math.floor(i / 6) / 5, s2 = i % 6 / 5;
227
+ }
228
+ const C2 = Math.max(F, e2, s2) * 2;
229
+ if (C2 === 0) return 30;
230
+ let D = 30 + (Math.round(s2) << 2 | Math.round(e2) << 1 | Math.round(F));
231
+ return C2 === 2 && (D += 60), D;
232
+ }, enumerable: false }, rgbToAnsi: { value: (u, F, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e2)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
233
+ }
234
+ function R(t, u, F) {
235
+ return String(t).normalize().replace(/\r\n/g, `
236
+ `).split(`
237
+ `).map((e2) => ED(e2, u, F)).join(`
238
+ `);
239
+ }
240
+ function aD(t, u) {
241
+ if (t === u) return;
242
+ const F = t.split(`
243
+ `), e2 = u.split(`
244
+ `), s2 = [];
245
+ for (let C2 = 0; C2 < Math.max(F.length, e2.length); C2++) F[C2] !== e2[C2] && s2.push(C2);
246
+ return s2;
247
+ }
248
+ function hD(t) {
249
+ return t === V;
250
+ }
251
+ function v(t, u) {
252
+ t.isTTY && t.setRawMode(u);
253
+ }
254
+ function WD({ input: t = import_node_process.stdin, output: u = import_node_process.stdout, overwrite: F = true, hideCursor: e2 = true } = {}) {
255
+ const s2 = f.createInterface({ input: t, output: u, prompt: "", tabSize: 1 });
256
+ f.emitKeypressEvents(t, s2), t.isTTY && t.setRawMode(true);
257
+ const C2 = (D, { name: i }) => {
258
+ if (String(D) === "" && process.exit(0), !F) return;
259
+ let n = i === "return" ? 0 : -1, E2 = i === "return" ? -1 : 0;
260
+ f.moveCursor(u, n, E2, () => {
261
+ f.clearLine(u, 1, () => {
262
+ t.once("keypress", C2);
263
+ });
264
+ });
265
+ };
266
+ return e2 && process.stdout.write(import_sisteransi.cursor.hide), t.once("keypress", C2), () => {
267
+ t.off("keypress", C2), e2 && process.stdout.write(import_sisteransi.cursor.show), t.isTTY && !PD && t.setRawMode(false), s2.terminal = false, s2.close();
268
+ };
269
+ }
270
+ var import_sisteransi, import_node_process, f, import_node_readline, import_node_tty, import_picocolors, M, J, Q, X, DD, m, T, P, W, r, uD, FD, eD, g, sD, b, O, CD, I, w, N, L, iD, y, rD, ED, oD, nD, a, V, z, lD, x, xD, bD, wD, Z, yD, SD, jD, MD, TD, PD;
271
+ var init_dist = __esm({
272
+ "node_modules/.pnpm/@clack+core@0.3.4/node_modules/@clack/core/dist/index.mjs"() {
273
+ import_sisteransi = __toESM(require_src(), 1);
274
+ import_node_process = require("node:process");
275
+ f = __toESM(require("node:readline"), 1);
276
+ import_node_readline = __toESM(require("node:readline"), 1);
277
+ import_node_tty = require("node:tty");
278
+ import_picocolors = __toESM(require_picocolors(), 1);
279
+ M = { exports: {} };
280
+ (function(t) {
281
+ var u = {};
282
+ t.exports = u, u.eastAsianWidth = function(e2) {
283
+ var s2 = e2.charCodeAt(0), C2 = e2.length == 2 ? e2.charCodeAt(1) : 0, D = s2;
284
+ return 55296 <= s2 && s2 <= 56319 && 56320 <= C2 && C2 <= 57343 && (s2 &= 1023, C2 &= 1023, D = s2 << 10 | C2, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
285
+ }, u.characterLength = function(e2) {
286
+ var s2 = this.eastAsianWidth(e2);
287
+ return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1;
288
+ };
289
+ function F(e2) {
290
+ return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
291
+ }
292
+ u.length = function(e2) {
293
+ for (var s2 = F(e2), C2 = 0, D = 0; D < s2.length; D++) C2 = C2 + this.characterLength(s2[D]);
294
+ return C2;
295
+ }, u.slice = function(e2, s2, C2) {
296
+ textLen = u.length(e2), s2 = s2 || 0, C2 = C2 || 1, s2 < 0 && (s2 = textLen + s2), C2 < 0 && (C2 = textLen + C2);
297
+ for (var D = "", i = 0, n = F(e2), E2 = 0; E2 < n.length; E2++) {
298
+ var h2 = n[E2], o2 = u.length(h2);
299
+ if (i >= s2 - (o2 == 2 ? 1 : 0)) if (i + o2 <= C2) D += h2;
300
+ else break;
301
+ i += o2;
302
+ }
303
+ return D;
304
+ };
305
+ })(M);
306
+ J = M.exports;
307
+ Q = j(J);
308
+ X = function() {
309
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
310
+ };
311
+ DD = j(X);
312
+ m = 10;
313
+ T = (t = 0) => (u) => `\x1B[${u + t}m`;
314
+ P = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`;
315
+ W = (t = 0) => (u, F, e2) => `\x1B[${38 + t};2;${u};${F};${e2}m`;
316
+ r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
317
+ Object.keys(r.modifier);
318
+ uD = Object.keys(r.color);
319
+ FD = Object.keys(r.bgColor);
320
+ [...uD, ...FD];
321
+ eD = tD();
322
+ g = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
323
+ sD = 39;
324
+ b = "\x07";
325
+ O = "[";
326
+ CD = "]";
327
+ I = "m";
328
+ w = `${CD}8;;`;
329
+ N = (t) => `${g.values().next().value}${O}${t}${I}`;
330
+ L = (t) => `${g.values().next().value}${w}${t}${b}`;
331
+ iD = (t) => t.split(" ").map((u) => A(u));
332
+ y = (t, u, F) => {
333
+ const e2 = [...u];
334
+ let s2 = false, C2 = false, D = A(S(t[t.length - 1]));
335
+ for (const [i, n] of e2.entries()) {
336
+ const E2 = A(n);
337
+ if (D + E2 <= F ? t[t.length - 1] += n : (t.push(n), D = 0), g.has(n) && (s2 = true, C2 = e2.slice(i + 1).join("").startsWith(w)), s2) {
338
+ C2 ? n === b && (s2 = false, C2 = false) : n === I && (s2 = false);
339
+ continue;
340
+ }
341
+ D += E2, D === F && i < e2.length - 1 && (t.push(""), D = 0);
342
+ }
343
+ !D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
344
+ };
345
+ rD = (t) => {
346
+ const u = t.split(" ");
347
+ let F = u.length;
348
+ for (; F > 0 && !(A(u[F - 1]) > 0); ) F--;
349
+ return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
350
+ };
351
+ ED = (t, u, F = {}) => {
352
+ if (F.trim !== false && t.trim() === "") return "";
353
+ let e2 = "", s2, C2;
354
+ const D = iD(t);
355
+ let i = [""];
356
+ for (const [E2, h2] of t.split(" ").entries()) {
357
+ F.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
358
+ let o2 = A(i[i.length - 1]);
359
+ if (E2 !== 0 && (o2 >= u && (F.wordWrap === false || F.trim === false) && (i.push(""), o2 = 0), (o2 > 0 || F.trim === false) && (i[i.length - 1] += " ", o2++)), F.hard && D[E2] > u) {
360
+ const B2 = u - o2, p = 1 + Math.floor((D[E2] - B2 - 1) / u);
361
+ Math.floor((D[E2] - 1) / u) < p && i.push(""), y(i, h2, u);
362
+ continue;
363
+ }
364
+ if (o2 + D[E2] > u && o2 > 0 && D[E2] > 0) {
365
+ if (F.wordWrap === false && o2 < u) {
366
+ y(i, h2, u);
367
+ continue;
368
+ }
369
+ i.push("");
370
+ }
371
+ if (o2 + D[E2] > u && F.wordWrap === false) {
372
+ y(i, h2, u);
373
+ continue;
374
+ }
375
+ i[i.length - 1] += h2;
376
+ }
377
+ F.trim !== false && (i = i.map((E2) => rD(E2)));
378
+ const n = [...i.join(`
379
+ `)];
380
+ for (const [E2, h2] of n.entries()) {
381
+ if (e2 += h2, g.has(h2)) {
382
+ const { groups: B2 } = new RegExp(`(?:\\${O}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(n.slice(E2).join("")) || { groups: {} };
383
+ if (B2.code !== void 0) {
384
+ const p = Number.parseFloat(B2.code);
385
+ s2 = p === sD ? void 0 : p;
386
+ } else B2.uri !== void 0 && (C2 = B2.uri.length === 0 ? void 0 : B2.uri);
387
+ }
388
+ const o2 = eD.codes.get(Number(s2));
389
+ n[E2 + 1] === `
390
+ ` ? (C2 && (e2 += L("")), s2 && o2 && (e2 += N(o2))) : h2 === `
391
+ ` && (s2 && o2 && (e2 += N(s2)), C2 && (e2 += L(C2)));
392
+ }
393
+ return e2;
394
+ };
395
+ oD = Object.defineProperty;
396
+ nD = (t, u, F) => u in t ? oD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
397
+ a = (t, u, F) => (nD(t, typeof u != "symbol" ? u + "" : u, F), F);
398
+ V = Symbol("clack:cancel");
399
+ z = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
400
+ lD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
401
+ x = class {
402
+ constructor({ render: u, input: F = import_node_process.stdin, output: e2 = import_node_process.stdout, ...s2 }, C2 = true) {
403
+ a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C2, this.input = F, this.output = e2;
404
+ }
405
+ prompt() {
406
+ const u = new import_node_tty.WriteStream(0);
407
+ return u._write = (F, e2, s2) => {
408
+ this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2();
409
+ }, this.input.pipe(u), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e2) => {
410
+ this.once("submit", () => {
411
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(this.value);
412
+ }), this.once("cancel", () => {
413
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(V);
414
+ });
415
+ });
416
+ }
417
+ on(u, F) {
418
+ const e2 = this.subscribers.get(u) ?? [];
419
+ e2.push({ cb: F }), this.subscribers.set(u, e2);
420
+ }
421
+ once(u, F) {
422
+ const e2 = this.subscribers.get(u) ?? [];
423
+ e2.push({ cb: F, once: true }), this.subscribers.set(u, e2);
424
+ }
425
+ emit(u, ...F) {
426
+ const e2 = this.subscribers.get(u) ?? [], s2 = [];
427
+ for (const C2 of e2) C2.cb(...F), C2.once && s2.push(() => e2.splice(e2.indexOf(C2), 1));
428
+ for (const C2 of s2) C2();
429
+ }
430
+ unsubscribe() {
431
+ this.subscribers.clear();
432
+ }
433
+ onKeypress(u, F) {
434
+ if (this.state === "error" && (this.state = "active"), (F == null ? void 0 : F.name) && !this._track && z.has(F.name) && this.emit("cursor", z.get(F.name)), (F == null ? void 0 : F.name) && lD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), (F == null ? void 0 : F.name) === "return") {
435
+ if (this.opts.validate) {
436
+ const e2 = this.opts.validate(this.value);
437
+ e2 && (this.error = e2, this.state = "error", this.rl.write(this.value));
438
+ }
439
+ this.state !== "error" && (this.state = "submit");
440
+ }
441
+ u === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
442
+ }
443
+ close() {
444
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
445
+ `), v(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
446
+ }
447
+ restoreCursor() {
448
+ const u = R(this._prevFrame, process.stdout.columns, { hard: true }).split(`
449
+ `).length - 1;
450
+ this.output.write(import_sisteransi.cursor.move(-999, u * -1));
451
+ }
452
+ render() {
453
+ const u = R(this._render(this) ?? "", process.stdout.columns, { hard: true });
454
+ if (u !== this._prevFrame) {
455
+ if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
456
+ else {
457
+ const F = aD(this._prevFrame, u);
458
+ if (this.restoreCursor(), F && (F == null ? void 0 : F.length) === 1) {
459
+ const e2 = F[0];
460
+ this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.lines(1));
461
+ const s2 = u.split(`
462
+ `);
463
+ this.output.write(s2[e2]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s2.length - e2 - 1));
464
+ return;
465
+ } else if (F && (F == null ? void 0 : F.length) > 1) {
466
+ const e2 = F[0];
467
+ this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.down());
468
+ const s2 = u.split(`
469
+ `).slice(e2);
470
+ this.output.write(s2.join(`
471
+ `)), this._prevFrame = u;
472
+ return;
473
+ }
474
+ this.output.write(import_sisteransi.erase.down());
475
+ }
476
+ this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
477
+ }
478
+ }
479
+ };
480
+ xD = class extends x {
481
+ get cursor() {
482
+ return this.value ? 0 : 1;
483
+ }
484
+ get _value() {
485
+ return this.cursor === 0;
486
+ }
487
+ constructor(u) {
488
+ super(u, false), this.value = !!u.initialValue, this.on("value", () => {
489
+ this.value = this._value;
490
+ }), this.on("confirm", (F) => {
491
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F, this.state = "submit", this.close();
492
+ }), this.on("cursor", () => {
493
+ this.value = !this.value;
494
+ });
495
+ }
496
+ };
497
+ bD = Object.defineProperty;
498
+ wD = (t, u, F) => u in t ? bD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
499
+ Z = (t, u, F) => (wD(t, typeof u != "symbol" ? u + "" : u, F), F);
500
+ yD = class extends x {
501
+ constructor(u) {
502
+ super(u, false), Z(this, "options"), Z(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
503
+ switch (F) {
504
+ case "left":
505
+ case "up":
506
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
507
+ break;
508
+ case "down":
509
+ case "right":
510
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
511
+ break;
512
+ }
513
+ this.changeValue();
514
+ });
515
+ }
516
+ get _value() {
517
+ return this.options[this.cursor];
518
+ }
519
+ changeValue() {
520
+ this.value = this._value.value;
521
+ }
522
+ };
523
+ SD = Object.defineProperty;
524
+ jD = (t, u, F) => u in t ? SD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
525
+ MD = (t, u, F) => (jD(t, typeof u != "symbol" ? u + "" : u, F), F);
526
+ TD = class extends x {
527
+ constructor(u) {
528
+ super(u), MD(this, "valueWithCursor", ""), this.on("finalize", () => {
529
+ this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
530
+ }), this.on("value", () => {
531
+ if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
532
+ else {
533
+ const F = this.value.slice(0, this.cursor), e2 = this.value.slice(this.cursor);
534
+ this.valueWithCursor = `${F}${import_picocolors.default.inverse(e2[0])}${e2.slice(1)}`;
535
+ }
536
+ });
537
+ }
538
+ get cursor() {
539
+ return this._cursor;
540
+ }
541
+ };
542
+ PD = globalThis.process.platform.startsWith("win");
543
+ }
544
+ });
545
+
546
+ // node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/dist/index.mjs
547
+ function q2() {
548
+ return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
549
+ }
550
+ var import_node_process2, import_picocolors2, import_sisteransi2, _2, o, H, I2, x2, S2, K, a2, d2, b2, E, C, w2, M2, U2, B, Z2, z2, X2, J2, Y, Q2, ee, y2, te, se, ie, oe, $e, f2, de;
551
+ var init_dist2 = __esm({
552
+ "node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/dist/index.mjs"() {
553
+ init_dist();
554
+ init_dist();
555
+ import_node_process2 = __toESM(require("node:process"), 1);
556
+ import_picocolors2 = __toESM(require_picocolors(), 1);
557
+ import_sisteransi2 = __toESM(require_src(), 1);
558
+ _2 = q2();
559
+ o = (r2, n) => _2 ? r2 : n;
560
+ H = o("\u25C6", "*");
561
+ I2 = o("\u25A0", "x");
562
+ x2 = o("\u25B2", "x");
563
+ S2 = o("\u25C7", "o");
564
+ K = o("\u250C", "T");
565
+ a2 = o("\u2502", "|");
566
+ d2 = o("\u2514", "\u2014");
567
+ b2 = o("\u25CF", ">");
568
+ E = o("\u25CB", " ");
569
+ C = o("\u25FB", "[\u2022]");
570
+ w2 = o("\u25FC", "[+]");
571
+ M2 = o("\u25FB", "[ ]");
572
+ U2 = o("\u25AA", "\u2022");
573
+ B = o("\u2500", "-");
574
+ Z2 = o("\u256E", "+");
575
+ z2 = o("\u251C", "+");
576
+ X2 = o("\u256F", "+");
577
+ J2 = o("\u25CF", "\u2022");
578
+ Y = o("\u25C6", "*");
579
+ Q2 = o("\u25B2", "!");
580
+ ee = o("\u25A0", "x");
581
+ y2 = (r2) => {
582
+ switch (r2) {
583
+ case "initial":
584
+ case "active":
585
+ return import_picocolors2.default.cyan(H);
586
+ case "cancel":
587
+ return import_picocolors2.default.red(I2);
588
+ case "error":
589
+ return import_picocolors2.default.yellow(x2);
590
+ case "submit":
591
+ return import_picocolors2.default.green(S2);
592
+ }
593
+ };
594
+ te = (r2) => new TD({ validate: r2.validate, placeholder: r2.placeholder, defaultValue: r2.defaultValue, initialValue: r2.initialValue, render() {
595
+ var _a;
596
+ const n = `${import_picocolors2.default.gray(a2)}
597
+ ${y2(this.state)} ${r2.message}
598
+ `, i = r2.placeholder ? import_picocolors2.default.inverse(r2.placeholder[0]) + import_picocolors2.default.dim(r2.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), t = this.value ? this.valueWithCursor : i;
599
+ switch (this.state) {
600
+ case "error":
601
+ return `${n.trim()}
602
+ ${import_picocolors2.default.yellow(a2)} ${t}
603
+ ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
604
+ `;
605
+ case "submit":
606
+ return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(this.value || r2.placeholder)}`;
607
+ case "cancel":
608
+ return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${((_a = this.value) == null ? void 0 : _a.trim()) ? `
609
+ ` + import_picocolors2.default.gray(a2) : ""}`;
610
+ default:
611
+ return `${n}${import_picocolors2.default.cyan(a2)} ${t}
612
+ ${import_picocolors2.default.cyan(d2)}
613
+ `;
614
+ }
615
+ } }).prompt();
616
+ se = (r2) => {
617
+ const n = r2.active ?? "Yes", i = r2.inactive ?? "No";
618
+ return new xD({ active: n, inactive: i, initialValue: r2.initialValue ?? true, render() {
619
+ const t = `${import_picocolors2.default.gray(a2)}
620
+ ${y2(this.state)} ${r2.message}
621
+ `, s2 = this.value ? n : i;
622
+ switch (this.state) {
623
+ case "submit":
624
+ return `${t}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(s2)}`;
625
+ case "cancel":
626
+ return `${t}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s2))}
627
+ ${import_picocolors2.default.gray(a2)}`;
628
+ default:
629
+ return `${t}${import_picocolors2.default.cyan(a2)} ${this.value ? `${import_picocolors2.default.green(b2)} ${n}` : `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(i)}` : `${import_picocolors2.default.green(b2)} ${i}`}
630
+ ${import_picocolors2.default.cyan(d2)}
631
+ `;
632
+ }
633
+ } }).prompt();
634
+ };
635
+ ie = (r2) => {
636
+ const n = (t, s2) => {
637
+ const c2 = t.label ?? String(t.value);
638
+ return s2 === "active" ? `${import_picocolors2.default.green(b2)} ${c2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}` : s2 === "selected" ? `${import_picocolors2.default.dim(c2)}` : s2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(c2))}` : `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(c2)}`;
639
+ };
640
+ let i = 0;
641
+ return new yD({ options: r2.options, initialValue: r2.initialValue, render() {
642
+ const t = `${import_picocolors2.default.gray(a2)}
643
+ ${y2(this.state)} ${r2.message}
644
+ `;
645
+ switch (this.state) {
646
+ case "submit":
647
+ return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "selected")}`;
648
+ case "cancel":
649
+ return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "cancelled")}
650
+ ${import_picocolors2.default.gray(a2)}`;
651
+ default: {
652
+ const s2 = r2.maxItems === void 0 ? 1 / 0 : Math.max(r2.maxItems, 5);
653
+ this.cursor >= i + s2 - 3 ? i = Math.max(Math.min(this.cursor - s2 + 3, this.options.length - s2), 0) : this.cursor < i + 2 && (i = Math.max(this.cursor - 2, 0));
654
+ const c2 = s2 < this.options.length && i > 0, l2 = s2 < this.options.length && i + s2 < this.options.length;
655
+ return `${t}${import_picocolors2.default.cyan(a2)} ${this.options.slice(i, i + s2).map((u, m2, $4) => m2 === 0 && c2 ? import_picocolors2.default.dim("...") : m2 === $4.length - 1 && l2 ? import_picocolors2.default.dim("...") : n(u, m2 + i === this.cursor ? "active" : "inactive")).join(`
656
+ ${import_picocolors2.default.cyan(a2)} `)}
657
+ ${import_picocolors2.default.cyan(d2)}
658
+ `;
659
+ }
660
+ }
661
+ } }).prompt();
662
+ };
663
+ oe = (r2 = "") => {
664
+ process.stdout.write(`${import_picocolors2.default.gray(K)} ${r2}
665
+ `);
666
+ };
667
+ $e = (r2 = "") => {
668
+ process.stdout.write(`${import_picocolors2.default.gray(a2)}
669
+ ${import_picocolors2.default.gray(d2)} ${r2}
670
+
671
+ `);
672
+ };
673
+ f2 = { message: (r2 = "", { symbol: n = import_picocolors2.default.gray(a2) } = {}) => {
674
+ const i = [`${import_picocolors2.default.gray(a2)}`];
675
+ if (r2) {
676
+ const [t, ...s2] = r2.split(`
677
+ `);
678
+ i.push(`${n} ${t}`, ...s2.map((c2) => `${import_picocolors2.default.gray(a2)} ${c2}`));
679
+ }
680
+ process.stdout.write(`${i.join(`
681
+ `)}
682
+ `);
683
+ }, info: (r2) => {
684
+ f2.message(r2, { symbol: import_picocolors2.default.blue(J2) });
685
+ }, success: (r2) => {
686
+ f2.message(r2, { symbol: import_picocolors2.default.green(Y) });
687
+ }, step: (r2) => {
688
+ f2.message(r2, { symbol: import_picocolors2.default.green(S2) });
689
+ }, warn: (r2) => {
690
+ f2.message(r2, { symbol: import_picocolors2.default.yellow(Q2) });
691
+ }, warning: (r2) => {
692
+ f2.warn(r2);
693
+ }, error: (r2) => {
694
+ f2.message(r2, { symbol: import_picocolors2.default.red(ee) });
695
+ } };
696
+ de = () => {
697
+ const r2 = _2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], n = _2 ? 80 : 120;
698
+ let i, t, s2 = false, c2 = "";
699
+ const l2 = (v2 = "") => {
700
+ s2 = true, i = WD(), c2 = v2.replace(/\.+$/, ""), process.stdout.write(`${import_picocolors2.default.gray(a2)}
701
+ `);
702
+ let g2 = 0, p = 0;
703
+ t = setInterval(() => {
704
+ const O2 = import_picocolors2.default.magenta(r2[g2]), P2 = ".".repeat(Math.floor(p)).slice(0, 3);
705
+ process.stdout.write(import_sisteransi2.cursor.move(-999, 0)), process.stdout.write(import_sisteransi2.erase.down(1)), process.stdout.write(`${O2} ${c2}${P2}`), g2 = g2 + 1 < r2.length ? g2 + 1 : 0, p = p < r2.length ? p + 0.125 : 0;
706
+ }, n);
707
+ }, u = (v2 = "", g2 = 0) => {
708
+ c2 = v2 ?? c2, s2 = false, clearInterval(t);
709
+ const p = g2 === 0 ? import_picocolors2.default.green(S2) : g2 === 1 ? import_picocolors2.default.red(I2) : import_picocolors2.default.red(x2);
710
+ process.stdout.write(import_sisteransi2.cursor.move(-999, 0)), process.stdout.write(import_sisteransi2.erase.down(1)), process.stdout.write(`${p} ${c2}
711
+ `), i();
712
+ }, m2 = (v2 = "") => {
713
+ c2 = v2 ?? c2;
714
+ }, $4 = (v2) => {
715
+ const g2 = v2 > 1 ? "Something went wrong" : "Canceled";
716
+ s2 && u(g2, v2);
717
+ };
718
+ return process.on("uncaughtExceptionMonitor", () => $4(2)), process.on("unhandledRejection", () => $4(2)), process.on("SIGINT", () => $4(1)), process.on("SIGTERM", () => $4(1)), process.on("exit", $4), { start: l2, stop: u, message: m2 };
719
+ };
720
+ }
721
+ });
722
+
153
723
  // node_modules/.pnpm/which-pm-runs@1.1.0/node_modules/which-pm-runs/index.js
154
724
  var require_which_pm_runs = __commonJS({
155
725
  "node_modules/.pnpm/which-pm-runs@1.1.0/node_modules/which-pm-runs/index.js"(exports2, module2) {
@@ -709,667 +1279,216 @@ var require_merge_stream = __commonJS({
709
1279
  }
710
1280
  });
711
1281
 
712
- // packages/qwik/src/cli/index.ts
713
- var cli_exports = {};
714
- __export(cli_exports, {
715
- runCli: () => runCli,
716
- updateApp: () => updateApp
717
- });
718
- module.exports = __toCommonJS(cli_exports);
719
-
720
- // node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs
721
- var FORCE_COLOR;
722
- var NODE_DISABLE_COLORS;
723
- var NO_COLOR;
724
- var TERM;
725
- var isTTY = true;
726
- if (typeof process !== "undefined") {
727
- ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
728
- isTTY = process.stdout && process.stdout.isTTY;
729
- }
730
- var $ = {
731
- enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
732
- };
733
- function init(x3, y3) {
734
- let rgx = new RegExp(`\\x1b\\[${y3}m`, "g");
735
- let open = `\x1B[${x3}m`, close = `\x1B[${y3}m`;
736
- return function(txt) {
737
- if (!$.enabled || txt == null) return txt;
738
- return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
739
- };
740
- }
741
- var reset = init(0, 0);
742
- var bold = init(1, 22);
743
- var dim = init(2, 22);
744
- var italic = init(3, 23);
745
- var underline = init(4, 24);
746
- var inverse = init(7, 27);
747
- var hidden = init(8, 28);
748
- var strikethrough = init(9, 29);
749
- var black = init(30, 39);
750
- var red = init(31, 39);
751
- var green = init(32, 39);
752
- var yellow = init(33, 39);
753
- var blue = init(34, 39);
754
- var magenta = init(35, 39);
755
- var cyan = init(36, 39);
756
- var white = init(37, 39);
757
- var gray = init(90, 39);
758
- var grey = init(90, 39);
759
- var bgBlack = init(40, 49);
760
- var bgRed = init(41, 49);
761
- var bgGreen = init(42, 49);
762
- var bgYellow = init(43, 49);
763
- var bgBlue = init(44, 49);
764
- var bgMagenta = init(45, 49);
765
- var bgCyan = init(46, 49);
766
- var bgWhite = init(47, 49);
767
-
768
- // packages/qwik/src/cli/utils/app-command.ts
769
- var import_node_fs = require("node:fs");
770
- var import_node_path = require("node:path");
771
- var AppCommand = class {
772
- args;
773
- task;
774
- cwd;
775
- _rootDir;
776
- _rootPkgJson;
777
- constructor(opts) {
778
- this._rootDir = opts.rootDir;
779
- this.cwd = opts.cwd;
780
- this.args = opts.args.slice();
781
- this.task = this.args[0];
782
- }
783
- get rootDir() {
784
- if (!this._rootDir) {
785
- const fsRoot = (0, import_node_path.resolve)("/");
786
- let testDir = process.cwd();
787
- for (let i = 0; i < 20; i++) {
788
- const pkgPath = (0, import_node_path.join)(testDir, "package.json");
789
- if ((0, import_node_fs.existsSync)(pkgPath)) {
790
- this._rootDir = testDir;
791
- break;
792
- }
793
- if (testDir === fsRoot) {
794
- break;
795
- }
796
- testDir = (0, import_node_path.dirname)(testDir);
797
- }
798
- if (!this._rootDir) {
799
- throw new Error(`Unable to find Qwik app package.json`);
800
- }
801
- }
802
- return this._rootDir;
803
- }
804
- set rootDir(rootDir) {
805
- this._rootDir = rootDir;
806
- }
807
- get packageJson() {
808
- if (!this._rootPkgJson) {
809
- const pkgJsonPath = (0, import_node_path.join)(this.rootDir, "package.json");
810
- this._rootPkgJson = JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf-8"));
811
- }
812
- return this._rootPkgJson;
813
- }
814
- getArg(name) {
815
- const key = `--${name}`;
816
- const matcher = new RegExp(`^${key}($|=)`);
817
- const index = this.args.findIndex((arg) => matcher.test(arg));
818
- if (index === -1) {
819
- return;
820
- }
821
- if (this.args[index].includes("=")) {
822
- return this.args[index].split("=")[1];
823
- }
824
- return this.args[index + 1];
825
- }
826
- };
827
-
828
- // node_modules/.pnpm/@clack+core@0.3.4/node_modules/@clack/core/dist/index.mjs
829
- var import_sisteransi = __toESM(require_src(), 1);
830
- var import_node_process = require("node:process");
831
- var f = __toESM(require("node:readline"), 1);
832
- var import_node_readline = __toESM(require("node:readline"), 1);
833
- var import_node_tty = require("node:tty");
834
- var import_picocolors = __toESM(require_picocolors(), 1);
835
- function q({ onlyFirst: t = false } = {}) {
836
- const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
837
- return new RegExp(u, t ? void 0 : "g");
838
- }
839
- function S(t) {
840
- if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
841
- return t.replace(q(), "");
842
- }
843
- function j(t) {
844
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
845
- }
846
- var M = { exports: {} };
847
- (function(t) {
848
- var u = {};
849
- t.exports = u, u.eastAsianWidth = function(e2) {
850
- var s2 = e2.charCodeAt(0), C2 = e2.length == 2 ? e2.charCodeAt(1) : 0, D = s2;
851
- return 55296 <= s2 && s2 <= 56319 && 56320 <= C2 && C2 <= 57343 && (s2 &= 1023, C2 &= 1023, D = s2 << 10 | C2, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
852
- }, u.characterLength = function(e2) {
853
- var s2 = this.eastAsianWidth(e2);
854
- return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1;
855
- };
856
- function F(e2) {
857
- return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
858
- }
859
- u.length = function(e2) {
860
- for (var s2 = F(e2), C2 = 0, D = 0; D < s2.length; D++) C2 = C2 + this.characterLength(s2[D]);
861
- return C2;
862
- }, u.slice = function(e2, s2, C2) {
863
- textLen = u.length(e2), s2 = s2 || 0, C2 = C2 || 1, s2 < 0 && (s2 = textLen + s2), C2 < 0 && (C2 = textLen + C2);
864
- for (var D = "", i = 0, n = F(e2), E2 = 0; E2 < n.length; E2++) {
865
- var h2 = n[E2], o2 = u.length(h2);
866
- if (i >= s2 - (o2 == 2 ? 1 : 0)) if (i + o2 <= C2) D += h2;
867
- else break;
868
- i += o2;
869
- }
870
- return D;
871
- };
872
- })(M);
873
- var J = M.exports;
874
- var Q = j(J);
875
- var X = function() {
876
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
877
- };
878
- var DD = j(X);
879
- function A(t, u = {}) {
880
- if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = S(t), t.length === 0)) return 0;
881
- t = t.replace(DD(), " ");
882
- const F = u.ambiguousIsNarrow ? 1 : 2;
883
- let e2 = 0;
884
- for (const s2 of t) {
885
- const C2 = s2.codePointAt(0);
886
- if (C2 <= 31 || C2 >= 127 && C2 <= 159 || C2 >= 768 && C2 <= 879) continue;
887
- switch (Q.eastAsianWidth(s2)) {
888
- case "F":
889
- case "W":
890
- e2 += 2;
891
- break;
892
- case "A":
893
- e2 += F;
894
- break;
895
- default:
896
- e2 += 1;
897
- }
898
- }
899
- return e2;
900
- }
901
- var m = 10;
902
- var T = (t = 0) => (u) => `\x1B[${u + t}m`;
903
- var P = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`;
904
- var W = (t = 0) => (u, F, e2) => `\x1B[${38 + t};2;${u};${F};${e2}m`;
905
- var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
906
- Object.keys(r.modifier);
907
- var uD = Object.keys(r.color);
908
- var FD = Object.keys(r.bgColor);
909
- [...uD, ...FD];
910
- function tD() {
911
- const t = /* @__PURE__ */ new Map();
912
- for (const [u, F] of Object.entries(r)) {
913
- for (const [e2, s2] of Object.entries(F)) r[e2] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F[e2] = r[e2], t.set(s2[0], s2[1]);
914
- Object.defineProperty(r, u, { value: F, enumerable: false });
915
- }
916
- return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T(), r.color.ansi256 = P(), r.color.ansi16m = W(), r.bgColor.ansi = T(m), r.bgColor.ansi256 = P(m), r.bgColor.ansi16m = W(m), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, e2) => u === F && F === e2 ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
917
- const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
918
- if (!F) return [0, 0, 0];
919
- let [e2] = F;
920
- e2.length === 3 && (e2 = [...e2].map((C2) => C2 + C2).join(""));
921
- const s2 = Number.parseInt(e2, 16);
922
- return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
923
- }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
924
- if (u < 8) return 30 + u;
925
- if (u < 16) return 90 + (u - 8);
926
- let F, e2, s2;
927
- if (u >= 232) F = ((u - 232) * 10 + 8) / 255, e2 = F, s2 = F;
928
- else {
929
- u -= 16;
930
- const i = u % 36;
931
- F = Math.floor(u / 36) / 5, e2 = Math.floor(i / 6) / 5, s2 = i % 6 / 5;
932
- }
933
- const C2 = Math.max(F, e2, s2) * 2;
934
- if (C2 === 0) return 30;
935
- let D = 30 + (Math.round(s2) << 2 | Math.round(e2) << 1 | Math.round(F));
936
- return C2 === 2 && (D += 60), D;
937
- }, enumerable: false }, rgbToAnsi: { value: (u, F, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e2)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
938
- }
939
- var eD = tD();
940
- var g = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
941
- var sD = 39;
942
- var b = "\x07";
943
- var O = "[";
944
- var CD = "]";
945
- var I = "m";
946
- var w = `${CD}8;;`;
947
- var N = (t) => `${g.values().next().value}${O}${t}${I}`;
948
- var L = (t) => `${g.values().next().value}${w}${t}${b}`;
949
- var iD = (t) => t.split(" ").map((u) => A(u));
950
- var y = (t, u, F) => {
951
- const e2 = [...u];
952
- let s2 = false, C2 = false, D = A(S(t[t.length - 1]));
953
- for (const [i, n] of e2.entries()) {
954
- const E2 = A(n);
955
- if (D + E2 <= F ? t[t.length - 1] += n : (t.push(n), D = 0), g.has(n) && (s2 = true, C2 = e2.slice(i + 1).join("").startsWith(w)), s2) {
956
- C2 ? n === b && (s2 = false, C2 = false) : n === I && (s2 = false);
957
- continue;
958
- }
959
- D += E2, D === F && i < e2.length - 1 && (t.push(""), D = 0);
1282
+ // packages/qwik/src/cli/migrate-v2/tools/visit-not-ignored-files.ts
1283
+ function visitNotIgnoredFiles(dirPath, visitor) {
1284
+ let ig;
1285
+ if ((0, import_fs2.existsSync)(".gitignore")) {
1286
+ ig = (0, import_ignore.default)();
1287
+ ig.add(".git");
1288
+ ig.add((0, import_fs2.readFileSync)(".gitignore", "utf-8"));
1289
+ }
1290
+ dirPath = (0, import_path4.relative)(process.cwd(), dirPath);
1291
+ if (dirPath !== "" && (ig == null ? void 0 : ig.ignores(dirPath))) {
1292
+ return;
960
1293
  }
961
- !D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
962
- };
963
- var rD = (t) => {
964
- const u = t.split(" ");
965
- let F = u.length;
966
- for (; F > 0 && !(A(u[F - 1]) > 0); ) F--;
967
- return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
968
- };
969
- var ED = (t, u, F = {}) => {
970
- if (F.trim !== false && t.trim() === "") return "";
971
- let e2 = "", s2, C2;
972
- const D = iD(t);
973
- let i = [""];
974
- for (const [E2, h2] of t.split(" ").entries()) {
975
- F.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
976
- let o2 = A(i[i.length - 1]);
977
- if (E2 !== 0 && (o2 >= u && (F.wordWrap === false || F.trim === false) && (i.push(""), o2 = 0), (o2 > 0 || F.trim === false) && (i[i.length - 1] += " ", o2++)), F.hard && D[E2] > u) {
978
- const B2 = u - o2, p = 1 + Math.floor((D[E2] - B2 - 1) / u);
979
- Math.floor((D[E2] - 1) / u) < p && i.push(""), y(i, h2, u);
1294
+ for (const child of (0, import_fs2.readdirSync)((0, import_path4.join)(process.cwd(), dirPath))) {
1295
+ const fullPath = (0, import_path4.join)(dirPath, child);
1296
+ if (ig == null ? void 0 : ig.ignores(fullPath)) {
980
1297
  continue;
981
1298
  }
982
- if (o2 + D[E2] > u && o2 > 0 && D[E2] > 0) {
983
- if (F.wordWrap === false && o2 < u) {
984
- y(i, h2, u);
985
- continue;
986
- }
987
- i.push("");
988
- }
989
- if (o2 + D[E2] > u && F.wordWrap === false) {
990
- y(i, h2, u);
991
- continue;
1299
+ if ((0, import_fs2.lstatSync)(fullPath).isFile()) {
1300
+ visitor(fullPath);
1301
+ } else {
1302
+ visitNotIgnoredFiles(fullPath, visitor);
992
1303
  }
993
- i[i.length - 1] += h2;
994
1304
  }
995
- F.trim !== false && (i = i.map((E2) => rD(E2)));
996
- const n = [...i.join(`
997
- `)];
998
- for (const [E2, h2] of n.entries()) {
999
- if (e2 += h2, g.has(h2)) {
1000
- const { groups: B2 } = new RegExp(`(?:\\${O}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(n.slice(E2).join("")) || { groups: {} };
1001
- if (B2.code !== void 0) {
1002
- const p = Number.parseFloat(B2.code);
1003
- s2 = p === sD ? void 0 : p;
1004
- } else B2.uri !== void 0 && (C2 = B2.uri.length === 0 ? void 0 : B2.uri);
1005
- }
1006
- const o2 = eD.codes.get(Number(s2));
1007
- n[E2 + 1] === `
1008
- ` ? (C2 && (e2 += L("")), s2 && o2 && (e2 += N(o2))) : h2 === `
1009
- ` && (s2 && o2 && (e2 += N(s2)), C2 && (e2 += L(C2)));
1010
- }
1011
- return e2;
1012
- };
1013
- function R(t, u, F) {
1014
- return String(t).normalize().replace(/\r\n/g, `
1015
- `).split(`
1016
- `).map((e2) => ED(e2, u, F)).join(`
1017
- `);
1018
1305
  }
1019
- var oD = Object.defineProperty;
1020
- var nD = (t, u, F) => u in t ? oD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
1021
- var a = (t, u, F) => (nD(t, typeof u != "symbol" ? u + "" : u, F), F);
1022
- function aD(t, u) {
1023
- if (t === u) return;
1024
- const F = t.split(`
1025
- `), e2 = u.split(`
1026
- `), s2 = [];
1027
- for (let C2 = 0; C2 < Math.max(F.length, e2.length); C2++) F[C2] !== e2[C2] && s2.push(C2);
1028
- return s2;
1029
- }
1030
- var V = Symbol("clack:cancel");
1031
- function hD(t) {
1032
- return t === V;
1033
- }
1034
- function v(t, u) {
1035
- t.isTTY && t.setRawMode(u);
1036
- }
1037
- var z = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
1038
- var lD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
1039
- var x = class {
1040
- constructor({ render: u, input: F = import_node_process.stdin, output: e2 = import_node_process.stdout, ...s2 }, C2 = true) {
1041
- a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C2, this.input = F, this.output = e2;
1042
- }
1043
- prompt() {
1044
- const u = new import_node_tty.WriteStream(0);
1045
- return u._write = (F, e2, s2) => {
1046
- this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2();
1047
- }, this.input.pipe(u), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e2) => {
1048
- this.once("submit", () => {
1049
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(this.value);
1050
- }), this.once("cancel", () => {
1051
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(V);
1052
- });
1053
- });
1054
- }
1055
- on(u, F) {
1056
- const e2 = this.subscribers.get(u) ?? [];
1057
- e2.push({ cb: F }), this.subscribers.set(u, e2);
1058
- }
1059
- once(u, F) {
1060
- const e2 = this.subscribers.get(u) ?? [];
1061
- e2.push({ cb: F, once: true }), this.subscribers.set(u, e2);
1062
- }
1063
- emit(u, ...F) {
1064
- const e2 = this.subscribers.get(u) ?? [], s2 = [];
1065
- for (const C2 of e2) C2.cb(...F), C2.once && s2.push(() => e2.splice(e2.indexOf(C2), 1));
1066
- for (const C2 of s2) C2();
1067
- }
1068
- unsubscribe() {
1069
- this.subscribers.clear();
1070
- }
1071
- onKeypress(u, F) {
1072
- if (this.state === "error" && (this.state = "active"), (F == null ? void 0 : F.name) && !this._track && z.has(F.name) && this.emit("cursor", z.get(F.name)), (F == null ? void 0 : F.name) && lD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), (F == null ? void 0 : F.name) === "return") {
1073
- if (this.opts.validate) {
1074
- const e2 = this.opts.validate(this.value);
1075
- e2 && (this.error = e2, this.state = "error", this.rl.write(this.value));
1076
- }
1077
- this.state !== "error" && (this.state = "submit");
1078
- }
1079
- u === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
1080
- }
1081
- close() {
1082
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
1083
- `), v(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
1306
+ var import_fs2, import_ignore, import_path4;
1307
+ var init_visit_not_ignored_files = __esm({
1308
+ "packages/qwik/src/cli/migrate-v2/tools/visit-not-ignored-files.ts"() {
1309
+ "use strict";
1310
+ import_fs2 = require("fs");
1311
+ import_ignore = __toESM(require("ignore"), 1);
1312
+ import_path4 = require("path");
1084
1313
  }
1085
- restoreCursor() {
1086
- const u = R(this._prevFrame, process.stdout.columns, { hard: true }).split(`
1087
- `).length - 1;
1088
- this.output.write(import_sisteransi.cursor.move(-999, u * -1));
1089
- }
1090
- render() {
1091
- const u = R(this._render(this) ?? "", process.stdout.columns, { hard: true });
1092
- if (u !== this._prevFrame) {
1093
- if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
1094
- else {
1095
- const F = aD(this._prevFrame, u);
1096
- if (this.restoreCursor(), F && (F == null ? void 0 : F.length) === 1) {
1097
- const e2 = F[0];
1098
- this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.lines(1));
1099
- const s2 = u.split(`
1100
- `);
1101
- this.output.write(s2[e2]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s2.length - e2 - 1));
1102
- return;
1103
- } else if (F && (F == null ? void 0 : F.length) > 1) {
1104
- const e2 = F[0];
1105
- this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.down());
1106
- const s2 = u.split(`
1107
- `).slice(e2);
1108
- this.output.write(s2.join(`
1109
- `)), this._prevFrame = u;
1110
- return;
1111
- }
1112
- this.output.write(import_sisteransi.erase.down());
1113
- }
1114
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
1314
+ });
1315
+
1316
+ // packages/qwik/src/cli/migrate-v2/rename-import.ts
1317
+ var rename_import_exports = {};
1318
+ __export(rename_import_exports, {
1319
+ replaceImportInFiles: () => replaceImportInFiles
1320
+ });
1321
+ function replaceImportInFiles(changes, library) {
1322
+ const project = new import_ts_morph.Project();
1323
+ visitNotIgnoredFiles(".", (path3) => {
1324
+ if (!path3.endsWith(".ts") && !path3.endsWith(".tsx")) {
1325
+ return;
1115
1326
  }
1116
- }
1117
- };
1118
- var xD = class extends x {
1119
- get cursor() {
1120
- return this.value ? 0 : 1;
1121
- }
1122
- get _value() {
1123
- return this.cursor === 0;
1124
- }
1125
- constructor(u) {
1126
- super(u, false), this.value = !!u.initialValue, this.on("value", () => {
1127
- this.value = this._value;
1128
- }), this.on("confirm", (F) => {
1129
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F, this.state = "submit", this.close();
1130
- }), this.on("cursor", () => {
1131
- this.value = !this.value;
1132
- });
1133
- }
1134
- };
1135
- var bD = Object.defineProperty;
1136
- var wD = (t, u, F) => u in t ? bD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
1137
- var Z = (t, u, F) => (wD(t, typeof u != "symbol" ? u + "" : u, F), F);
1138
- var yD = class extends x {
1139
- constructor(u) {
1140
- super(u, false), Z(this, "options"), Z(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
1141
- switch (F) {
1142
- case "left":
1143
- case "up":
1144
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1145
- break;
1146
- case "down":
1147
- case "right":
1148
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1149
- break;
1150
- }
1151
- this.changeValue();
1152
- });
1153
- }
1154
- get _value() {
1155
- return this.options[this.cursor];
1156
- }
1157
- changeValue() {
1158
- this.value = this._value.value;
1159
- }
1160
- };
1161
- var SD = Object.defineProperty;
1162
- var jD = (t, u, F) => u in t ? SD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
1163
- var MD = (t, u, F) => (jD(t, typeof u != "symbol" ? u + "" : u, F), F);
1164
- var TD = class extends x {
1165
- constructor(u) {
1166
- super(u), MD(this, "valueWithCursor", ""), this.on("finalize", () => {
1167
- this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
1168
- }), this.on("value", () => {
1169
- if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
1170
- else {
1171
- const F = this.value.slice(0, this.cursor), e2 = this.value.slice(this.cursor);
1172
- this.valueWithCursor = `${F}${import_picocolors.default.inverse(e2[0])}${e2.slice(1)}`;
1327
+ project.addSourceFileAtPath(path3);
1328
+ });
1329
+ project.getSourceFiles().forEach((sourceFile) => {
1330
+ let hasChanges = false;
1331
+ sourceFile.getImportDeclarations().forEach((importDeclaration) => {
1332
+ if (importDeclaration.getModuleSpecifierValue().startsWith(library)) {
1333
+ for (const [oldImport, newImport] of changes) {
1334
+ importDeclaration.getNamedImports().forEach((namedImport) => {
1335
+ if (namedImport.getName() === oldImport) {
1336
+ namedImport.setName(newImport);
1337
+ hasChanges = true;
1338
+ }
1339
+ });
1340
+ }
1173
1341
  }
1174
1342
  });
1343
+ sourceFile.getDescendantsOfKind(import_ts_morph.ts.SyntaxKind.Identifier).forEach((identifier) => {
1344
+ for (const [oldImport, newImport] of changes) {
1345
+ if (identifier.getText() === oldImport) {
1346
+ identifier.replaceWithText(newImport);
1347
+ hasChanges = true;
1348
+ }
1349
+ }
1350
+ });
1351
+ if (hasChanges) {
1352
+ sourceFile.saveSync();
1353
+ f2.info(`Updated imports in ${sourceFile.getFilePath()}`);
1354
+ }
1355
+ });
1356
+ }
1357
+ var import_ts_morph;
1358
+ var init_rename_import = __esm({
1359
+ "packages/qwik/src/cli/migrate-v2/rename-import.ts"() {
1360
+ "use strict";
1361
+ import_ts_morph = require("ts-morph");
1362
+ init_visit_not_ignored_files();
1363
+ init_dist2();
1175
1364
  }
1176
- get cursor() {
1177
- return this._cursor;
1178
- }
1365
+ });
1366
+
1367
+ // packages/qwik/src/cli/index.ts
1368
+ var index_exports = {};
1369
+ __export(index_exports, {
1370
+ runCli: () => runCli,
1371
+ updateApp: () => updateApp
1372
+ });
1373
+ module.exports = __toCommonJS(index_exports);
1374
+
1375
+ // node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs
1376
+ var FORCE_COLOR;
1377
+ var NODE_DISABLE_COLORS;
1378
+ var NO_COLOR;
1379
+ var TERM;
1380
+ var isTTY = true;
1381
+ if (typeof process !== "undefined") {
1382
+ ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
1383
+ isTTY = process.stdout && process.stdout.isTTY;
1384
+ }
1385
+ var $ = {
1386
+ enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
1179
1387
  };
1180
- var PD = globalThis.process.platform.startsWith("win");
1181
- function WD({ input: t = import_node_process.stdin, output: u = import_node_process.stdout, overwrite: F = true, hideCursor: e2 = true } = {}) {
1182
- const s2 = f.createInterface({ input: t, output: u, prompt: "", tabSize: 1 });
1183
- f.emitKeypressEvents(t, s2), t.isTTY && t.setRawMode(true);
1184
- const C2 = (D, { name: i }) => {
1185
- if (String(D) === "" && process.exit(0), !F) return;
1186
- let n = i === "return" ? 0 : -1, E2 = i === "return" ? -1 : 0;
1187
- f.moveCursor(u, n, E2, () => {
1188
- f.clearLine(u, 1, () => {
1189
- t.once("keypress", C2);
1190
- });
1191
- });
1192
- };
1193
- return e2 && process.stdout.write(import_sisteransi.cursor.hide), t.once("keypress", C2), () => {
1194
- t.off("keypress", C2), e2 && process.stdout.write(import_sisteransi.cursor.show), t.isTTY && !PD && t.setRawMode(false), s2.terminal = false, s2.close();
1388
+ function init(x3, y3) {
1389
+ let rgx = new RegExp(`\\x1b\\[${y3}m`, "g");
1390
+ let open = `\x1B[${x3}m`, close = `\x1B[${y3}m`;
1391
+ return function(txt) {
1392
+ if (!$.enabled || txt == null) return txt;
1393
+ return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
1195
1394
  };
1196
1395
  }
1396
+ var reset = init(0, 0);
1397
+ var bold = init(1, 22);
1398
+ var dim = init(2, 22);
1399
+ var italic = init(3, 23);
1400
+ var underline = init(4, 24);
1401
+ var inverse = init(7, 27);
1402
+ var hidden = init(8, 28);
1403
+ var strikethrough = init(9, 29);
1404
+ var black = init(30, 39);
1405
+ var red = init(31, 39);
1406
+ var green = init(32, 39);
1407
+ var yellow = init(33, 39);
1408
+ var blue = init(34, 39);
1409
+ var magenta = init(35, 39);
1410
+ var cyan = init(36, 39);
1411
+ var white = init(37, 39);
1412
+ var gray = init(90, 39);
1413
+ var grey = init(90, 39);
1414
+ var bgBlack = init(40, 49);
1415
+ var bgRed = init(41, 49);
1416
+ var bgGreen = init(42, 49);
1417
+ var bgYellow = init(43, 49);
1418
+ var bgBlue = init(44, 49);
1419
+ var bgMagenta = init(45, 49);
1420
+ var bgCyan = init(46, 49);
1421
+ var bgWhite = init(47, 49);
1197
1422
 
1198
- // node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/dist/index.mjs
1199
- var import_node_process2 = __toESM(require("node:process"), 1);
1200
- var import_picocolors2 = __toESM(require_picocolors(), 1);
1201
- var import_sisteransi2 = __toESM(require_src(), 1);
1202
- function q2() {
1203
- return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1204
- }
1205
- var _2 = q2();
1206
- var o = (r2, n) => _2 ? r2 : n;
1207
- var H = o("\u25C6", "*");
1208
- var I2 = o("\u25A0", "x");
1209
- var x2 = o("\u25B2", "x");
1210
- var S2 = o("\u25C7", "o");
1211
- var K = o("\u250C", "T");
1212
- var a2 = o("\u2502", "|");
1213
- var d2 = o("\u2514", "\u2014");
1214
- var b2 = o("\u25CF", ">");
1215
- var E = o("\u25CB", " ");
1216
- var C = o("\u25FB", "[\u2022]");
1217
- var w2 = o("\u25FC", "[+]");
1218
- var M2 = o("\u25FB", "[ ]");
1219
- var U2 = o("\u25AA", "\u2022");
1220
- var B = o("\u2500", "-");
1221
- var Z2 = o("\u256E", "+");
1222
- var z2 = o("\u251C", "+");
1223
- var X2 = o("\u256F", "+");
1224
- var J2 = o("\u25CF", "\u2022");
1225
- var Y = o("\u25C6", "*");
1226
- var Q2 = o("\u25B2", "!");
1227
- var ee = o("\u25A0", "x");
1228
- var y2 = (r2) => {
1229
- switch (r2) {
1230
- case "initial":
1231
- case "active":
1232
- return import_picocolors2.default.cyan(H);
1233
- case "cancel":
1234
- return import_picocolors2.default.red(I2);
1235
- case "error":
1236
- return import_picocolors2.default.yellow(x2);
1237
- case "submit":
1238
- return import_picocolors2.default.green(S2);
1423
+ // packages/qwik/src/cli/utils/app-command.ts
1424
+ var import_node_fs = require("node:fs");
1425
+ var import_node_path = require("node:path");
1426
+ var AppCommand = class {
1427
+ args;
1428
+ task;
1429
+ cwd;
1430
+ _rootDir;
1431
+ _rootPkgJson;
1432
+ constructor(opts) {
1433
+ this._rootDir = opts.rootDir;
1434
+ this.cwd = opts.cwd;
1435
+ this.args = opts.args.slice();
1436
+ this.task = this.args[0];
1239
1437
  }
1240
- };
1241
- var te = (r2) => new TD({ validate: r2.validate, placeholder: r2.placeholder, defaultValue: r2.defaultValue, initialValue: r2.initialValue, render() {
1242
- var _a;
1243
- const n = `${import_picocolors2.default.gray(a2)}
1244
- ${y2(this.state)} ${r2.message}
1245
- `, i = r2.placeholder ? import_picocolors2.default.inverse(r2.placeholder[0]) + import_picocolors2.default.dim(r2.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), t = this.value ? this.valueWithCursor : i;
1246
- switch (this.state) {
1247
- case "error":
1248
- return `${n.trim()}
1249
- ${import_picocolors2.default.yellow(a2)} ${t}
1250
- ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
1251
- `;
1252
- case "submit":
1253
- return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(this.value || r2.placeholder)}`;
1254
- case "cancel":
1255
- return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${((_a = this.value) == null ? void 0 : _a.trim()) ? `
1256
- ` + import_picocolors2.default.gray(a2) : ""}`;
1257
- default:
1258
- return `${n}${import_picocolors2.default.cyan(a2)} ${t}
1259
- ${import_picocolors2.default.cyan(d2)}
1260
- `;
1438
+ get rootDir() {
1439
+ if (!this._rootDir) {
1440
+ const fsRoot = (0, import_node_path.resolve)("/");
1441
+ let testDir = process.cwd();
1442
+ for (let i = 0; i < 20; i++) {
1443
+ const pkgPath = (0, import_node_path.join)(testDir, "package.json");
1444
+ if ((0, import_node_fs.existsSync)(pkgPath)) {
1445
+ this._rootDir = testDir;
1446
+ break;
1447
+ }
1448
+ if (testDir === fsRoot) {
1449
+ break;
1450
+ }
1451
+ testDir = (0, import_node_path.dirname)(testDir);
1452
+ }
1453
+ if (!this._rootDir) {
1454
+ throw new Error(`Unable to find Qwik app package.json`);
1455
+ }
1456
+ }
1457
+ return this._rootDir;
1261
1458
  }
1262
- } }).prompt();
1263
- var se = (r2) => {
1264
- const n = r2.active ?? "Yes", i = r2.inactive ?? "No";
1265
- return new xD({ active: n, inactive: i, initialValue: r2.initialValue ?? true, render() {
1266
- const t = `${import_picocolors2.default.gray(a2)}
1267
- ${y2(this.state)} ${r2.message}
1268
- `, s2 = this.value ? n : i;
1269
- switch (this.state) {
1270
- case "submit":
1271
- return `${t}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(s2)}`;
1272
- case "cancel":
1273
- return `${t}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s2))}
1274
- ${import_picocolors2.default.gray(a2)}`;
1275
- default:
1276
- return `${t}${import_picocolors2.default.cyan(a2)} ${this.value ? `${import_picocolors2.default.green(b2)} ${n}` : `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(i)}` : `${import_picocolors2.default.green(b2)} ${i}`}
1277
- ${import_picocolors2.default.cyan(d2)}
1278
- `;
1459
+ set rootDir(rootDir) {
1460
+ this._rootDir = rootDir;
1461
+ }
1462
+ get packageJson() {
1463
+ if (!this._rootPkgJson) {
1464
+ const pkgJsonPath = (0, import_node_path.join)(this.rootDir, "package.json");
1465
+ this._rootPkgJson = JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf-8"));
1279
1466
  }
1280
- } }).prompt();
1281
- };
1282
- var ie = (r2) => {
1283
- const n = (t, s2) => {
1284
- const c2 = t.label ?? String(t.value);
1285
- return s2 === "active" ? `${import_picocolors2.default.green(b2)} ${c2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}` : s2 === "selected" ? `${import_picocolors2.default.dim(c2)}` : s2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(c2))}` : `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(c2)}`;
1286
- };
1287
- let i = 0;
1288
- return new yD({ options: r2.options, initialValue: r2.initialValue, render() {
1289
- const t = `${import_picocolors2.default.gray(a2)}
1290
- ${y2(this.state)} ${r2.message}
1291
- `;
1292
- switch (this.state) {
1293
- case "submit":
1294
- return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "selected")}`;
1295
- case "cancel":
1296
- return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "cancelled")}
1297
- ${import_picocolors2.default.gray(a2)}`;
1298
- default: {
1299
- const s2 = r2.maxItems === void 0 ? 1 / 0 : Math.max(r2.maxItems, 5);
1300
- this.cursor >= i + s2 - 3 ? i = Math.max(Math.min(this.cursor - s2 + 3, this.options.length - s2), 0) : this.cursor < i + 2 && (i = Math.max(this.cursor - 2, 0));
1301
- const c2 = s2 < this.options.length && i > 0, l2 = s2 < this.options.length && i + s2 < this.options.length;
1302
- return `${t}${import_picocolors2.default.cyan(a2)} ${this.options.slice(i, i + s2).map((u, m2, $4) => m2 === 0 && c2 ? import_picocolors2.default.dim("...") : m2 === $4.length - 1 && l2 ? import_picocolors2.default.dim("...") : n(u, m2 + i === this.cursor ? "active" : "inactive")).join(`
1303
- ${import_picocolors2.default.cyan(a2)} `)}
1304
- ${import_picocolors2.default.cyan(d2)}
1305
- `;
1306
- }
1467
+ return this._rootPkgJson;
1468
+ }
1469
+ getArg(name) {
1470
+ const key = `--${name}`;
1471
+ const matcher = new RegExp(`^${key}($|=)`);
1472
+ const index = this.args.findIndex((arg) => matcher.test(arg));
1473
+ if (index === -1) {
1474
+ return;
1307
1475
  }
1308
- } }).prompt();
1309
- };
1310
- var oe = (r2 = "") => {
1311
- process.stdout.write(`${import_picocolors2.default.gray(K)} ${r2}
1312
- `);
1313
- };
1314
- var $e = (r2 = "") => {
1315
- process.stdout.write(`${import_picocolors2.default.gray(a2)}
1316
- ${import_picocolors2.default.gray(d2)} ${r2}
1317
-
1318
- `);
1319
- };
1320
- var f2 = { message: (r2 = "", { symbol: n = import_picocolors2.default.gray(a2) } = {}) => {
1321
- const i = [`${import_picocolors2.default.gray(a2)}`];
1322
- if (r2) {
1323
- const [t, ...s2] = r2.split(`
1324
- `);
1325
- i.push(`${n} ${t}`, ...s2.map((c2) => `${import_picocolors2.default.gray(a2)} ${c2}`));
1476
+ if (this.args[index].includes("=")) {
1477
+ return this.args[index].split("=")[1];
1478
+ }
1479
+ return this.args[index + 1];
1326
1480
  }
1327
- process.stdout.write(`${i.join(`
1328
- `)}
1329
- `);
1330
- }, info: (r2) => {
1331
- f2.message(r2, { symbol: import_picocolors2.default.blue(J2) });
1332
- }, success: (r2) => {
1333
- f2.message(r2, { symbol: import_picocolors2.default.green(Y) });
1334
- }, step: (r2) => {
1335
- f2.message(r2, { symbol: import_picocolors2.default.green(S2) });
1336
- }, warn: (r2) => {
1337
- f2.message(r2, { symbol: import_picocolors2.default.yellow(Q2) });
1338
- }, warning: (r2) => {
1339
- f2.warn(r2);
1340
- }, error: (r2) => {
1341
- f2.message(r2, { symbol: import_picocolors2.default.red(ee) });
1342
- } };
1343
- var de = () => {
1344
- const r2 = _2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], n = _2 ? 80 : 120;
1345
- let i, t, s2 = false, c2 = "";
1346
- const l2 = (v2 = "") => {
1347
- s2 = true, i = WD(), c2 = v2.replace(/\.+$/, ""), process.stdout.write(`${import_picocolors2.default.gray(a2)}
1348
- `);
1349
- let g2 = 0, p = 0;
1350
- t = setInterval(() => {
1351
- const O2 = import_picocolors2.default.magenta(r2[g2]), P2 = ".".repeat(Math.floor(p)).slice(0, 3);
1352
- process.stdout.write(import_sisteransi2.cursor.move(-999, 0)), process.stdout.write(import_sisteransi2.erase.down(1)), process.stdout.write(`${O2} ${c2}${P2}`), g2 = g2 + 1 < r2.length ? g2 + 1 : 0, p = p < r2.length ? p + 0.125 : 0;
1353
- }, n);
1354
- }, u = (v2 = "", g2 = 0) => {
1355
- c2 = v2 ?? c2, s2 = false, clearInterval(t);
1356
- const p = g2 === 0 ? import_picocolors2.default.green(S2) : g2 === 1 ? import_picocolors2.default.red(I2) : import_picocolors2.default.red(x2);
1357
- process.stdout.write(import_sisteransi2.cursor.move(-999, 0)), process.stdout.write(import_sisteransi2.erase.down(1)), process.stdout.write(`${p} ${c2}
1358
- `), i();
1359
- }, m2 = (v2 = "") => {
1360
- c2 = v2 ?? c2;
1361
- }, $4 = (v2) => {
1362
- const g2 = v2 > 1 ? "Something went wrong" : "Canceled";
1363
- s2 && u(g2, v2);
1364
- };
1365
- return process.on("uncaughtExceptionMonitor", () => $4(2)), process.on("unhandledRejection", () => $4(2)), process.on("SIGINT", () => $4(1)), process.on("SIGTERM", () => $4(1)), process.on("exit", $4), { start: l2, stop: u, message: m2 };
1366
1481
  };
1367
1482
 
1483
+ // packages/qwik/src/cli/add/run-add-interactive.ts
1484
+ init_dist2();
1485
+
1368
1486
  // packages/qwik/src/cli/utils/integrations.ts
1369
1487
  var import_node_fs3 = __toESM(require("node:fs"), 1);
1370
1488
  var import_node_path3 = require("node:path");
1371
1489
 
1372
1490
  // packages/qwik/src/cli/utils/utils.ts
1491
+ init_dist2();
1373
1492
  var import_which_pm_runs = __toESM(require_which_pm_runs(), 1);
1374
1493
  var import_node_fs2 = __toESM(require("node:fs"), 1);
1375
1494
  var import_node_path2 = require("node:path");
@@ -1419,6 +1538,10 @@ async function readPackageJson(dir) {
1419
1538
  const pkgJson = JSON.parse(await import_node_fs2.default.promises.readFile(path3, "utf-8"));
1420
1539
  return pkgJson;
1421
1540
  }
1541
+ async function writePackageJson(dir, pkgJson) {
1542
+ const path3 = (0, import_node_path2.join)(dir, "package.json");
1543
+ await import_node_fs2.default.promises.writeFile(path3, JSON.stringify(pkgJson, null, 2) + "\n");
1544
+ }
1422
1545
  function dashToTitleCase(str) {
1423
1546
  return str.toLocaleLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join(" ");
1424
1547
  }
@@ -1567,7 +1690,7 @@ async function loadIntegrations() {
1567
1690
  const dirItems = await import_node_fs3.default.promises.readdir(dir);
1568
1691
  await Promise.all(
1569
1692
  dirItems.map(async (dirItem) => {
1570
- var _a, _b, _c;
1693
+ var _a, _b, _c, _d;
1571
1694
  const dirPath = (0, import_node_path3.join)(dir, dirItem);
1572
1695
  const stat = await import_node_fs3.default.promises.stat(dirPath);
1573
1696
  if (stat.isDirectory()) {
@@ -1579,7 +1702,8 @@ async function loadIntegrations() {
1579
1702
  dir: dirPath,
1580
1703
  pkgJson,
1581
1704
  docs: ((_b = pkgJson.__qwik__) == null ? void 0 : _b.docs) ?? [],
1582
- priority: ((_c = pkgJson == null ? void 0 : pkgJson.__qwik__) == null ? void 0 : _c.priority) ?? 0
1705
+ priority: ((_c = pkgJson == null ? void 0 : pkgJson.__qwik__) == null ? void 0 : _c.priority) ?? 0,
1706
+ alwaysInRoot: ((_d = pkgJson.__qwik__) == null ? void 0 : _d.alwaysInRoot) ?? []
1583
1707
  };
1584
1708
  loadingIntegrations.push(integration);
1585
1709
  }
@@ -1606,6 +1730,7 @@ async function loadIntegrations() {
1606
1730
  var import_node_path6 = require("node:path");
1607
1731
 
1608
1732
  // packages/qwik/src/cli/utils/install-deps.ts
1733
+ init_dist2();
1609
1734
  function installDeps(pkgManager, dir) {
1610
1735
  return runCommand(pkgManager, ["install"], dir);
1611
1736
  }
@@ -1626,43 +1751,45 @@ function logNextStep(nextSteps, packageManager) {
1626
1751
  }
1627
1752
 
1628
1753
  // packages/qwik/src/cli/add/update-app.ts
1629
- var import_node_path5 = require("node:path");
1754
+ init_dist2();
1630
1755
  var import_node_fs5 = __toESM(require("node:fs"), 1);
1756
+ var import_node_path5 = require("node:path");
1631
1757
 
1632
1758
  // packages/qwik/src/cli/add/update-files.ts
1633
1759
  var import_node_fs4 = __toESM(require("node:fs"), 1);
1634
1760
  var import_node_path4 = require("node:path");
1635
- async function mergeIntegrationDir(fileUpdates, opts, srcDir, destDir) {
1761
+ async function mergeIntegrationDir(fileUpdates, opts, srcDir, destDir, alwaysInRoot) {
1636
1762
  const items = await import_node_fs4.default.promises.readdir(srcDir);
1637
1763
  await Promise.all(
1638
1764
  items.map(async (itemName) => {
1639
1765
  const destName = itemName === "gitignore" ? ".gitignore" : itemName;
1640
1766
  const ext = (0, import_node_path4.extname)(destName);
1641
1767
  const srcChildPath = (0, import_node_path4.join)(srcDir, itemName);
1642
- const destChildPath = (0, import_node_path4.join)(destDir, destName);
1768
+ const destRootPath = (0, import_node_path4.join)(destDir, destName);
1643
1769
  const s2 = await import_node_fs4.default.promises.stat(srcChildPath);
1644
1770
  if (s2.isDirectory()) {
1645
- await mergeIntegrationDir(fileUpdates, opts, srcChildPath, destChildPath);
1771
+ await mergeIntegrationDir(fileUpdates, opts, srcChildPath, destRootPath, alwaysInRoot);
1646
1772
  } else if (s2.isFile()) {
1773
+ const finalDestPath = getFinalDestPath(opts, destRootPath, destDir, destName, alwaysInRoot);
1647
1774
  if (destName === "package.json") {
1648
- await mergePackageJsons(fileUpdates, srcChildPath, destChildPath);
1775
+ await mergePackageJsons(fileUpdates, srcChildPath, destRootPath);
1649
1776
  } else if (destName === "settings.json") {
1650
- await mergeJsons(fileUpdates, srcChildPath, destChildPath);
1777
+ await mergeJsons(fileUpdates, srcChildPath, finalDestPath);
1651
1778
  } else if (destName === "README.md") {
1652
- await mergeReadmes(fileUpdates, srcChildPath, destChildPath);
1779
+ await mergeReadmes(fileUpdates, srcChildPath, finalDestPath);
1653
1780
  } else if (destName === ".gitignore" || destName === ".prettierignore" || destName === ".eslintignore") {
1654
- await mergeIgnoresFile(fileUpdates, srcChildPath, destChildPath);
1781
+ await mergeIgnoresFile(fileUpdates, srcChildPath, destRootPath);
1655
1782
  } else if (ext === ".css") {
1656
- await mergeCss(fileUpdates, srcChildPath, destChildPath, opts);
1657
- } else if (import_node_fs4.default.existsSync(destChildPath)) {
1783
+ await mergeCss(fileUpdates, srcChildPath, finalDestPath, opts);
1784
+ } else if (import_node_fs4.default.existsSync(finalDestPath)) {
1658
1785
  fileUpdates.files.push({
1659
- path: destChildPath,
1786
+ path: finalDestPath,
1660
1787
  content: await import_node_fs4.default.promises.readFile(srcChildPath),
1661
1788
  type: "overwrite"
1662
1789
  });
1663
1790
  } else {
1664
1791
  fileUpdates.files.push({
1665
- path: destChildPath,
1792
+ path: finalDestPath,
1666
1793
  content: await import_node_fs4.default.promises.readFile(srcChildPath),
1667
1794
  type: "create"
1668
1795
  });
@@ -1671,6 +1798,14 @@ async function mergeIntegrationDir(fileUpdates, opts, srcDir, destDir) {
1671
1798
  })
1672
1799
  );
1673
1800
  }
1801
+ function getFinalDestPath(opts, destRootPath, destDir, destName, alwaysInRoot) {
1802
+ const projectDir = opts.projectDir ? opts.projectDir : "";
1803
+ const rootDirEndIndex = destDir.indexOf(opts.rootDir) + opts.rootDir.length;
1804
+ const destWithoutRoot = destDir.slice(rootDirEndIndex);
1805
+ const destChildPath = (0, import_node_path4.join)(opts.rootDir, projectDir, destWithoutRoot, destName);
1806
+ const finalDestPath = alwaysInRoot && alwaysInRoot.some((rootItem) => destName.includes(rootItem) || destDir.includes(rootItem)) ? destRootPath : destChildPath;
1807
+ return finalDestPath;
1808
+ }
1674
1809
  async function mergePackageJsons(fileUpdates, srcPath, destPath) {
1675
1810
  var _a;
1676
1811
  const srcContent = await import_node_fs4.default.promises.readFile(srcPath, "utf-8");
@@ -1807,25 +1942,25 @@ var import_fs = __toESM(require("fs"), 1);
1807
1942
  var import_path = require("path");
1808
1943
 
1809
1944
  // packages/qwik/src/cli/code-mod/code-mod.ts
1810
- function updateViteConfig(ts, sourceText, updates) {
1945
+ function updateViteConfig(ts2, sourceText, updates) {
1811
1946
  if (!(updates == null ? void 0 : updates.imports) && !(updates == null ? void 0 : updates.qwikViteConfig) && !(updates == null ? void 0 : updates.viteConfig) && !(updates == null ? void 0 : updates.vitePlugins) && !(updates == null ? void 0 : updates.vitePluginsPrepend)) {
1812
1947
  return null;
1813
1948
  }
1814
- sourceText = transformSource(ts, sourceText, () => (tsSourceFile) => {
1949
+ sourceText = transformSource(ts2, sourceText, () => (tsSourceFile) => {
1815
1950
  if (updates.imports) {
1816
1951
  for (const importData of updates.imports) {
1817
- tsSourceFile = ensureImport(ts, tsSourceFile, importData);
1952
+ tsSourceFile = ensureImport(ts2, tsSourceFile, importData);
1818
1953
  }
1819
1954
  }
1820
1955
  const statements = [];
1821
1956
  for (const s2 of tsSourceFile.statements) {
1822
- if (ts.isExportAssignment(s2) && s2.expression && ts.isCallExpression(s2.expression)) {
1823
- if (ts.isIdentifier(s2.expression.expression) && s2.expression.expression.text === "defineConfig" && (updates.viteConfig || updates.qwikViteConfig || updates.vitePlugins || updates.vitePluginsPrepend)) {
1957
+ if (ts2.isExportAssignment(s2) && s2.expression && ts2.isCallExpression(s2.expression)) {
1958
+ if (ts2.isIdentifier(s2.expression.expression) && s2.expression.expression.text === "defineConfig" && (updates.viteConfig || updates.qwikViteConfig || updates.vitePlugins || updates.vitePluginsPrepend)) {
1824
1959
  statements.push(
1825
- ts.factory.updateExportAssignment(
1960
+ ts2.factory.updateExportAssignment(
1826
1961
  s2,
1827
1962
  s2.modifiers,
1828
- updateDefineConfig(ts, s2.expression, updates)
1963
+ updateDefineConfig(ts2, s2.expression, updates)
1829
1964
  )
1830
1965
  );
1831
1966
  continue;
@@ -1833,20 +1968,20 @@ function updateViteConfig(ts, sourceText, updates) {
1833
1968
  }
1834
1969
  statements.push(s2);
1835
1970
  }
1836
- return ts.factory.updateSourceFile(tsSourceFile, statements);
1971
+ return ts2.factory.updateSourceFile(tsSourceFile, statements);
1837
1972
  });
1838
1973
  return sourceText;
1839
1974
  }
1840
- function ensureImport(ts, tsSourceFile, importData) {
1975
+ function ensureImport(ts2, tsSourceFile, importData) {
1841
1976
  if (importData && importData.importPath) {
1842
1977
  if (Array.isArray(importData.namedImports)) {
1843
1978
  importData.namedImports.forEach((namedImport) => {
1844
- tsSourceFile = ensureNamedImport(ts, tsSourceFile, namedImport, importData.importPath);
1979
+ tsSourceFile = ensureNamedImport(ts2, tsSourceFile, namedImport, importData.importPath);
1845
1980
  });
1846
1981
  }
1847
1982
  if (typeof importData.defaultImport === "string") {
1848
1983
  tsSourceFile = ensureDefaultImport(
1849
- ts,
1984
+ ts2,
1850
1985
  tsSourceFile,
1851
1986
  importData.defaultImport,
1852
1987
  importData.importPath
@@ -1855,36 +1990,36 @@ function ensureImport(ts, tsSourceFile, importData) {
1855
1990
  }
1856
1991
  return tsSourceFile;
1857
1992
  }
1858
- function ensureNamedImport(ts, tsSourceFile, namedImport, importPath) {
1859
- if (!hasNamedImport(ts, tsSourceFile, namedImport, importPath)) {
1860
- tsSourceFile = appendImports(ts, tsSourceFile, null, namedImport, importPath);
1993
+ function ensureNamedImport(ts2, tsSourceFile, namedImport, importPath) {
1994
+ if (!hasNamedImport(ts2, tsSourceFile, namedImport, importPath)) {
1995
+ tsSourceFile = appendImports(ts2, tsSourceFile, null, namedImport, importPath);
1861
1996
  }
1862
1997
  return tsSourceFile;
1863
1998
  }
1864
- function ensureDefaultImport(ts, tsSourceFile, defaultImport, importPath) {
1865
- if (!hasDefaultImport(ts, tsSourceFile, importPath)) {
1866
- tsSourceFile = appendImports(ts, tsSourceFile, defaultImport, null, importPath);
1999
+ function ensureDefaultImport(ts2, tsSourceFile, defaultImport, importPath) {
2000
+ if (!hasDefaultImport(ts2, tsSourceFile, importPath)) {
2001
+ tsSourceFile = appendImports(ts2, tsSourceFile, defaultImport, null, importPath);
1867
2002
  }
1868
2003
  return tsSourceFile;
1869
2004
  }
1870
- function hasNamedImport(ts, tsSourceFile, namedImport, importPath) {
1871
- return !!findNamedImport(ts, tsSourceFile, namedImport, importPath);
2005
+ function hasNamedImport(ts2, tsSourceFile, namedImport, importPath) {
2006
+ return !!findNamedImport(ts2, tsSourceFile, namedImport, importPath);
1872
2007
  }
1873
- function hasDefaultImport(ts, tsSourceFile, importPath) {
1874
- return !!findDefaultImport(ts, tsSourceFile, importPath);
2008
+ function hasDefaultImport(ts2, tsSourceFile, importPath) {
2009
+ return !!findDefaultImport(ts2, tsSourceFile, importPath);
1875
2010
  }
1876
- function findNamedImport(ts, tsSourceFile, namedImport, importPath) {
1877
- return findImportDeclarations(ts, tsSourceFile).find((n) => {
1878
- if (n.importClause && n.moduleSpecifier && ts.isStringLiteral(n.moduleSpecifier)) {
2011
+ function findNamedImport(ts2, tsSourceFile, namedImport, importPath) {
2012
+ return findImportDeclarations(ts2, tsSourceFile).find((n) => {
2013
+ if (n.importClause && n.moduleSpecifier && ts2.isStringLiteral(n.moduleSpecifier)) {
1879
2014
  if (n.moduleSpecifier.text !== importPath) {
1880
2015
  return false;
1881
2016
  }
1882
2017
  const namedImports = n.importClause.namedBindings;
1883
- if (namedImports && ts.isNamedImports(namedImports) && namedImports.elements) {
2018
+ if (namedImports && ts2.isNamedImports(namedImports) && namedImports.elements) {
1884
2019
  return namedImports.elements.some((namedImportElement) => {
1885
- if (ts.isImportSpecifier(namedImportElement)) {
2020
+ if (ts2.isImportSpecifier(namedImportElement)) {
1886
2021
  const importName = namedImportElement.name;
1887
- if (importName && ts.isIdentifier(importName)) {
2022
+ if (importName && ts2.isIdentifier(importName)) {
1888
2023
  return importName.text === namedImport;
1889
2024
  }
1890
2025
  }
@@ -1895,11 +2030,11 @@ function findNamedImport(ts, tsSourceFile, namedImport, importPath) {
1895
2030
  return false;
1896
2031
  });
1897
2032
  }
1898
- function findDefaultImport(ts, tsSourceFile, importPath) {
1899
- return findImportDeclarations(ts, tsSourceFile).find((n) => {
2033
+ function findDefaultImport(ts2, tsSourceFile, importPath) {
2034
+ return findImportDeclarations(ts2, tsSourceFile).find((n) => {
1900
2035
  if (n.importClause && n.moduleSpecifier) {
1901
2036
  const modulePath = n.moduleSpecifier;
1902
- if (ts.isStringLiteral(modulePath) && modulePath.text === importPath) {
2037
+ if (ts2.isStringLiteral(modulePath) && modulePath.text === importPath) {
1903
2038
  const moduleDefault = n.importClause.name;
1904
2039
  if (moduleDefault && moduleDefault.text === importPath) {
1905
2040
  return true;
@@ -1909,18 +2044,18 @@ function findDefaultImport(ts, tsSourceFile, importPath) {
1909
2044
  return false;
1910
2045
  });
1911
2046
  }
1912
- function findImportDeclarations(ts, tsSourceFile) {
1913
- return tsSourceFile.statements.filter(ts.isImportDeclaration);
2047
+ function findImportDeclarations(ts2, tsSourceFile) {
2048
+ return tsSourceFile.statements.filter(ts2.isImportDeclaration);
1914
2049
  }
1915
- function appendImports(ts, tsSourceFile, defaultImport, namedImport, importPath) {
2050
+ function appendImports(ts2, tsSourceFile, defaultImport, namedImport, importPath) {
1916
2051
  const statements = tsSourceFile.statements.slice();
1917
2052
  let foundExistingImport = false;
1918
2053
  for (let i = statements.length - 1; i >= 0; i--) {
1919
2054
  const n = statements[i];
1920
- if (!ts.isImportDeclaration(n)) {
2055
+ if (!ts2.isImportDeclaration(n)) {
1921
2056
  continue;
1922
2057
  }
1923
- if (!n.moduleSpecifier || !ts.isStringLiteral(n.moduleSpecifier)) {
2058
+ if (!n.moduleSpecifier || !ts2.isStringLiteral(n.moduleSpecifier)) {
1924
2059
  continue;
1925
2060
  }
1926
2061
  if (n.moduleSpecifier.text !== importPath) {
@@ -1930,13 +2065,13 @@ function appendImports(ts, tsSourceFile, defaultImport, namedImport, importPath)
1930
2065
  const existingNamedImports = [];
1931
2066
  if (n.importClause) {
1932
2067
  const namedImports = n.importClause.namedBindings;
1933
- if (namedImports && ts.isNamedImports(namedImports) && namedImports.elements) {
2068
+ if (namedImports && ts2.isNamedImports(namedImports) && namedImports.elements) {
1934
2069
  existingNamedImports.push(...namedImports.elements);
1935
2070
  }
1936
2071
  }
1937
2072
  if (typeof namedImport === "string") {
1938
- const identifier = ts.factory.createIdentifier(namedImport);
1939
- const importSpecifier = ts.factory.createImportSpecifier(false, void 0, identifier);
2073
+ const identifier = ts2.factory.createIdentifier(namedImport);
2074
+ const importSpecifier = ts2.factory.createImportSpecifier(false, void 0, identifier);
1940
2075
  existingNamedImports.push(importSpecifier);
1941
2076
  }
1942
2077
  existingNamedImports.sort((a3, b3) => {
@@ -1946,16 +2081,16 @@ function appendImports(ts, tsSourceFile, defaultImport, namedImport, importPath)
1946
2081
  });
1947
2082
  let defaultIdentifier = n.importClause ? n.importClause.name : void 0;
1948
2083
  if (typeof defaultImport === "string") {
1949
- defaultIdentifier = ts.factory.createIdentifier(defaultImport);
2084
+ defaultIdentifier = ts2.factory.createIdentifier(defaultImport);
1950
2085
  }
1951
2086
  let namedBindings = void 0;
1952
2087
  if (existingNamedImports.length > 0) {
1953
- namedBindings = ts.factory.createNamedImports(existingNamedImports);
2088
+ namedBindings = ts2.factory.createNamedImports(existingNamedImports);
1954
2089
  }
1955
- statements[i] = ts.factory.updateImportDeclaration(
2090
+ statements[i] = ts2.factory.updateImportDeclaration(
1956
2091
  n,
1957
2092
  void 0,
1958
- ts.factory.createImportClause(false, defaultIdentifier, namedBindings),
2093
+ ts2.factory.createImportClause(false, defaultIdentifier, namedBindings),
1959
2094
  n.moduleSpecifier,
1960
2095
  void 0
1961
2096
  );
@@ -1964,61 +2099,61 @@ function appendImports(ts, tsSourceFile, defaultImport, namedImport, importPath)
1964
2099
  let defaultIdentifier = void 0;
1965
2100
  let namedBindings = void 0;
1966
2101
  if (typeof defaultImport === "string") {
1967
- defaultIdentifier = ts.factory.createIdentifier(defaultImport);
2102
+ defaultIdentifier = ts2.factory.createIdentifier(defaultImport);
1968
2103
  }
1969
2104
  if (typeof namedImport === "string") {
1970
- namedBindings = ts.factory.createNamedImports([
1971
- ts.factory.createImportSpecifier(
2105
+ namedBindings = ts2.factory.createNamedImports([
2106
+ ts2.factory.createImportSpecifier(
1972
2107
  false,
1973
2108
  void 0,
1974
- ts.factory.createIdentifier(namedImport)
2109
+ ts2.factory.createIdentifier(namedImport)
1975
2110
  )
1976
2111
  ]);
1977
2112
  }
1978
- const newNamedImport = ts.factory.createImportDeclaration(
2113
+ const newNamedImport = ts2.factory.createImportDeclaration(
1979
2114
  void 0,
1980
- ts.factory.createImportClause(false, defaultIdentifier, namedBindings),
1981
- ts.factory.createStringLiteral(importPath)
2115
+ ts2.factory.createImportClause(false, defaultIdentifier, namedBindings),
2116
+ ts2.factory.createStringLiteral(importPath)
1982
2117
  );
1983
- const lastImportIndex = findLastImportIndex(ts, tsSourceFile);
2118
+ const lastImportIndex = findLastImportIndex(ts2, tsSourceFile);
1984
2119
  statements.splice(lastImportIndex + 1, 0, newNamedImport);
1985
2120
  }
1986
- return ts.factory.updateSourceFile(tsSourceFile, statements);
2121
+ return ts2.factory.updateSourceFile(tsSourceFile, statements);
1987
2122
  }
1988
- function findLastImportIndex(ts, tsSourceFile) {
2123
+ function findLastImportIndex(ts2, tsSourceFile) {
1989
2124
  for (let i = tsSourceFile.statements.length - 1; i >= 0; i--) {
1990
2125
  const s2 = tsSourceFile.statements[i];
1991
- if (ts.isImportDeclaration(s2)) {
2126
+ if (ts2.isImportDeclaration(s2)) {
1992
2127
  return i;
1993
2128
  }
1994
- if (ts.isStringLiteral(s2) && s2.text === "use strict") {
2129
+ if (ts2.isStringLiteral(s2) && s2.text === "use strict") {
1995
2130
  return i;
1996
2131
  }
1997
2132
  }
1998
2133
  return 0;
1999
2134
  }
2000
- function updateDefineConfig(ts, callExp, updates) {
2135
+ function updateDefineConfig(ts2, callExp, updates) {
2001
2136
  const args = [];
2002
2137
  for (let i = 0; i < callExp.arguments.length; i++) {
2003
2138
  const exp = callExp.arguments[i];
2004
2139
  if (i === 0) {
2005
- if (ts.isArrowFunction(exp) && ts.isBlock(exp.body)) {
2140
+ if (ts2.isArrowFunction(exp) && ts2.isBlock(exp.body)) {
2006
2141
  args.push(
2007
- ts.factory.updateArrowFunction(
2142
+ ts2.factory.updateArrowFunction(
2008
2143
  exp,
2009
2144
  exp.modifiers,
2010
2145
  exp.typeParameters,
2011
2146
  exp.parameters,
2012
2147
  exp.type,
2013
2148
  exp.equalsGreaterThanToken,
2014
- updateDefineConfigFnReturn(ts, exp.body, updates)
2149
+ updateDefineConfigFnReturn(ts2, exp.body, updates)
2015
2150
  )
2016
2151
  );
2017
2152
  continue;
2018
2153
  }
2019
- if (ts.isFunctionExpression(exp) && ts.isBlock(exp.body)) {
2154
+ if (ts2.isFunctionExpression(exp) && ts2.isBlock(exp.body)) {
2020
2155
  args.push(
2021
- ts.factory.updateFunctionExpression(
2156
+ ts2.factory.updateFunctionExpression(
2022
2157
  exp,
2023
2158
  exp.modifiers,
2024
2159
  exp.asteriskToken,
@@ -2026,53 +2161,53 @@ function updateDefineConfig(ts, callExp, updates) {
2026
2161
  exp.typeParameters,
2027
2162
  exp.parameters,
2028
2163
  exp.type,
2029
- updateDefineConfigFnReturn(ts, exp.body, updates)
2164
+ updateDefineConfigFnReturn(ts2, exp.body, updates)
2030
2165
  )
2031
2166
  );
2032
2167
  continue;
2033
2168
  }
2034
- if (ts.isObjectLiteralExpression(exp)) {
2035
- args.push(updateVitConfigObj(ts, exp, updates));
2169
+ if (ts2.isObjectLiteralExpression(exp)) {
2170
+ args.push(updateVitConfigObj(ts2, exp, updates));
2036
2171
  continue;
2037
2172
  }
2038
2173
  }
2039
2174
  args.push(exp);
2040
2175
  }
2041
- return ts.factory.updateCallExpression(callExp, callExp.expression, callExp.typeArguments, args);
2176
+ return ts2.factory.updateCallExpression(callExp, callExp.expression, callExp.typeArguments, args);
2042
2177
  }
2043
- function updateDefineConfigFnReturn(ts, fnBody, updates) {
2178
+ function updateDefineConfigFnReturn(ts2, fnBody, updates) {
2044
2179
  const statements = [];
2045
2180
  for (const s2 of fnBody.statements) {
2046
- if (ts.isReturnStatement(s2) && s2.expression && ts.isObjectLiteralExpression(s2.expression)) {
2181
+ if (ts2.isReturnStatement(s2) && s2.expression && ts2.isObjectLiteralExpression(s2.expression)) {
2047
2182
  statements.push(
2048
- ts.factory.updateReturnStatement(s2, updateVitConfigObj(ts, s2.expression, updates))
2183
+ ts2.factory.updateReturnStatement(s2, updateVitConfigObj(ts2, s2.expression, updates))
2049
2184
  );
2050
2185
  } else {
2051
2186
  statements.push(s2);
2052
2187
  }
2053
2188
  }
2054
- return ts.factory.updateBlock(fnBody, statements);
2189
+ return ts2.factory.updateBlock(fnBody, statements);
2055
2190
  }
2056
- function updateVitConfigObj(ts, obj, updates) {
2191
+ function updateVitConfigObj(ts2, obj, updates) {
2057
2192
  if (updates.viteConfig) {
2058
- obj = updateObjectLiteralExpression(ts, obj, updates.viteConfig);
2193
+ obj = updateObjectLiteralExpression(ts2, obj, updates.viteConfig);
2059
2194
  }
2060
2195
  if (updates.vitePlugins || updates.vitePluginsPrepend || updates.qwikViteConfig) {
2061
- obj = updatePlugins(ts, obj, updates);
2196
+ obj = updatePlugins(ts2, obj, updates);
2062
2197
  }
2063
2198
  return obj;
2064
2199
  }
2065
- function updatePlugins(ts, obj, updates) {
2200
+ function updatePlugins(ts2, obj, updates) {
2066
2201
  const properties = [];
2067
2202
  for (const p of obj.properties) {
2068
- if (ts.isPropertyAssignment(p)) {
2069
- if (p.name && ts.isIdentifier(p.name) && p.name.text === "plugins") {
2070
- if (ts.isArrayLiteralExpression(p.initializer)) {
2203
+ if (ts2.isPropertyAssignment(p)) {
2204
+ if (p.name && ts2.isIdentifier(p.name) && p.name.text === "plugins") {
2205
+ if (ts2.isArrayLiteralExpression(p.initializer)) {
2071
2206
  properties.push(
2072
- ts.factory.updatePropertyAssignment(
2207
+ ts2.factory.updatePropertyAssignment(
2073
2208
  p,
2074
2209
  p.name,
2075
- updatePluginsArray(ts, p.initializer, updates)
2210
+ updatePluginsArray(ts2, p.initializer, updates)
2076
2211
  )
2077
2212
  );
2078
2213
  continue;
@@ -2081,17 +2216,17 @@ function updatePlugins(ts, obj, updates) {
2081
2216
  }
2082
2217
  properties.push(p);
2083
2218
  }
2084
- return ts.factory.updateObjectLiteralExpression(obj, properties);
2219
+ return ts2.factory.updateObjectLiteralExpression(obj, properties);
2085
2220
  }
2086
- function updatePluginsArray(ts, arr, updates) {
2221
+ function updatePluginsArray(ts2, arr, updates) {
2087
2222
  var _a, _b;
2088
2223
  const elms = [...arr.elements];
2089
2224
  if (updates.vitePlugins) {
2090
2225
  for (const vitePlugin of updates.vitePlugins) {
2091
- const pluginExp = createPluginCall(ts, vitePlugin);
2226
+ const pluginExp = createPluginCall(ts2, vitePlugin);
2092
2227
  const pluginName = (_a = pluginExp == null ? void 0 : pluginExp.expression) == null ? void 0 : _a.escapedText;
2093
2228
  const alreadyDefined = elms.some(
2094
- (el) => ts.isCallExpression(el) && ts.isIdentifier(el.expression) && el.expression.escapedText === pluginName
2229
+ (el) => ts2.isCallExpression(el) && ts2.isIdentifier(el.expression) && el.expression.escapedText === pluginName
2095
2230
  );
2096
2231
  if (pluginExp && !alreadyDefined) {
2097
2232
  elms.push(pluginExp);
@@ -2100,10 +2235,10 @@ function updatePluginsArray(ts, arr, updates) {
2100
2235
  }
2101
2236
  if (updates.vitePluginsPrepend) {
2102
2237
  for (const vitePlugin of updates.vitePluginsPrepend) {
2103
- const pluginExp = createPluginCall(ts, vitePlugin);
2238
+ const pluginExp = createPluginCall(ts2, vitePlugin);
2104
2239
  const pluginName = (_b = pluginExp == null ? void 0 : pluginExp.expression) == null ? void 0 : _b.escapedText;
2105
2240
  const alreadyDefined = elms.some(
2106
- (el) => ts.isCallExpression(el) && ts.isIdentifier(el.expression) && el.expression.escapedText === pluginName
2241
+ (el) => ts2.isCallExpression(el) && ts2.isIdentifier(el.expression) && el.expression.escapedText === pluginName
2107
2242
  );
2108
2243
  if (pluginExp && !alreadyDefined) {
2109
2244
  elms.unshift(pluginExp);
@@ -2113,68 +2248,68 @@ function updatePluginsArray(ts, arr, updates) {
2113
2248
  if (updates.qwikViteConfig) {
2114
2249
  for (let i = 0; i < elms.length; i++) {
2115
2250
  const elm = elms[i];
2116
- if (ts.isCallExpression(elm) && ts.isIdentifier(elm.expression)) {
2251
+ if (ts2.isCallExpression(elm) && ts2.isIdentifier(elm.expression)) {
2117
2252
  if (elm.expression.escapedText === "qwikVite") {
2118
- elms[i] = updateQwikRouterPlugin(ts, elm, updates.qwikViteConfig);
2253
+ elms[i] = updateQwikRouterPlugin(ts2, elm, updates.qwikViteConfig);
2119
2254
  }
2120
2255
  }
2121
2256
  }
2122
2257
  }
2123
- return ts.factory.updateArrayLiteralExpression(arr, elms);
2258
+ return ts2.factory.updateArrayLiteralExpression(arr, elms);
2124
2259
  }
2125
- function createPluginCall(ts, vitePlugin) {
2260
+ function createPluginCall(ts2, vitePlugin) {
2126
2261
  if (typeof vitePlugin === "string") {
2127
- const tmp = ts.createSourceFile(
2262
+ const tmp = ts2.createSourceFile(
2128
2263
  "tmp.ts",
2129
2264
  "export default " + vitePlugin,
2130
- ts.ScriptTarget.Latest
2265
+ ts2.ScriptTarget.Latest
2131
2266
  );
2132
2267
  for (const s2 of tmp.statements) {
2133
- if (ts.isExportAssignment(s2)) {
2268
+ if (ts2.isExportAssignment(s2)) {
2134
2269
  return s2.expression;
2135
2270
  }
2136
2271
  }
2137
2272
  }
2138
2273
  return null;
2139
2274
  }
2140
- function updateQwikRouterPlugin(ts, callExp, qwikViteConfig) {
2275
+ function updateQwikRouterPlugin(ts2, callExp, qwikViteConfig) {
2141
2276
  const args = callExp.arguments.slice();
2142
- const config = args[0] && ts.isObjectLiteralExpression(args[0]) ? args[0] : ts.factory.createObjectLiteralExpression();
2143
- args[0] = updateObjectLiteralExpression(ts, config, qwikViteConfig);
2144
- return ts.factory.updateCallExpression(callExp, callExp.expression, callExp.typeArguments, args);
2277
+ const config = args[0] && ts2.isObjectLiteralExpression(args[0]) ? args[0] : ts2.factory.createObjectLiteralExpression();
2278
+ args[0] = updateObjectLiteralExpression(ts2, config, qwikViteConfig);
2279
+ return ts2.factory.updateCallExpression(callExp, callExp.expression, callExp.typeArguments, args);
2145
2280
  }
2146
- function updateObjectLiteralExpression(ts, obj, updateObj) {
2281
+ function updateObjectLiteralExpression(ts2, obj, updateObj) {
2147
2282
  for (const [propName, value] of Object.entries(updateObj)) {
2148
2283
  if (typeof value === "string") {
2149
- const tmp = ts.createSourceFile("tmp.ts", "export default " + value, ts.ScriptTarget.Latest);
2284
+ const tmp = ts2.createSourceFile("tmp.ts", "export default " + value, ts2.ScriptTarget.Latest);
2150
2285
  for (const s2 of tmp.statements) {
2151
- if (ts.isExportAssignment(s2)) {
2286
+ if (ts2.isExportAssignment(s2)) {
2152
2287
  const exp = s2.expression;
2153
2288
  let added = false;
2154
2289
  const properties = [];
2155
2290
  for (const p of obj.properties) {
2156
- if (p.name && ts.isIdentifier(p.name) && p.name.text === propName) {
2157
- properties.push(ts.factory.createPropertyAssignment(propName, exp));
2291
+ if (p.name && ts2.isIdentifier(p.name) && p.name.text === propName) {
2292
+ properties.push(ts2.factory.createPropertyAssignment(propName, exp));
2158
2293
  added = true;
2159
2294
  } else {
2160
2295
  properties.push(p);
2161
2296
  }
2162
2297
  }
2163
2298
  if (!added) {
2164
- properties.unshift(ts.factory.createPropertyAssignment(propName, exp));
2299
+ properties.unshift(ts2.factory.createPropertyAssignment(propName, exp));
2165
2300
  }
2166
- obj = ts.factory.updateObjectLiteralExpression(obj, properties);
2301
+ obj = ts2.factory.updateObjectLiteralExpression(obj, properties);
2167
2302
  }
2168
2303
  }
2169
2304
  }
2170
2305
  }
2171
2306
  return obj;
2172
2307
  }
2173
- function transformSource(ts, sourceText, transformer) {
2174
- const t = ts.transform(ts.createSourceFile("/tmp.ts", sourceText, ts.ScriptTarget.Latest), [
2308
+ function transformSource(ts2, sourceText, transformer) {
2309
+ const t = ts2.transform(ts2.createSourceFile("/tmp.ts", sourceText, ts2.ScriptTarget.Latest), [
2175
2310
  transformer
2176
2311
  ]);
2177
- const p = ts.createPrinter({
2312
+ const p = ts2.createPrinter({
2178
2313
  removeComments: false,
2179
2314
  omitTrailingSemicolon: false,
2180
2315
  noEmitHelpers: true
@@ -2196,8 +2331,8 @@ async function updateViteConfigs(fileUpdates, integration, rootDir) {
2196
2331
  throw new Error(`Could not find vite.config.ts or vite.config.mts in ${rootDir}`);
2197
2332
  }
2198
2333
  const destContent = await import_fs.default.promises.readFile(viteConfigPath, "utf-8");
2199
- const ts = (await import("typescript")).default;
2200
- let updatedContent = updateViteConfig(ts, destContent, viteConfig);
2334
+ const ts2 = (await import("typescript")).default;
2335
+ let updatedContent = updateViteConfig(ts2, destContent, viteConfig);
2201
2336
  if (updatedContent) {
2202
2337
  try {
2203
2338
  const prettier = (await import("prettier")).default;
@@ -2244,7 +2379,13 @@ async function updateApp(pkgManager, opts) {
2244
2379
  ...integration.pkgJson.devDependencies
2245
2380
  };
2246
2381
  }
2247
- await mergeIntegrationDir(fileUpdates, opts, integration.dir, opts.rootDir);
2382
+ await mergeIntegrationDir(
2383
+ fileUpdates,
2384
+ opts,
2385
+ integration.dir,
2386
+ opts.rootDir,
2387
+ integration.alwaysInRoot
2388
+ );
2248
2389
  if (true) {
2249
2390
  await updateViteConfigs(fileUpdates, integration, opts.rootDir);
2250
2391
  }
@@ -2303,7 +2444,6 @@ async function runAddInteractive(app, id) {
2303
2444
  const pkgManager = getPackageManager();
2304
2445
  const integrations2 = await loadIntegrations();
2305
2446
  let integration;
2306
- printHeader();
2307
2447
  if (typeof id === "string") {
2308
2448
  integration = integrations2.find((i) => i.id === id);
2309
2449
  if (!integration) {
@@ -2332,15 +2472,20 @@ async function runAddInteractive(app, id) {
2332
2472
  ...integration.pkgJson.dependencies,
2333
2473
  ...integration.pkgJson.devDependencies
2334
2474
  }).length > 0;
2335
- let runInstall = false;
2475
+ let runInstall2 = false;
2336
2476
  if (integrationHasDeps) {
2337
- runInstall = true;
2477
+ runInstall2 = true;
2338
2478
  }
2339
- const result = await updateApp(pkgManager, {
2479
+ const updateAppOptions = {
2340
2480
  rootDir: app.rootDir,
2341
2481
  integration: integration.id,
2342
- installDeps: runInstall
2343
- });
2482
+ installDeps: runInstall2
2483
+ };
2484
+ const projectDir = app.getArg("projectDir");
2485
+ if (projectDir) {
2486
+ updateAppOptions.projectDir = projectDir;
2487
+ }
2488
+ const result = await updateApp(pkgManager, updateAppOptions);
2344
2489
  if (app.getArg("skipConfirmation") !== "true") {
2345
2490
  await logUpdateAppResult(pkgManager, result);
2346
2491
  }
@@ -2436,6 +2581,7 @@ function logUpdateAppCommitResult(result, pkgManager) {
2436
2581
  }
2437
2582
 
2438
2583
  // packages/qwik/src/cli/add/print-add-help.ts
2584
+ init_dist2();
2439
2585
  var SPACE_TO_HINT = 25;
2440
2586
  var MAX_HINT_LENGTH = 50;
2441
2587
  function renderIntegration(integrations2) {
@@ -2488,6 +2634,7 @@ async function runAddCommand(app) {
2488
2634
  // packages/qwik/src/cli/new/run-new-command.ts
2489
2635
  var import_node_fs7 = __toESM(require("node:fs"), 1);
2490
2636
  var import_path2 = require("path");
2637
+ init_dist2();
2491
2638
 
2492
2639
  // packages/qwik/src/cli/utils/templates.ts
2493
2640
  var import_node_fs6 = __toESM(require("node:fs"), 1);
@@ -4751,6 +4898,503 @@ function isString(s2) {
4751
4898
  return typeof s2 === "string" && s2.trim().length > 0;
4752
4899
  }
4753
4900
 
4901
+ // packages/qwik/src/cli/run.ts
4902
+ init_dist2();
4903
+
4904
+ // packages/qwik/src/cli/migrate-v2/run-migration.ts
4905
+ init_dist2();
4906
+
4907
+ // packages/qwik/src/cli/migrate-v2/replace-package.ts
4908
+ var import_path5 = require("path");
4909
+
4910
+ // packages/qwik/src/cli/migrate-v2/tools/binary-extensions.ts
4911
+ var import_path3 = require("path");
4912
+ var binaryExtensions = /* @__PURE__ */ new Set([
4913
+ // types originally from https://github.com/sindresorhus/binary-extensions/blob/40e44b510d87a63dcf42300bc8fbcb105f45a61c/binary-extensions.json
4914
+ ".3dm",
4915
+ ".3ds",
4916
+ ".3g2",
4917
+ ".3gp",
4918
+ ".7z",
4919
+ ".a",
4920
+ ".aac",
4921
+ ".adp",
4922
+ ".ai",
4923
+ ".aif",
4924
+ ".aiff",
4925
+ ".als",
4926
+ ".alz",
4927
+ ".ape",
4928
+ ".apk",
4929
+ ".appimage",
4930
+ ".ar",
4931
+ ".arj",
4932
+ ".asf",
4933
+ ".au",
4934
+ ".avi",
4935
+ ".bak",
4936
+ ".baml",
4937
+ ".bh",
4938
+ ".bin",
4939
+ ".bk",
4940
+ ".bmp",
4941
+ ".btif",
4942
+ ".bz2",
4943
+ ".bzip2",
4944
+ ".cab",
4945
+ ".caf",
4946
+ ".cgm",
4947
+ ".class",
4948
+ ".cmx",
4949
+ ".cpio",
4950
+ ".cr2",
4951
+ ".cur",
4952
+ ".dat",
4953
+ ".dcm",
4954
+ ".deb",
4955
+ ".dex",
4956
+ ".djvu",
4957
+ ".dll",
4958
+ ".dmg",
4959
+ ".dng",
4960
+ ".doc",
4961
+ ".docm",
4962
+ ".docx",
4963
+ ".dot",
4964
+ ".dotm",
4965
+ ".dra",
4966
+ ".DS_Store",
4967
+ ".dsk",
4968
+ ".dts",
4969
+ ".dtshd",
4970
+ ".dvb",
4971
+ ".dwg",
4972
+ ".dxf",
4973
+ ".ecelp4800",
4974
+ ".ecelp7470",
4975
+ ".ecelp9600",
4976
+ ".egg",
4977
+ ".eol",
4978
+ ".eot",
4979
+ ".epub",
4980
+ ".exe",
4981
+ ".f4v",
4982
+ ".fbs",
4983
+ ".fh",
4984
+ ".fla",
4985
+ ".flac",
4986
+ ".flatpak",
4987
+ ".fli",
4988
+ ".flv",
4989
+ ".fpx",
4990
+ ".fst",
4991
+ ".fvt",
4992
+ ".g3",
4993
+ ".gh",
4994
+ ".gif",
4995
+ ".glb",
4996
+ ".graffle",
4997
+ ".gz",
4998
+ ".gzip",
4999
+ ".h261",
5000
+ ".h263",
5001
+ ".h264",
5002
+ ".icns",
5003
+ ".ico",
5004
+ ".ief",
5005
+ ".img",
5006
+ ".ipa",
5007
+ ".iso",
5008
+ ".jar",
5009
+ ".jpeg",
5010
+ ".jpg",
5011
+ ".jpgv",
5012
+ ".jpm",
5013
+ ".jxr",
5014
+ ".key",
5015
+ ".keystore",
5016
+ ".ktx",
5017
+ ".lha",
5018
+ ".lib",
5019
+ ".lvp",
5020
+ ".lz",
5021
+ ".lzh",
5022
+ ".lzma",
5023
+ ".lzo",
5024
+ ".m3u",
5025
+ ".m4a",
5026
+ ".m4v",
5027
+ ".mar",
5028
+ ".mdi",
5029
+ ".mht",
5030
+ ".mid",
5031
+ ".midi",
5032
+ ".mj2",
5033
+ ".mka",
5034
+ ".mkv",
5035
+ ".mmr",
5036
+ ".mng",
5037
+ ".mobi",
5038
+ ".mov",
5039
+ ".movie",
5040
+ ".mp3",
5041
+ ".mp4",
5042
+ ".mp4a",
5043
+ ".mpeg",
5044
+ ".mpg",
5045
+ ".mpga",
5046
+ ".msi",
5047
+ ".mxu",
5048
+ ".nef",
5049
+ ".npx",
5050
+ ".npy",
5051
+ ".numbers",
5052
+ ".nupkg",
5053
+ ".o",
5054
+ ".odp",
5055
+ ".ods",
5056
+ ".odt",
5057
+ ".oga",
5058
+ ".ogg",
5059
+ ".ogv",
5060
+ ".otf",
5061
+ ".ott",
5062
+ ".pages",
5063
+ ".pbm",
5064
+ ".pbf",
5065
+ ".pcx",
5066
+ ".pdb",
5067
+ ".pdf",
5068
+ ".pea",
5069
+ ".pgm",
5070
+ ".pic",
5071
+ ".pkg",
5072
+ ".plist",
5073
+ ".png",
5074
+ ".pnm",
5075
+ ".pot",
5076
+ ".potm",
5077
+ ".potx",
5078
+ ".ppa",
5079
+ ".ppam",
5080
+ ".ppm",
5081
+ ".pps",
5082
+ ".ppsm",
5083
+ ".ppsx",
5084
+ ".ppt",
5085
+ ".pptm",
5086
+ ".pptx",
5087
+ ".psd",
5088
+ ".pxd",
5089
+ ".pxz",
5090
+ ".pya",
5091
+ ".pyc",
5092
+ ".pyo",
5093
+ ".pyv",
5094
+ ".qt",
5095
+ ".rar",
5096
+ ".ras",
5097
+ ".raw",
5098
+ ".resources",
5099
+ ".rgb",
5100
+ ".rip",
5101
+ ".rlc",
5102
+ ".rmf",
5103
+ ".rmvb",
5104
+ ".rpm",
5105
+ ".rtf",
5106
+ ".rz",
5107
+ ".s3m",
5108
+ ".s7z",
5109
+ ".scpt",
5110
+ ".sgi",
5111
+ ".shar",
5112
+ ".snap",
5113
+ ".sil",
5114
+ ".sketch",
5115
+ ".slk",
5116
+ ".smv",
5117
+ ".snk",
5118
+ ".so",
5119
+ ".stl",
5120
+ ".suo",
5121
+ ".sub",
5122
+ ".swf",
5123
+ ".tar",
5124
+ ".tbz",
5125
+ ".tbz2",
5126
+ ".tga",
5127
+ ".tgz",
5128
+ ".thmx",
5129
+ ".tif",
5130
+ ".tiff",
5131
+ ".tlz",
5132
+ ".ttc",
5133
+ ".ttf",
5134
+ ".txz",
5135
+ ".udf",
5136
+ ".uvh",
5137
+ ".uvi",
5138
+ ".uvm",
5139
+ ".uvp",
5140
+ ".uvs",
5141
+ ".uvu",
5142
+ ".viv",
5143
+ ".vob",
5144
+ ".war",
5145
+ ".wav",
5146
+ ".wax",
5147
+ ".wbmp",
5148
+ ".wdp",
5149
+ ".weba",
5150
+ ".webm",
5151
+ ".webp",
5152
+ ".whl",
5153
+ ".wim",
5154
+ ".wm",
5155
+ ".wma",
5156
+ ".wmv",
5157
+ ".wmx",
5158
+ ".woff",
5159
+ ".woff2",
5160
+ ".wrm",
5161
+ ".wvx",
5162
+ ".xbm",
5163
+ ".xif",
5164
+ ".xla",
5165
+ ".xlam",
5166
+ ".xls",
5167
+ ".xlsb",
5168
+ ".xlsm",
5169
+ ".xlsx",
5170
+ ".xlt",
5171
+ ".xltm",
5172
+ ".xltx",
5173
+ ".xm",
5174
+ ".xmind",
5175
+ ".xpi",
5176
+ ".xpm",
5177
+ ".xwd",
5178
+ ".xz",
5179
+ ".z",
5180
+ ".zip",
5181
+ ".zipx"
5182
+ ]);
5183
+ function isBinaryPath(path3) {
5184
+ return binaryExtensions.has((0, import_path3.extname)(path3).toLowerCase());
5185
+ }
5186
+
5187
+ // packages/qwik/src/cli/migrate-v2/replace-package.ts
5188
+ init_visit_not_ignored_files();
5189
+ var import_fs3 = require("fs");
5190
+ init_dist2();
5191
+ function updateFileContent(path3, content) {
5192
+ (0, import_fs3.writeFileSync)(path3, content);
5193
+ f2.info(`"${path3}" has been updated`);
5194
+ }
5195
+ function replacePackage(oldPackageName, newPackageName, skipDependencies = false) {
5196
+ if (!skipDependencies) {
5197
+ replacePackageInDependencies(oldPackageName, newPackageName);
5198
+ }
5199
+ replaceMentions(oldPackageName, newPackageName);
5200
+ }
5201
+ function replacePackageInDependencies(oldPackageName, newPackageName) {
5202
+ visitNotIgnoredFiles(".", (path3) => {
5203
+ if ((0, import_path5.basename)(path3) !== "package.json") {
5204
+ return;
5205
+ }
5206
+ try {
5207
+ const packageJson = JSON.parse((0, import_fs3.readFileSync)(path3, "utf-8"));
5208
+ for (const deps of [
5209
+ packageJson.dependencies ?? {},
5210
+ packageJson.devDependencies ?? {},
5211
+ packageJson.peerDependencies ?? {},
5212
+ packageJson.optionalDependencies ?? {}
5213
+ ]) {
5214
+ if (oldPackageName in deps) {
5215
+ deps[newPackageName] = deps[oldPackageName];
5216
+ delete deps[oldPackageName];
5217
+ }
5218
+ }
5219
+ updateFileContent(path3, JSON.stringify(packageJson, null, 2));
5220
+ } catch (e2) {
5221
+ console.warn(`Could not replace ${oldPackageName} with ${newPackageName} in ${path3}.`);
5222
+ }
5223
+ });
5224
+ }
5225
+ function replaceMentions(oldPackageName, newPackageName) {
5226
+ visitNotIgnoredFiles(".", (path3) => {
5227
+ if (isBinaryPath(path3)) {
5228
+ return;
5229
+ }
5230
+ const ignoredFiles = [
5231
+ "yarn.lock",
5232
+ "package-lock.json",
5233
+ "pnpm-lock.yaml",
5234
+ "bun.lockb",
5235
+ "CHANGELOG.md"
5236
+ ];
5237
+ if (ignoredFiles.includes((0, import_path5.basename)(path3))) {
5238
+ return;
5239
+ }
5240
+ try {
5241
+ const contents = (0, import_fs3.readFileSync)(path3, "utf-8");
5242
+ if (!contents.includes(oldPackageName)) {
5243
+ return;
5244
+ }
5245
+ updateFileContent(path3, contents.replace(new RegExp(oldPackageName, "g"), newPackageName));
5246
+ } catch {
5247
+ f2.warn(
5248
+ `An error was thrown when trying to update ${path3}. If you believe the migration should have updated it, be sure to review the file and open an issue.`
5249
+ );
5250
+ }
5251
+ });
5252
+ }
5253
+
5254
+ // packages/qwik/src/cli/migrate-v2/update-dependencies.ts
5255
+ var import_node_child_process4 = require("node:child_process");
5256
+
5257
+ // packages/qwik/src/cli/migrate-v2/versions.ts
5258
+ var versionTagPriority = ["latest", "v2", "rc", "beta", "alpha"];
5259
+ var packageNames = [
5260
+ "@qwik.dev/core",
5261
+ "@qwik.dev/router",
5262
+ "@qwik.dev/react",
5263
+ "eslint-plugin-qwik"
5264
+ ];
5265
+
5266
+ // packages/qwik/src/cli/migrate-v2/update-dependencies.ts
5267
+ var import_semver = require("semver");
5268
+ init_dist2();
5269
+ async function updateDependencies() {
5270
+ const packageJson = await readPackageJson(process.cwd());
5271
+ const version = getPackageTag();
5272
+ const dependencyNames = [
5273
+ "dependencies",
5274
+ "devDependencies",
5275
+ "peerDependencies",
5276
+ "optionalDependencies"
5277
+ ];
5278
+ for (const name of packageNames) {
5279
+ for (const propName of dependencyNames) {
5280
+ const prop = packageJson[propName];
5281
+ if (prop && prop[name]) {
5282
+ prop[name] = version;
5283
+ }
5284
+ }
5285
+ }
5286
+ await writePackageJson(process.cwd(), packageJson);
5287
+ const loading = de();
5288
+ loading.start(`Updating dependencies...`);
5289
+ await runInstall();
5290
+ loading.stop("Dependencies have been updated");
5291
+ }
5292
+ function getPackageTag() {
5293
+ var _a;
5294
+ const tags = (_a = (0, import_node_child_process4.execSync)("npm dist-tag @qwik.dev/core", {
5295
+ encoding: "utf-8"
5296
+ })) == null ? void 0 : _a.split("\n").filter(Boolean).map(
5297
+ (data) => data.split(":").map((v2) => v2 == null ? void 0 : v2.trim()).filter(Boolean)
5298
+ ).filter((v2) => v2.length === 2).sort((a3, b3) => {
5299
+ let aIndex = versionTagPriority.indexOf(a3[0]);
5300
+ let bIndex = versionTagPriority.indexOf(b3[0]);
5301
+ if (aIndex === -1) {
5302
+ aIndex = Infinity;
5303
+ } else if (bIndex === -1) {
5304
+ bIndex = Infinity;
5305
+ }
5306
+ return aIndex - bIndex;
5307
+ });
5308
+ for (const [, version] of tags) {
5309
+ if ((0, import_semver.major)(version) === 2) {
5310
+ return version;
5311
+ }
5312
+ }
5313
+ f2.warn('Failed to resolve the Qwik version tag, version "2.0.0" will be installed');
5314
+ return "2.0.0";
5315
+ }
5316
+ async function installTsMorph() {
5317
+ var _a, _b;
5318
+ const packageJson = await readPackageJson(process.cwd());
5319
+ if (((_a = packageJson.dependencies) == null ? void 0 : _a["ts-morph"]) || ((_b = packageJson.devDependencies) == null ? void 0 : _b["ts-morph"])) {
5320
+ return false;
5321
+ }
5322
+ const loading = de();
5323
+ loading.start("Fetching migration tools..");
5324
+ (packageJson.devDependencies ??= {})["ts-morph"] = "latest";
5325
+ await writePackageJson(process.cwd(), packageJson);
5326
+ await runInstall();
5327
+ loading.stop("Migration tools have been loaded");
5328
+ return true;
5329
+ }
5330
+ async function runInstall() {
5331
+ const { install } = installDeps(getPackageManager(), process.cwd());
5332
+ const passed = await install;
5333
+ if (!passed) {
5334
+ throw new Error("Failed to install dependencies");
5335
+ }
5336
+ }
5337
+ async function removeTsMorphFromPackageJson() {
5338
+ var _a, _b;
5339
+ const packageJson = await readPackageJson(process.cwd());
5340
+ (_a = packageJson.dependencies) == null ? true : delete _a["ts-morph"];
5341
+ (_b = packageJson.devDependencies) == null ? true : delete _b["ts-morph"];
5342
+ await writePackageJson(process.cwd(), packageJson);
5343
+ }
5344
+
5345
+ // packages/qwik/src/cli/migrate-v2/run-migration.ts
5346
+ async function runV2Migration(app) {
5347
+ oe(
5348
+ `\u2728 ${bgMagenta(" This command will migrate your Qwik application from v1 to v2")}
5349
+ This includes the following:
5350
+ - "@builder.io/qwik", "@builder.io/qwik-city" and "@builder.io/qwik-react" packages will be rescoped to "@qwik.dev/core", "@qwik.dev/router" and "@qwik.dev/react" respectively
5351
+ - related dependencies will be updated
5352
+
5353
+ ${bold(bgRed('Warning: migration tool is experimental and will migrate your application to the "alpha" release of Qwik V2'))}`
5354
+ );
5355
+ const proceed = await se({
5356
+ message: "Do you want to proceed?",
5357
+ initialValue: true
5358
+ });
5359
+ if (hD(proceed) || !proceed) {
5360
+ bye();
5361
+ }
5362
+ try {
5363
+ const installedTsMorph = await installTsMorph();
5364
+ const { replaceImportInFiles: replaceImportInFiles2 } = await Promise.resolve().then(() => (init_rename_import(), rename_import_exports));
5365
+ replaceImportInFiles2(
5366
+ [
5367
+ ["QwikCityProvider", "QwikRouterProvider"],
5368
+ ["qwikCity", "qwikRouter"],
5369
+ ["QwikCityVitePluginOptions", "QwikRouterVitePluginOptions"],
5370
+ ["QwikCityPlugin", "QwikRouterPlugin"],
5371
+ ["createQwikCity", "createQwikRouter"],
5372
+ ["QwikCityNodeRequestOptions", "QwikRouterNodeRequestOptions"]
5373
+ ],
5374
+ "@builder.io/qwik-city"
5375
+ );
5376
+ replaceImportInFiles2(
5377
+ [["qwikCityPlan", "qwikRouterConfig"]],
5378
+ "@qwik-city-plan"
5379
+ // using old name, package name will be updated in the next step
5380
+ );
5381
+ replaceImportInFiles2([["jsxs", "jsx"]], "@builder.io/qwik/jsx-runtime");
5382
+ replacePackage("@qwik-city-plan", "@qwik-router-config", true);
5383
+ replacePackage("@builder.io/qwik-city", "@qwik.dev/router");
5384
+ replacePackage("@builder.io/qwik-react", "@qwik.dev/react");
5385
+ replacePackage("@builder.io/qwik/jsx-runtime", "@qwik.dev/core");
5386
+ replacePackage("@builder.io/qwik", "@qwik.dev/core");
5387
+ if (installedTsMorph) {
5388
+ await removeTsMorphFromPackageJson();
5389
+ }
5390
+ await updateDependencies();
5391
+ f2.success(`${green(`Your application has been successfully migrated to v2!`)}`);
5392
+ } catch (error) {
5393
+ console.error(error);
5394
+ throw error;
5395
+ }
5396
+ }
5397
+
4754
5398
  // packages/qwik/src/cli/run.ts
4755
5399
  var SPACE_TO_HINT2 = 18;
4756
5400
  var COMMANDS = [
@@ -4789,6 +5433,13 @@ var COMMANDS = [
4789
5433
  run: () => runJokeCommand(),
4790
5434
  showInHelp: true
4791
5435
  },
5436
+ {
5437
+ value: "migrate-v2",
5438
+ label: "migrate-v2",
5439
+ hint: "Rescopes the application from @builder.io/* namespace to @qwik.dev/*",
5440
+ run: (app) => runV2Migration(app),
5441
+ showInHelp: false
5442
+ },
4792
5443
  {
4793
5444
  value: "help",
4794
5445
  label: "help",
@@ -4839,6 +5490,10 @@ async function runCommand2(app) {
4839
5490
  await runJokeCommand();
4840
5491
  return;
4841
5492
  }
5493
+ case "migrate-v2": {
5494
+ await runV2Migration(app);
5495
+ return;
5496
+ }
4842
5497
  case "version": {
4843
5498
  printVersion();
4844
5499
  return;
@@ -4881,7 +5536,7 @@ async function printHelp(app) {
4881
5536
  await runCommand2(Object.assign(app, { task: args[0], args }));
4882
5537
  }
4883
5538
  function printVersion() {
4884
- console.log("2.0.0-alpha.0-dev+dd93926");
5539
+ console.log("2.0.0-alpha.10-dev+a588b48");
4885
5540
  }
4886
5541
  // Annotate the CommonJS export names for ESM import in node:
4887
5542
  0 && (module.exports = {