@forsakringskassan/vite-lib-config 4.1.0 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
7
+ var __commonJS = (cb, mod) => function __require2() {
8
8
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
9
  };
10
10
  var __export = (target, all) => {
@@ -915,133 +915,6 @@ var require_picocolors = __commonJS({
915
915
  }
916
916
  });
917
917
 
918
- // node_modules/has-flag/index.js
919
- var require_has_flag = __commonJS({
920
- "node_modules/has-flag/index.js"(exports2, module2) {
921
- "use strict";
922
- module2.exports = (flag, argv = process.argv) => {
923
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
924
- const position = argv.indexOf(prefix + flag);
925
- const terminatorPosition = argv.indexOf("--");
926
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
927
- };
928
- }
929
- });
930
-
931
- // node_modules/supports-color/index.js
932
- var require_supports_color = __commonJS({
933
- "node_modules/supports-color/index.js"(exports2, module2) {
934
- "use strict";
935
- var os = require("os");
936
- var tty = require("tty");
937
- var hasFlag = require_has_flag();
938
- var { env } = process;
939
- var flagForceColor;
940
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
941
- flagForceColor = 0;
942
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
943
- flagForceColor = 1;
944
- }
945
- function envForceColor() {
946
- if ("FORCE_COLOR" in env) {
947
- if (env.FORCE_COLOR === "true") {
948
- return 1;
949
- }
950
- if (env.FORCE_COLOR === "false") {
951
- return 0;
952
- }
953
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
954
- }
955
- }
956
- function translateLevel(level) {
957
- if (level === 0) {
958
- return false;
959
- }
960
- return {
961
- level,
962
- hasBasic: true,
963
- has256: level >= 2,
964
- has16m: level >= 3
965
- };
966
- }
967
- function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
968
- const noFlagForceColor = envForceColor();
969
- if (noFlagForceColor !== void 0) {
970
- flagForceColor = noFlagForceColor;
971
- }
972
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
973
- if (forceColor === 0) {
974
- return 0;
975
- }
976
- if (sniffFlags) {
977
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
978
- return 3;
979
- }
980
- if (hasFlag("color=256")) {
981
- return 2;
982
- }
983
- }
984
- if (haveStream && !streamIsTTY && forceColor === void 0) {
985
- return 0;
986
- }
987
- const min = forceColor || 0;
988
- if (env.TERM === "dumb") {
989
- return min;
990
- }
991
- if (process.platform === "win32") {
992
- const osRelease = os.release().split(".");
993
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
994
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
995
- }
996
- return 1;
997
- }
998
- if ("CI" in env) {
999
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
1000
- return 1;
1001
- }
1002
- return min;
1003
- }
1004
- if ("TEAMCITY_VERSION" in env) {
1005
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1006
- }
1007
- if (env.COLORTERM === "truecolor") {
1008
- return 3;
1009
- }
1010
- if ("TERM_PROGRAM" in env) {
1011
- const version3 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1012
- switch (env.TERM_PROGRAM) {
1013
- case "iTerm.app":
1014
- return version3 >= 3 ? 3 : 2;
1015
- case "Apple_Terminal":
1016
- return 2;
1017
- }
1018
- }
1019
- if (/-256(color)?$/i.test(env.TERM)) {
1020
- return 2;
1021
- }
1022
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1023
- return 1;
1024
- }
1025
- if ("COLORTERM" in env) {
1026
- return 1;
1027
- }
1028
- return min;
1029
- }
1030
- function getSupportLevel(stream2, options = {}) {
1031
- const level = supportsColor(stream2, {
1032
- streamIsTTY: stream2 && stream2.isTTY,
1033
- ...options
1034
- });
1035
- return translateLevel(level);
1036
- }
1037
- module2.exports = {
1038
- supportsColor: getSupportLevel,
1039
- stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
1040
- stderr: getSupportLevel({ isTTY: tty.isatty(2) })
1041
- };
1042
- }
1043
- });
1044
-
1045
918
  // node_modules/semver/internal/constants.js
