@jsenv/core 40.9.1 → 40.11.0

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.
@@ -433,6 +433,11 @@ const detailsFromFirstReference = (reference) => {
433
433
  ) {
434
434
  return {};
435
435
  }
436
+ if (referenceInProject.type === "entry_point") {
437
+ return {
438
+ "first reference": referenceInProject.trace.message,
439
+ };
440
+ }
436
441
  return {
437
442
  "first reference in project": `${referenceInProject.trace.url}:${referenceInProject.trace.line}:${referenceInProject.trace.column}`,
438
443
  };
@@ -2911,6 +2916,7 @@ const createKitchen = ({
2911
2916
  dev = false,
2912
2917
  build = false,
2913
2918
  runtimeCompat,
2919
+ mode,
2914
2920
 
2915
2921
  ignore,
2916
2922
  ignoreProtocol = "remove",
@@ -2960,7 +2966,10 @@ const createKitchen = ({
2960
2966
  }
2961
2967
 
2962
2968
  if (packageDependencies === "auto") {
2963
- packageDependencies = build && nodeRuntimeEnabled ? "ignore" : "include";
2969
+ packageDependencies =
2970
+ build && (nodeRuntimeEnabled || mode === "package")
2971
+ ? "ignore"
2972
+ : "include";
2964
2973
  }
2965
2974
 
2966
2975
  const kitchen = {
@@ -3347,7 +3356,7 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
3347
3356
  `no plugin has handled url during "fetchUrlContent" hook -> url will be ignored`,
3348
3357
  {
3349
3358
  "url": urlInfo.url,
3350
- "url reference trace": urlInfo.firstReference.trace.message,
3359
+ "url reference trace": urlInfo.firstReference?.trace.message,
3351
3360
  },
3352
3361
  ),
3353
3362
  );
@@ -4002,7 +4011,7 @@ const jsenvPluginInliningIntoHtml = () => {
4002
4011
  });
4003
4012
  });
4004
4013
  };