1046
919
  var require_constants = __commonJS({
1047
920
  "node_modules/semver/internal/constants.js"(exports2, module2) {
@@ -1097,7 +970,7 @@ var require_re = __commonJS({
1097
970
  exports2 = module2.exports = {};
1098
971
  var re = exports2.re = [];
1099
972
  var safeRe = exports2.safeRe = [];
1100
- var src2 = exports2.src = [];
973
+ var src = exports2.src = [];
1101
974
  var safeSrc = exports2.safeSrc = [];
1102
975
  var t = exports2.t = {};
1103
976
  var R = 0;
@@ -1118,7 +991,7 @@ var require_re = __commonJS({
1118
991
  const index = R++;
1119
992
  debug2(name, index, value);
1120
993
  t[name] = index;
1121
- src2[index] = value;
994
+ src[index] = value;
1122
995
  safeSrc[index] = safe;
1123
996
  re[index] = new RegExp(value, isGlobal ? "g" : void 0);
1124
997
  safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
@@ -1126,46 +999,46 @@ var require_re = __commonJS({
1126
999
  createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
1127
1000
  createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
1128
1001
  createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
1129
- createToken("MAINVERSION", `(${src2[t.NUMERICIDENTIFIER]})\\.(${src2[t.NUMERICIDENTIFIER]})\\.(${src2[t.NUMERICIDENTIFIER]})`);
1130
- createToken("MAINVERSIONLOOSE", `(${src2[t.NUMERICIDENTIFIERLOOSE]})\\.(${src2[t.NUMERICIDENTIFIERLOOSE]})\\.(${src2[t.NUMERICIDENTIFIERLOOSE]})`);
1131
- createToken("PRERELEASEIDENTIFIER", `(?:${src2[t.NONNUMERICIDENTIFIER]}|${src2[t.NUMERICIDENTIFIER]})`);
1132
- createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src2[t.NONNUMERICIDENTIFIER]}|${src2[t.NUMERICIDENTIFIERLOOSE]})`);
1133
- createToken("PRERELEASE", `(?:-(${src2[t.PRERELEASEIDENTIFIER]}(?:\\.${src2[t.PRERELEASEIDENTIFIER]})*))`);
1134
- createToken("PRERELEASELOOSE", `(?:-?(${src2[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src2[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
1002
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
1003
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
1004
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
1005
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
1006
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
1007
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
1135
1008
  createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
1136
- createToken("BUILD", `(?:\\+(${src2[t.BUILDIDENTIFIER]}(?:\\.${src2[t.BUILDIDENTIFIER]})*))`);
1137
- createToken("FULLPLAIN", `v?${src2[t.MAINVERSION]}${src2[t.PRERELEASE]}?${src2[t.BUILD]}?`);
1138
- createToken("FULL", `^${src2[t.FULLPLAIN]}$`);
1139
- createToken("LOOSEPLAIN", `[v=\\s]*${src2[t.MAINVERSIONLOOSE]}${src2[t.PRERELEASELOOSE]}?${src2[t.BUILD]}?`);
1140
- createToken("LOOSE", `^${src2[t.LOOSEPLAIN]}$`);
1009
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
1010
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
1011
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
1012
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
1013
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
1141
1014
  createToken("GTLT", "((?:<|>)?=?)");
1142
- createToken("XRANGEIDENTIFIERLOOSE", `${src2[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
1143
- createToken("XRANGEIDENTIFIER", `${src2[t.NUMERICIDENTIFIER]}|x|X|\\*`);
1144
- createToken("XRANGEPLAIN", `[v=\\s]*(${src2[t.XRANGEIDENTIFIER]})(?:\\.(${src2[t.XRANGEIDENTIFIER]})(?:\\.(${src2[t.XRANGEIDENTIFIER]})(?:${src2[t.PRERELEASE]})?${src2[t.BUILD]}?)?)?`);
1145
- createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src2[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src2[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src2[t.XRANGEIDENTIFIERLOOSE]})(?:${src2[t.PRERELEASELOOSE]})?${src2[t.BUILD]}?)?)?`);
1146
- createToken("XRANGE", `^${src2[t.GTLT]}\\s*${src2[t.XRANGEPLAIN]}$`);
1147
- createToken("XRANGELOOSE", `^${src2[t.GTLT]}\\s*${src2[t.XRANGEPLAINLOOSE]}$`);
1015
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
1016
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
1017
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
1018
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
1019
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
1020
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
1148
1021
  createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
1149
- createToken("COERCE", `${src2[t.COERCEPLAIN]}(?:$|[^\\d])`);
1150
- createToken("COERCEFULL", src2[t.COERCEPLAIN] + `(?:${src2[t.PRERELEASE]})?(?:${src2[t.BUILD]})?(?:$|[^\\d])`);
1151
- createToken("COERCERTL", src2[t.COERCE], true);
1152
- createToken("COERCERTLFULL", src2[t.COERCEFULL], true);
1022
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
1023
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
1024
+ createToken("COERCERTL", src[t.COERCE], true);
1025
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
1153
1026
  createToken("LONETILDE", "(?:~>?)");
1154
- createToken("TILDETRIM", `(\\s*)${src2[t.LONETILDE]}\\s+`, true);
1027
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
1155
1028
  exports2.tildeTrimReplace = "$1~";
1156
- createToken("TILDE", `^${src2[t.LONETILDE]}${src2[t.XRANGEPLAIN]}$`);
1157
- createToken("TILDELOOSE", `^${src2[t.LONETILDE]}${src2[t.XRANGEPLAINLOOSE]}$`);
1029
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
1030
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
1158
1031
  createToken("LONECARET", "(?:\\^)");
1159
- createToken("CARETTRIM", `(\\s*)${src2[t.LONECARET]}\\s+`, true);
1032
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
1160
1033
  exports2.caretTrimReplace = "$1^";
1161
- createToken("CARET", `^${src2[t.LONECARET]}${src2[t.XRANGEPLAIN]}$`);
1162
- createToken("CARETLOOSE", `^${src2[t.LONECARET]}${src2[t.XRANGEPLAINLOOSE]}$`);
1163
- createToken("COMPARATORLOOSE", `^${src2[t.GTLT]}\\s*(${src2[t.LOOSEPLAIN]})$|^$`);
1164
- createToken("COMPARATOR", `^${src2[t.GTLT]}\\s*(${src2[t.FULLPLAIN]})$|^$`);
1165
- createToken("COMPARATORTRIM", `(\\s*)${src2[t.GTLT]}\\s*(${src2[t.LOOSEPLAIN]}|${src2[t.XRANGEPLAIN]})`, true);
1034
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
1035
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
1036
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
1037
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
1038
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
1166
1039
  exports2.comparatorTrimReplace = "$1$2$3";
1167
- createToken("HYPHENRANGE", `^\\s*(${src2[t.XRANGEPLAIN]})\\s+-\\s+(${src2[t.XRANGEPLAIN]})\\s*$`);
1168
- createToken("HYPHENRANGELOOSE", `^\\s*(${src2[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src2[t.XRANGEPLAINLOOSE]})\\s*$`);
1040
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
1041
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
1169
1042
  createToken("STAR", "(<|>)?=?\\s*\\*");
1170
1043
  createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
1171
1044
  createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
@@ -2964,7 +2837,8 @@ var import_ufuzzy = __toESM(require_uFuzzy());
2964
2837
  var import_deepmerge = __toESM(require_cjs());
2965
2838
  var import_picocolors = __toESM(require_picocolors());
2966
2839
 
2967
- // node_modules/@vitejs/plugin-vue/dist/index.mjs
2840
+ // node_modules/@vitejs/plugin-vue/dist/index.js
2841
+ var import_node_module = require("node:module");
2968
2842
  var import_node_fs = __toESM(require("node:fs"), 1);
2969
2843
  var import_vite = require("vite");
2970
2844
  var import_vue = require("vue");
@@ -2989,28 +2863,42 @@ function makeRegexIdFilterToMatchWithQuery(input) {
2989
2863
  return new RegExp(input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"), input.flags);
2990
2864
  }
2991
2865
 
2992
- // node_modules/@vitejs/plugin-vue/dist/index.mjs
2993
- var import_node_module = require("node:module");
2866
+ // node_modules/@vitejs/plugin-vue/dist/index.js
2994
2867
  var import_node_path = __toESM(require("node:path"), 1);
2995
2868
  var import_node_crypto = __toESM(require("node:crypto"), 1);
2996
- var import_tty = __toESM(require("tty"), 1);
2997
- var import_util = __toESM(require("util"), 1);
2998
- var version = "6.0.0";
2869
+ var __create2 = Object.create;
2870
+ var __defProp2 = Object.defineProperty;
2871
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
2872
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
2873
+ var __getProtoOf2 = Object.getPrototypeOf;
2874
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
2875
+ var __commonJS2 = (cb, mod) => function() {
2876
+ return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
2877
+ };
2878
+ var __copyProps2 = (to, from, except, desc) => {
2879
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames2(from), i = 0, n = keys.length, key; i < n; i++) {
2880
+ key = keys[i];
2881
+ if (!__hasOwnProp2.call(to, key) && key !== except) __defProp2(to, key, {
2882
+ get: ((k) => from[k]).bind(null, key),
2883
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
2884
+ });
2885
+ }
2886
+ return to;
2887
+ };
2888
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
2889
+ value: mod,
2890
+ enumerable: true
2891
+ }) : target, mod));
2892
+ var __require = /* @__PURE__ */ (0, import_node_module.createRequire)(__filename);
2893
+ var version = "6.0.1";
2999
2894
  function resolveCompiler(root) {
3000
2895
  const compiler = tryResolveCompiler(root) || tryResolveCompiler();
3001
- if (!compiler) {
3002
- throw new Error(
3003
- `Failed to resolve vue/compiler-sfc.
3004
- @vitejs/plugin-vue requires vue (>=3.2.25) to be present in the dependency tree.`
3005
- );
3006
- }
2896
+ if (!compiler) throw new Error("Failed to resolve vue/compiler-sfc.\n@vitejs/plugin-vue requires vue (>=3.2.25) to be present in the dependency tree.");
3007
2897
  return compiler;
3008
2898
  }
3009
2899
  function tryResolveCompiler(root) {
3010
2900
  const vueMeta = tryRequire("vue/package.json", root);
3011
- if (vueMeta && vueMeta.version.split(".")[0] >= 3) {
3012
- return tryRequire("vue/compiler-sfc", root);
3013
- }
2901
+ if (vueMeta && vueMeta.version.split(".")[0] >= 3) return tryRequire("vue/compiler-sfc", root);
3014
2902
  }
3015
2903
  var _require = (0, import_node_module.createRequire)(__filename);
3016
2904
  function tryRequire(id, from) {
@@ -3022,21 +2910,11 @@ function tryRequire(id, from) {
3022
2910
  function parseVueRequest(id) {
3023
2911
  const [filename, rawQuery] = id.split(`?`, 2);
3024
2912
  const query = Object.fromEntries(new URLSearchParams(rawQuery));
3025
- if (query.vue != null) {
3026
- query.vue = true;
3027
- }
3028
- if (query.index != null) {
3029
- query.index = Number(query.index);
3030
- }
3031
- if (query.raw != null) {
3032
- query.raw = true;
3033
- }
3034
- if (query.url != null) {
3035
- query.url = true;
3036
- }
3037
- if (query.scoped != null) {
3038
- query.scoped = true;
3039
- }
2913
+ if (query.vue != null) query.vue = true;
2914
+ if (query.index != null) query.index = Number(query.index);
2915
+ if (query.raw != null) query.raw = true;
2916
+ if (query.url != null) query.url = true;
2917
+ if (query.scoped != null) query.scoped = true;
3040
2918
  return {
3041
2919
  filename,
3042
2920
  query
@@ -3045,14 +2923,7 @@ function parseVueRequest(id) {
3045
2923
  var cache = /* @__PURE__ */ new Map();
3046
2924
  var hmrCache = /* @__PURE__ */ new Map();
3047
2925
  var prevCache = /* @__PURE__ */ new Map();
3048
- function createDescriptor(filename, source, {
3049
- root,
3050
- isProduction,
3051
- sourceMap,
3052
- compiler,
3053
- template,
3054
- features
3055
- }, hmr = false) {
2926
+ function createDescriptor(filename, source, { root, isProduction, sourceMap, compiler, template, features }, hmr = false) {
3056
2927
  const { descriptor, errors } = compiler.parse(source, {
3057
2928
  filename,
3058
2929
  sourceMap,
@@ -3060,22 +2931,15 @@ function createDescriptor(filename, source, {
3060
2931
  });
3061
2932
  const normalizedPath = (0, import_vite.normalizePath)(import_node_path.default.relative(root, filename));
3062
2933
  const componentIdGenerator = features?.componentIdGenerator;
3063
- if (componentIdGenerator === "filepath") {
3064
- descriptor.id = getHash(normalizedPath);
3065
- } else if (componentIdGenerator === "filepath-source") {
3066
- descriptor.id = getHash(normalizedPath + source);
3067
- } else if (typeof componentIdGenerator === "function") {
3068
- descriptor.id = componentIdGenerator(
3069
- normalizedPath,
3070
- source,
3071
- isProduction,
3072
- getHash
3073
- );
3074
- } else {
3075
- descriptor.id = getHash(normalizedPath + (isProduction ? source : ""));
3076
- }
2934
+ if (componentIdGenerator === "filepath") descriptor.id = getHash(normalizedPath);
2935
+ else if (componentIdGenerator === "filepath-source") descriptor.id = getHash(normalizedPath + source);
2936
+ else if (typeof componentIdGenerator === "function") descriptor.id = componentIdGenerator(normalizedPath, source, isProduction, getHash);
2937
+ else descriptor.id = getHash(normalizedPath + (isProduction ? source : ""));
3077
2938
  (hmr ? hmrCache : cache).set(filename, descriptor);
3078
- return { descriptor, errors };
2939
+ return {
2940
+ descriptor,
2941
+ errors
2942
+ };
3079
2943
  }
3080
2944
  function getPrevDescriptor(filename) {
3081
2945
  return prevCache.get(filename);
@@ -3084,46 +2948,32 @@ function invalidateDescriptor(filename, hmr = false) {
3084
2948
  const _cache = hmr ? hmrCache : cache;
3085
2949
  const prev = _cache.get(filename);
3086
2950
  _cache.delete(filename);
3087
- if (prev) {
3088
- prevCache.set(filename, prev);
3089
- }
2951
+ if (prev) prevCache.set(filename, prev);
3090
2952
  }
3091
2953
  function getDescriptor(filename, options, createIfNotFound = true, hmr = false, code) {
3092
2954
  const _cache = hmr ? hmrCache : cache;
3093
- if (_cache.has(filename)) {
3094
- return _cache.get(filename);
3095
- }
2955
+ if (_cache.has(filename)) return _cache.get(filename);
3096
2956
  if (createIfNotFound) {
3097
- const { descriptor, errors } = createDescriptor(
3098
- filename,
3099
- code ?? import_node_fs.default.readFileSync(filename, "utf-8"),
3100
- options,
3101
- hmr
3102
- );
3103
- if (errors.length && !hmr) {
3104
- throw errors[0];
3105
- }
2957
+ const { descriptor, errors } = createDescriptor(filename, code ?? import_node_fs.default.readFileSync(filename, "utf-8"), options, hmr);
2958
+ if (errors.length && !hmr) throw errors[0];
3106
2959
  return descriptor;
3107
2960
  }
3108
2961
  }
3109
2962
  function getSrcDescriptor(filename, query) {
3110
- if (query.scoped) {
3111
- return cache.get(`${filename}?src=${query.src}`);
3112
- }
2963
+ if (query.scoped) return cache.get(`${filename}?src=${query.src}`);
3113
2964
  return cache.get(filename);
3114
2965
  }
3115
2966
  function getTempSrcDescriptor(filename, query) {
3116
2967
  return {
3117
2968
  filename,
3118
2969
  id: query.id || "",
3119
- styles: [
3120
- {
3121
- scoped: query.scoped,
3122
- loc: {
3123
- start: { line: 0, column: 0 }
3124
- }
3125
- }
3126
- ],
2970
+ styles: [{
2971
+ scoped: query.scoped,
2972
+ loc: { start: {
2973
+ line: 0,
2974
+ column: 0
2975
+ } }
2976
+ }],
3127
2977
  isTemp: true
3128
2978
  };
3129
2979
  }
@@ -3137,12 +2987,10 @@ function setSrcDescriptor(filename, entry, scoped) {
3137
2987
  function getHash(text) {
3138
2988
  return import_node_crypto.default.hash("sha256", text, "hex").substring(0, 8);
3139
2989
  }
3140
- function slash(path4) {
3141
- const isExtendedLengthPath = path4.startsWith("\\\\?\\");
3142
- if (isExtendedLengthPath) {
3143
- return path4;
3144
- }
3145
- return path4.replace(/\\/g, "/");
2990
+ function slash(path$1) {
2991
+ const isExtendedLengthPath = path$1.startsWith("\\\\?\\");
2992
+ if (isExtendedLengthPath) return path$1;
2993
+ return path$1.replace(/\\/g, "/");
3146
2994
  }
3147
2995
  function createRollupError(id, error) {
3148
2996
  const { message, name, stack } = error;
@@ -3153,53 +3001,30 @@ function createRollupError(id, error) {
3153
3001
  name,
3154
3002
  stack
3155
3003
  };
3156
- if ("code" in error && error.loc) {
3157
- rollupError.loc = {
3158
- file: id,
3159
- line: error.loc.start.line,
3160
- column: error.loc.start.column
3161
- };
3162
- }
3004
+ if ("code" in error && error.loc) rollupError.loc = {
3005
+ file: id,
3006
+ line: error.loc.start.line,
3007
+ column: error.loc.start.column
3008
+ };
3163
3009
  return rollupError;
3164
3010
  }
3165
3011
  async function transformTemplateAsModule(code, filename, descriptor, options, pluginContext, ssr, customElement) {
3166
- const result = compile(
3167
- code,
3168
- filename,
3169
- descriptor,
3170
- options,
3171
- pluginContext,
3172
- ssr,
3173
- customElement
3174
- );
3012
+ const result = compile(code, filename, descriptor, options, pluginContext, ssr, customElement);
3175
3013
  let returnCode = result.code;
3176
- if (options.devServer && options.devServer.config.server.hmr !== false && !ssr && !options.isProduction) {
3177
- returnCode += `
3014
+ if (options.devServer && options.devServer.config.server.hmr !== false && !ssr && !options.isProduction) returnCode += `
3178
3015
  import.meta.hot.accept(({ render }) => {
3179
3016
  __VUE_HMR_RUNTIME__.rerender(${JSON.stringify(descriptor.id)}, render)
3180
3017
  })`;
3181
- }
3182
3018
  return {
3183
3019
  code: returnCode,
3184
3020
  map: result.map
3185
3021
  };
3186
3022
  }
3187
3023
  function transformTemplateInMain(code, descriptor, options, pluginContext, ssr, customElement) {
3188
- const result = compile(
3189
- code,
3190
- descriptor.filename,
3191
- descriptor,
3192
- options,
3193
- pluginContext,
3194
- ssr,
3195
- customElement
3196
- );
3024
+ const result = compile(code, descriptor.filename, descriptor, options, pluginContext, ssr, customElement);
3197
3025
  return {
3198
3026
  ...result,
3199
- code: result.code.replace(
3200
- /\nexport (function|const) (render|ssrRender)/,
3201
- "\n$1 _sfc_$2"
3202
- )
3027
+ code: result.code.replace(/\nexport (function|const) (render|ssrRender)/, "\n$1 _sfc_$2")
3203
3028
  };
3204
3029
  }
3205
3030
  function compile(code, filename, descriptor, options, pluginContext, ssr, customElement) {
@@ -3208,35 +3033,26 @@ function compile(code, filename, descriptor, options, pluginContext, ssr, custom
3208
3033
  ...resolveTemplateCompilerOptions(descriptor, options, filename, ssr),
3209
3034
  source: code
3210
3035
  });
3211
- if (result.errors.length) {
3212
- result.errors.forEach(
3213
- (error) => pluginContext.error(
3214
- typeof error === "string" ? { id: filename, message: error } : createRollupError(filename, error)
3215
- )
3216
- );
3217
- }
3218
- if (result.tips.length) {
3219
- result.tips.forEach(
3220
- (tip) => pluginContext.warn({
3221
- id: filename,
3222
- message: tip
3223
- })
3224
- );
3225
- }
3036
+ if (result.errors.length) result.errors.forEach((error) => pluginContext.error(typeof error === "string" ? {
3037
+ id: filename,
3038
+ message: error
3039
+ } : createRollupError(filename, error)));
3040
+ if (result.tips.length) result.tips.forEach((tip) => pluginContext.warn({
3041
+ id: filename,
3042
+ message: tip
3043
+ }));
3226
3044
  return result;
3227
3045
  }
3228
3046
  function resolveTemplateCompilerOptions(descriptor, options, filename, ssr) {
3229
3047
  const block = descriptor.template;
3230
- if (!block) {
3231
- return;
3232
- }
3048
+ if (!block) return;
3233
3049
  const resolvedScript = getResolvedScript(descriptor, ssr);
3234
- const hasScoped = descriptor.styles.some((s) => s.scoped);
3050
+ const hasScoped = descriptor.styles.some((s$1) => s$1.scoped);
3235
3051
  const { id, cssVars } = descriptor;
3236
3052
  let transformAssetUrls = options.template?.transformAssetUrls;
3237
3053
  let assetUrlOptions;
3238
- if (transformAssetUrls === false) ;
3239
- else if (options.devServer) {
3054
+ if (transformAssetUrls === false) {
3055
+ } else if (options.devServer) {
3240
3056
  if (filename.startsWith(options.root)) {
3241
3057
  const devBase = options.devServer.config.base;
3242
3058
  assetUrlOptions = {
@@ -3244,38 +3060,26 @@ function resolveTemplateCompilerOptions(descriptor, options, filename, ssr) {
3244
3060
  includeAbsolute: !!devBase
3245
3061
  };
3246
3062
  }
3247
- } else {
3248
- assetUrlOptions = {
3249
- includeAbsolute: true
3250
- };
3251
- }
3252
- if (transformAssetUrls && typeof transformAssetUrls === "object") {
3253
- if (Object.values(transformAssetUrls).some((val) => Array.isArray(val))) {
3254
- transformAssetUrls = {
3255
- ...assetUrlOptions,
3256
- tags: transformAssetUrls
3257
- };
3258
- } else {
3259
- transformAssetUrls = { ...assetUrlOptions, ...transformAssetUrls };
3260
- }
3261
- } else {
3262
- transformAssetUrls = assetUrlOptions;
3263
- }
3063
+ } else assetUrlOptions = { includeAbsolute: true };
3064
+ if (transformAssetUrls && typeof transformAssetUrls === "object") if (Object.values(transformAssetUrls).some((val) => Array.isArray(val))) transformAssetUrls = {
3065
+ ...assetUrlOptions,
3066
+ tags: transformAssetUrls
3067
+ };
3068
+ else transformAssetUrls = {
3069
+ ...assetUrlOptions,
3070
+ ...transformAssetUrls
3071
+ };
3072
+ else transformAssetUrls = assetUrlOptions;
3264
3073
  let preprocessOptions = block.lang && options.template?.preprocessOptions;
3265
- if (block.lang === "pug") {
3266
- preprocessOptions = {
3267
- doctype: "html",
3268
- ...preprocessOptions
3269
- };
3270
- }
3074
+ if (block.lang === "pug") preprocessOptions = {
3075
+ doctype: "html",
3076
+ ...preprocessOptions
3077
+ };
3271
3078
  const expressionPlugins = options.template?.compilerOptions?.expressionPlugins || [];
3272
3079
  const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang;
3273
- if (lang && /tsx?$/.test(lang) && !expressionPlugins.includes("typescript")) {
3274
- expressionPlugins.push("typescript");
3275
- }
3080
+ if (lang && /tsx?$/.test(lang) && !expressionPlugins.includes("typescript")) expressionPlugins.push("typescript");
3276
3081
  return {
3277
3082
  ...options.template,
3278
- // @ts-expect-error TODO remove when 3.6 is out
3279
3083
  vapor: descriptor.vapor,
3280
3084
  id,
3281
3085
  ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
@@ -3298,12 +3102,10 @@ function resolveTemplateCompilerOptions(descriptor, options, filename, ssr) {
3298
3102
  }
3299
3103
  };
3300
3104
  }
3301
- function canReuseAST(version3) {
3302
- if (version3) {
3303
- const [_, minor, patch] = version3.split(".").map(Number);
3304
- if (minor >= 4 && patch >= 3) {
3305
- return true;
3306
- }
3105
+ function canReuseAST(version$1) {
3106
+ if (version$1) {
3107
+ const [_, minor, patch] = version$1.split(".").map(Number);
3108
+ if (minor >= 4 && patch >= 3) return true;
3307
3109
  }
3308
3110
  return false;
3309
3111
  }
@@ -3332,58 +3134,36 @@ function isUseInlineTemplate(descriptor, options) {
3332
3134
  }
3333
3135
  var scriptIdentifier = `_sfc_main`;
3334
3136
  function resolveScript(descriptor, options, ssr, customElement) {
3335
- if (!descriptor.script && !descriptor.scriptSetup) {
3336
- return null;
3337
- }
3137
+ if (!descriptor.script && !descriptor.scriptSetup) return null;
3338
3138
  const cached = getResolvedScript(descriptor, ssr);
3339
- if (cached) {
3340
- return cached;
3341
- }
3139
+ if (cached) return cached;
3342
3140
  const resolved = options.compiler.compileScript(descriptor, {
3343
3141
  ...options.script,
3344
3142
  id: descriptor.id,
3345
3143
  isProd: options.isProduction,
3346
3144
  inlineTemplate: isUseInlineTemplate(descriptor, options),
3347
- templateOptions: resolveTemplateCompilerOptions(
3348
- descriptor,
3349
- options,
3350
- descriptor.filename,
3351
- ssr
3352
- ),
3145
+ templateOptions: resolveTemplateCompilerOptions(descriptor, options, descriptor.filename, ssr),
3353
3146
  sourceMap: options.sourceMap,
3354
3147
  genDefaultAs: canInlineMain(descriptor, options) ? scriptIdentifier : void 0,
3355
3148
  customElement,
3356
3149
  propsDestructure: options.features?.propsDestructure ?? options.script?.propsDestructure
3357
3150
  });
3358
3151
  if (!options.isProduction && resolved?.deps) {
3359
- for (const [key, sfcs] of typeDepToSFCMap) {
3360
- if (sfcs.has(descriptor.filename) && !resolved.deps.includes(key)) {
3361
- sfcs.delete(descriptor.filename);
3362
- }
3363
- }
3152
+ for (const [key, sfcs] of typeDepToSFCMap) if (sfcs.has(descriptor.filename) && !resolved.deps.includes(key)) sfcs.delete(descriptor.filename);
3364
3153
  for (const dep of resolved.deps) {
3365
3154
  const existingSet = typeDepToSFCMap.get(dep);
3366
- if (!existingSet) {
3367
- typeDepToSFCMap.set(dep, /* @__PURE__ */ new Set([descriptor.filename]));
3368
- } else {
3369
- existingSet.add(descriptor.filename);
3370
- }
3155
+ if (!existingSet) typeDepToSFCMap.set(dep, /* @__PURE__ */ new Set([descriptor.filename]));
3156
+ else existingSet.add(descriptor.filename);
3371
3157
  }
3372
3158
  }
3373
3159
  setResolvedScript(descriptor, resolved, ssr);
3374
3160
  return resolved;
3375
3161
  }
3376
3162
  function canInlineMain(descriptor, options) {
3377
- if (descriptor.script?.src || descriptor.scriptSetup?.src) {
3378
- return false;
3379
- }
3163
+ if (descriptor.script?.src || descriptor.scriptSetup?.src) return false;
3380
3164
  const lang = descriptor.script?.lang || descriptor.scriptSetup?.lang;
3381
- if (!lang || lang === "js") {
3382
- return true;
3383
- }
3384
- if (lang === "ts" && options.devServer) {
3385
- return true;
3386
- }
3165
+ if (!lang || lang === "js") return true;
3166
+ if (lang === "ts" && options.devServer) return true;
3387
3167
  return false;
3388
3168
  }
3389
3169
  var comma = ",".charCodeAt(0);
@@ -3391,7 +3171,7 @@ var semicolon = ";".charCodeAt(0);
3391
3171
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
3392
3172
  var intToChar = new Uint8Array(64);
3393
3173
  var charToInt = new Uint8Array(128);
3394
- for (let i = 0; i < chars.length; i++) {
3174
+ for (let i = 0; i < 64; i++) {
3395
3175
  const c = chars.charCodeAt(i);
3396
3176
  intToChar[i] = c;
3397
3177
  charToInt[c] = i;
@@ -3408,9 +3188,7 @@ function decodeInteger(reader, relative) {
3408
3188
  } while (integer & 32);
3409
3189
  const shouldNegate = value & 1;
3410
3190
  value >>>= 1;
3411
- if (shouldNegate) {
3412
- value = -2147483648 | -value;
3413
- }
3191
+ if (shouldNegate) value = -2147483648 | -value;
3414
3192
  return relative + value;
3415
3193
  }
3416
3194
  function encodeInteger(builder, num, relative) {
@@ -3419,32 +3197,24 @@ function encodeInteger(builder, num, relative) {
3419
3197
  do {
3420
3198
  let clamped = delta & 31;
3421
3199
  delta >>>= 5;
3422
- if (delta > 0)
3423
- clamped |= 32;
3200
+ if (delta > 0) clamped |= 32;
3424
3201
  builder.write(intToChar[clamped]);
3425
3202
  } while (delta > 0);
3426
3203
  return num;
3427
3204
  }
3428
3205
  function hasMoreVlq(reader, max) {
3429
- if (reader.pos >= max)
3430
- return false;
3206
+ if (reader.pos >= max) return false;
3431
3207
  return reader.peek() !== comma;
3432
3208
  }
3433
3209
  var bufLength = 1024 * 16;
3434
- var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
3435
- decode(buf) {
3436
- const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
3437
- return out.toString();
3438
- }
3439
- } : {
3440
- decode(buf) {
3441
- let out = "";
3442
- for (let i = 0; i < buf.length; i++) {
3443
- out += String.fromCharCode(buf[i]);
3444
- }
3445
- return out;
3446
- }
3447
- };
3210
+ var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
3211
+ const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
3212
+ return out.toString();
3213
+ } } : { decode(buf) {
3214
+ let out = "";
3215
+ for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
3216
+ return out;
3217
+ } };
3448
3218
  var StringWriter = class {
3449
3219
  constructor() {
3450
3220
  this.pos = 0;
@@ -3499,8 +3269,7 @@ function decode(mappings) {
3499
3269
  while (reader.pos < semi) {
3500
3270
  let seg;
3501
3271
  genColumn = decodeInteger(reader, genColumn);
3502
- if (genColumn < lastCol)
3503
- sorted = false;
3272
+ if (genColumn < lastCol) sorted = false;
3504
3273
  lastCol = genColumn;
3505
3274
  if (hasMoreVlq(reader, semi)) {
3506
3275
  sourcesIndex = decodeInteger(reader, sourcesIndex);
@@ -3508,18 +3277,24 @@ function decode(mappings) {
3508
3277
  sourceColumn = decodeInteger(reader, sourceColumn);
3509
3278
  if (hasMoreVlq(reader, semi)) {
3510
3279
  namesIndex = decodeInteger(reader, namesIndex);
3511
- seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
3512
- } else {
3513
- seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
3514
- }
3515
- } else {
3516
- seg = [genColumn];
3517
- }
3280
+ seg = [
3281
+ genColumn,
3282
+ sourcesIndex,
3283
+ sourceLine,
3284
+ sourceColumn,
3285
+ namesIndex
3286
+ ];
3287
+ } else seg = [
3288
+ genColumn,
3289
+ sourcesIndex,
3290
+ sourceLine,
3291
+ sourceColumn
3292
+ ];
3293
+ } else seg = [genColumn];
3518
3294
  line.push(seg);
3519
3295
  reader.pos++;
3520
3296
  }
3521
- if (!sorted)
3522
- sort(line);
3297
+ if (!sorted) sort(line);
3523
3298
  decoded.push(line);
3524
3299
  reader.pos = semi + 1;
3525
3300
  } while (reader.pos <= length);
@@ -3539,23 +3314,18 @@ function encode(decoded) {
3539
3314
  let namesIndex = 0;
3540
3315
  for (let i = 0; i < decoded.length; i++) {
3541
3316
  const line = decoded[i];
3542
- if (i > 0)
3543
- writer.write(semicolon);
3544
- if (line.length === 0)
3545
- continue;
3317
+ if (i > 0) writer.write(semicolon);
3318
+ if (line.length === 0) continue;
3546
3319
  let genColumn = 0;
3547
3320
  for (let j = 0; j < line.length; j++) {
3548
3321
  const segment = line[j];
3549
- if (j > 0)
3550
- writer.write(comma);
3322
+ if (j > 0) writer.write(comma);
3551
3323
  genColumn = encodeInteger(writer, segment[0], genColumn);
3552
- if (segment.length === 1)
3553
- continue;
3324
+ if (segment.length === 1) continue;
3554
3325
  sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
3555
3326
  sourceLine = encodeInteger(writer, segment[2], sourceLine);
3556
3327
  sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
3557
- if (segment.length === 4)
3558
- continue;
3328
+ if (segment.length === 4) continue;
3559
3329
  namesIndex = encodeInteger(writer, segment[4], namesIndex);
3560
3330
  }
3561
3331
  }
@@ -3585,16 +3355,16 @@ function parseAbsoluteUrl(input) {
3585
3355
  }
3586
3356
  function parseFileUrl(input) {
3587
3357
  const match2 = fileRegex.exec(input);
3588
- const path4 = match2[2];
3589
- return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(path4) ? path4 : "/" + path4, match2[3] || "", match2[4] || "");
3358
+ const path$1 = match2[2];
3359
+ return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(path$1) ? path$1 : "/" + path$1, match2[3] || "", match2[4] || "");
3590
3360
  }
3591
- function makeUrl(scheme, user, host, port, path4, query, hash) {
3361
+ function makeUrl(scheme, user, host, port, path$1, query, hash) {
3592
3362
  return {
3593
3363
  scheme,
3594
3364
  user,
3595
3365
  host,
3596
3366
  port,
3597
- path: path4,
3367
+ path: path$1,
3598
3368
  query,
3599
3369
  hash,
3600
3370
  type: 7
@@ -3602,43 +3372,37 @@ function makeUrl(scheme, user, host, port, path4, query, hash) {
3602
3372
  }
3603
3373
  function parseUrl(input) {
3604
3374
  if (isSchemeRelativeUrl(input)) {
3605
- const url2 = parseAbsoluteUrl("http:" + input);
3606
- url2.scheme = "";
3607
- url2.type = 6;
3608
- return url2;
3375
+ const url$1 = parseAbsoluteUrl("http:" + input);
3376
+ url$1.scheme = "";
3377
+ url$1.type = 6;
3378
+ return url$1;
3609
3379
  }
3610
3380
  if (isAbsolutePath(input)) {
3611
- const url2 = parseAbsoluteUrl("http://foo.com" + input);
3612
- url2.scheme = "";
3613
- url2.host = "";
3614
- url2.type = 5;
3615
- return url2;
3616
- }
3617
- if (isFileUrl(input))
3618
- return parseFileUrl(input);
3619
- if (isAbsoluteUrl(input))
3620
- return parseAbsoluteUrl(input);
3381
+ const url$1 = parseAbsoluteUrl("http://foo.com" + input);
3382
+ url$1.scheme = "";
3383
+ url$1.host = "";
3384
+ url$1.type = 5;
3385
+ return url$1;
3386
+ }
3387
+ if (isFileUrl(input)) return parseFileUrl(input);
3388
+ if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);
3621
3389
  const url = parseAbsoluteUrl("http://foo.com/" + input);
3622
3390
  url.scheme = "";
3623
3391
  url.host = "";
3624
3392
  url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
3625
3393
  return url;
3626
3394
  }
3627
- function stripPathFilename(path4) {
3628
- if (path4.endsWith("/.."))
3629
- return path4;
3630
- const index = path4.lastIndexOf("/");
3631
- return path4.slice(0, index + 1);
3395
+ function stripPathFilename(path$1) {
3396
+ if (path$1.endsWith("/..")) return path$1;
3397
+ const index = path$1.lastIndexOf("/");
3398
+ return path$1.slice(0, index + 1);
3632
3399
  }
3633
3400
  function mergePaths(url, base) {
3634
- normalizePath(base, base.type);
3635
- if (url.path === "/") {
3636
- url.path = base.path;
3637
- } else {
3638
- url.path = stripPathFilename(base.path) + url.path;
3639
- }
3401
+ normalizePath$1(base, base.type);
3402
+ if (url.path === "/") url.path = base.path;
3403
+ else url.path = stripPathFilename(base.path) + url.path;
3640
3404
  }
3641
- function normalizePath(url, type) {
3405
+ function normalizePath$1(url, type) {
3642
3406
  const rel = type <= 4;
3643
3407
  const pieces = url.path.split("/");
3644
3408
  let pointer = 1;
@@ -3651,33 +3415,25 @@ function normalizePath(url, type) {
3651
3415
  continue;
3652
3416
  }
3653
3417
  addTrailingSlash = false;
3654
- if (piece === ".")
3655
- continue;
3418
+ if (piece === ".") continue;
3656
3419
  if (piece === "..") {
3657
3420
  if (positive) {
3658
3421
  addTrailingSlash = true;
3659
3422
  positive--;
3660
3423
  pointer--;
3661
- } else if (rel) {
3662
- pieces[pointer++] = piece;
3663
- }
3424
+ } else if (rel) pieces[pointer++] = piece;
3664
3425
  continue;
3665
3426
  }
3666
3427
  pieces[pointer++] = piece;
3667
3428
  positive++;
3668
3429
  }
3669
- let path4 = "";
3670
- for (let i = 1; i < pointer; i++) {
3671
- path4 += "/" + pieces[i];
3672
- }
3673
- if (!path4 || addTrailingSlash && !path4.endsWith("/..")) {
3674
- path4 += "/";
3675
- }
3676
- url.path = path4;
3430
+ let path$1 = "";
3431
+ for (let i = 1; i < pointer; i++) path$1 += "/" + pieces[i];
3432
+ if (!path$1 || addTrailingSlash && !path$1.endsWith("/..")) path$1 += "/";
3433
+ url.path = path$1;
3677
3434
  }
3678
- function resolve$1(input, base) {
3679
- if (!input && !base)
3680
- return "";
3435
+ function resolve(input, base) {
3436
+ if (!input && !base) return "";
3681
3437
  const url = parseUrl(input);
3682
3438
  let inputType = url.type;
3683
3439
  if (base && inputType !== 7) {
@@ -3686,41 +3442,31 @@ function resolve$1(input, base) {
3686
3442
  switch (inputType) {
3687
3443
  case 1:
3688
3444
  url.hash = baseUrl.hash;
3689
- // fall through
3690
3445
  case 2:
3691
3446
  url.query = baseUrl.query;
3692
- // fall through
3693
3447
  case 3:
3694
3448
  case 4:
3695
3449
  mergePaths(url, baseUrl);
3696
- // fall through
3697
3450
  case 5:
3698
3451
  url.user = baseUrl.user;
3699
3452
  url.host = baseUrl.host;
3700
3453
  url.port = baseUrl.port;
3701
- // fall through
3702
3454
  case 6:
3703
3455
  url.scheme = baseUrl.scheme;
3704
3456
  }
3705
- if (baseType > inputType)
3706
- inputType = baseType;
3457
+ if (baseType > inputType) inputType = baseType;
3707
3458
  }
3708
- normalizePath(url, inputType);
3459
+ normalizePath$1(url, inputType);
3709
3460
  const queryHash = url.query + url.hash;
3710
3461
  switch (inputType) {
3711
- // This is impossible, because of the empty checks at the start of the function.
3712
- // case UrlType.Empty:
3713
3462
  case 2:
3714
3463
  case 3:
3715
3464
  return queryHash;
3716
3465
  case 4: {
3717
- const path4 = url.path.slice(1);
3718
- if (!path4)
3719
- return queryHash || ".";
3720
- if (isRelative(base || input) && !isRelative(path4)) {
3721
- return "./" + path4 + queryHash;
3722
- }
3723
- return path4 + queryHash;
3466
+ const path$1 = url.path.slice(1);
3467
+ if (!path$1) return queryHash || ".";
3468
+ if (isRelative(base || input) && !isRelative(path$1)) return "./" + path$1 + queryHash;
3469
+ return path$1 + queryHash;
3724
3470
  }
3725
3471
  case 5:
3726
3472
  return url.path + queryHash;
@@ -3728,47 +3474,34 @@ function resolve$1(input, base) {
3728
3474
  return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
3729
3475
  }
3730
3476
  }
3731
- function resolve(input, base) {
3732
- if (base && !base.endsWith("/"))
3733
- base += "/";
3734
- return resolve$1(input, base);
3477
+ function stripFilename(path$1) {
3478
+ if (!path$1) return "";
3479
+ const index = path$1.lastIndexOf("/");
3480
+ return path$1.slice(0, index + 1);
3735
3481
  }
3736
- function stripFilename(path4) {
3737
- if (!path4)
3738
- return "";
3739
- const index = path4.lastIndexOf("/");
3740
- return path4.slice(0, index + 1);
3482
+ function resolver(mapUrl, sourceRoot) {
3483
+ const from = stripFilename(mapUrl);
3484
+ const prefix = sourceRoot ? sourceRoot + "/" : "";
3485
+ return (source) => resolve(prefix + (source || ""), from);
3741
3486
  }
3742
3487
  var COLUMN$1 = 0;
3743
3488
  function maybeSort(mappings, owned) {
3744
3489
  const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
3745
- if (unsortedIndex === mappings.length)
3746
- return mappings;
3747
- if (!owned)
3748
- mappings = mappings.slice();
3749
- for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {
3750
- mappings[i] = sortSegments(mappings[i], owned);
3751
- }
3490
+ if (unsortedIndex === mappings.length) return mappings;
3491
+ if (!owned) mappings = mappings.slice();
3492
+ for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) mappings[i] = sortSegments(mappings[i], owned);
3752
3493
  return mappings;
3753
3494
  }
3754
3495
  function nextUnsortedSegmentLine(mappings, start) {
3755
- for (let i = start; i < mappings.length; i++) {
3756
- if (!isSorted(mappings[i]))
3757
- return i;
3758
- }
3496
+ for (let i = start; i < mappings.length; i++) if (!isSorted(mappings[i])) return i;
3759
3497
  return mappings.length;
3760
3498
  }
3761
3499
  function isSorted(line) {
3762
- for (let j = 1; j < line.length; j++) {
3763
- if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) {
3764
- return false;
3765
- }
3766
- }
3500
+ for (let j = 1; j < line.length; j++) if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) return false;
3767
3501
  return true;
3768
3502
  }
3769
3503
  function sortSegments(line, owned) {
3770
- if (!owned)
3771
- line = line.slice();
3504
+ if (!owned) line = line.slice();
3772
3505
  return line.sort(sortComparator);
3773
3506
  }
3774
3507
  function sortComparator(a, b) {
@@ -3781,41 +3514,44 @@ function memoizedState() {
3781
3514
  lastIndex: -1
3782
3515
  };
3783
3516
  }
3517
+ function parse$1(map) {
3518
+ return typeof map === "string" ? JSON.parse(map) : map;
3519
+ }
3784
3520
  var TraceMap = class {
3785
3521
  constructor(map, mapUrl) {
3786
3522
  const isString = typeof map === "string";
3787
- if (!isString && map._decodedMemo)
3788
- return map;
3789
- const parsed = isString ? JSON.parse(map) : map;
3790
- const { version: version3, file, names, sourceRoot, sources, sourcesContent } = parsed;
3791
- this.version = version3;
3523
+ if (!isString && map._decodedMemo) return map;
3524
+ const parsed = parse$1(map);
3525
+ const { version: version$1, file, names, sourceRoot, sources, sourcesContent } = parsed;
3526
+ this.version = version$1;
3792
3527
  this.file = file;
3793
3528
  this.names = names || [];
3794
3529
  this.sourceRoot = sourceRoot;
3795
3530
  this.sources = sources;
3796
3531
  this.sourcesContent = sourcesContent;
3797
3532
  this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
3798
- const from = resolve(sourceRoot || "", stripFilename(mapUrl));
3799
- this.resolvedSources = sources.map((s) => resolve(s || "", from));
3533
+ const resolve$1 = resolver(mapUrl, sourceRoot);
3534
+ this.resolvedSources = sources.map(resolve$1);
3800
3535
  const { mappings } = parsed;
3801
3536
  if (typeof mappings === "string") {
3802
3537
  this._encoded = mappings;
3803
3538
  this._decoded = void 0;
3804
- } else {
3539
+ } else if (Array.isArray(mappings)) {
3805
3540
  this._encoded = void 0;
3806
3541
  this._decoded = maybeSort(mappings, isString);
3807
- }
3542
+ } else if (parsed.sections) throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
3543
+ else throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
3808
3544
  this._decodedMemo = memoizedState();
3809
3545
  this._bySources = void 0;
3810
3546
  this._bySourceMemos = void 0;
3811
3547
  }
3812
3548
  };
3813
- function cast$2(map) {
3549
+ function cast$1(map) {
3814
3550
  return map;
3815
3551
  }
3816
3552
  function decodedMappings(map) {
3817
3553
  var _a;
3818
- return (_a = cast$2(map))._decoded || (_a._decoded = decode(cast$2(map)._encoded));
3554
+ return (_a = cast$1(map))._decoded || (_a._decoded = decode(cast$1(map)._encoded));
3819
3555
  }
3820
3556
  function eachMapping(map, cb) {
3821
3557
  const decoded = decodedMappings(map);
@@ -3835,8 +3571,7 @@ function eachMapping(map, cb) {
3835
3571
  originalLine = seg[2] + 1;
3836
3572
  originalColumn = seg[3];
3837
3573
  }
3838
- if (seg.length === 5)
3839
- name = names[seg[4]];
3574
+ if (seg.length === 5) name = names[seg[4]];
3840
3575
  cb({
3841
3576
  generatedLine,
3842
3577
  generatedColumn,
@@ -3854,21 +3589,24 @@ var SetArray = class {
3854
3589
  this.array = [];
3855
3590
  }
3856
3591
  };
3857
- function cast$1(set) {
3592
+ function cast(set) {
3858
3593
  return set;
3859
3594
  }
3860
3595
  function get(setarr, key) {
3861
- return cast$1(setarr)._indexes[key];
3596
+ return cast(setarr)._indexes[key];
3862
3597
  }
3863
3598
  function put(setarr, key) {
3864
3599
  const index = get(setarr, key);
3865
- if (index !== void 0)
3866
- return index;
3867
- const { array, _indexes: indexes } = cast$1(setarr);
3600
+ if (index !== void 0) return index;
3601
+ const { array, _indexes: indexes } = cast(setarr);
3868
3602
  const length = array.push(key);
3869
3603
  return indexes[key] = length - 1;
3870
3604
  }
3871
3605
  var COLUMN = 0;
3606
+ var SOURCES_INDEX = 1;
3607
+ var SOURCE_LINE = 2;
3608
+ var SOURCE_COLUMN = 3;
3609
+ var NAMES_INDEX = 4;
3872
3610
  var NO_NAME = -1;
3873
3611
  var GenMapping = class {
3874
3612
  constructor({ file, sourceRoot } = {}) {
@@ -3881,14 +3619,14 @@ var GenMapping = class {
3881
3619
  this._ignoreList = new SetArray();
3882
3620
  }
3883
3621
  };
3884
- function cast(map) {
3622
+ function cast2(map) {
3885
3623
  return map;
3886
3624
  }
3887
3625
  function addMapping(map, mapping2) {
3888
3626
  return addMappingInternal(false, map, mapping2);
3889
3627
  }
3890
3628
  function toDecodedMap(map) {
3891
- const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList2 } = cast(map);
3629
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList$1 } = cast2(map);
3892
3630
  removeEmptyFinalLines(mappings);
3893
3631
  return {
3894
3632
  version: 3,
@@ -3898,118 +3636,116 @@ function toDecodedMap(map) {
3898
3636
  sources: sources.array,
3899
3637
  sourcesContent,
3900
3638
  mappings,
3901
- ignoreList: ignoreList2.array
3639
+ ignoreList: ignoreList$1.array
3902
3640
  };
3903
3641
  }
3904
3642
  function toEncodedMap(map) {
3905
3643
  const decoded = toDecodedMap(map);
3906
- return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) });
3644
+ return Object.assign({}, decoded, { mappings: encode(decoded.mappings) });
3907
3645
  }
3908
3646
  function fromMap(input) {
3909
3647
  const map = new TraceMap(input);
3910
- const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
3911
- putAll(cast(gen)._names, map.names);
3912
- putAll(cast(gen)._sources, map.sources);
3913
- cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
3914
- cast(gen)._mappings = decodedMappings(map);
3915
- if (map.ignoreList)
3916
- putAll(cast(gen)._ignoreList, map.ignoreList);
3648
+ const gen = new GenMapping({
3649
+ file: map.file,
3650
+ sourceRoot: map.sourceRoot
3651
+ });
3652
+ putAll(cast2(gen)._names, map.names);
3653
+ putAll(cast2(gen)._sources, map.sources);
3654
+ cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
3655
+ cast2(gen)._mappings = decodedMappings(map);
3656
+ if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList);
3917
3657
  return gen;
3918
3658
  }
3919
3659
  function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
3920
- const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = cast(map);
3921
- const line = getLine(mappings, genLine);
3660
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = cast2(map);
3661
+ const line = getIndex(mappings, genLine);
3922
3662
  const index = getColumnIndex(line, genColumn);
3923
3663
  if (!source) {
3664
+ if (skipable && skipSourceless(line, index)) return;
3924
3665
  return insert(line, index, [genColumn]);
3925
3666
  }
3667
+ assert(sourceLine);
3668
+ assert(sourceColumn);
3926
3669
  const sourcesIndex = put(sources, source);
3927
3670
  const namesIndex = name ? put(names, name) : NO_NAME;
3928
- if (sourcesIndex === sourcesContent.length)
3929
- sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
3930
- return insert(line, index, name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
3931
- }
3932
- function getLine(mappings, index) {
3933
- for (let i = mappings.length; i <= index; i++) {
3934
- mappings[i] = [];
3935
- }
3936
- return mappings[index];
3671
+ if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
3672
+ if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) return;
3673
+ return insert(line, index, name ? [
3674
+ genColumn,
3675
+ sourcesIndex,
3676
+ sourceLine,
3677
+ sourceColumn,
3678
+ namesIndex
3679
+ ] : [
3680
+ genColumn,
3681
+ sourcesIndex,
3682
+ sourceLine,
3683
+ sourceColumn
3684
+ ]);
3685
+ }
3686
+ function assert(_val) {
3687
+ }
3688
+ function getIndex(arr, index) {
3689
+ for (let i = arr.length; i <= index; i++) arr[i] = [];
3690
+ return arr[index];
3937
3691
  }
3938
3692
  function getColumnIndex(line, genColumn) {
3939
3693
  let index = line.length;
3940
3694
  for (let i = index - 1; i >= 0; index = i--) {
3941
3695
  const current = line[i];
3942
- if (genColumn >= current[COLUMN])
3943
- break;
3696
+ if (genColumn >= current[COLUMN]) break;
3944
3697
  }
3945
3698
  return index;
3946
3699
  }
3947
3700
  function insert(array, index, value) {
3948
- for (let i = array.length; i > index; i--) {
3949
- array[i] = array[i - 1];
3950
- }
3701
+ for (let i = array.length; i > index; i--) array[i] = array[i - 1];
3951
3702
  array[index] = value;
3952
3703
  }
3953
3704
  function removeEmptyFinalLines(mappings) {
3954
3705
  const { length } = mappings;
3955
3706
  let len = length;
3956
- for (let i = len - 1; i >= 0; len = i, i--) {
3957
- if (mappings[i].length > 0)
3958
- break;
3959
- }
3960
- if (len < length)
3961
- mappings.length = len;
3707
+ for (let i = len - 1; i >= 0; len = i, i--) if (mappings[i].length > 0) break;
3708
+ if (len < length) mappings.length = len;
3962
3709
  }
3963
3710
  function putAll(setarr, array) {
3964
- for (let i = 0; i < array.length; i++)
3965
- put(setarr, array[i]);
3711
+ for (let i = 0; i < array.length; i++) put(setarr, array[i]);
3712
+ }
3713
+ function skipSourceless(line, index) {
3714
+ if (index === 0) return true;
3715
+ const prev = line[index - 1];
3716
+ return prev.length === 1;
3717
+ }
3718
+ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
3719
+ if (index === 0) return false;
3720
+ const prev = line[index - 1];
3721
+ if (prev.length === 1) return false;
3722
+ return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
3966
3723
  }
3967
3724
  function addMappingInternal(skipable, map, mapping2) {
3968
3725
  const { generated, source, original, name, content } = mapping2;
3969
- if (!source) {
3970
- return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null);
3971
- }
3726
+ if (!source) return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null);
3727
+ assert(original);
3972
3728
  return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
3973
3729
  }
3974
- function getDefaultExportFromCjs(x) {
3975
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
3976
- }
3977
- var src = { exports: {} };
3978
- var browser = { exports: {} };
3979
- var ms;
3980
- var hasRequiredMs;
3981
- function requireMs() {
3982
- if (hasRequiredMs) return ms;
3983
- hasRequiredMs = 1;
3730
+ var require_ms = __commonJS2({ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
3984
3731
  var s = 1e3;
3985
3732
  var m = s * 60;
3986
3733
  var h = m * 60;
3987
3734
  var d = h * 24;
3988
3735
  var w = d * 7;
3989
3736
  var y = d * 365.25;
3990
- ms = function(val, options) {
3737
+ module2.exports = function(val, options) {
3991
3738
  options = options || {};
3992
3739
  var type = typeof val;
3993
- if (type === "string" && val.length > 0) {
3994
- return parse(val);
3995
- } else if (type === "number" && isFinite(val)) {
3996
- return options.long ? fmtLong(val) : fmtShort(val);
3997
- }
3998
- throw new Error(
3999
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
4000
- );
3740
+ if (type === "string" && val.length > 0) return parse(val);
3741
+ else if (type === "number" && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
3742
+ throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
4001
3743
  };
4002
3744
  function parse(str) {
4003
3745
  str = String(str);
4004
- if (str.length > 100) {
4005
- return;
4006
- }
4007
- var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
4008
- str
4009
- );
4010
- if (!match2) {
4011
- return;
4012
- }
3746
+ if (str.length > 100) return;
3747
+ var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
3748
+ if (!match2) return;
4013
3749
  var n = parseFloat(match2[1]);
4014
3750
  var type = (match2[2] || "ms").toLowerCase();
4015
3751
  switch (type) {
@@ -4055,49 +3791,28 @@ function requireMs() {
4055
3791
  return void 0;
4056
3792
  }
4057
3793
  }
4058
- function fmtShort(ms2) {
4059
- var msAbs = Math.abs(ms2);
4060
- if (msAbs >= d) {
4061
- return Math.round(ms2 / d) + "d";
4062
- }
4063
- if (msAbs >= h) {
4064
- return Math.round(ms2 / h) + "h";
4065
- }
4066
- if (msAbs >= m) {
4067
- return Math.round(ms2 / m) + "m";
4068
- }
4069
- if (msAbs >= s) {
4070
- return Math.round(ms2 / s) + "s";
4071
- }
4072
- return ms2 + "ms";
3794
+ function fmtShort(ms) {
3795
+ var msAbs = Math.abs(ms);
3796
+ if (msAbs >= d) return Math.round(ms / d) + "d";
3797
+ if (msAbs >= h) return Math.round(ms / h) + "h";
3798
+ if (msAbs >= m) return Math.round(ms / m) + "m";
3799
+ if (msAbs >= s) return Math.round(ms / s) + "s";
3800
+ return ms + "ms";
4073
3801
  }
4074
- function fmtLong(ms2) {
4075
- var msAbs = Math.abs(ms2);
4076
- if (msAbs >= d) {
4077
- return plural(ms2, msAbs, d, "day");
4078
- }
4079
- if (msAbs >= h) {
4080
- return plural(ms2, msAbs, h, "hour");
4081
- }
4082
- if (msAbs >= m) {
4083
- return plural(ms2, msAbs, m, "minute");
4084
- }
4085
- if (msAbs >= s) {
4086
- return plural(ms2, msAbs, s, "second");
4087
- }
4088
- return ms2 + " ms";
3802
+ function fmtLong(ms) {
3803
+ var msAbs = Math.abs(ms);
3804
+ if (msAbs >= d) return plural(ms, msAbs, d, "day");
3805
+ if (msAbs >= h) return plural(ms, msAbs, h, "hour");
3806
+ if (msAbs >= m) return plural(ms, msAbs, m, "minute");
3807
+ if (msAbs >= s) return plural(ms, msAbs, s, "second");
3808
+ return ms + " ms";
4089
3809
  }
4090
- function plural(ms2, msAbs, n, name) {
3810
+ function plural(ms, msAbs, n, name) {
4091
3811
  var isPlural = msAbs >= n * 1.5;
4092
- return Math.round(ms2 / n) + " " + name + (isPlural ? "s" : "");
3812
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
4093
3813
  }
4094
- return ms;
4095
- }
4096
- var common;
4097
- var hasRequiredCommon;
4098
- function requireCommon() {
4099
- if (hasRequiredCommon) return common;
4100
- hasRequiredCommon = 1;
3814
+ } });
3815
+ var require_common = __commonJS2({ "../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/common.js"(exports2, module2) {
4101
3816
  function setup(env) {
4102
3817
  createDebug.debug = createDebug;
4103
3818
  createDebug.default = createDebug;
@@ -4105,7 +3820,7 @@ function requireCommon() {
4105
3820
  createDebug.disable = disable;
4106
3821
  createDebug.enable = enable;
4107
3822
  createDebug.enabled = enabled;
4108
- createDebug.humanize = requireMs();
3823
+ createDebug.humanize = require_ms();
4109
3824
  createDebug.destroy = destroy;
4110
3825
  Object.keys(env).forEach((key) => {
4111
3826
  createDebug[key] = env[key];
@@ -4127,26 +3842,20 @@ function requireCommon() {
4127
3842
  let enableOverride = null;
4128
3843
  let namespacesCache;
4129
3844
  let enabledCache;
4130
- function debug2(...args) {
4131
- if (!debug2.enabled) {
4132
- return;
4133
- }
4134
- const self = debug2;
3845
+ function debug$1(...args) {
3846
+ if (!debug$1.enabled) return;
3847
+ const self = debug$1;
4135
3848
  const curr = Number(/* @__PURE__ */ new Date());
4136
- const ms2 = curr - (prevTime || curr);
4137
- self.diff = ms2;
3849
+ const ms = curr - (prevTime || curr);
3850
+ self.diff = ms;
4138
3851
  self.prev = prevTime;
4139
3852
  self.curr = curr;
4140
3853
  prevTime = curr;
4141
3854
  args[0] = createDebug.coerce(args[0]);
4142
- if (typeof args[0] !== "string") {
4143
- args.unshift("%O");
4144
- }
3855
+ if (typeof args[0] !== "string") args.unshift("%O");
4145
3856
  let index = 0;
4146
3857
  args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format) => {
4147
- if (match2 === "%%") {
4148
- return "%";
4149
- }
3858
+ if (match2 === "%%") return "%";
4150
3859
  index++;
4151
3860
  const formatter = createDebug.formatters[format];
4152
3861
  if (typeof formatter === "function") {
@@ -4161,18 +3870,16 @@ function requireCommon() {
4161
3870
  const logFn = self.log || createDebug.log;
4162
3871
  logFn.apply(self, args);
4163
3872
  }
4164
- debug2.namespace = namespace;
4165
- debug2.useColors = createDebug.useColors();
4166
- debug2.color = createDebug.selectColor(namespace);
4167
- debug2.extend = extend;
4168
- debug2.destroy = createDebug.destroy;
4169
- Object.defineProperty(debug2, "enabled", {
3873
+ debug$1.namespace = namespace;
3874
+ debug$1.useColors = createDebug.useColors();
3875
+ debug$1.color = createDebug.selectColor(namespace);
3876
+ debug$1.extend = extend;
3877
+ debug$1.destroy = createDebug.destroy;
3878
+ Object.defineProperty(debug$1, "enabled", {
4170
3879
  enumerable: true,
4171
3880
  configurable: false,
4172
3881
  get: () => {
4173
- if (enableOverride !== null) {
4174
- return enableOverride;
4175
- }
3882
+ if (enableOverride !== null) return enableOverride;
4176
3883
  if (namespacesCache !== createDebug.namespaces) {
4177
3884
  namespacesCache = createDebug.namespaces;
4178
3885
  enabledCache = createDebug.enabled(namespace);
@@ -4183,10 +3890,8 @@ function requireCommon() {
4183
3890
  enableOverride = v;
4184
3891
  }
4185
3892
  });
4186
- if (typeof createDebug.init === "function") {
4187
- createDebug.init(debug2);
4188
- }
4189
- return debug2;
3893
+ if (typeof createDebug.init === "function") createDebug.init(debug$1);
3894
+ return debug$1;
4190
3895
  }
4191
3896
  function extend(namespace, delimiter) {
4192
3897
  const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
@@ -4199,67 +3904,42 @@ function requireCommon() {
4199
3904
  createDebug.names = [];
4200
3905
  createDebug.skips = [];
4201
3906
  const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
4202
- for (const ns of split) {
4203
- if (ns[0] === "-") {
4204
- createDebug.skips.push(ns.slice(1));
4205
- } else {
4206
- createDebug.names.push(ns);
4207
- }
4208
- }
3907
+ for (const ns of split) if (ns[0] === "-") createDebug.skips.push(ns.slice(1));
3908
+ else createDebug.names.push(ns);
4209
3909
  }
4210
3910
  function matchesTemplate(search, template) {
4211
3911
  let searchIndex = 0;
4212
3912
  let templateIndex = 0;
4213
3913
  let starIndex = -1;
4214
3914
  let matchIndex = 0;
4215
- while (searchIndex < search.length) {
4216
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
4217
- if (template[templateIndex] === "*") {
4218
- starIndex = templateIndex;
4219
- matchIndex = searchIndex;
4220
- templateIndex++;
4221
- } else {
4222
- searchIndex++;
4223
- templateIndex++;
4224
- }
4225
- } else if (starIndex !== -1) {
4226
- templateIndex = starIndex + 1;
4227
- matchIndex++;
4228
- searchIndex = matchIndex;
4229
- } else {
4230
- return false;
4231
- }
4232
- }
4233
- while (templateIndex < template.length && template[templateIndex] === "*") {
3915
+ while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") {
3916
+ starIndex = templateIndex;
3917
+ matchIndex = searchIndex;
3918
+ templateIndex++;
3919
+ } else {
3920
+ searchIndex++;
4234
3921
  templateIndex++;
4235
3922
  }
3923
+ else if (starIndex !== -1) {
3924
+ templateIndex = starIndex + 1;
3925
+ matchIndex++;
3926
+ searchIndex = matchIndex;
3927
+ } else return false;
3928
+ while (templateIndex < template.length && template[templateIndex] === "*") templateIndex++;
4236
3929
  return templateIndex === template.length;
4237
3930
  }
4238
3931
  function disable() {
4239
- const namespaces = [
4240
- ...createDebug.names,
4241
- ...createDebug.skips.map((namespace) => "-" + namespace)
4242
- ].join(",");
3932
+ const namespaces = [...createDebug.names, ...createDebug.skips.map((namespace) => "-" + namespace)].join(",");
4243
3933
  createDebug.enable("");
4244
3934
  return namespaces;
4245
3935
  }
4246
3936
  function enabled(name) {
4247
- for (const skip of createDebug.skips) {
4248
- if (matchesTemplate(name, skip)) {
4249
- return false;
4250
- }
4251
- }
4252
- for (const ns of createDebug.names) {
4253
- if (matchesTemplate(name, ns)) {
4254
- return true;
4255
- }
4256
- }
3937
+ for (const skip of createDebug.skips) if (matchesTemplate(name, skip)) return false;
3938
+ for (const ns of createDebug.names) if (matchesTemplate(name, ns)) return true;
4257
3939
  return false;
4258
3940
  }
4259
3941
  function coerce(val) {
4260
- if (val instanceof Error) {
4261
- return val.stack || val.message;
4262
- }
3942
+ if (val instanceof Error) return val.stack || val.message;
4263
3943
  return val;
4264
3944
  }
4265
3945
  function destroy() {
@@ -4268,407 +3948,191 @@ function requireCommon() {
4268
3948
  createDebug.enable(createDebug.load());
4269
3949
  return createDebug;
4270
3950
  }
4271
- common = setup;
4272
- return common;
4273
- }
4274
- var hasRequiredBrowser;
4275
- function requireBrowser() {
4276
- if (hasRequiredBrowser) return browser.exports;
4277
- hasRequiredBrowser = 1;
4278
- (function(module2, exports2) {
4279
- exports2.formatArgs = formatArgs;
4280
- exports2.save = save;
4281
- exports2.load = load;
4282
- exports2.useColors = useColors;
4283
- exports2.storage = localstorage();
4284
- exports2.destroy = /* @__PURE__ */ (() => {
4285
- let warned2 = false;
4286
- return () => {
4287
- if (!warned2) {
4288
- warned2 = true;
4289
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
4290
- }
4291
- };
4292
- })();
4293
- exports2.colors = [
4294
- "#0000CC",
4295
- "#0000FF",
4296
- "#0033CC",
4297
- "#0033FF",
4298
- "#0066CC",
4299
- "#0066FF",
4300
- "#0099CC",
4301
- "#0099FF",
4302
- "#00CC00",
4303
- "#00CC33",
4304
- "#00CC66",
4305
- "#00CC99",
4306
- "#00CCCC",
4307
- "#00CCFF",
4308
- "#3300CC",
4309
- "#3300FF",
4310
- "#3333CC",
4311
- "#3333FF",
4312
- "#3366CC",
4313
- "#3366FF",
4314
- "#3399CC",
4315
- "#3399FF",
4316
- "#33CC00",
4317
- "#33CC33",
4318
- "#33CC66",
4319
- "#33CC99",
4320
- "#33CCCC",
4321
- "#33CCFF",
4322
- "#6600CC",
4323
- "#6600FF",
4324
- "#6633CC",
4325
- "#6633FF",
4326
- "#66CC00",
4327
- "#66CC33",
4328
- "#9900CC",
4329
- "#9900FF",
4330
- "#9933CC",
4331
- "#9933FF",
4332
- "#99CC00",
4333
- "#99CC33",
4334
- "#CC0000",
4335
- "#CC0033",
4336
- "#CC0066",
4337
- "#CC0099",
4338
- "#CC00CC",
4339
- "#CC00FF",
4340
- "#CC3300",
4341
- "#CC3333",
4342
- "#CC3366",
4343
- "#CC3399",
4344
- "#CC33CC",
4345
- "#CC33FF",
4346
- "#CC6600",
4347
- "#CC6633",
4348
- "#CC9900",
4349
- "#CC9933",
4350
- "#CCCC00",
4351
- "#CCCC33",
4352
- "#FF0000",
4353
- "#FF0033",
4354
- "#FF0066",
4355
- "#FF0099",
4356
- "#FF00CC",
4357
- "#FF00FF",
4358
- "#FF3300",
4359
- "#FF3333",
4360
- "#FF3366",
4361
- "#FF3399",
4362
- "#FF33CC",
4363
- "#FF33FF",
4364
- "#FF6600",
4365
- "#FF6633",
4366
- "#FF9900",
4367
- "#FF9933",
4368
- "#FFCC00",
4369
- "#FFCC33"
3951
+ module2.exports = setup;
3952
+ } });
3953
+ var require_node = __commonJS2({ "../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js"(exports2, module2) {
3954
+ const tty = __require("tty");
3955
+ const util = __require("util");
3956
+ exports2.init = init;
3957
+ exports2.log = log;
3958
+ exports2.formatArgs = formatArgs;
3959
+ exports2.save = save;
3960
+ exports2.load = load;
3961
+ exports2.useColors = useColors;
3962
+ exports2.destroy = util.deprecate(() => {
3963
+ }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
3964
+ exports2.colors = [
3965
+ 6,
3966
+ 2,
3967
+ 3,
3968
+ 4,
3969
+ 5,
3970
+ 1
3971
+ ];
3972
+ try {
3973
+ const supportsColor = __require("supports-color");
3974
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports2.colors = [
3975
+ 20,
3976
+ 21,
3977
+ 26,
3978
+ 27,
3979
+ 32,
3980
+ 33,
3981
+ 38,
3982
+ 39,
3983
+ 40,
3984
+ 41,
3985
+ 42,
3986
+ 43,
3987
+ 44,
3988
+ 45,
3989
+ 56,
3990
+ 57,
3991
+ 62,
3992
+ 63,
3993
+ 68,
3994
+ 69,
3995
+ 74,
3996
+ 75,
3997
+ 76,
3998
+ 77,
3999
+ 78,
4000
+ 79,
4001
+ 80,
4002
+ 81,
4003
+ 92,
4004
+ 93,
4005
+ 98,
4006
+ 99,
4007
+ 112,
4008
+ 113,
4009
+ 128,
4010
+ 129,
4011
+ 134,
4012
+ 135,
4013
+ 148,
4014
+ 149,
4015
+ 160,
4016
+ 161,
4017
+ 162,
4018
+ 163,
4019
+ 164,
4020
+ 165,
4021
+ 166,
4022
+ 167,
4023
+ 168,
4024
+ 169,
4025
+ 170,
4026
+ 171,
4027
+ 172,
4028
+ 173,
4029
+ 178,
4030
+ 179,
4031
+ 184,
4032
+ 185,
4033
+ 196,
4034
+ 197,
4035
+ 198,
4036
+ 199,
4037
+ 200,
4038
+ 201,
4039
+ 202,
4040
+ 203,
4041
+ 204,
4042
+ 205,
4043
+ 206,
4044
+ 207,
4045
+ 208,
4046
+ 209,
4047
+ 214,
4048
+ 215,
4049
+ 220,
4050
+ 221
4370
4051
  ];
4371
- function useColors() {
4372
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
4373
- return true;
4374
- }
4375
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
4376
- return false;
4377
- }
4378
- let m;
4379
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
4380
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
4381
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
4382
- typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
4383
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
4384
- }
4385
- function formatArgs(args) {
4386
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
4387
- if (!this.useColors) {
4388
- return;
4389
- }
4390
- const c = "color: " + this.color;
4391
- args.splice(1, 0, c, "color: inherit");
4392
- let index = 0;
4393
- let lastC = 0;
4394
- args[0].replace(/%[a-zA-Z%]/g, (match2) => {
4395
- if (match2 === "%%") {
4396
- return;
4397
- }
4398
- index++;
4399
- if (match2 === "%c") {
4400
- lastC = index;
4401
- }
4402
- });
4403
- args.splice(lastC, 0, c);
4404
- }
4405
- exports2.log = console.debug || console.log || (() => {
4406
- });
4407
- function save(namespaces) {
4408
- try {
4409
- if (namespaces) {
4410
- exports2.storage.setItem("debug", namespaces);
4411
- } else {
4412
- exports2.storage.removeItem("debug");
4413
- }
4414
- } catch (error) {
4415
- }
4416
- }
4417
- function load() {
4418
- let r;
4419
- try {
4420
- r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
4421
- } catch (error) {
4422
- }
4423
- if (!r && typeof process !== "undefined" && "env" in process) {
4424
- r = process.env.DEBUG;
4425
- }
4426
- return r;
4427
- }
4428
- function localstorage() {
4429
- try {
4430
- return localStorage;
4431
- } catch (error) {
4432
- }
4433
- }
4434
- module2.exports = requireCommon()(exports2);
4435
- const { formatters } = module2.exports;
4436
- formatters.j = function(v) {
4437
- try {
4438
- return JSON.stringify(v);
4439
- } catch (error) {
4440
- return "[UnexpectedJSONParseError]: " + error.message;
4441
- }
4442
- };
4443
- })(browser, browser.exports);
4444
- return browser.exports;
4445
- }
4446
- var node = { exports: {} };
4447
- var hasRequiredNode;
4448
- function requireNode() {
4449
- if (hasRequiredNode) return node.exports;
4450
- hasRequiredNode = 1;
4451
- (function(module2, exports2) {
4452
- const tty = import_tty.default;
4453
- const util = import_util.default;
4454
- exports2.init = init;
4455
- exports2.log = log;
4456
- exports2.formatArgs = formatArgs;
4457
- exports2.save = save;
4458
- exports2.load = load;
4459
- exports2.useColors = useColors;
4460
- exports2.destroy = util.deprecate(
4461
- () => {
4462
- },
4463
- "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
4464
- );
4465
- exports2.colors = [6, 2, 3, 4, 5, 1];
4466
- try {
4467
- const supportsColor = require_supports_color();
4468
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
4469
- exports2.colors = [
4470
- 20,
4471
- 21,
4472
- 26,
4473
- 27,
4474
- 32,
4475
- 33,
4476
- 38,
4477
- 39,
4478
- 40,
4479
- 41,
4480
- 42,
4481
- 43,
4482
- 44,
4483
- 45,
4484
- 56,
4485
- 57,
4486
- 62,
4487
- 63,
4488
- 68,
4489
- 69,
4490
- 74,
4491
- 75,
4492
- 76,
4493
- 77,
4494
- 78,
4495
- 79,
4496
- 80,
4497
- 81,
4498
- 92,
4499
- 93,
4500
- 98,
4501
- 99,
4502
- 112,
4503
- 113,
4504
- 128,
4505
- 129,
4506
- 134,
4507
- 135,
4508
- 148,
4509
- 149,
4510
- 160,
4511
- 161,
4512
- 162,
4513
- 163,
4514
- 164,
4515
- 165,
4516
- 166,
4517
- 167,
4518
- 168,
4519
- 169,
4520
- 170,
4521
- 171,
4522
- 172,
4523
- 173,
4524
- 178,
4525
- 179,
4526
- 184,
4527
- 185,
4528
- 196,
4529
- 197,
4530
- 198,
4531
- 199,
4532
- 200,
4533
- 201,
4534
- 202,
4535
- 203,
4536
- 204,
4537
- 205,
4538
- 206,
4539
- 207,
4540
- 208,
4541
- 209,
4542
- 214,
4543
- 215,
4544
- 220,
4545
- 221
4546
- ];
4547
- }
4548
- } catch (error) {
4549
- }
4550
- exports2.inspectOpts = Object.keys(process.env).filter((key) => {
4551
- return /^debug_/i.test(key);
4552
- }).reduce((obj, key) => {
4553
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
4554
- return k.toUpperCase();
4555
- });
4556
- let val = process.env[key];
4557
- if (/^(yes|on|true|enabled)$/i.test(val)) {
4558
- val = true;
4559
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
4560
- val = false;
4561
- } else if (val === "null") {
4562
- val = null;
4563
- } else {
4564
- val = Number(val);
4565
- }
4566
- obj[prop] = val;
4567
- return obj;
4568
- }, {});
4569
- function useColors() {
4570
- return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
4571
- }
4572
- function formatArgs(args) {
4573
- const { namespace: name, useColors: useColors2 } = this;
4574
- if (useColors2) {
4575
- const c = this.color;
4576
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
4577
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
4578
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
4579
- args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
4580
- } else {
4581
- args[0] = getDate() + name + " " + args[0];
4582
- }
4583
- }
4584
- function getDate() {
4585
- if (exports2.inspectOpts.hideDate) {
4586
- return "";
4587
- }
4588
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
4589
- }
4590
- function log(...args) {
4591
- return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
4592
- }
4593
- function save(namespaces) {
4594
- if (namespaces) {
4595
- process.env.DEBUG = namespaces;
4596
- } else {
4597
- delete process.env.DEBUG;
4598
- }
4599
- }
4600
- function load() {
4601
- return process.env.DEBUG;
4602
- }
4603
- function init(debug2) {
4604
- debug2.inspectOpts = {};
4605
- const keys = Object.keys(exports2.inspectOpts);
4606
- for (let i = 0; i < keys.length; i++) {
4607
- debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
4608
- }
4609
- }
4610
- module2.exports = requireCommon()(exports2);
4611
- const { formatters } = module2.exports;
4612
- formatters.o = function(v) {
4613
- this.inspectOpts.colors = this.useColors;
4614
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
4615
- };
4616
- formatters.O = function(v) {
4617
- this.inspectOpts.colors = this.useColors;
4618
- return util.inspect(v, this.inspectOpts);
4619
- };
4620
- })(node, node.exports);
4621
- return node.exports;
4622
- }
4623
- var hasRequiredSrc;
4624
- function requireSrc() {
4625
- if (hasRequiredSrc) return src.exports;
4626
- hasRequiredSrc = 1;
4627
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
4628
- src.exports = requireBrowser();
4629
- } else {
4630
- src.exports = requireNode();
4052
+ } catch (error) {
4631
4053
  }
4632
- return src.exports;
4633
- }
4634
- var srcExports = requireSrc();
4635
- var _debug = /* @__PURE__ */ getDefaultExportFromCjs(srcExports);
4636
- var debug = _debug("vite:hmr");
4054
+ exports2.inspectOpts = Object.keys(process.env).filter((key) => {
4055
+ return /^debug_/i.test(key);
4056
+ }).reduce((obj, key) => {
4057
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
4058
+ return k.toUpperCase();
4059
+ });
4060
+ let val = process.env[key];
4061
+ if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
4062
+ else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
4063
+ else if (val === "null") val = null;
4064
+ else val = Number(val);
4065
+ obj[prop] = val;
4066
+ return obj;
4067
+ }, {});
4068
+ function useColors() {
4069
+ return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
4070
+ }
4071
+ function formatArgs(args) {
4072
+ const { namespace: name, useColors: useColors$1 } = this;
4073
+ if (useColors$1) {
4074
+ const c = this.color;
4075
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
4076
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
4077
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
4078
+ args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
4079
+ } else args[0] = getDate() + name + " " + args[0];
4080
+ }
4081
+ function getDate() {
4082
+ if (exports2.inspectOpts.hideDate) return "";
4083
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
4084
+ }
4085
+ function log(...args) {
4086
+ return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
4087
+ }
4088
+ function save(namespaces) {
4089
+ if (namespaces) process.env.DEBUG = namespaces;
4090
+ else delete process.env.DEBUG;
4091
+ }
4092
+ function load() {
4093
+ return process.env.DEBUG;
4094
+ }
4095
+ function init(debug$1) {
4096
+ debug$1.inspectOpts = {};
4097
+ const keys = Object.keys(exports2.inspectOpts);
4098
+ for (let i = 0; i < keys.length; i++) debug$1.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
4099
+ }
4100
+ module2.exports = require_common()(exports2);
4101
+ const { formatters } = module2.exports;
4102
+ formatters.o = function(v) {
4103
+ this.inspectOpts.colors = this.useColors;
4104
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
4105
+ };
4106
+ formatters.O = function(v) {
4107
+ this.inspectOpts.colors = this.useColors;
4108
+ return util.inspect(v, this.inspectOpts);
4109
+ };
4110
+ } });
4111
+ var import_node = __toESM2(require_node(), 1);
4112
+ var debug = (0, import_node.default)("vite:hmr");
4637
4113
  var directRequestRE = /(?:\?|&)direct\b/;
4638
4114
  async function handleHotUpdate({ file, modules, read }, options, customElement, typeDepModules) {
4639
4115
  const prevDescriptor = getDescriptor(file, options, false, true);
4640
- if (!prevDescriptor) {
4641
- return;
4642
- }
4116
+ if (!prevDescriptor) return;
4643
4117
  const content = await read();
4644
4118
  const { descriptor } = createDescriptor(file, content, options, true);
4645
4119
  let needRerender = false;
4646
- const affectedModules = /* @__PURE__ */ new Set();
4120
+ const affectedModules = new Set(modules.filter((mod) => mod.type !== "js"));
4647
4121
  const mainModule = getMainModule(modules);
4648
- const templateModule = modules.find((m) => /type=template/.test(m.url));
4122
+ const templateModule = modules.find((m$1) => /type=template/.test(m$1.url));
4649
4123
  resolveScript(descriptor, options, false, customElement);
4650
4124
  const scriptChanged = hasScriptChanged(prevDescriptor, descriptor);
4651
- if (scriptChanged) {
4652
- affectedModules.add(getScriptModule(modules) || mainModule);
4653
- }
4125
+ if (scriptChanged) affectedModules.add(getScriptModule(modules) || mainModule);
4654
4126
  if (!isEqualBlock(descriptor.template, prevDescriptor.template)) {
4655
- if (!scriptChanged) {
4656
- setResolvedScript(
4657
- descriptor,
4658
- getResolvedScript(prevDescriptor, false),
4659
- false
4660
- );
4661
- }
4127
+ if (!scriptChanged) setResolvedScript(descriptor, getResolvedScript(prevDescriptor, false), false);
4662
4128
  affectedModules.add(templateModule);
4663
4129
  needRerender = true;
4664
4130
  }
4665
4131
  let didUpdateStyle = false;
4666
4132
  const prevStyles = prevDescriptor.styles || [];
4667
4133
  const nextStyles = descriptor.styles || [];
4668
- if (prevDescriptor.cssVars.join("") !== descriptor.cssVars.join("")) {
4669
- affectedModules.add(mainModule);
4670
- }
4671
- if (prevStyles.some((s) => s.scoped) !== nextStyles.some((s) => s.scoped)) {
4134
+ if (prevDescriptor.cssVars.join("") !== descriptor.cssVars.join("")) affectedModules.add(mainModule);
4135
+ if (prevStyles.some((s$1) => s$1.scoped) !== nextStyles.some((s$1) => s$1.scoped)) {
4672
4136
  affectedModules.add(templateModule);
4673
4137
  affectedModules.add(mainModule);
4674
4138
  }
@@ -4677,68 +4141,42 @@ async function handleHotUpdate({ file, modules, read }, options, customElement,
4677
4141
  const next = nextStyles[i];
4678
4142
  if (!prev || !isEqualBlock(prev, next)) {
4679
4143
  didUpdateStyle = true;
4680
- const mod = modules.find(
4681
- (m) => m.url.includes(`type=style&index=${i}`) && m.url.endsWith(`.${next.lang || "css"}`) && !directRequestRE.test(m.url)
4682
- );
4144
+ const mod = modules.find((m$1) => m$1.url.includes(`type=style&index=${i}`) && m$1.url.endsWith(`.${next.lang || "css"}`) && !directRequestRE.test(m$1.url));
4683
4145
  if (mod) {
4684
4146
  affectedModules.add(mod);
4685
- if (mod.url.includes("&inline")) {
4686
- affectedModules.add(mainModule);
4687
- }
4688
- } else {
4689
- affectedModules.add(mainModule);
4690
- }
4147
+ if (mod.url.includes("&inline")) affectedModules.add(mainModule);
4148
+ } else affectedModules.add(mainModule);
4691
4149
  }
4692
4150
  }
4693
- if (prevStyles.length > nextStyles.length) {
4694
- affectedModules.add(mainModule);
4695
- }
4151
+ if (prevStyles.length > nextStyles.length) affectedModules.add(mainModule);
4696
4152
  const prevCustoms = prevDescriptor.customBlocks || [];
4697
4153
  const nextCustoms = descriptor.customBlocks || [];
4698
- if (prevCustoms.length !== nextCustoms.length) {
4699
- affectedModules.add(mainModule);
4700
- } else {
4701
- for (let i = 0; i < nextCustoms.length; i++) {
4702
- const prev = prevCustoms[i];
4703
- const next = nextCustoms[i];
4704
- if (!prev || !isEqualBlock(prev, next)) {
4705
- const mod = modules.find(
4706
- (m) => m.url.includes(`type=${prev.type}&index=${i}`)
4707
- );
4708
- if (mod) {
4709
- affectedModules.add(mod);
4710
- } else {
4711
- affectedModules.add(mainModule);
4712
- }
4713
- }
4154
+ if (prevCustoms.length !== nextCustoms.length) affectedModules.add(mainModule);
4155
+ else for (let i = 0; i < nextCustoms.length; i++) {
4156
+ const prev = prevCustoms[i];
4157
+ const next = nextCustoms[i];
4158
+ if (!prev || !isEqualBlock(prev, next)) {
4159
+ const mod = modules.find((m$1) => m$1.url.includes(`type=${prev.type}&index=${i}`));
4160
+ if (mod) affectedModules.add(mod);
4161
+ else affectedModules.add(mainModule);
4714
4162
  }
4715
4163
  }
4716
4164
  const updateType = [];
4717
4165
  if (needRerender) {
4718
4166
  updateType.push(`template`);
4719
- if (!templateModule) {
4720
- affectedModules.add(mainModule);
4721
- } else if (mainModule && !affectedModules.has(mainModule)) {
4722
- const styleImporters = [...mainModule.importers].filter(
4723
- (m) => (0, import_vite.isCSSRequest)(m.url)
4724
- );
4725
- styleImporters.forEach((m) => affectedModules.add(m));
4167
+ if (!templateModule) affectedModules.add(mainModule);
4168
+ else if (mainModule && !affectedModules.has(mainModule)) {
4169
+ const styleImporters = [...mainModule.importers].filter((m$1) => (0, import_vite.isCSSRequest)(m$1.url));
4170
+ styleImporters.forEach((m$1) => affectedModules.add(m$1));
4726
4171
  }
4727
4172
  }
4728
- if (didUpdateStyle) {
4729
- updateType.push(`style`);
4730
- }
4173
+ if (didUpdateStyle) updateType.push(`style`);
4731
4174
  if (updateType.length) {
4732
- if (file.endsWith(".vue")) {
4733
- invalidateDescriptor(file);
4734
- } else {
4735
- cache.set(file, descriptor);
4736
- }
4175
+ if (file.endsWith(".vue")) invalidateDescriptor(file);
4176
+ else cache.set(file, descriptor);
4737
4177
  debug(`[vue:update(${updateType.join("&")})] ${file}`);
4738
4178
  }
4739
- return [...affectedModules, ...typeDepModules || []].filter(
4740
- Boolean
4741
- );
4179
+ return [...affectedModules, ...typeDepModules || []].filter(Boolean);
4742
4180
  }
4743
4181
  function isEqualBlock(a, b) {
4744
4182
  if (!a && !b) return true;
@@ -4747,95 +4185,62 @@ function isEqualBlock(a, b) {
4747
4185
  if (a.content !== b.content) return false;
4748
4186
  const keysA = Object.keys(a.attrs);
4749
4187
  const keysB = Object.keys(b.attrs);
4750
- if (keysA.length !== keysB.length) {
4751
- return false;
4752
- }
4188
+ if (keysA.length !== keysB.length) return false;
4753
4189
  return keysA.every((key) => a.attrs[key] === b.attrs[key]);
4754
4190
  }
4755
4191
  function isOnlyTemplateChanged(prev, next) {
4756
- return !hasScriptChanged(prev, next) && prev.styles.length === next.styles.length && prev.styles.every((s, i) => isEqualBlock(s, next.styles[i])) && prev.customBlocks.length === next.customBlocks.length && prev.customBlocks.every((s, i) => isEqualBlock(s, next.customBlocks[i]));
4192
+ return !hasScriptChanged(prev, next) && prev.styles.length === next.styles.length && prev.styles.every((s$1, i) => isEqualBlock(s$1, next.styles[i])) && prev.customBlocks.length === next.customBlocks.length && prev.customBlocks.every((s$1, i) => isEqualBlock(s$1, next.customBlocks[i]));
4757
4193
  }
4758
4194
  function deepEqual(obj1, obj2, excludeProps = [], deepParentsOfObj1 = []) {
4759
- if (typeof obj1 !== typeof obj2) {
4760
- return false;
4761
- }
4762
- if (obj1 == null || obj2 == null || typeof obj1 !== "object" || deepParentsOfObj1.includes(obj1)) {
4763
- return obj1 === obj2;
4764
- }
4195
+ if (typeof obj1 !== typeof obj2) return false;
4196
+ if (obj1 == null || obj2 == null || typeof obj1 !== "object" || deepParentsOfObj1.includes(obj1)) return obj1 === obj2;
4765
4197
  const keys1 = Object.keys(obj1);
4766
4198
  const keys2 = Object.keys(obj2);
4767
- if (keys1.length !== keys2.length) {
4768
- return false;
4769
- }
4199
+ if (keys1.length !== keys2.length) return false;
4770
4200
  for (const key of keys1) {
4771
- if (excludeProps.includes(key)) {
4772
- continue;
4773
- }
4774
- if (!deepEqual(obj1[key], obj2[key], excludeProps, [
4775
- ...deepParentsOfObj1,
4776
- obj1
4777
- ])) {
4778
- return false;
4779
- }
4201
+ if (excludeProps.includes(key)) continue;
4202
+ if (!deepEqual(obj1[key], obj2[key], excludeProps, [...deepParentsOfObj1, obj1])) return false;
4780
4203
  }
4781
4204
  return true;
4782
4205
  }
4783
4206
  function isEqualAst(prev, next) {
4784
- if (typeof prev === "undefined" || typeof next === "undefined") {
4785
- return prev === next;
4786
- }
4787
- if (prev.length !== next.length) {
4788
- return false;
4789
- }
4207
+ if (typeof prev === "undefined" || typeof next === "undefined") return prev === next;
4208
+ if (prev.length !== next.length) return false;
4790
4209
  for (let i = 0; i < prev.length; i++) {
4791
4210
  const prevNode = prev[i];
4792
4211
  const nextNode = next[i];
4793
- if (
4794
- // deep equal, but ignore start/end/loc/range/leadingComments/trailingComments/innerComments
4795
- !deepEqual(prevNode, nextNode, [
4796
- "start",
4797
- "end",
4798
- "loc",
4799
- "range",
4800
- "leadingComments",
4801
- "trailingComments",
4802
- "innerComments",
4803
- // https://github.com/vuejs/core/issues/11923
4804
- // avoid comparing the following properties of typeParameters
4805
- // as it may be imported from 3rd lib and complex to compare
4806
- "_ownerScope",
4807
- "_resolvedReference",
4808
- "_resolvedElements"
4809
- ])
4810
- ) {
4811
- return false;
4812
- }
4212
+ if (!deepEqual(prevNode, nextNode, [
4213
+ "start",
4214
+ "end",
4215
+ "loc",
4216
+ "range",
4217
+ "leadingComments",
4218
+ "trailingComments",
4219
+ "innerComments",
4220
+ "_ownerScope",
4221
+ "_resolvedReference",
4222
+ "_resolvedElements"
4223
+ ])) return false;
4813
4224
  }
4814
4225
  return true;
4815
4226
  }
4816
4227
  function hasScriptChanged(prev, next) {
4817
4228
  const prevScript = getResolvedScript(prev, false);
4818
4229
  const nextScript = getResolvedScript(next, false);
4819
- if (!isEqualBlock(prev.script, next.script) && !isEqualAst(prevScript?.scriptAst, nextScript?.scriptAst)) {
4820
- return true;
4821
- }
4822
- if (!isEqualBlock(prev.scriptSetup, next.scriptSetup) && !isEqualAst(prevScript?.scriptSetupAst, nextScript?.scriptSetupAst)) {
4823
- return true;
4824
- }
4230
+ if (!isEqualBlock(prev.script, next.script) && !isEqualAst(prevScript?.scriptAst, nextScript?.scriptAst)) return true;
4231
+ if (!isEqualBlock(prev.scriptSetup, next.scriptSetup) && !isEqualAst(prevScript?.scriptSetupAst, nextScript?.scriptSetupAst)) return true;
4825
4232
  const prevResolvedScript = getResolvedScript(prev, false);
4826
4233
  const prevImports = prevResolvedScript?.imports;
4827
- if (prevImports) {
4828
- return !next.template || next.shouldForceReload(prevImports);
4829
- }
4234
+ if (prevImports) return !next.template || next.shouldForceReload(prevImports);
4830
4235
  return false;
4831
4236
  }
4832
4237
  function getMainModule(modules) {
4833
- return modules.filter((m) => !/type=/.test(m.url) || /type=script/.test(m.url)).sort((m1, m2) => {
4238
+ return modules.filter((m$1) => !/type=/.test(m$1.url) || /type=script/.test(m$1.url)).sort((m1, m2) => {
4834
4239
  return m1.url.length - m2.url.length;
4835
4240
  })[0];
4836
4241
  }
4837
4242
  function getScriptModule(modules) {
4838
- return modules.find((m) => /type=script.*&lang\.\w+$/.test(m.url));
4243
+ return modules.find((m$1) => /type=script.*&lang\.\w+$/.test(m$1.url));
4839
4244
  }
4840
4245
  function handleTypeDepChange(affectedComponents, { modules, server: { moduleGraph } }) {
4841
4246
  const affected = /* @__PURE__ */ new Set();
@@ -4863,63 +4268,21 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
4863
4268
  const { devServer, isProduction, devToolsEnabled } = options;
4864
4269
  const prevDescriptor = getPrevDescriptor(filename);
4865
4270
  const { descriptor, errors } = createDescriptor(filename, code, options);
4866
- if (import_node_fs.default.existsSync(filename)) {
4867
- getDescriptor(
4868
- filename,
4869
- options,
4870
- true,
4871
- true,
4872
- // for vue files, create descriptor from fs read to be consistent with
4873
- // logic in handleHotUpdate()
4874
- // for non vue files, e.g. md files in vitepress, we assume
4875
- // `hmrContext.read` is overwritten so handleHotUpdate() is dealing with
4876
- // post-transform code, so we populate the descriptor with post-transform
4877
- // code here as well.
4878
- filename.endsWith(".vue") ? void 0 : code
4879
- );
4880
- }
4271
+ if (import_node_fs.default.existsSync(filename)) getDescriptor(filename, options, true, true, filename.endsWith(".vue") ? void 0 : code);
4881
4272
  if (errors.length) {
4882
- errors.forEach(
4883
- (error) => pluginContext.error(createRollupError(filename, error))
4884
- );
4273
+ errors.forEach((error) => pluginContext.error(createRollupError(filename, error)));
4885
4274
  return null;
4886
4275
  }
4887
4276
  const attachedProps = [];
4888
- const hasScoped = descriptor.styles.some((s) => s.scoped);
4889
- const { code: scriptCode, map: scriptMap } = await genScriptCode(
4890
- descriptor,
4891
- options,
4892
- pluginContext,
4893
- ssr,
4894
- customElement
4895
- );
4277
+ const hasScoped = descriptor.styles.some((s$1) => s$1.scoped);
4278
+ const { code: scriptCode, map: scriptMap } = await genScriptCode(descriptor, options, pluginContext, ssr, customElement);
4896
4279
  const hasTemplateImport = descriptor.template && !isUseInlineTemplate(descriptor, options);
4897
4280
  let templateCode = "";
4898
4281
  let templateMap = void 0;
4899
- if (hasTemplateImport) {
4900
- ({ code: templateCode, map: templateMap } = await genTemplateCode(
4901
- descriptor,
4902
- options,
4903
- pluginContext,
4904
- ssr,
4905
- customElement
4906
- ));
4907
- }
4908
- if (hasTemplateImport) {
4909
- attachedProps.push(
4910
- ssr ? ["ssrRender", "_sfc_ssrRender"] : ["render", "_sfc_render"]
4911
- );
4912
- } else {
4913
- if (prevDescriptor && !isEqualBlock(descriptor.template, prevDescriptor.template)) {
4914
- attachedProps.push([ssr ? "ssrRender" : "render", "() => {}"]);
4915
- }
4916
- }
4917
- const stylesCode = await genStyleCode(
4918
- descriptor,
4919
- pluginContext,
4920
- customElement,
4921
- attachedProps
4922
- );
4282
+ if (hasTemplateImport) ({ code: templateCode, map: templateMap } = await genTemplateCode(descriptor, options, pluginContext, ssr, customElement));
4283
+ if (hasTemplateImport) attachedProps.push(ssr ? ["ssrRender", "_sfc_ssrRender"] : ["render", "_sfc_render"]);
4284
+ else if (prevDescriptor && !isEqualBlock(descriptor.template, prevDescriptor.template)) attachedProps.push([ssr ? "ssrRender" : "render", "() => {}"]);
4285
+ const stylesCode = await genStyleCode(descriptor, pluginContext, customElement, attachedProps);
4923
4286
  const customBlocksCode = await genCustomBlockCode(descriptor, pluginContext);
4924
4287
  const output = [
4925
4288
  scriptCode,
@@ -4927,183 +4290,94 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
4927
4290
  stylesCode,
4928
4291
  customBlocksCode
4929
4292
  ];
4930
- if (hasScoped) {
4931
- attachedProps.push([`__scopeId`, JSON.stringify(`data-v-${descriptor.id}`)]);
4932
- }
4933
- if (devToolsEnabled || devServer && !isProduction) {
4934
- attachedProps.push([
4935
- `__file`,
4936
- JSON.stringify(isProduction ? import_node_path.default.basename(filename) : filename)
4937
- ]);
4938
- }
4293
+ if (hasScoped) attachedProps.push([`__scopeId`, JSON.stringify(`data-v-${descriptor.id}`)]);
4294
+ if (devToolsEnabled || devServer && !isProduction) attachedProps.push([`__file`, JSON.stringify(isProduction ? import_node_path.default.basename(filename) : filename)]);
4939
4295
  if (devServer && devServer.config.server.hmr !== false && !ssr && !isProduction) {
4940
4296
  output.push(`_sfc_main.__hmrId = ${JSON.stringify(descriptor.id)}`);
4941
- output.push(
4942
- `typeof __VUE_HMR_RUNTIME__ !== 'undefined' && __VUE_HMR_RUNTIME__.createRecord(_sfc_main.__hmrId, _sfc_main)`
4943
- );
4944
- output.push(
4945
- `import.meta.hot.on('file-changed', ({ file }) => {`,
4946
- ` __VUE_HMR_RUNTIME__.CHANGED_FILE = file`,
4947
- `})`
4948
- );
4949
- if (prevDescriptor && isOnlyTemplateChanged(prevDescriptor, descriptor)) {
4950
- output.push(
4951
- `export const _rerender_only = __VUE_HMR_RUNTIME__.CHANGED_FILE === ${JSON.stringify((0, import_vite.normalizePath)(filename))}`
4952
- );
4953
- }
4954
- output.push(
4955
- `import.meta.hot.accept(mod => {`,
4956
- ` if (!mod) return`,
4957
- ` const { default: updated, _rerender_only } = mod`,
4958
- ` if (_rerender_only) {`,
4959
- ` __VUE_HMR_RUNTIME__.rerender(updated.__hmrId, updated.render)`,
4960
- ` } else {`,
4961
- ` __VUE_HMR_RUNTIME__.reload(updated.__hmrId, updated)`,
4962
- ` }`,
4963
- `})`
4964
- );
4297
+ output.push("typeof __VUE_HMR_RUNTIME__ !== 'undefined' && __VUE_HMR_RUNTIME__.createRecord(_sfc_main.__hmrId, _sfc_main)");
4298
+ output.push(`import.meta.hot.on('file-changed', ({ file }) => {`, ` __VUE_HMR_RUNTIME__.CHANGED_FILE = file`, `})`);
4299
+ if (prevDescriptor && isOnlyTemplateChanged(prevDescriptor, descriptor)) output.push(`export const _rerender_only = __VUE_HMR_RUNTIME__.CHANGED_FILE === ${JSON.stringify((0, import_vite.normalizePath)(filename))}`);
4300
+ output.push(`import.meta.hot.accept(mod => {`, ` if (!mod) return`, ` const { default: updated, _rerender_only } = mod`, ` if (_rerender_only) {`, ` __VUE_HMR_RUNTIME__.rerender(updated.__hmrId, updated.render)`, ` } else {`, ` __VUE_HMR_RUNTIME__.reload(updated.__hmrId, updated)`, ` }`, `})`);
4965
4301
  }
4966
4302
  if (ssr) {
4967
- const normalizedFilename = (0, import_vite.normalizePath)(
4968
- import_node_path.default.relative(options.root, filename)
4969
- );
4970
- output.push(
4971
- `import { useSSRContext as __vite_useSSRContext } from 'vue'`,
4972
- `const _sfc_setup = _sfc_main.setup`,
4973
- `_sfc_main.setup = (props, ctx) => {`,
4974
- ` const ssrContext = __vite_useSSRContext()`,
4975
- ` ;(ssrContext.modules || (ssrContext.modules = new Set())).add(${JSON.stringify(
4976
- normalizedFilename
4977
- )})`,
4978
- ` return _sfc_setup ? _sfc_setup(props, ctx) : undefined`,
4979
- `}`
4980
- );
4303
+ const normalizedFilename = (0, import_vite.normalizePath)(import_node_path.default.relative(options.root, filename));
4304
+ output.push(`import { useSSRContext as __vite_useSSRContext } from 'vue'`, `const _sfc_setup = _sfc_main.setup`, `_sfc_main.setup = (props, ctx) => {`, ` const ssrContext = __vite_useSSRContext()`, ` ;(ssrContext.modules || (ssrContext.modules = new Set())).add(${JSON.stringify(normalizedFilename)})`, ` return _sfc_setup ? _sfc_setup(props, ctx) : undefined`, `}`);
4981
4305
  }
4982
4306
  let resolvedMap = void 0;
4983
- if (options.sourceMap) {
4984
- if (templateMap) {
4985
- const from = scriptMap ?? {
4986
- file: filename,
4987
- sourceRoot: "",
4988
- version: 3,
4989
- sources: [],
4990
- sourcesContent: [],
4991
- names: [],
4992
- mappings: ""
4993
- };
4994
- const gen = fromMap(
4995
- // version property of result.map is declared as string
4996
- // but actually it is `3`
4997
- from
4998
- );
4999
- const tracer = new TraceMap(
5000
- // same above
5001
- templateMap
5002
- );
5003
- const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
5004
- eachMapping(tracer, (m) => {
5005
- if (m.source == null) return;
5006
- addMapping(gen, {
5007
- source: m.source,
5008
- original: { line: m.originalLine, column: m.originalColumn },
5009
- generated: {
5010
- line: m.generatedLine + offset,
5011
- column: m.generatedColumn
5012
- }
5013
- });
4307
+ if (options.sourceMap) if (templateMap) {
4308
+ const from = scriptMap ?? {
4309
+ file: filename,
4310
+ sourceRoot: "",
4311
+ version: 3,
4312
+ sources: [],
4313
+ sourcesContent: [],
4314
+ names: [],
4315
+ mappings: ""
4316
+ };
4317
+ const gen = fromMap(from);
4318
+ const tracer = new TraceMap(templateMap);
4319
+ const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
4320
+ eachMapping(tracer, (m$1) => {
4321
+ if (m$1.source == null) return;
4322
+ addMapping(gen, {
4323
+ source: m$1.source,
4324
+ original: {
4325
+ line: m$1.originalLine,
4326
+ column: m$1.originalColumn
4327
+ },
4328
+ generated: {
4329
+ line: m$1.generatedLine + offset,
4330
+ column: m$1.generatedColumn
4331
+ }
5014
4332
  });
5015
- resolvedMap = toEncodedMap(gen);
5016
- resolvedMap.sourcesContent = templateMap.sourcesContent;
5017
- } else {
5018
- resolvedMap = scriptMap;
5019
- }
5020
- }
5021
- if (!attachedProps.length) {
5022
- output.push(`export default _sfc_main`);
5023
- } else {
5024
- output.push(
5025
- `import _export_sfc from '${EXPORT_HELPER_ID}'`,
5026
- `export default /*#__PURE__*/_export_sfc(_sfc_main, [${attachedProps.map(([key, val]) => `['${key}',${val}]`).join(",")}])`
5027
- );
5028
- }
4333
+ });
4334
+ resolvedMap = toEncodedMap(gen);
4335
+ resolvedMap.sourcesContent = templateMap.sourcesContent;
4336
+ } else resolvedMap = scriptMap;
4337
+ if (!attachedProps.length) output.push(`export default _sfc_main`);
4338
+ else output.push(`import _export_sfc from '${EXPORT_HELPER_ID}'`, `export default /*#__PURE__*/_export_sfc(_sfc_main, [${attachedProps.map(([key, val]) => `['${key}',${val}]`).join(",")}])`);
5029
4339
  let resolvedCode = output.join("\n");
5030
4340
  const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang;
5031
4341
  if (lang && /tsx?$/.test(lang) && !descriptor.script?.src) {
5032
4342
  const { transformWithOxc } = await import("vite");
5033
4343
  if (transformWithOxc) {
5034
- const { code: code2, map } = await transformWithOxc(
5035
- resolvedCode,
5036
- filename,
5037
- {
5038
- // #430 support decorators in .vue file
5039
- // target can be overridden by oxc config target
5040
- // @ts-ignore Rolldown-specific
5041
- ...options.devServer?.config.oxc,
5042
- lang: "ts",
5043
- sourcemap: options.sourceMap
5044
- },
5045
- resolvedMap
5046
- );
5047
- resolvedCode = code2;
4344
+ const { code: code$1, map } = await transformWithOxc(resolvedCode, filename, {
4345
+ ...options.devServer?.config.oxc,
4346
+ lang: "ts",
4347
+ sourcemap: options.sourceMap
4348
+ }, resolvedMap);
4349
+ resolvedCode = code$1;
5048
4350
  resolvedMap = resolvedMap ? map : resolvedMap;
5049
4351
  } else {
5050
- const { code: code2, map } = await (0, import_vite.transformWithEsbuild)(
5051
- resolvedCode,
5052
- filename,
5053
- {
5054
- target: "esnext",
5055
- charset: "utf8",
5056
- // #430 support decorators in .vue file
5057
- // target can be overridden by esbuild config target
5058
- ...options.devServer?.config.esbuild,
5059
- loader: "ts",
5060
- sourcemap: options.sourceMap
5061
- },
5062
- resolvedMap
5063
- );
5064
- resolvedCode = code2;
4352
+ const { code: code$1, map } = await (0, import_vite.transformWithEsbuild)(resolvedCode, filename, {
4353
+ target: "esnext",
4354
+ charset: "utf8",
4355
+ ...options.devServer?.config.esbuild,
4356
+ loader: "ts",
4357
+ sourcemap: options.sourceMap
4358
+ }, resolvedMap);
4359
+ resolvedCode = code$1;
5065
4360
  resolvedMap = resolvedMap ? map : resolvedMap;
5066
4361
  }
5067
4362
  }
5068
4363
  return {
5069
4364
  code: resolvedCode,
5070
- map: resolvedMap || {
5071
- mappings: ""
5072
- },
5073
- meta: {
5074
- vite: {
5075
- lang: descriptor.script?.lang || descriptor.scriptSetup?.lang || "js"
5076
- }
5077
- }
4365
+ map: resolvedMap || { mappings: "" },
4366
+ meta: { vite: { lang: descriptor.script?.lang || descriptor.scriptSetup?.lang || "js" } }
5078
4367
  };
5079
4368
  }
5080
4369
  async function genTemplateCode(descriptor, options, pluginContext, ssr, customElement) {
5081
4370
  const template = descriptor.template;
5082
4371
  const hasScoped = descriptor.styles.some((style) => style.scoped);
5083
- if ((!template.lang || template.lang === "html") && !template.src) {
5084
- return transformTemplateInMain(
5085
- template.content,
5086
- descriptor,
5087
- options,
5088
- pluginContext,
5089
- ssr,
5090
- customElement
5091
- );
5092
- } else {
5093
- if (template.src) {
5094
- await linkSrcToDescriptor(
5095
- template.src,
5096
- descriptor,
5097
- pluginContext,
5098
- hasScoped
5099
- );
5100
- }
5101
- const src2 = template.src || descriptor.filename;
4372
+ if ((!template.lang || template.lang === "html") && !template.src) return transformTemplateInMain(template.content, descriptor, options, pluginContext, ssr, customElement);
4373
+ else {
4374
+ if (template.src) await linkSrcToDescriptor(template.src, descriptor, pluginContext, hasScoped);
4375
+ const src = template.src || descriptor.filename;
5102
4376
  const srcQuery = template.src ? hasScoped ? `&src=${descriptor.id}` : "&src=true" : "";
5103
4377
  const scopedQuery = hasScoped ? `&scoped=${descriptor.id}` : ``;
5104
4378
  const attrsQuery = attrsToQuery(template.attrs, "js", true);
5105
4379
  const query = `?vue&type=template${srcQuery}${scopedQuery}${attrsQuery}`;
5106
- const request = JSON.stringify(src2 + query);
4380
+ const request = JSON.stringify(src + query);
5107
4381
  const renderFnName = ssr ? "ssrRender" : "render";
5108
4382
  return {
5109
4383
  code: `import { ${renderFnName} as _sfc_${renderFnName} } from ${request}`,
@@ -5116,33 +4390,23 @@ async function genScriptCode(descriptor, options, pluginContext, ssr, customElem
5116
4390
  let scriptCode = `const ${scriptIdentifier} = { ${vaporFlag} }`;
5117
4391
  let map;
5118
4392
  const script = resolveScript(descriptor, options, ssr, customElement);
5119
- if (script) {
5120
- if (canInlineMain(descriptor, options)) {
5121
- if (!options.compiler.version) {
5122
- const userPlugins = options.script?.babelParserPlugins || [];
5123
- const defaultPlugins2 = script.lang === "ts" ? userPlugins.includes("decorators") ? ["typescript"] : ["typescript", "decorators-legacy"] : [];
5124
- scriptCode = options.compiler.rewriteDefault(
5125
- script.content,
5126
- scriptIdentifier,
5127
- [...defaultPlugins2, ...userPlugins]
5128
- );
5129
- } else {
5130
- scriptCode = script.content;
5131
- }
5132
- map = script.map;
5133
- } else {
5134
- if (script.src) {
5135
- await linkSrcToDescriptor(script.src, descriptor, pluginContext, false);
5136
- }
5137
- const src2 = script.src || descriptor.filename;
5138
- const langFallback = script.src && import_node_path.default.extname(src2).slice(1) || "js";
5139
- const attrsQuery = attrsToQuery(script.attrs, langFallback);
5140
- const srcQuery = script.src ? `&src=true` : ``;
5141
- const query = `?vue&type=script${srcQuery}${attrsQuery}`;
5142
- const request = JSON.stringify(src2 + query);
5143
- scriptCode = `import _sfc_main from ${request}
4393
+ if (script) if (canInlineMain(descriptor, options)) {
4394
+ if (!options.compiler.version) {
4395
+ const userPlugins = options.script?.babelParserPlugins || [];
4396
+ const defaultPlugins2 = script.lang === "ts" ? userPlugins.includes("decorators") ? ["typescript"] : ["typescript", "decorators-legacy"] : [];
4397
+ scriptCode = options.compiler.rewriteDefault(script.content, scriptIdentifier, [...defaultPlugins2, ...userPlugins]);
4398
+ } else scriptCode = script.content;
4399
+ map = script.map;
4400
+ } else {
4401
+ if (script.src) await linkSrcToDescriptor(script.src, descriptor, pluginContext, false);
4402
+ const src = script.src || descriptor.filename;
4403
+ const langFallback = script.src && import_node_path.default.extname(src).slice(1) || "js";
4404
+ const attrsQuery = attrsToQuery(script.attrs, langFallback);
4405
+ const srcQuery = script.src ? `&src=true` : ``;
4406
+ const query = `?vue&type=script${srcQuery}${attrsQuery}`;
4407
+ const request = JSON.stringify(src + query);
4408
+ scriptCode = `import _sfc_main from ${request}
5144
4409
  export * from ${request}`;
5145
- }
5146
4410
  }
5147
4411
  return {
5148
4412
  code: scriptCode,
@@ -5155,59 +4419,29 @@ async function genStyleCode(descriptor, pluginContext, customElement, attachedPr
5155
4419
  if (descriptor.styles.length) {
5156
4420
  for (let i = 0; i < descriptor.styles.length; i++) {
5157
4421
  const style = descriptor.styles[i];
5158
- if (style.src) {
5159
- await linkSrcToDescriptor(
5160
- style.src,
5161
- descriptor,
5162
- pluginContext,
5163
- style.scoped
5164
- );
5165
- }
5166
- const src2 = style.src || descriptor.filename;
4422
+ if (style.src) await linkSrcToDescriptor(style.src, descriptor, pluginContext, style.scoped);
4423
+ const src = style.src || descriptor.filename;
5167
4424
  const attrsQuery = attrsToQuery(style.attrs, "css");
5168
4425
  const srcQuery = style.src ? style.scoped ? `&src=${descriptor.id}` : "&src=true" : "";
5169
4426
  const directQuery = customElement ? `&inline` : ``;
5170
4427
  const scopedQuery = style.scoped ? `&scoped=${descriptor.id}` : ``;
5171
4428
  const query = `?vue&type=style&index=${i}${srcQuery}${directQuery}${scopedQuery}`;
5172
- const styleRequest = src2 + query + attrsQuery;
4429
+ const styleRequest = src + query + attrsQuery;
5173
4430
  if (style.module) {
5174
- if (customElement) {
5175
- throw new Error(
5176
- `<style module> is not supported in custom elements mode.`
5177
- );
5178
- }
5179
- const [importCode, nameMap] = genCSSModulesCode(
5180
- i,
5181
- styleRequest,
5182
- style.module
5183
- );
4431
+ if (customElement) throw new Error(`<style module> is not supported in custom elements mode.`);
4432
+ const [importCode, nameMap] = genCSSModulesCode(i, styleRequest, style.module);
5184
4433
  stylesCode += importCode;
5185
4434
  Object.assign(cssModulesMap ||= {}, nameMap);
5186
- } else {
5187
- if (customElement) {
5188
- stylesCode += `
5189
- import _style_${i} from ${JSON.stringify(
5190
- styleRequest
5191
- )}`;
5192
- } else {
5193
- stylesCode += `
4435
+ } else if (customElement) stylesCode += `
4436
+ import _style_${i} from ${JSON.stringify(styleRequest)}`;
4437
+ else stylesCode += `
5194
4438
  import ${JSON.stringify(styleRequest)}`;
5195
- }
5196
- }
5197
- }
5198
- if (customElement) {
5199
- attachedProps.push([
5200
- `styles`,
5201
- `[${descriptor.styles.map((_, i) => `_style_${i}`).join(",")}]`
5202
- ]);
5203
4439
  }
4440
+ if (customElement) attachedProps.push([`styles`, `[${descriptor.styles.map((_, i) => `_style_${i}`).join(",")}]`]);
5204
4441
  }
5205
4442
  if (cssModulesMap) {
5206
- const mappingCode = Object.entries(cssModulesMap).reduce(
5207
- (code, [key, value]) => code + `"${key}":${value},
5208
- `,
5209
- "{\n"
5210
- ) + "}";
4443
+ const mappingCode = Object.entries(cssModulesMap).reduce((code, [key, value]) => code + `"${key}":${value},
4444
+ `, "{\n") + "}";
5211
4445
  stylesCode += `
5212
4446
  const cssModules = ${mappingCode}`;
5213
4447
  attachedProps.push([`__cssModules`, `cssModules`]);
@@ -5218,24 +4452,19 @@ function genCSSModulesCode(index, request, moduleName) {
5218
4452
  const styleVar = `style${index}`;
5219
4453
  const exposedName = typeof moduleName === "string" ? moduleName : "$style";
5220
4454
  const moduleRequest = request.replace(/\.(\w+)$/, ".module.$1");
5221
- return [
5222
- `
5223
- import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
5224
- { [exposedName]: styleVar }
5225
- ];
4455
+ return [`
4456
+ import ${styleVar} from ${JSON.stringify(moduleRequest)}`, { [exposedName]: styleVar }];
5226
4457
  }
5227
4458
  async function genCustomBlockCode(descriptor, pluginContext) {
5228
4459
  let code = "";
5229
4460
  for (let index = 0; index < descriptor.customBlocks.length; index++) {
5230
4461
  const block = descriptor.customBlocks[index];
5231
- if (block.src) {
5232
- await linkSrcToDescriptor(block.src, descriptor, pluginContext, false);
5233
- }
5234
- const src2 = block.src || descriptor.filename;
4462
+ if (block.src) await linkSrcToDescriptor(block.src, descriptor, pluginContext, false);
4463
+ const src = block.src || descriptor.filename;
5235
4464
  const attrsQuery = attrsToQuery(block.attrs, block.type);
5236
4465
  const srcQuery = block.src ? `&src=true` : ``;
5237
4466
  const query = `?vue&type=${block.type}&index=${index}${srcQuery}${attrsQuery}`;
5238
- const request = JSON.stringify(src2 + query);
4467
+ const request = JSON.stringify(src + query);
5239
4468
  code += `import block${index} from ${request}
5240
4469
  `;
5241
4470
  code += `if (typeof block${index} === 'function') block${index}(_sfc_main)
@@ -5243,8 +4472,8 @@ async function genCustomBlockCode(descriptor, pluginContext) {
5243
4472
  }
5244
4473
  return code;
5245
4474
  }
5246
- async function linkSrcToDescriptor(src2, descriptor, pluginContext, scoped) {
5247
- const srcFile = (await pluginContext.resolve(src2, descriptor.filename))?.id || src2;
4475
+ async function linkSrcToDescriptor(src, descriptor, pluginContext, scoped) {
4476
+ const srcFile = (await pluginContext.resolve(src, descriptor.filename))?.id || src;
5248
4477
  setSrcDescriptor(srcFile.replace(/\?.*$/, ""), descriptor, scoped);
5249
4478
  }
5250
4479
  var ignoreList = [
@@ -5261,13 +4490,9 @@ function attrsToQuery(attrs, langFallback, forceLangFallback = false) {
5261
4490
  let query = ``;
5262
4491
  for (const name in attrs) {
5263
4492
  const value = attrs[name];
5264
- if (!ignoreList.includes(name)) {
5265
- query += `&${encodeURIComponent(name)}${value ? `=${encodeURIComponent(value)}` : ``}`;
5266
- }
5267
- }
5268
- if (langFallback || attrs.lang) {
5269
- query += `lang` in attrs ? forceLangFallback ? `&lang.${langFallback}` : `&lang.${attrs.lang}` : `&lang.${langFallback}`;
4493
+ if (!ignoreList.includes(name)) query += `&${encodeURIComponent(name)}${value ? `=${encodeURIComponent(value)}` : ``}`;
5270
4494
  }
4495
+ if (langFallback || attrs.lang) query += `lang` in attrs ? forceLangFallback ? `&lang.${langFallback}` : `&lang.${attrs.lang}` : `&lang.${langFallback}`;
5271
4496
  return query;
5272
4497
  }
5273
4498
  async function transformStyle(code, descriptor, index, options, pluginContext, filename) {
@@ -5279,43 +4504,28 @@ async function transformStyle(code, descriptor, index, options, pluginContext, f
5279
4504
  isProd: options.isProduction,
5280
4505
  source: code,
5281
4506
  scoped: block.scoped,
5282
- ...options.cssDevSourcemap ? {
5283
- postcssOptions: {
5284
- map: {
5285
- from: filename,
5286
- inline: false,
5287
- annotation: false
5288
- }
5289
- }
5290
- } : {}
4507
+ ...options.cssDevSourcemap ? { postcssOptions: { map: {
4508
+ from: filename,
4509
+ inline: false,
4510
+ annotation: false
4511
+ } } } : {}
5291
4512
  });
5292
4513
  if (result.errors.length) {
5293
4514
  result.errors.forEach((error) => {
5294
- if (error.line && error.column) {
5295
- error.loc = {
5296
- file: descriptor.filename,
5297
- line: error.line + block.loc.start.line,
5298
- column: error.column
5299
- };
5300
- }
4515
+ if (error.line && error.column) error.loc = {
4516
+ file: descriptor.filename,
4517
+ line: error.line + block.loc.start.line,
4518
+ column: error.column
4519
+ };
5301
4520
  pluginContext.error(error);
5302
4521
  });
5303
4522
  return null;
5304
4523
  }
5305
- const map = result.map ? await (0, import_vite.formatPostcssSourceMap)(
5306
- // version property of result.map is declared as string
5307
- // but actually it is a number
5308
- result.map,
5309
- filename
5310
- ) : { mappings: "" };
4524
+ const map = result.map ? await (0, import_vite.formatPostcssSourceMap)(result.map, filename) : { mappings: "" };
5311
4525
  return {
5312
4526
  code: result.code,
5313
4527
  map,
5314
- meta: block.scoped && !descriptor.isTemp ? {
5315
- vite: {
5316
- cssScopeTo: [descriptor.filename, "default"]
5317
- }
5318
- } : void 0
4528
+ meta: block.scoped && !descriptor.isTemp ? { vite: { cssScopeTo: [descriptor.filename, "default"] } } : void 0
5319
4529
  };
5320
4530
  }
5321
4531
  function vuePlugin(rawOptions = {}) {
@@ -5323,16 +4533,13 @@ function vuePlugin(rawOptions = {}) {
5323
4533
  const options = (0, import_vue.shallowRef)({
5324
4534
  isProduction: process.env.NODE_ENV === "production",
5325
4535
  compiler: null,
5326
- // to be set in buildStart
5327
4536
  customElement: /\.ce\.vue$/,
5328
4537
  ...rawOptions,
5329
4538
  root: process.cwd(),
5330
4539
  sourceMap: true,
5331
4540
  cssDevSourcemap: false
5332
4541
  });
5333
- const include = (0, import_vue.shallowRef)(
5334
- rawOptions.include ?? /\.vue$/
5335
- );
4542
+ const include = (0, import_vue.shallowRef)(rawOptions.include ?? /\.vue$/);
5336
4543
  const exclude = (0, import_vue.shallowRef)(rawOptions.exclude);
5337
4544
  let optionsHookIsCalled = false;
5338
4545
  const filter3 = (0, import_vue.computed)(() => (0, import_vite.createFilter)(include.value, exclude.value));
@@ -5354,22 +4561,14 @@ function vuePlugin(rawOptions = {}) {
5354
4561
  return include.value;
5355
4562
  },
5356
4563
  set include(value) {
5357
- if (optionsHookIsCalled) {
5358
- throw new Error(
5359
- "include cannot be updated after `options` hook is called"
5360
- );
5361
- }
4564
+ if (optionsHookIsCalled) throw new Error("include cannot be updated after `options` hook is called");
5362
4565
  include.value = value;
5363
4566
  },
5364
4567
  get exclude() {
5365
4568
  return exclude.value;
5366
4569
  },
5367
4570
  set exclude(value) {
5368
- if (optionsHookIsCalled) {
5369
- throw new Error(
5370
- "exclude cannot be updated after `options` hook is called"
5371
- );
5372
- }
4571
+ if (optionsHookIsCalled) throw new Error("exclude cannot be updated after `options` hook is called");
5373
4572
  exclude.value = value;
5374
4573
  },
5375
4574
  version
@@ -5380,26 +4579,14 @@ function vuePlugin(rawOptions = {}) {
5380
4579
  event: "file-changed",
5381
4580
  data: { file: (0, import_vite.normalizePath)(ctx.file) }
5382
4581
  });
5383
- if (options.value.compiler.invalidateTypeCache) {
5384
- options.value.compiler.invalidateTypeCache(ctx.file);
5385
- }
4582
+ if (options.value.compiler.invalidateTypeCache) options.value.compiler.invalidateTypeCache(ctx.file);
5386
4583
  let typeDepModules;
5387
4584
  const matchesFilter = filter3.value(ctx.file);
5388
4585
  if (typeDepToSFCMap.has(ctx.file)) {
5389
- typeDepModules = handleTypeDepChange(
5390
- typeDepToSFCMap.get(ctx.file),
5391
- ctx
5392
- );
4586
+ typeDepModules = handleTypeDepChange(typeDepToSFCMap.get(ctx.file), ctx);
5393
4587
  if (!matchesFilter) return typeDepModules;
5394
4588
  }
5395
- if (matchesFilter) {
5396
- return handleHotUpdate(
5397
- ctx,
5398
- options.value,
5399
- customElementFilter.value(ctx.file),
5400
- typeDepModules
5401
- );
5402
- }
4589
+ if (matchesFilter) return handleHotUpdate(ctx, options.value, customElementFilter.value(ctx.file), typeDepModules);
5403
4590
  },
5404
4591
  config(config) {
5405
4592
  const parseDefine = (v) => {
@@ -5410,20 +4597,13 @@ function vuePlugin(rawOptions = {}) {
5410
4597
  }
5411
4598
  };
5412
4599
  return {
5413
- resolve: {
5414
- dedupe: config.build?.ssr ? [] : ["vue"]
5415
- },
4600
+ resolve: { dedupe: config.build?.ssr ? [] : ["vue"] },
5416
4601
  define: {
5417
4602
  __VUE_OPTIONS_API__: options.value.features?.optionsAPI ?? parseDefine(config.define?.__VUE_OPTIONS_API__) ?? true,
5418
4603
  __VUE_PROD_DEVTOOLS__: (options.value.features?.prodDevtools || parseDefine(config.define?.__VUE_PROD_DEVTOOLS__)) ?? false,
5419
- __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: (options.value.features?.prodHydrationMismatchDetails || parseDefine(
5420
- config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
5421
- )) ?? false
4604
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: (options.value.features?.prodHydrationMismatchDetails || parseDefine(config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__)) ?? false
5422
4605
  },
5423
- ssr: {
5424
- // @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
5425
- external: config.legacy?.buildSsrCjsExternalHeuristics ? ["vue", "@vue/server-renderer"] : []
5426
- }
4606
+ ssr: { external: config.legacy?.buildSsrCjsExternalHeuristics ? ["vue", "@vue/server-renderer"] : [] }
5427
4607
  };
5428
4608
  },
5429
4609
  configResolved(config) {
@@ -5438,31 +4618,20 @@ function vuePlugin(rawOptions = {}) {
5438
4618
  const _warn = config.logger.warn;
5439
4619
  config.logger.warn = (...args) => {
5440
4620
  const msg = args[0];
5441
- if (msg.match(
5442
- /\[lightningcss\] '(deep|slotted|global)' is not recognized as a valid pseudo-/
5443
- )) {
5444
- return;
5445
- }
4621
+ if (msg.match(/\[lightningcss\] '(deep|slotted|global)' is not recognized as a valid pseudo-/)) return;
5446
4622
  _warn(...args);
5447
4623
  };
5448
4624
  transformCachedModule = config.command === "build" && options.value.sourceMap && config.build.watch != null;
5449
4625
  },
5450
4626
  options() {
5451
4627
  optionsHookIsCalled = true;
5452
- plugin.transform.filter = {
5453
- id: {
5454
- include: [
5455
- ...makeIdFiltersToMatchWithQuery(ensureArray(include.value)),
5456
- /[?&]vue\b/
5457
- ],
5458
- exclude: exclude.value
5459
- }
5460
- };
4628
+ plugin.transform.filter = { id: {
4629
+ include: [...makeIdFiltersToMatchWithQuery(ensureArray(include.value)), /[?&]vue\b/],
4630
+ exclude: exclude.value
4631
+ } };
5461
4632
  },
5462
4633
  shouldTransformCachedModule({ id }) {
5463
- if (transformCachedModule && parseVueRequest(id).query.vue) {
5464
- return true;
5465
- }
4634
+ if (transformCachedModule && parseVueRequest(id).query.vue) return true;
5466
4635
  return false;
5467
4636
  },
5468
4637
  configureServer(server) {
@@ -5470,112 +4639,51 @@ function vuePlugin(rawOptions = {}) {
5470
4639
  },
5471
4640
  buildStart() {
5472
4641
  const compiler = options.value.compiler = options.value.compiler || resolveCompiler(options.value.root);
5473
- if (compiler.invalidateTypeCache) {
5474
- options.value.devServer?.watcher.on("unlink", (file) => {
5475
- compiler.invalidateTypeCache(file);
5476
- });
5477
- }
4642
+ if (compiler.invalidateTypeCache) options.value.devServer?.watcher.on("unlink", (file) => {
4643
+ compiler.invalidateTypeCache(file);
4644
+ });
5478
4645
  },
5479
4646
  resolveId: {
5480
- filter: {
5481
- id: [exactRegex(EXPORT_HELPER_ID), /[?&]vue\b/]
5482
- },
4647
+ filter: { id: [exactRegex(EXPORT_HELPER_ID), /[?&]vue\b/] },
5483
4648
  handler(id) {
5484
- if (id === EXPORT_HELPER_ID) {
5485
- return id;
5486
- }
5487
- if (parseVueRequest(id).query.vue) {
5488
- return id;
5489
- }
4649
+ if (id === EXPORT_HELPER_ID) return id;
4650
+ if (parseVueRequest(id).query.vue) return id;
5490
4651
  }
5491
4652
  },
5492
4653
  load: {
5493
- filter: {
5494
- id: [exactRegex(EXPORT_HELPER_ID), /[?&]vue\b/]
5495
- },
4654
+ filter: { id: [exactRegex(EXPORT_HELPER_ID), /[?&]vue\b/] },
5496
4655
  handler(id, opt) {
5497
- if (id === EXPORT_HELPER_ID) {
5498
- return helperCode;
5499
- }
4656
+ if (id === EXPORT_HELPER_ID) return helperCode;
5500
4657
  const ssr = opt?.ssr === true;
5501
4658
  const { filename, query } = parseVueRequest(id);
5502
4659
  if (query.vue) {
5503
- if (query.src) {
5504
- return import_node_fs.default.readFileSync(filename, "utf-8");
5505
- }
4660
+ if (query.src) return import_node_fs.default.readFileSync(filename, "utf-8");
5506
4661
  const descriptor = getDescriptor(filename, options.value);
5507
4662
  let block;
5508
- if (query.type === "script") {
5509
- block = resolveScript(
5510
- descriptor,
5511
- options.value,
5512
- ssr,
5513
- customElementFilter.value(filename)
5514
- );
5515
- } else if (query.type === "template") {
5516
- block = descriptor.template;
5517
- } else if (query.type === "style") {
5518
- block = descriptor.styles[query.index];
5519
- } else if (query.index != null) {
5520
- block = descriptor.customBlocks[query.index];
5521
- }
5522
- if (block) {
5523
- return {
5524
- code: block.content,
5525
- map: block.map
5526
- };
5527
- }
4663
+ if (query.type === "script") block = resolveScript(descriptor, options.value, ssr, customElementFilter.value(filename));
4664
+ else if (query.type === "template") block = descriptor.template;
4665
+ else if (query.type === "style") block = descriptor.styles[query.index];
4666
+ else if (query.index != null) block = descriptor.customBlocks[query.index];
4667
+ if (block) return {
4668
+ code: block.content,
4669
+ map: block.map
4670
+ };
5528
4671
  }
5529
4672
  }
5530
4673
  },
5531
- transform: {
5532
- // filter is set in options() hook
5533
- handler(code, id, opt) {
5534
- const ssr = opt?.ssr === true;
5535
- const { filename, query } = parseVueRequest(id);
5536
- if (query.raw || query.url) {
5537
- return;
5538
- }
5539
- if (!filter3.value(filename) && !query.vue) {
5540
- return;
5541
- }
5542
- if (!query.vue) {
5543
- return transformMain(
5544
- code,
5545
- filename,
5546
- options.value,
5547
- this,
5548
- ssr,
5549
- customElementFilter.value(filename)
5550
- );
5551
- } else {
5552
- const descriptor = query.src ? getSrcDescriptor(filename, query) || getTempSrcDescriptor(filename, query) : getDescriptor(filename, options.value);
5553
- if (query.src) {
5554
- this.addWatchFile(filename);
5555
- }
5556
- if (query.type === "template") {
5557
- return transformTemplateAsModule(
5558
- code,
5559
- filename,
5560
- descriptor,
5561
- options.value,
5562
- this,
5563
- ssr,
5564
- customElementFilter.value(filename)
5565
- );
5566
- } else if (query.type === "style") {
5567
- return transformStyle(
5568
- code,
5569
- descriptor,
5570
- Number(query.index || 0),
5571
- options.value,
5572
- this,
5573
- filename
5574
- );
5575
- }
5576
- }
4674
+ transform: { handler(code, id, opt) {
4675
+ const ssr = opt?.ssr === true;
4676
+ const { filename, query } = parseVueRequest(id);
4677
+ if (query.raw || query.url) return;
4678
+ if (!filter3.value(filename) && !query.vue) return;
4679
+ if (!query.vue) return transformMain(code, filename, options.value, this, ssr, customElementFilter.value(filename));
4680
+ else {
4681
+ const descriptor = query.src ? getSrcDescriptor(filename, query) || getTempSrcDescriptor(filename, query) : getDescriptor(filename, options.value);
4682
+ if (query.src) this.addWatchFile(filename);
4683
+ if (query.type === "template") return transformTemplateAsModule(code, filename, descriptor, options.value, this, ssr, customElementFilter.value(filename));
4684
+ else if (query.type === "style") return transformStyle(code, descriptor, Number(query.index || 0), options.value, this, filename);
5577
4685
  }
5578
- }
4686
+ } }
5579
4687
  };
5580
4688
  return plugin;
5581
4689
  }
@@ -6278,7 +5386,7 @@ var AST = class _AST {
6278
5386
  this.#fillNegs();
6279
5387
  if (!this.type) {
6280
5388
  const noEmpty = this.isStart() && this.isEnd();
6281
- const src2 = this.#parts.map((p) => {
5389
+ const src = this.#parts.map((p) => {
6282
5390
  const [re, _, hasMagic2, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
6283
5391
  this.#hasMagic = this.#hasMagic || hasMagic2;
6284
5392
  this.#uflag = this.#uflag || uflag;
@@ -6292,11 +5400,11 @@ var AST = class _AST {
6292
5400
  const aps = addPatternStart;
6293
5401
  const needNoTrav = (
6294
5402
  // dots are allowed, and the pattern starts with [ or .
6295
- dot && aps.has(src2.charAt(0)) || // the pattern starts with \., and then [ or .
6296
- src2.startsWith("\\.") && aps.has(src2.charAt(2)) || // the pattern starts with \.\., and then [ or .
6297
- src2.startsWith("\\.\\.") && aps.has(src2.charAt(4))
5403
+ dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
5404
+ src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
5405
+ src.startsWith("\\.\\.") && aps.has(src.charAt(4))
6298
5406
  );
6299
- const needNoDot = !dot && !allowDot && aps.has(src2.charAt(0));
5407
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
6300
5408
  start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
6301
5409
  }
6302
5410
  }
@@ -6305,10 +5413,10 @@ var AST = class _AST {
6305
5413
  if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") {
6306
5414
  end = "(?:$|\\/)";
6307
5415
  }
6308
- const final2 = start2 + src2 + end;
5416
+ const final2 = start2 + src + end;
6309
5417
  return [
6310
5418
  final2,
6311
- unescape(src2),
5419
+ unescape(src),
6312
5420
  this.#hasMagic = !!this.#hasMagic,
6313
5421
  this.#uflag
6314
5422
  ];
@@ -6377,9 +5485,9 @@ var AST = class _AST {
6377
5485
  continue;
6378
5486
  }
6379
5487
  if (c === "[") {
6380
- const [src2, needUflag, consumed, magic] = parseClass(glob2, i);
5488
+ const [src, needUflag, consumed, magic] = parseClass(glob2, i);
6381
5489
  if (consumed) {
6382
- re += src2;
5490
+ re += src;
6383
5491
  uflag = uflag || needUflag;
6384
5492
  i += consumed - 1;
6385
5493
  hasMagic2 = hasMagic2 || magic;
@@ -8578,11 +7686,11 @@ var Pipe = class {
8578
7686
  dest;
8579
7687
  opts;
8580
7688
  ondrain;
8581
- constructor(src2, dest, opts) {
8582
- this.src = src2;
7689
+ constructor(src, dest, opts) {
7690
+ this.src = src;
8583
7691
  this.dest = dest;
8584
7692
  this.opts = opts;
8585
- this.ondrain = () => src2[RESUME]();
7693
+ this.ondrain = () => src[RESUME]();
8586
7694
  this.dest.on("drain", this.ondrain);
8587
7695
  }
8588
7696
  unpipe() {
@@ -8604,10 +7712,10 @@ var PipeProxyErrors = class extends Pipe {
8604
7712
  this.src.removeListener("error", this.proxyErrors);
8605
7713
  super.unpipe();
8606
7714
  }
8607
- constructor(src2, dest, opts) {
8608
- super(src2, dest, opts);
7715
+ constructor(src, dest, opts) {
7716
+ super(src, dest, opts);
8609
7717
  this.proxyErrors = (er) => dest.emit("error", er);
8610
- src2.on("error", this.proxyErrors);
7718
+ src.on("error", this.proxyErrors);
8611
7719
  }
8612
7720
  };
8613
7721
  var isObjectModeOptions = (o) => !!o.objectMode;
@@ -12197,12 +11305,12 @@ function babelPlugin() {
12197
11305
  name: "fk:babel",
12198
11306
  enforce: "post",
12199
11307
  apply: "build",
12200
- async transform(src2, id) {
11308
+ async transform(src, id) {
12201
11309
  const { pathname: filename } = new URL(id, "file://");
12202
11310
  if (!filter2.test(filename)) {
12203
11311
  return null;
12204
11312
  }
12205
- const transformed = await babel.transformAsync(src2, {
11313
+ const transformed = await babel.transformAsync(src, {
12206
11314
  sourceMaps: true,
12207
11315
  comments: true,
12208
11316
  filename
@@ -12212,7 +11320,7 @@ function babelPlugin() {
12212
11320
  }
12213
11321
  const { code, map } = transformed;
12214
11322
  return {
12215
- code: code ?? src2,
11323
+ code: code ?? src,
12216
11324
  map: map ?? null
12217
11325
  };
12218
11326
  }