4005
- const onScriptWithSrc = (scriptNode, { src }) => {
4014
+ const onScriptWithSrc = (scriptNode, { type, src }) => {
4006
4015
  let scriptReference;
4007
4016
  for (const dependencyReference of urlInfo.referenceToOthersSet) {
4008
4017
  if (
@@ -4029,7 +4038,7 @@ const jsenvPluginInliningIntoHtml = () => {
4029
4038
  column,
4030
4039
  isOriginal,
4031
4040
  specifier: scriptInlineUrl,
4032
- type: scriptReference.type,
4041
+ type,
4033
4042
  subtype: scriptReference.subtype,
4034
4043
  expectedType: scriptReference.expectedType,
4035
4044
  });
@@ -4073,7 +4082,7 @@ const jsenvPluginInliningIntoHtml = () => {
4073
4082
  if (!src) {
4074
4083
  return;
4075
4084
  }
4076
- onScriptWithSrc(scriptNode, { src });
4085
+ onScriptWithSrc(scriptNode, { type, src });
4077
4086
  },
4078
4087
  });
4079
4088
  if (actions.length > 0) {
@@ -5037,7 +5046,7 @@ const jsenvPluginHtmlReferenceAnalysis = ({
5037
5046
  const createInlineReference = (
5038
5047
  node,
5039
5048
  inlineContent,
5040
- { type, expectedType, contentType },
5049
+ { type, subtype, expectedType, contentType },
5041
5050
  ) => {
5042
5051
  const hotAccept =
5043
5052
  getHtmlNodeAttribute(node, "hot-accept") !== undefined;
@@ -5053,6 +5062,7 @@ const jsenvPluginHtmlReferenceAnalysis = ({
5053
5062
  getHtmlNodeAttribute(node, "jsenv-debug") !== undefined;
5054
5063
  const inlineReference = urlInfo.dependencies.foundInline({
5055
5064
  type,
5065
+ subtype,
5056
5066
  expectedType,
5057
5067
  isOriginalPosition: isOriginal,
5058
5068
  specifierLine: line,
@@ -5929,7 +5939,6 @@ const createNodeEsmResolver = ({
5929
5939
  const resolveNodeEsmFallbackNullToDelegateToWebPlugin =
5930
5940
  createResolverWithFallbackOnError(
5931
5941
  applyNodeEsmResolution,
5932
-
5933
5942
  () => DELEGATE_TO_WEB_RESOLUTION_PLUGIN,
5934
5943
  );
5935
5944
 
@@ -6345,7 +6354,6 @@ const jsenvPluginNodeEsmResolution = (
6345
6354
  );
6346
6355
  }
6347
6356
  return createNodeEsmResolver({
6348
- build: kitchenContext.build,
6349
6357
  runtimeCompat: kitchenContext.runtimeCompat,
6350
6358
  rootDirectoryUrl: kitchenContext.rootDirectoryUrl,
6351
6359
  packageConditions,
@@ -6362,7 +6370,6 @@ const jsenvPluginNodeEsmResolution = (
6362
6370
  appliesDuring: "*",
6363
6371
  init: (kitchenContext) => {
6364
6372
  nodeEsmResolverDefault = createNodeEsmResolver({
6365
- build: kitchenContext.build,
6366
6373
  runtimeCompat: kitchenContext.runtimeCompat,
6367
6374
  rootDirectoryUrl: kitchenContext.rootDirectoryUrl,
6368
6375
  preservesSymlink: true,
@@ -7205,6 +7212,10 @@ const jsenvPluginProtocolFile = ({
7205
7212
  return null;
7206
7213
  }
7207
7214
  const { firstReference } = urlInfo;
7215
+ if (!firstReference) {
7216
+ console.warn("No firstReference for", urlInfo.url);
7217
+ return null;
7218
+ }
7208
7219
  let { fsStat } = firstReference;
7209
7220
  if (!fsStat) {
7210
7221
  fsStat = readEntryStatSync(urlInfo.url, { nullIfNotFound: true });
@@ -7233,6 +7244,9 @@ const jsenvPluginProtocolFile = ({
7233
7244
  return null;
7234
7245
  }
7235
7246
  const { firstReference } = urlInfo;
7247
+ if (!firstReference) {
7248
+ return null;
7249
+ }
7236
7250
  let { fsStat } = firstReference;
7237
7251
  if (!fsStat) {
7238
7252
  fsStat = readEntryStatSync(urlInfo.url, { nullIfNotFound: true });
@@ -7804,7 +7818,10 @@ const jsenvPluginNodeRuntime = ({ runtimeCompat }) => {
7804
7818
 
7805
7819
  const jsenvPluginImportMetaCss = () => {
7806
7820
  const importMetaCssClientFileUrl = import.meta.resolve(
7807
- "../js/import_meta_css.js",
7821
+ "../client/import_meta_css/import_meta_css.js",
7822
+ );
7823
+ const importMetaCssBuildFileUrl = import.meta.resolve(
7824
+ "../client/import_meta_css/import_meta_css_build.js",
7808
7825
  );
7809
7826
 
7810
7827
  return {
@@ -7826,35 +7843,17 @@ const jsenvPluginImportMetaCss = () => {
7826
7843
  if (!usesImportMetaCss) {
7827
7844
  return null;
7828
7845
  }
7829
- return injectImportMetaCss(urlInfo, importMetaCssClientFileUrl);
7846
+ return injectImportMetaCss(
7847
+ urlInfo,
7848
+ urlInfo.context.build
7849
+ ? importMetaCssBuildFileUrl
7850
+ : importMetaCssClientFileUrl,
7851
+ );
7830
7852
  },
7831
7853
  },
7832
7854
  };
7833
7855
  };
7834
7856
 
7835
- const injectImportMetaCss = (urlInfo, importMetaCssClientFileUrl) => {
7836
- const importMetaCssClientFileReference = urlInfo.dependencies.inject({
7837
- parentUrl: urlInfo.url,
7838
- type: "js_import",
7839
- expectedType: "js_module",
7840
- specifier: importMetaCssClientFileUrl,
7841
- });
7842
- let content = urlInfo.content;
7843
- let prelude = `import { installImportMetaCss } from ${importMetaCssClientFileReference.generatedSpecifier};
7844
-
7845
- const remove = installImportMetaCss(import.meta);
7846
- if (import.meta.hot) {
7847
- import.meta.hot.dispose(() => {
7848
- remove();
7849
- });
7850
- }
7851
-
7852
- `;
7853
- return {
7854
- content: `${prelude.replace(/\n/g, "")}${content}`,
7855
- };
7856
- };
7857
-
7858
7857
  const babelPluginMetadataUsesImportMetaCss = () => {
7859
7858
  return {
7860
7859
  name: "metadata-uses-import-meta-css",
@@ -7886,6 +7885,29 @@ const babelPluginMetadataUsesImportMetaCss = () => {
7886
7885
  };
7887
7886
  };
7888
7887
 
7888
+ const injectImportMetaCss = (urlInfo, importMetaCssClientFileUrl) => {
7889
+ const importMetaCssClientFileReference = urlInfo.dependencies.inject({
7890
+ parentUrl: urlInfo.url,
7891
+ type: "js_import",
7892
+ expectedType: "js_module",
7893
+ specifier: importMetaCssClientFileUrl,
7894
+ });
7895
+ let content = urlInfo.content;
7896
+ let prelude = `import { installImportMetaCss } from ${importMetaCssClientFileReference.generatedSpecifier};
7897
+
7898
+ const remove = installImportMetaCss(import.meta);
7899
+ if (import.meta.hot) {
7900
+ import.meta.hot.dispose(() => {
7901
+ remove();
7902
+ });
7903
+ }
7904
+
7905
+ `;
7906
+ return {
7907
+ content: `${prelude.replace(/\n/g, "")}${content}`,
7908
+ };
7909
+ };
7910
+
7889
7911
  // https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/plugin-handbook.md#toc-stages-of-babel
7890
7912
  // https://github.com/cfware/babel-plugin-bundled-import-meta/blob/master/index.js
7891
7913
  // https://github.com/babel/babel/blob/f4edf62f6beeab8ae9f2b7f0b82f1b3b12a581af/packages/babel-helper-module-imports/src/index.js#L7
@@ -8832,7 +8854,7 @@ const jsenvPluginRibbon = ({
8832
8854
 
8833
8855
 
8834
8856
  const jsenvPluginDropToOpen = () => {
8835
- const clientFileUrl = import.meta.resolve("../js/drop_to_open.js");
8857
+ const clientFileUrl = import.meta.resolve("../client/drop_to_open/drop_to_open.js");
8836
8858
  return {
8837
8859
  name: "jsenv:drop_to_open",
8838
8860
  appliesDuring: "dev",
@@ -11316,31 +11338,60 @@ const jsenvPluginMappings = (mappings) => {
11316
11338
  * @param {string|url} params.buildDirectoryUrl
11317
11339
  * Directory where optimized files will be written
11318
11340
  * @param {object} params.entryPoints
11319
- * Object where keys are paths to source files and values are their future name in the build directory.
11320
- * Keys are relative to sourceDirectoryUrl
11321
- * @param {object} params.runtimeCompat
11322
- * Code generated will be compatible with these runtimes
11323
- * @param {string} [params.assetsDirectory]
11324
- * Directory where asset files will be written. By default sibling to the entry build file.
11325
- * @param {string|url} [params.base=""]
11326
- * Urls in build file contents will be prefixed with this string
11327
- * @param {boolean|object} [params.bundling=true]
11328
- * Reduce number of files written in the build directory
11329
- * @param {boolean|object} [params.minification=true]
11330
- * Minify the content of files written into the build directory
11331
- * @param {boolean} [params.versioning=true]
11332
- * Use versioning on files written in the build directory
11333
- * @param {('search_param'|'filename')} [params.versioningMethod="search_param"]
11334
- * Controls how url are versioned in the build directory
11335
- * @param {('none'|'inline'|'file'|'programmatic')} [params.sourcemaps="none"]
11336
- * Generate sourcemaps in the build directory
11337
- * @param {('error'|'copy'|'preserve')|function} [params.directoryReferenceEffect="error"]
11338
- * What to do when a reference leads to a directory on the filesystem
11341
+ * Object where keys are paths to source files and values are configuration objects for each entry point.
11342
+ * Keys are relative to sourceDirectoryUrl or bare specifiers
11343
+ * @param {object} [params.logs]
11344
+ * Configuration for build logging
11345
+ * @param {string|url} [params.outDirectoryUrl]
11346
+ * Directory for temporary build files and cache
11347
+ * @param {object} [params.buildDirectoryCleanPatterns]
11348
+ * Patterns for files to clean from build directory before building (defaults to all files)
11349
+ * @param {boolean} [params.returnBuildInlineContents]
11350
+ * Whether to return inline contents in the result
11351
+ * @param {boolean} [params.returnBuildManifest]
11352
+ * Whether to return build manifest in the result
11353
+ * @param {boolean} [params.returnBuildFileVersions]
11354
+ * Whether to return file versions in the result
11355
+ * @param {AbortSignal} [params.signal]
11356
+ * Signal to abort the build process
11357
+ * @param {boolean} [params.handleSIGINT=true]
11358
+ * Whether to handle SIGINT for graceful shutdown
11359
+ * @param {boolean} [params.writeOnFileSystem=true]
11360
+ * Whether to write build files to the filesystem
11361
+ * @param {boolean} [params.watch=false]
11362
+ * Whether to enable watch mode for continuous building
11363
+ * @param {object} [params.sourceFilesConfig]
11364
+ * Configuration for source file watching
11365
+ * @param {number} [params.cooldownBetweenFileEvents]
11366
+ * Cooldown time between file change events in watch mode
11367
+ *
11368
+ * Entry point configuration (values in params.entryPoints):
11369
+ * @param {string} [entryPoint.buildRelativeUrl]
11370
+ * Relative URL where this entry point will be written in the build directory
11371
+ * @param {object} [entryPoint.runtimeCompat]
11372
+ * Runtime compatibility configuration for this entry point
11373
+ * @param {string} [entryPoint.assetsDirectory]
11374
+ * Directory where asset files will be written for this entry point
11375
+ * @param {string|url} [entryPoint.base]
11376
+ * Base URL prefix for references in this entry point
11377
+ * @param {boolean|object} [entryPoint.bundling=true]
11378
+ * Whether to enable bundling for this entry point
11379
+ * @param {boolean|object} [entryPoint.minification=true]
11380
+ * Whether to enable minification for this entry point
11381
+ * @param {boolean} [entryPoint.versioning=true]
11382
+ * Whether to enable versioning for this entry point
11383
+ * @param {('search_param'|'filename')} [entryPoint.versioningMethod]
11384
+ * How URLs are versioned for this entry point (defaults to "search_param")
11385
+ * @param {('none'|'inline'|'file'|'programmatic')} [entryPoint.sourcemaps]
11386
+ * Sourcemap generation strategy for this entry point (defaults to "none")
11387
+ *
11339
11388
  * @return {Promise<Object>} buildReturnValue
11340
- * @return {Promise<Object>} buildReturnValue.buildInlineContents
11341
- * Contains content that is inline into build files
11342
- * @return {Promise<Object>} buildReturnValue.buildManifest
11343
- * Map build file paths without versioning to versioned file paths
11389
+ * @return {Promise<Object>} [buildReturnValue.buildInlineContents]
11390
+ * Contents that are inlined into build files (if returnBuildInlineContents is true)
11391
+ * @return {Promise<Object>} [buildReturnValue.buildManifest]
11392
+ * Map of build file paths without versioning to versioned file paths (if returnBuildManifest is true)
11393
+ * @return {Promise<Object>} [buildReturnValue.buildFileVersions]
11394
+ * Version information for build files (if returnBuildFileVersions is true)
11344
11395
  */
11345
11396
  const build = async ({
11346
11397
  sourceDirectoryUrl,
@@ -11565,7 +11616,7 @@ const build = async ({
11565
11616
  });
11566
11617
 
11567
11618
  const logLevel = logs.level;
11568
- const logger = createLogger({ logLevel });
11619
+ let logger = createLogger({ logLevel });
11569
11620
  const animatedLogEnabled =
11570
11621
  logs.animated &&
11571
11622
  // canEraseProcessStdout
@@ -12046,9 +12097,9 @@ const build = async ({
12046
12097
  const buildTask = createTaskLog("build");
12047
12098
  buildAbortController = new AbortController();
12048
12099
  try {
12100
+ logger = createLogger({ logLevel: "warn" });
12049
12101
  const result = await runBuild({
12050
12102
  signal: buildAbortController.signal,
12051
- logLevel: "warn",
12052
12103
  });
12053
12104
  buildTask.done();
12054
12105
  resolveFirstBuild(result);
@@ -12101,6 +12152,7 @@ const build = async ({
12101
12152
 
12102
12153
  const entryPointDefaultParams = {
12103
12154
  buildRelativeUrl: undefined,
12155
+ mode: undefined,
12104
12156
  runtimeCompat: defaultRuntimeCompat,
12105
12157
  plugins: [],
12106
12158
  mappings: undefined,
@@ -12154,6 +12206,7 @@ const prepareEntryPointBuild = async (
12154
12206
  ) => {
12155
12207
  let {
12156
12208
  buildRelativeUrl,
12209
+ mode,
12157
12210
  runtimeCompat,
12158
12211
  plugins,
12159
12212
  mappings,
@@ -12228,7 +12281,7 @@ const prepareEntryPointBuild = async (
12228
12281
  assetsDirectory = `${assetsDirectory}/`;
12229
12282
  }
12230
12283
  if (entryPointParams.base === undefined) {
12231
- base = someEntryPointUseNode ? "./" : "/";
12284
+ base = mode === "package" || someEntryPointUseNode ? "./" : "/";
12232
12285
  }
12233
12286
  if (entryPointParams.bundling === undefined) {
12234
12287
  bundling = true;
@@ -12237,13 +12290,21 @@ const prepareEntryPointBuild = async (
12237
12290
  bundling = {};
12238
12291
  }
12239
12292
  if (entryPointParams.minification === undefined) {
12240
- minification = !someEntryPointUseNode;
12293
+ if (mode === "package" || someEntryPointUseNode) {
12294
+ minification = false;
12295
+ } else {
12296
+ minification = true;
12297
+ }
12241
12298
  }
12242
12299
  if (minification === true) {
12243
12300
  minification = {};
12244
12301
  }
12245
12302
  if (entryPointParams.versioning === undefined) {
12246
- versioning = !someEntryPointUseNode;
12303
+ if (mode === "package" || someEntryPointUseNode) {
12304
+ versioning = false;
12305
+ } else {
12306
+ versioning = true;
12307
+ }
12247
12308
  }
12248
12309
  if (entryPointParams.versioningMethod === undefined) {
12249
12310
  versioningMethod = entryPointDefaultParams.versioningMethod;
@@ -12252,7 +12313,14 @@ const prepareEntryPointBuild = async (
12252
12313
  assetManifest = versioningMethod === "filename";
12253
12314
  }
12254
12315
  if (entryPointParams.preserveComments === undefined) {
12255
- preserveComments = someEntryPointUseNode;
12316
+ if (mode === "package" || someEntryPointUseNode) {
12317
+ preserveComments = true;
12318
+ }
12319
+ }
12320
+ if (entryPointParams.sourcemaps === undefined) {
12321
+ if (mode === "package") {
12322
+ sourcemaps = "file";
12323
+ }
12256
12324
  }
12257
12325
  }
12258
12326
 
@@ -12279,6 +12347,7 @@ const prepareEntryPointBuild = async (
12279
12347
  ignoreProtocol: "keep",
12280
12348
  build: true,
12281
12349
  runtimeCompat,
12350
+ mode,
12282
12351
  initialContext: contextSharedDuringBuild,
12283
12352
  sourcemaps,
12284
12353
  sourcemapsSourcesContent,
@@ -12379,6 +12448,7 @@ const prepareEntryPointBuild = async (
12379
12448
  ignoreProtocol: "remove",
12380
12449
  build: true,
12381
12450
  runtimeCompat,
12451
+ mode,
12382
12452
  initialContext: contextSharedDuringBuild,
12383
12453
  sourcemaps,
12384
12454
  sourcemapsComment: "relative",
@@ -147,6 +147,14 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
147
147
  return 3;
148
148
  }
149
149
 
150
+ if (env.TERM === 'xterm-ghostty') {
151
+ return 3;
152
+ }
153
+
154
+ if (env.TERM === 'wezterm') {
155
+ return 3;
156
+ }
157
+
150
158
  if ('TERM_PROGRAM' in env) {
151
159
  const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
152
160
 
@@ -214,10 +222,14 @@ function isUnicodeSupported() {
214
222
  function ansiRegex({onlyFirst = false} = {}) {
215
223
  // Valid string terminator sequences are BEL, ESC\, and 0x9c
216
224
  const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)';
217
- const pattern = [
218
- `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
219
- '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
220
- ].join('|');
225
+
226
+ // OSC sequences only: ESC ] ... ST (non-greedy until the first ST)
227
+ const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
228
+
229
+ // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte
230
+ const csi = '[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]';
231
+
232
+ const pattern = `${osc}|${csi}`;
221
233
 
222
234
  return new RegExp(pattern, onlyFirst ? undefined : 'g');
223
235
  }
@@ -535,11 +547,10 @@ function isWide(x) {
535
547
  || x >= 0xFE54 && x <= 0xFE66
536
548
  || x >= 0xFE68 && x <= 0xFE6B
537
549
  || x >= 0x16FE0 && x <= 0x16FE4
538
- || x === 0x16FF0
539
- || x === 0x16FF1
540
- || x >= 0x17000 && x <= 0x187F7
541
- || x >= 0x18800 && x <= 0x18CD5
542
- || x >= 0x18CFF && x <= 0x18D08
550
+ || x >= 0x16FF0 && x <= 0x16FF6
551
+ || x >= 0x17000 && x <= 0x18CD5
552
+ || x >= 0x18CFF && x <= 0x18D1E
553
+ || x >= 0x18D80 && x <= 0x18DF2
543
554
  || x >= 0x1AFF0 && x <= 0x1AFF3
544
555
  || x >= 0x1AFF5 && x <= 0x1AFFB
545
556
  || x === 0x1AFFD
@@ -584,7 +595,7 @@ function isWide(x) {
584
595
  || x >= 0x1F680 && x <= 0x1F6C5
585
596
  || x === 0x1F6CC
586
597
  || x >= 0x1F6D0 && x <= 0x1F6D2
587
- || x >= 0x1F6D5 && x <= 0x1F6D7
598
+ || x >= 0x1F6D5 && x <= 0x1F6D8
588
599
  || x >= 0x1F6DC && x <= 0x1F6DF
589
600
  || x === 0x1F6EB
590
601
  || x === 0x1F6EC
@@ -595,11 +606,12 @@ function isWide(x) {
595
606
  || x >= 0x1F93C && x <= 0x1F945
596
607
  || x >= 0x1F947 && x <= 0x1F9FF
597
608
  || x >= 0x1FA70 && x <= 0x1FA7C
598
- || x >= 0x1FA80 && x <= 0x1FA89
599
- || x >= 0x1FA8F && x <= 0x1FAC6
600
- || x >= 0x1FACE && x <= 0x1FADC
601
- || x >= 0x1FADF && x <= 0x1FAE9
602
- || x >= 0x1FAF0 && x <= 0x1FAF8
609
+ || x >= 0x1FA80 && x <= 0x1FA8A
610
+ || x >= 0x1FA8E && x <= 0x1FAC6
611
+ || x === 0x1FAC8
612
+ || x >= 0x1FACD && x <= 0x1FADC
613
+ || x >= 0x1FADF && x <= 0x1FAEA
614
+ || x >= 0x1FAEF && x <= 0x1FAF8
603
615
  || x >= 0x20000 && x <= 0x2FFFD
604
616
  || x >= 0x30000 && x <= 0x3FFFD;
605
617
  }
@@ -1,4 +1,4 @@
1
- var n,l$1,u$2,i$1,r$1,o$1,e$1,f$2,c$1,s$1,a$1,p$1={},v$1=[],y$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w$1=Array.isArray;function d$1(n,l){for(var u in l)n[u]=l[u];return n}function g$1(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function _$1(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) void 0===e[o]&&(e[o]=l.defaultProps[o]);return m$1(l,e,i,r,null)}function m$1(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u$2:o,__i:-1,__u:0};return null==o&&null!=l$1.vnode&&l$1.vnode(e),e}function k$1(n){return n.children}function x$1(n,l){this.props=n,this.context=l;}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?S(n):null}function C$2(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C$2(n)}}function M(n){(!n.__d&&(n.__d=true)&&i$1.push(n)&&!$.__r++||r$1!=l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$1)($);}function $(){for(var n,u,t,r,o,f,c,s=1;i$1.length;)i$1.length>s&&i$1.sort(e$1),n=i$1.shift(),s=i$1.length,n.__d&&(t=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d$1({},r)).__v=r.__v+1,l$1.vnode&&l$1.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,N$1(f,t,c),t.__e!=o&&C$2(t)));$.__r=0;}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_=t&&t.__k||v$1,m=l.length;for(f=P$1(u,l,_,f,m),a=0;a<m;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p$1:_[y.__i]||p$1,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B$2(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),4&y.__u||h.__k===y.__k?f=A(y,f,n):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P$1(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m$1(null,o,null,null,null):w$1(o)?m$1(k$1,{children:o},null,null,null):null==o.constructor&&o.__b>0?m$1(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D$1(e,e));return t}function A(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=A(t[i],l,u));return l}n.__e!=l&&(l&&n.type&&!u.contains(l)&&(l=S(n)),u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function H$1(n,l){return l=l||[],null==n||"boolean"==typeof n||(w$1(n)?n.some(function(n){H$1(n,l);}):l.push(n)),l}function L(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return -1}function T$1(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y$1.test(l)?u:u+"px";}function j$2(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T$1(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T$1(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f$2,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c$1,n.addEventListener(l,r?a$1:s$1,r)):n.removeEventListener(l,r?a$1:s$1,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function F$1(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c$1++;else if(u.t<t.u)return;return t(l$1.event?l$1.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l$1.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x$1(b,M),h.constructor=j,h.render=E$1),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d$1({},h.__s)),d$1(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l$1.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d$1(d$1({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k$1&&null==a.key&&(L=V$1(a.props.children)),f=I(n,w$1(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f;}else {for(T=o.length;T--;)g$1(o[T]);z$1(u);}else u.__e=t.__e,u.__k=t.__k,n.then||z$1(u);l$1.__e(n,u,t);}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q$1(t.__e,u,t,i,r,o,e,c,s);return (a=l$1.diffed)&&a(u),128&u.__u?void 0:f}function z$1(n){n&&n.__c&&(n.__c.__e=true),n&&n.__k&&n.__k.forEach(z$1);}function N$1(n,u,t){for(var i=0;i<t.length;i++)B$2(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function V$1(n){return "object"!=typeof n||null==n||n.__b&&n.__b>0?n:w$1(n)?n.map(V$1):d$1({},n)}function q$1(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l$1.__m&&l$1.__m(t,e),c=false),e=null;}if(null==x)b===k||c&&u.data==k||(u.data=k);else {if(e=e&&n.call(u.childNodes),b=i.props||p$1,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j$2(u,a,null,d,o);}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j$2(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I("template"==t.type?u.content:u,w$1(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g$1(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j$2(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j$2(u,a,m,b[a],o));}return u}function B$2(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l$1.__e(n,t);}}function D$1(n,u,t){var i,r;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B$2(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&D$1(i[r],u,t||"function"!=typeof n.type);t||g$1(n.__e),n.__c=n.__=n.__e=void 0;}function E$1(n,l,u){return this.constructor(n,u)}function G$1(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l$1.__&&l$1.__(u,t),o=(r="function"=="undefined")?null:t.__k,e=[],f=[],O(t,u=(t).__k=_$1(k$1,null,[u]),o||p$1,p$1,t.namespaceURI,o?null:t.firstChild?n.call(t.childNodes):null,e,o?o.__e:t.firstChild,r,f),N$1(e,u,f);}n=v$1.slice,l$1={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u$2=0,x$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d$1({},this.state),"function"==typeof n&&(n=n(d$1({},u),this.props)),n&&d$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this));},x$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),M(this));},x$1.prototype.render=k$1,i$1=[],o$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e$1=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f$2=/(PointerCapture)$|Capture$/i,c$1=0,s$1=F$1(false),a$1=F$1(true);
1
+ var n,l$1,u$2,i$1,r$1,o$1,e$1,f$2,c$1,s$1,a$1,p$1={},v$1=[],y$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w$1=Array.isArray;function d$1(n,l){for(var u in l)n[u]=l[u];return n}function g$1(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function _$1(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) void 0===e[o]&&(e[o]=l.defaultProps[o]);return m$1(l,e,i,r,null)}function m$1(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u$2:o,__i:-1,__u:0};return null==o&&null!=l$1.vnode&&l$1.vnode(e),e}function k$1(n){return n.children}function x$1(n,l){this.props=n,this.context=l;}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?S(n):null}function C$2(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C$2(n)}}function M(n){(!n.__d&&(n.__d=true)&&i$1.push(n)&&!$.__r++||r$1!=l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$1)($);}function $(){for(var n,u,t,r,o,f,c,s=1;i$1.length;)i$1.length>s&&i$1.sort(e$1),n=i$1.shift(),s=i$1.length,n.__d&&(t=void 0,r=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d$1({},r)).__v=r.__v+1,l$1.vnode&&l$1.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,N$1(f,t,c),r.__e=r.__=null,t.__e!=o&&C$2(t)));$.__r=0;}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_,m=t&&t.__k||v$1,b=l.length;for(f=P$1(u,l,m,f,b),a=0;a<b;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p$1:m[y.__i]||p$1,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B$2(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),(_=!!(4&y.__u))||h.__k===y.__k?f=A(y,f,n,_):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P$1(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m$1(null,o,null,null,null):w$1(o)?m$1(k$1,{children:o},null,null,null):null==o.constructor&&o.__b>0?m$1(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D$1(e,e));return t}function A(n,l,u,t){var i,r;if("function"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=A(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=S(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function H$1(n,l){return l=l||[],null==n||"boolean"==typeof n||(w$1(n)?n.some(function(n){H$1(n,l);}):l.push(n)),l}function L(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return -1}function T$1(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y$1.test(l)?u:u+"px";}function j$2(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T$1(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T$1(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f$2,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c$1,n.addEventListener(l,r?a$1:s$1,r)):n.removeEventListener(l,r?a$1:s$1,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function F$1(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c$1++;else if(u.t<t.u)return;return t(l$1.event?l$1.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l$1.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x$1(b,M),h.constructor=j,h.render=E$1),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d$1({},h.__s)),d$1(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l$1.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d$1(d$1({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k$1&&null==a.key&&(L=V$1(a.props.children)),f=I(n,w$1(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f;}else {for(T=o.length;T--;)g$1(o[T]);z$1(u);}else u.__e=t.__e,u.__k=t.__k,n.then||z$1(u);l$1.__e(n,u,t);}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q$1(t.__e,u,t,i,r,o,e,c,s);return (a=l$1.diffed)&&a(u),128&u.__u?void 0:f}function z$1(n){n&&n.__c&&(n.__c.__e=true),n&&n.__k&&n.__k.forEach(z$1);}function N$1(n,u,t){for(var i=0;i<t.length;i++)B$2(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function V$1(n){return "object"!=typeof n||null==n||n.__b&&n.__b>0?n:w$1(n)?n.map(V$1):d$1({},n)}function q$1(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l$1.__m&&l$1.__m(t,e),c=false),e=null;}if(null==x)b===k||c&&u.data==k||(u.data=k);else {if(e=e&&n.call(u.childNodes),b=i.props||p$1,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j$2(u,a,null,d,o);}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j$2(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I("template"==t.type?u.content:u,w$1(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g$1(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j$2(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j$2(u,a,m,b[a],o));}return u}function B$2(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l$1.__e(n,t);}}function D$1(n,u,t){var i,r;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B$2(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&D$1(i[r],u,t||"function"!=typeof n.type);t||g$1(n.__e),n.__c=n.__=n.__e=void 0;}function E$1(n,l,u){return this.constructor(n,u)}function G$1(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l$1.__&&l$1.__(u,t),o=(r="function"=="undefined")?null:t.__k,e=[],f=[],O(t,u=(t).__k=_$1(k$1,null,[u]),o||p$1,p$1,t.namespaceURI,o?null:t.firstChild?n.call(t.childNodes):null,e,o?o.__e:t.firstChild,r,f),N$1(e,u,f);}n=v$1.slice,l$1={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u$2=0,x$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d$1({},this.state),"function"==typeof n&&(n=n(d$1({},u),this.props)),n&&d$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this));},x$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),M(this));},x$1.prototype.render=k$1,i$1=[],o$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e$1=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f$2=/(PointerCapture)$|Capture$/i,c$1=0,s$1=F$1(false),a$1=F$1(true);
2
2
 
3
3
  var t,r,u$1,i,o=0,f$1=[],c=l$1,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function p(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,h(D,n)}function h(n,u,i){var o=p(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return true;var u=o.__c.__H.__.filter(function(n){return !!n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=true);}}),c&&c.call(this,n,t,r)||i};r.__f=true;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function y(n,u){var i=p(t++,3);!c.__s&&C$1(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i));}function _(n,u){var i=p(t++,4);!c.__s&&C$1(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i));}function j$1(){for(var n;n=f$1.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B$1),n.__H.__h=[];}catch(t){n.__H.__h=[],c.__e(t,n.__v);}}c.__b=function(n){r=null,e&&e(n);},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t);},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u$1===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(i.__h.forEach(z),i.__h.forEach(B$1),i.__h=[],t=0)),u$1=r;},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f$1.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j$1)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),u$1=r=null;},c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return !n.__||B$1(n)});}catch(r){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],c.__e(r,n.__v);}}),l&&l(n,t);},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n);}catch(n){t=n;}}),r.__H=void 0,t&&c.__e(t,r.__v));};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r));}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function B$1(n){var t=r;n.__c=n.__(),r=t;}function C$1(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return "function"==typeof t?t(n):t}
4
4
 
@@ -1,14 +1,11 @@
1
- import "file:///Users/dmail/Documents/dev/jsenv/core/packages/internal/plugin-transpilation/src/babel/new_stylesheet/client/new_stylesheet.js";
2
-
3
- const installImportMetaCss = importMeta => {
1
+ const installImportMetaCss = (importMeta) => {
4
2
  let cssText = "";
5
- let stylesheet = new CSSStyleSheet({
6
- baseUrl: importMeta.url
7
- });
3
+ let stylesheet = new CSSStyleSheet({ baseUrl: importMeta.url });
8
4
  let adopted = false;
5
+
9
6
  const css = {
10
7
  toString: () => cssText,
11
- update: value => {
8
+ update: (value) => {
12
9
  cssText = value;
13
10
  cssText += `
14
11
  /* sourceURL=${importMeta.url} */
@@ -17,17 +14,23 @@ const installImportMetaCss = importMeta => {
17
14
  },
18
15
  inject: () => {
19
16
  if (!adopted) {
20
- document.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];
17
+ document.adoptedStyleSheets = [
18
+ ...document.adoptedStyleSheets,
19
+ stylesheet,
20
+ ];
21
21
  adopted = true;
22
22
  }
23
23
  },
24
24
  remove: () => {
25
25
  if (adopted) {
26
- document.adoptedStyleSheets = document.adoptedStyleSheets.filter(s => s !== stylesheet);
26
+ document.adoptedStyleSheets = document.adoptedStyleSheets.filter(
27
+ (s) => s !== stylesheet,
28
+ );
27
29
  adopted = false;
28
30
  }
29
- }
31
+ },
30
32
  };
33
+
31
34
  Object.defineProperty(importMeta, "css", {
32
35
  get() {
33
36
  return css;
@@ -35,8 +38,9 @@ const installImportMetaCss = importMeta => {
35
38
  set(value) {
36
39
  css.update(value);
37
40
  css.inject();
38
- }
41
+ },
39
42
  });
43
+
40
44
  return css.remove;
41
45
  };
42
46
 
@@ -0,0 +1,22 @@
1
+ const installImportMetaCss = (importMeta) => {
2
+ const stylesheet = new CSSStyleSheet({ baseUrl: importMeta.url });
3
+
4
+ let called = false;
5
+ // eslint-disable-next-line accessor-pairs
6
+ Object.defineProperty(importMeta, "css", {
7
+ configurable: true,
8
+ set(value) {
9
+ if (called) {
10
+ throw new Error("import.meta.css setter can only be called once");
11
+ }
12
+ called = true;
13
+ stylesheet.replaceSync(value);
14
+ document.adoptedStyleSheets = [
15
+ ...document.adoptedStyleSheets,
16
+ stylesheet,
17
+ ];
18
+ },
19
+ });
20
+ };
21
+
22
+ export { installImportMetaCss };