@weapp-tailwindcss/postcss 3.0.5 → 3.0.7

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.
package/dist/index.js CHANGED
@@ -1,11 +1,23 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_html_transform = require("./html-transform-Dgak7hXa.js");
2
+ const require_html_transform = require("./html-transform-CMF3g0Cc.js");
3
+ const require_postcss = require("./postcss-by-0mwIg.js");
3
4
  require("./types.js");
4
5
  let postcss = require("postcss");
5
6
  postcss = require_html_transform.__toESM(postcss);
6
7
  let postcss_value_parser = require("postcss-value-parser");
7
8
  let postcss_value_parser$1 = require_html_transform.__toESM(postcss_value_parser, 1);
8
9
  postcss_value_parser = require_html_transform.__toESM(postcss_value_parser);
10
+ let node_path = require("node:path");
11
+ node_path = require_html_transform.__toESM(node_path);
12
+ let node_process = require("node:process");
13
+ node_process = require_html_transform.__toESM(node_process);
14
+ let node_fs_promises = require("node:fs/promises");
15
+ let tailwindcss_config = require("tailwindcss-config");
16
+ let tailwindcss_patch = require("tailwindcss-patch");
17
+ let node_fs = require("node:fs");
18
+ let micromatch = require("micromatch");
19
+ micromatch = require_html_transform.__toESM(micromatch);
20
+ let node_module = require("node:module");
9
21
  let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
10
22
  let lru_cache = require("lru-cache");
11
23
  let postcss_selector_parser = require("postcss-selector-parser");
@@ -20,11 +32,11 @@ let postcss_pxtrans = require("postcss-pxtrans");
20
32
  postcss_pxtrans = require_html_transform.__toESM(postcss_pxtrans);
21
33
  let postcss_rem_to_responsive_pixel = require("postcss-rem-to-responsive-pixel");
22
34
  postcss_rem_to_responsive_pixel = require_html_transform.__toESM(postcss_rem_to_responsive_pixel);
23
- let node_process = require("node:process");
24
- node_process = require_html_transform.__toESM(node_process);
25
35
  let postcss_rule_unit_converter = require("postcss-rule-unit-converter");
26
36
  postcss_rule_unit_converter = require_html_transform.__toESM(postcss_rule_unit_converter);
27
37
  let _weapp_core_escape = require("@weapp-core/escape");
38
+ let postcss_load_config = require("postcss-load-config");
39
+ postcss_load_config = require_html_transform.__toESM(postcss_load_config);
28
40
  const MODERN_COLOR_FUNCTION_NAMES = new Set([
29
41
  "oklch",
30
42
  "oklab",
@@ -7286,6 +7298,15 @@ const MINI_PROGRAM_ELEMENT_SCOPE_SELECTORS = new Set([
7286
7298
  "::before",
7287
7299
  "::after"
7288
7300
  ]);
7301
+ const MINI_PROGRAM_NATIVE_ELEMENT_SELECTORS = new Set([
7302
+ ...MINI_PROGRAM_ELEMENT_SCOPE_SELECTORS,
7303
+ "button",
7304
+ "input",
7305
+ "textarea",
7306
+ "canvas",
7307
+ "video",
7308
+ "audio"
7309
+ ]);
7289
7310
  const MINI_PROGRAM_PREFLIGHT_SELECTORS = new Set(["*", ...MINI_PROGRAM_ELEMENT_SCOPE_SELECTORS]);
7290
7311
  const MINI_PROGRAM_THEME_SCOPE_SELECTORS = new Set([
7291
7312
  ":host",
@@ -7362,11 +7383,12 @@ const MINI_PROGRAM_UNSUPPORTED_BROWSER_TAG_SELECTORS = new Set([
7362
7383
  "ul",
7363
7384
  "video"
7364
7385
  ]);
7365
- function normalizeSelector$1(selector) {
7386
+ const MINI_PROGRAM_UNSUPPORTED_BROWSER_PREFLIGHT_SELECTOR_PARTS = new Set([...MINI_PROGRAM_UNSUPPORTED_BROWSER_TAG_SELECTORS, "::file-selector-button"]);
7387
+ function normalizeSelector$2(selector) {
7366
7388
  return selector.trim().replace(/\s+/g, "");
7367
7389
  }
7368
7390
  function normalizePseudoElementSelector(selector) {
7369
- return normalizeSelector$1(selector).replace(/^:(before|after)$/, "::$1");
7391
+ return normalizeSelector$2(selector).replace(/^:(before|after)$/, "::$1");
7370
7392
  }
7371
7393
  function getRuleSelectors(rule) {
7372
7394
  return rule.selector.split(",").map(normalizePseudoElementSelector).filter(Boolean);
@@ -7375,8 +7397,15 @@ function getSortedRuleSelectorKey(rule) {
7375
7397
  return getRuleSelectors(rule).sort().join(",");
7376
7398
  }
7377
7399
  function isUnsupportedBrowserSelector(selector) {
7378
- const normalized = normalizeSelector$1(selector);
7379
- return MINI_PROGRAM_UNSUPPORTED_BROWSER_SELECTORS.has(normalized) || MINI_PROGRAM_UNSUPPORTED_BROWSER_TAG_SELECTORS.has(normalized);
7400
+ const normalized = normalizeSelector$2(selector);
7401
+ return MINI_PROGRAM_UNSUPPORTED_BROWSER_SELECTORS.has(normalized) || MINI_PROGRAM_UNSUPPORTED_BROWSER_TAG_SELECTORS.has(normalized) && !MINI_PROGRAM_NATIVE_ELEMENT_SELECTORS.has(normalized);
7402
+ }
7403
+ function isUnsupportedBrowserPreflightSelector(selector) {
7404
+ const normalizedParts = selector.split(",").map(normalizeSelector$2).filter(Boolean);
7405
+ return normalizedParts.length > 1 && normalizedParts.every((part) => MINI_PROGRAM_UNSUPPORTED_BROWSER_PREFLIGHT_SELECTOR_PARTS.has(part));
7406
+ }
7407
+ function isMiniProgramNativeElementSelector(selector) {
7408
+ return MINI_PROGRAM_NATIVE_ELEMENT_SELECTORS.has(normalizePseudoElementSelector(selector));
7380
7409
  }
7381
7410
  function isMiniProgramPreflightSelector(selectors) {
7382
7411
  return selectors.length > 0 && selectors.every((selector) => MINI_PROGRAM_PREFLIGHT_SELECTORS.has(selector)) && selectors.some((selector) => selector === "*" || selector === ":before" || selector === ":after" || selector === "::before" || selector === "::after");
@@ -7397,6 +7426,7 @@ const PREFLIGHT_RESET_PROPS = new Set([
7397
7426
  ]);
7398
7427
  const PSEUDO_CONTENT_SELECTOR_RE = /^(?:::before|::after|:before|:after)(?:,(?:::before|::after|:before|:after))*$/;
7399
7428
  const TW_CONTENT_VAR_RE = /var\(\s*--tw-content\b/;
7429
+ const BROWSER_PREFLIGHT_SINGLE_ELEMENT_DECLARATIONS = new Map([["button", new Set(["appearance:button", "-moz-appearance:button"])], ["textarea", new Set(["resize:vertical"])]]);
7400
7430
  function hasTailwindPreflightDeclaration(rule) {
7401
7431
  let hasTailwindVar = false;
7402
7432
  let hasResetProp = false;
@@ -7406,6 +7436,13 @@ function hasTailwindPreflightDeclaration(rule) {
7406
7436
  });
7407
7437
  return hasTailwindVar || hasResetProp;
7408
7438
  }
7439
+ function hasTailwindVariableDeclaration(rule) {
7440
+ let hasTailwindVar = false;
7441
+ rule.walkDecls((decl) => {
7442
+ if (decl.prop.startsWith("--tw-")) hasTailwindVar = true;
7443
+ });
7444
+ return hasTailwindVar;
7445
+ }
7409
7446
  function isCustomPropertyRule(rule) {
7410
7447
  let hasDeclaration = false;
7411
7448
  let allCustomProperties = true;
@@ -7441,7 +7478,27 @@ function usesTwContentVariable(root) {
7441
7478
  }
7442
7479
  function isMiniProgramPreflightRule(node) {
7443
7480
  if (node.type !== "rule") return false;
7444
- return isMiniProgramPreflightSelector(getRuleSelectors(node)) && hasTailwindPreflightDeclaration(node);
7481
+ const selectors = getRuleSelectors(node);
7482
+ if (!isMiniProgramPreflightSelector(selectors)) return false;
7483
+ if (selectors.includes("*")) return hasTailwindPreflightDeclaration(node);
7484
+ if (hasTailwindVariableDeclaration(node)) return true;
7485
+ return selectors.some((selector) => selector === ":before" || selector === ":after" || selector === "::before" || selector === "::after") && selectors.some((selector) => selector === "view" || selector === "text") && hasTailwindPreflightDeclaration(node);
7486
+ }
7487
+ function isBrowserElementPreflightRule(node) {
7488
+ if (node.type !== "rule") return false;
7489
+ const selectors = getRuleSelectors(node);
7490
+ if (selectors.length !== 1) return false;
7491
+ const declarations = BROWSER_PREFLIGHT_SINGLE_ELEMENT_DECLARATIONS.get(selectors[0]);
7492
+ if (!declarations) return false;
7493
+ let hasDeclaration = false;
7494
+ let allBrowserPreflightDeclarations = true;
7495
+ node.each((child) => {
7496
+ if (child.type !== "decl") return;
7497
+ hasDeclaration = true;
7498
+ const key = `${child.prop.toLowerCase()}:${child.value.trim().toLowerCase()}`;
7499
+ if (!declarations.has(key)) allBrowserPreflightDeclarations = false;
7500
+ });
7501
+ return hasDeclaration && allBrowserPreflightDeclarations;
7445
7502
  }
7446
7503
  function isMiniProgramThemeVariableRule(node) {
7447
7504
  if (node.type !== "rule") return false;
@@ -7625,7 +7682,7 @@ function removeSpecificityPlaceholders(root) {
7625
7682
  function isEffectivelyEmptyContainer(container) {
7626
7683
  return !container.nodes || container.nodes.every((node) => node.type === "comment");
7627
7684
  }
7628
- function removeEmptyAtRules(root) {
7685
+ function removeEmptyAtRules$1(root) {
7629
7686
  root.walkAtRules((atRule) => {
7630
7687
  if (isEffectivelyEmptyContainer(atRule)) atRule.remove();
7631
7688
  });
@@ -7640,6 +7697,18 @@ function removeEmptyAtRuleAncestors(parent) {
7640
7697
  function removeUnsupportedBrowserSelectors(root) {
7641
7698
  root.walkRules((rule) => {
7642
7699
  if (!rule.selectors || rule.selectors.length === 0) return;
7700
+ if (isUnsupportedBrowserPreflightSelector(rule.selector)) {
7701
+ const parent = rule.parent;
7702
+ rule.remove();
7703
+ removeEmptyAtRuleAncestors(parent);
7704
+ return;
7705
+ }
7706
+ if (isBrowserElementPreflightRule(rule)) {
7707
+ const parent = rule.parent;
7708
+ rule.remove();
7709
+ removeEmptyAtRuleAncestors(parent);
7710
+ return;
7711
+ }
7643
7712
  const selectors = rule.selectors.filter((selector) => !isUnsupportedBrowserSelector(selector));
7644
7713
  if (selectors.length === rule.selectors.length) return;
7645
7714
  if (selectors.length === 0) {
@@ -7777,7 +7846,7 @@ function finalizeMiniProgramCssRoot(root, options = {}) {
7777
7846
  }));
7778
7847
  const themeRule = collectThemeVariableRule(root, options);
7779
7848
  insertHoistedRules(root, mergeEquivalentHoistedRules(themeRule ? [...preflightRules, themeRule] : preflightRules), hoistAnchor);
7780
- removeEmptyAtRules(root);
7849
+ removeEmptyAtRules$1(root);
7781
7850
  }
7782
7851
  function hoistTailwindPreflightBase(css) {
7783
7852
  try {
@@ -7827,6 +7896,10 @@ function isMiniProgramElementVariableScopeRule(rule) {
7827
7896
  const selectors = getRuleSelectors(rule);
7828
7897
  return selectors.length > 0 && selectors.every((selector) => MINI_PROGRAM_ELEMENT_SCOPE_SELECTORS.has(selector));
7829
7898
  }
7899
+ function isMiniProgramNativeElementRule(rule) {
7900
+ const selectors = getRuleSelectors(rule);
7901
+ return selectors.length > 0 && selectors.every((selector) => isMiniProgramNativeElementSelector(selector)) && !isMiniProgramPreflightRule(rule);
7902
+ }
7830
7903
  function isOnlyTwContentDeclarations(rule) {
7831
7904
  let hasDeclaration = false;
7832
7905
  let onlyContentVariable = true;
@@ -7910,6 +7983,15 @@ function pruneMiniProgramGeneratedCss(css, options = {}) {
7910
7983
  rule.selector = MINI_PROGRAM_ELEMENT_SCOPE_SELECTOR;
7911
7984
  return;
7912
7985
  }
7986
+ if (isUnsupportedBrowserPreflightSelector(rule.selector)) {
7987
+ rule.remove();
7988
+ return;
7989
+ }
7990
+ if (isBrowserElementPreflightRule(rule)) {
7991
+ rule.remove();
7992
+ return;
7993
+ }
7994
+ if (isMiniProgramNativeElementRule(rule)) return;
7913
7995
  if (isMiniProgramThemeVariableRule(rule)) {
7914
7996
  moveTailwindV4GradientRuntimeDeclarations(rule);
7915
7997
  if (!rule.parent) return;
@@ -7918,7 +8000,11 @@ function pruneMiniProgramGeneratedCss(css, options = {}) {
7918
8000
  }
7919
8001
  if (hasClassSelector$2(rule.selector)) return;
7920
8002
  if (!shouldPreserveContentInit) removeEmptyContentInitDeclarations(rule);
7921
- if (options.preservePreflight && isMiniProgramPreflightRule(rule)) return;
8003
+ if (isMiniProgramPreflightRule(rule)) {
8004
+ if (options.preservePreflight) return;
8005
+ rule.remove();
8006
+ return;
8007
+ }
7922
8008
  if (isCustomPropertyRule(rule)) {
7923
8009
  moveTailwindV4GradientRuntimeDeclarations(rule);
7924
8010
  if (!rule.parent) return;
@@ -7933,6 +8019,875 @@ function pruneMiniProgramGeneratedCss(css, options = {}) {
7933
8019
  return root.toString();
7934
8020
  }
7935
8021
  //#endregion
8022
+ //#region src/css-macro/auto.ts
8023
+ const CSS_MACRO_STYLE_OPTIONS_MARKER = "__weappTailwindcssCssMacroEnabled";
8024
+ const PLATFORM_ENV_KEYS$1 = [
8025
+ "WEAPP_TW_TARGET",
8026
+ "WEAPP_TAILWINDCSS_TARGET",
8027
+ "UNI_PLATFORM",
8028
+ "UNI_UTS_PLATFORM",
8029
+ "TARO_ENV",
8030
+ "MPX_CLI_MODE",
8031
+ "MPX_CURRENT_TARGET_MODE"
8032
+ ];
8033
+ const CONDITIONAL_END_RE = /^\s*#endif\s*$/;
8034
+ function readEnvValue$1(key) {
8035
+ return typeof node_process.default === "undefined" ? void 0 : node_process.default.env[key];
8036
+ }
8037
+ function normalizePlatformToken(value) {
8038
+ return value?.trim().replaceAll("_", "-").toUpperCase() || void 0;
8039
+ }
8040
+ function resolveCssMacroPlatform(options) {
8041
+ const explicit = normalizePlatformToken(options?.platform);
8042
+ if (explicit) return explicit;
8043
+ for (const key of PLATFORM_ENV_KEYS$1) {
8044
+ const value = normalizePlatformToken(readEnvValue$1(key));
8045
+ if (value) return value;
8046
+ }
8047
+ }
8048
+ function createPlatformTokenSet(platform) {
8049
+ const normalized = normalizePlatformToken(platform);
8050
+ const tokens = /* @__PURE__ */ new Set();
8051
+ if (!normalized) return tokens;
8052
+ tokens.add(normalized);
8053
+ if (normalized.startsWith("MP-")) tokens.add("MP");
8054
+ if (normalized === "WEAPP" || normalized === "WEIXIN" || normalized === "WX") {
8055
+ tokens.add("MP");
8056
+ tokens.add("MP-WEIXIN");
8057
+ }
8058
+ if (normalized === "MP-WEIXIN") {
8059
+ tokens.add("WEAPP");
8060
+ tokens.add("WEIXIN");
8061
+ tokens.add("WX");
8062
+ }
8063
+ if (normalized === "H5") tokens.add("WEB");
8064
+ if (normalized === "WEB") tokens.add("H5");
8065
+ if (normalized === "APP") tokens.add("APP-PLUS");
8066
+ if (normalized.startsWith("APP-")) tokens.add("APP");
8067
+ if (normalized.startsWith("QUICKAPP-WEBVIEW")) tokens.add("QUICKAPP-WEBVIEW");
8068
+ return tokens;
8069
+ }
8070
+ function combineAnd(values) {
8071
+ if (values.includes(false)) return false;
8072
+ return values.every((value) => value === true) ? true : void 0;
8073
+ }
8074
+ function combineOr(values) {
8075
+ if (values.includes(true)) return true;
8076
+ return values.every((value) => value === false) ? false : void 0;
8077
+ }
8078
+ function evaluatePlatformExpression(expression, platformTokens) {
8079
+ return combineOr(expression.split(/\s*\|\|\s*/).map((orPart) => {
8080
+ return combineAnd(orPart.split(/\s*&&\s*/).map((part) => {
8081
+ const token = normalizePlatformToken(part);
8082
+ if (!token || /[<>=!()]/.test(token)) return;
8083
+ return platformTokens.has(token);
8084
+ }));
8085
+ }));
8086
+ }
8087
+ function negateConditionalValue(value) {
8088
+ return value === void 0 ? void 0 : !value;
8089
+ }
8090
+ function getActiveConditionalValue(stack) {
8091
+ if (stack.includes(false)) return false;
8092
+ return stack.includes(void 0) ? void 0 : true;
8093
+ }
8094
+ function parseConditionalStart(text) {
8095
+ const normalized = text.trim();
8096
+ if (!normalized.startsWith("#")) return;
8097
+ const body = normalized.slice(1).trimStart();
8098
+ for (const directive of ["ifndef", "ifdef"]) {
8099
+ if (!body.startsWith(directive)) continue;
8100
+ const expression = body.slice(directive.length).trim();
8101
+ if (expression.length === 0) return;
8102
+ return {
8103
+ directive,
8104
+ expression
8105
+ };
8106
+ }
8107
+ }
8108
+ function compileCssMacroConditionalComments(css, options) {
8109
+ const platformTokens = createPlatformTokenSet(resolveCssMacroPlatform(options));
8110
+ if (platformTokens.size === 0 || !css.includes("#if")) return css;
8111
+ try {
8112
+ const root = postcss.default.parse(css);
8113
+ const transformContainer = (container) => {
8114
+ const stack = [];
8115
+ for (const node of [...container.nodes ?? []]) {
8116
+ if (node.type === "comment") {
8117
+ const start = parseConditionalStart(node.text);
8118
+ if (start) {
8119
+ const value = start.directive === "ifndef" ? negateConditionalValue(evaluatePlatformExpression(start.expression, platformTokens)) : evaluatePlatformExpression(start.expression, platformTokens);
8120
+ const parentActive = getActiveConditionalValue(stack);
8121
+ stack.push(value);
8122
+ if (parentActive !== void 0 && value !== void 0) node.remove();
8123
+ continue;
8124
+ }
8125
+ if (CONDITIONAL_END_RE.test(node.text)) {
8126
+ const value = stack.pop();
8127
+ if (getActiveConditionalValue(stack) !== void 0 && value !== void 0) node.remove();
8128
+ continue;
8129
+ }
8130
+ }
8131
+ if (getActiveConditionalValue(stack) === false) {
8132
+ node.remove();
8133
+ continue;
8134
+ }
8135
+ if ("nodes" in node && node.nodes) transformContainer(node);
8136
+ }
8137
+ };
8138
+ transformContainer(root);
8139
+ return root.toString();
8140
+ } catch {
8141
+ return css;
8142
+ }
8143
+ }
8144
+ function parseCssPluginRequest(params) {
8145
+ const value = params.trim();
8146
+ const quoted = /^(['"])(.*?)\1/.exec(value);
8147
+ if (quoted) return quoted[2];
8148
+ const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
8149
+ return url?.[2] ?? url?.[3];
8150
+ }
8151
+ function isCssMacroPluginRequest(request) {
8152
+ if (request === "weapp-tailwindcss/css-macro") return true;
8153
+ if (!request?.includes("css-macro")) return false;
8154
+ return node_path.default.basename(request).startsWith("css-macro");
8155
+ }
8156
+ function hasCssMacroTailwindV4Directive(css) {
8157
+ if (!css?.includes("css-macro")) return false;
8158
+ try {
8159
+ let found = false;
8160
+ postcss.default.parse(css).walkAtRules("plugin", (rule) => {
8161
+ if (isCssMacroPluginRequest(parseCssPluginRequest(rule.params))) found = true;
8162
+ });
8163
+ return found;
8164
+ } catch {
8165
+ return /@plugin\s+(?:url\(\s*)?["']weapp-tailwindcss\/css-macro["']/.test(css);
8166
+ }
8167
+ }
8168
+ function isCssMacroPostcssPlugin(plugin) {
8169
+ if (plugin === require_postcss.creator) return true;
8170
+ return Boolean(plugin && (typeof plugin === "function" || typeof plugin === "object") && plugin.postcssPlugin === "postcss-weapp-tw-css-macro-plugin");
8171
+ }
8172
+ function withCssMacroPostcssPlugins(plugins) {
8173
+ const macroPlugin = require_postcss.creator();
8174
+ if (!plugins) return [macroPlugin];
8175
+ if (Array.isArray(plugins)) return plugins.some(isCssMacroPostcssPlugin) ? plugins : [...plugins, macroPlugin];
8176
+ if (typeof plugins === "object") {
8177
+ const values = Object.values(plugins).filter(Boolean);
8178
+ if (values.some(isCssMacroPostcssPlugin)) return values;
8179
+ return [...values, macroPlugin];
8180
+ }
8181
+ return [macroPlugin];
8182
+ }
8183
+ function withCssMacroStyleOptions(options) {
8184
+ const postcssOptions = options?.postcssOptions;
8185
+ return {
8186
+ ...options,
8187
+ [CSS_MACRO_STYLE_OPTIONS_MARKER]: true,
8188
+ postcssOptions: {
8189
+ ...postcssOptions,
8190
+ plugins: withCssMacroPostcssPlugins(postcssOptions?.plugins)
8191
+ }
8192
+ };
8193
+ }
8194
+ function hasCssMacroStyleOptions(options) {
8195
+ return Boolean(options?.[CSS_MACRO_STYLE_OPTIONS_MARKER]);
8196
+ }
8197
+ async function transformCssMacroCss(css, options) {
8198
+ const result = (await (0, postcss.default)([require_postcss.creator()]).process(css, { from: void 0 })).css;
8199
+ return compileCssMacroConditionalComments(result, options);
8200
+ }
8201
+ //#endregion
8202
+ //#region src/generator-plugin/config-directive.ts
8203
+ function quoteCssString(value) {
8204
+ return value.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
8205
+ }
8206
+ function toCssPath(value) {
8207
+ return value.replaceAll("\\", "/");
8208
+ }
8209
+ function prependConfigDirective(css, config) {
8210
+ if (!config || /@config\s+/.test(css)) return css;
8211
+ return `@config "${quoteCssString(toCssPath(config))}";\n${css}`;
8212
+ }
8213
+ //#endregion
8214
+ //#region src/generator-plugin/context.ts
8215
+ const PLUGIN_NAME$1 = "weapp-tailwindcss";
8216
+ function resolveInputFile(result) {
8217
+ const from = result.opts.from;
8218
+ if (typeof from !== "string" || from.length === 0) return;
8219
+ return node_path.default.isAbsolute(from) ? from : node_path.default.resolve(node_process.default.cwd(), from);
8220
+ }
8221
+ function resolvePostcssBase(result, options) {
8222
+ if (options.base) return options.base;
8223
+ const inputFile = resolveInputFile(result);
8224
+ return inputFile ? node_path.default.dirname(inputFile) : node_process.default.cwd();
8225
+ }
8226
+ function resolvePostcssProjectRoot(result, options) {
8227
+ if (options.projectRoot) return options.projectRoot;
8228
+ const inputFile = resolveInputFile(result);
8229
+ return inputFile ? node_path.default.dirname(inputFile) : node_process.default.cwd();
8230
+ }
8231
+ function replaceRootCss(root, css, result) {
8232
+ root.removeAll();
8233
+ try {
8234
+ const nextRoot = postcss.default.parse(css, { from: resolveInputFile(result) });
8235
+ root.append(nextRoot.nodes);
8236
+ } catch {
8237
+ root.raws = { after: css };
8238
+ }
8239
+ }
8240
+ function addDependencyMessages(result, generated) {
8241
+ for (const file of generated.dependencies) result.messages.push({
8242
+ type: "dependency",
8243
+ plugin: PLUGIN_NAME$1,
8244
+ file
8245
+ });
8246
+ }
8247
+ function addSourceDependencyMessages(result, files) {
8248
+ for (const file of files) result.messages.push({
8249
+ type: "dependency",
8250
+ plugin: PLUGIN_NAME$1,
8251
+ file
8252
+ });
8253
+ }
8254
+ //#endregion
8255
+ //#region src/generator-plugin/directives.ts
8256
+ const TAILWIND_ROOT_DIRECTIVE_NAMES = new Set([
8257
+ "config",
8258
+ "custom-variant",
8259
+ "plugin",
8260
+ "source",
8261
+ "tailwind",
8262
+ "theme",
8263
+ "utility",
8264
+ "variant"
8265
+ ]);
8266
+ function parseImportRequest(params) {
8267
+ return /^(?:url\(\s*)?(["']?)([^"')\s]+)\1\s*\)?/.exec(params.trim())?.[2];
8268
+ }
8269
+ function isTailwindImportRequest(request, options = {}) {
8270
+ const normalized = options.importFallback && (request === "weapp-tailwindcss" || request?.startsWith("weapp-tailwindcss/")) ? request.replace(/^weapp-tailwindcss/, "tailwindcss") : request;
8271
+ return normalized === "tailwindcss" || normalized === "tailwindcss4" || normalized?.startsWith("tailwindcss/") === true || normalized?.startsWith("tailwindcss4/") === true;
8272
+ }
8273
+ function hasTailwindApplyDirective(css) {
8274
+ return /@apply\b/.test(css);
8275
+ }
8276
+ function hasTailwindRootDirectives(root, options = {}) {
8277
+ let found = false;
8278
+ root.walkAtRules((rule) => {
8279
+ if (rule.name === "import" && isTailwindImportRequest(parseImportRequest(rule.params), options)) {
8280
+ found = true;
8281
+ return false;
8282
+ }
8283
+ if (TAILWIND_ROOT_DIRECTIVE_NAMES.has(rule.name)) {
8284
+ found = true;
8285
+ return false;
8286
+ }
8287
+ });
8288
+ return found;
8289
+ }
8290
+ //#endregion
8291
+ //#region src/source-scan/inline-source.ts
8292
+ const NUMERICAL_RANGE_RE = /^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;
8293
+ function segmentTopLevel(input, separator, options = {}) {
8294
+ const parts = [];
8295
+ const stack = [];
8296
+ let lastPos = 0;
8297
+ let quote;
8298
+ for (let index = 0; index < input.length; index++) {
8299
+ const char = input[index];
8300
+ if (char === "\\") {
8301
+ index += 1;
8302
+ continue;
8303
+ }
8304
+ if (quote) {
8305
+ if (char === quote) quote = void 0;
8306
+ continue;
8307
+ }
8308
+ if (char === "\"" || char === "'") {
8309
+ quote = char;
8310
+ continue;
8311
+ }
8312
+ if (char === "(") {
8313
+ stack.push(")");
8314
+ continue;
8315
+ }
8316
+ if (char === "[") {
8317
+ stack.push("]");
8318
+ continue;
8319
+ }
8320
+ if (char === "{") {
8321
+ stack.push("}");
8322
+ continue;
8323
+ }
8324
+ if (stack.length > 0 && char === stack[stack.length - 1]) {
8325
+ stack.pop();
8326
+ continue;
8327
+ }
8328
+ if (stack.length === 0 && char === separator) {
8329
+ const part = input.slice(lastPos, index);
8330
+ if (part || options.keepEmpty) parts.push(part);
8331
+ lastPos = index + 1;
8332
+ }
8333
+ }
8334
+ const part = input.slice(lastPos);
8335
+ if (part || options.keepEmpty) parts.push(part);
8336
+ return parts;
8337
+ }
8338
+ function isSequence(value) {
8339
+ return NUMERICAL_RANGE_RE.test(value);
8340
+ }
8341
+ function expandSequence(value) {
8342
+ const match = value.match(NUMERICAL_RANGE_RE);
8343
+ if (!match) return [value];
8344
+ const [, start, end, stepValue] = match;
8345
+ if (start === void 0 || end === void 0) return [value];
8346
+ let step = stepValue ? Number.parseInt(stepValue, 10) : void 0;
8347
+ const startNumber = Number.parseInt(start, 10);
8348
+ const endNumber = Number.parseInt(end, 10);
8349
+ const increasing = startNumber < endNumber;
8350
+ if (step === void 0) step = increasing ? 1 : -1;
8351
+ if (step === 0) return [];
8352
+ if (increasing && step < 0) step = -step;
8353
+ if (!increasing && step > 0) step = -step;
8354
+ const result = [];
8355
+ for (let value = startNumber; increasing ? value <= endNumber : value >= endNumber; value += step) result.push(String(value));
8356
+ return result;
8357
+ }
8358
+ function expandInlineSourceCandidatePattern(pattern) {
8359
+ const index = pattern.indexOf("{");
8360
+ if (index === -1) return [pattern];
8361
+ const prefix = pattern.slice(0, index);
8362
+ const rest = pattern.slice(index);
8363
+ let depth = 0;
8364
+ let endIndex = -1;
8365
+ for (let index = 0; index < rest.length; index++) {
8366
+ const char = rest[index];
8367
+ if (char === "{") depth += 1;
8368
+ else if (char === "}") {
8369
+ depth -= 1;
8370
+ if (depth === 0) {
8371
+ endIndex = index;
8372
+ break;
8373
+ }
8374
+ }
8375
+ }
8376
+ if (endIndex === -1) return [pattern];
8377
+ const inner = rest.slice(1, endIndex);
8378
+ const suffix = rest.slice(endIndex + 1);
8379
+ const parts = (isSequence(inner) ? expandSequence(inner) : segmentTopLevel(inner, ",", { keepEmpty: true })).flatMap((part) => expandInlineSourceCandidatePattern(part));
8380
+ return expandInlineSourceCandidatePattern(suffix).flatMap((suffix) => parts.map((part) => `${prefix}${part}${suffix}`));
8381
+ }
8382
+ function parseSourceInlineParam(params) {
8383
+ let value = params.trim();
8384
+ const negated = value.startsWith("not ");
8385
+ if (negated) value = value.slice(4).trim();
8386
+ if (!value.startsWith("inline(") || !value.endsWith(")")) return;
8387
+ const inlineValue = value.slice(7, -1).trim();
8388
+ const match = /^(['"])([\s\S]*)\1$/.exec(inlineValue);
8389
+ if (!match) return;
8390
+ const source = match[2];
8391
+ if (source === void 0) return;
8392
+ return {
8393
+ negated,
8394
+ source
8395
+ };
8396
+ }
8397
+ function collectCssInlineSourceCandidates(root) {
8398
+ const included = /* @__PURE__ */ new Set();
8399
+ const excluded = /* @__PURE__ */ new Set();
8400
+ root.walkAtRules("source", (rule) => {
8401
+ const parsed = parseSourceInlineParam(rule.params);
8402
+ if (!parsed) return;
8403
+ const target = parsed.negated ? excluded : included;
8404
+ for (const source of segmentTopLevel(parsed.source, " ")) {
8405
+ const trimmed = source.trim();
8406
+ if (!trimmed) continue;
8407
+ for (const candidate of expandInlineSourceCandidatePattern(trimmed)) {
8408
+ const normalized = candidate.trim();
8409
+ if (normalized) target.add(normalized);
8410
+ }
8411
+ }
8412
+ });
8413
+ for (const candidate of excluded) included.delete(candidate);
8414
+ return {
8415
+ included,
8416
+ excluded
8417
+ };
8418
+ }
8419
+ //#endregion
8420
+ //#region src/source-scan.ts
8421
+ const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
8422
+ "html",
8423
+ "wxml",
8424
+ "axml",
8425
+ "jxml",
8426
+ "ksml",
8427
+ "ttml",
8428
+ "qml",
8429
+ "tyml",
8430
+ "xhsml",
8431
+ "swan",
8432
+ "vue",
8433
+ "mpx",
8434
+ "js",
8435
+ "jsx",
8436
+ "ts",
8437
+ "tsx"
8438
+ ];
8439
+ const FULL_SOURCE_SCAN_EXTENSIONS = [
8440
+ "js",
8441
+ "jsx",
8442
+ "mjs",
8443
+ "cjs",
8444
+ "ts",
8445
+ "tsx",
8446
+ "mts",
8447
+ "cts",
8448
+ "vue",
8449
+ "uvue",
8450
+ "nvue",
8451
+ "svelte",
8452
+ "mpx",
8453
+ "html",
8454
+ "wxml",
8455
+ "axml",
8456
+ "jxml",
8457
+ "ksml",
8458
+ "ttml",
8459
+ "qml",
8460
+ "tyml",
8461
+ "xhsml",
8462
+ "swan",
8463
+ "css",
8464
+ "wxss",
8465
+ "acss",
8466
+ "jxss",
8467
+ "ttss",
8468
+ "qss",
8469
+ "tyss",
8470
+ "scss",
8471
+ "sass",
8472
+ "less",
8473
+ "styl",
8474
+ "stylus"
8475
+ ];
8476
+ function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
8477
+ return `**/*.{${extensions.join(",")}}`;
8478
+ }
8479
+ createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
8480
+ new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
8481
+ function toPosixPath(value) {
8482
+ return value.split(node_path.default.sep).join("/");
8483
+ }
8484
+ function resolveSourceScanPath(value) {
8485
+ const resolved = node_path.default.resolve(value);
8486
+ try {
8487
+ return node_fs.realpathSync.native(resolved);
8488
+ } catch {
8489
+ return resolved;
8490
+ }
8491
+ }
8492
+ function normalizeEntryPattern(entry) {
8493
+ return node_path.default.isAbsolute(entry.pattern) ? toPosixPath(node_path.default.relative(resolveSourceScanPath(entry.base), entry.pattern)) : entry.pattern;
8494
+ }
8495
+ function isFileMatchedByTailwindSourceEntry(file, entry) {
8496
+ const relative = toPosixPath(node_path.default.relative(resolveSourceScanPath(entry.base), file));
8497
+ return relative && !relative.startsWith("../") && !node_path.default.isAbsolute(relative) && micromatch.default.isMatch(relative, normalizeEntryPattern(entry));
8498
+ }
8499
+ function isFileExcludedByTailwindSourceEntries(file, entries) {
8500
+ if (!entries?.length) return false;
8501
+ const resolvedFile = resolveSourceScanPath(file);
8502
+ return entries.some((entry) => entry.negated && isFileMatchedByTailwindSourceEntry(resolvedFile, entry));
8503
+ }
8504
+ function parseConfigParam(params) {
8505
+ const value = params.trim();
8506
+ return /^(['"])(.+)\1$/.exec(value)?.[2];
8507
+ }
8508
+ function isLegacyContentObject(value) {
8509
+ return typeof value === "object" && value !== null && "files" in value;
8510
+ }
8511
+ function normalizeGlobPattern(pattern) {
8512
+ return pattern.startsWith("./") ? pattern.slice(2) : pattern;
8513
+ }
8514
+ function hasGlobMagic(value) {
8515
+ return /[*?[\]{}()!+@]/.test(value);
8516
+ }
8517
+ function splitStaticGlobPrefix(pattern) {
8518
+ const segments = normalizeGlobPattern(pattern).split(/[\\/]+/);
8519
+ const prefix = [];
8520
+ const rest = [];
8521
+ let reachedGlob = false;
8522
+ for (const segment of segments) {
8523
+ if (!reachedGlob && segment && !hasGlobMagic(segment)) {
8524
+ prefix.push(segment);
8525
+ continue;
8526
+ }
8527
+ reachedGlob = true;
8528
+ rest.push(segment);
8529
+ }
8530
+ return {
8531
+ prefix,
8532
+ rest
8533
+ };
8534
+ }
8535
+ function normalizeLegacyContentEntries(content, base, options = {}) {
8536
+ if (typeof content === "string") {
8537
+ const negated = content.startsWith("!");
8538
+ return [{
8539
+ base,
8540
+ negated,
8541
+ pattern: normalizeGlobPattern(negated ? content.slice(1) : content)
8542
+ }];
8543
+ }
8544
+ if (Array.isArray(content)) return content.flatMap((item) => normalizeLegacyContentEntries(item, base, options));
8545
+ if (isLegacyContentObject(content)) return normalizeLegacyContentEntries(content.files, content.relative && options.relativeBase ? options.relativeBase : base, options);
8546
+ return [];
8547
+ }
8548
+ async function pathExistsAsDirectory(file) {
8549
+ try {
8550
+ return (await (0, node_fs_promises.stat)(file)).isDirectory();
8551
+ } catch {
8552
+ return false;
8553
+ }
8554
+ }
8555
+ async function resolveTailwindSourceEntry(sourcePath, base, negated, defaultPattern = createSourceScanPattern()) {
8556
+ const absoluteSource = node_path.default.isAbsolute(sourcePath) ? node_path.default.resolve(sourcePath) : node_path.default.resolve(base, sourcePath);
8557
+ if (await pathExistsAsDirectory(absoluteSource)) return {
8558
+ base: absoluteSource,
8559
+ negated,
8560
+ pattern: normalizeGlobPattern(defaultPattern)
8561
+ };
8562
+ if (node_path.default.isAbsolute(sourcePath)) return {
8563
+ base: node_path.default.dirname(absoluteSource),
8564
+ negated,
8565
+ pattern: normalizeGlobPattern(node_path.default.basename(absoluteSource))
8566
+ };
8567
+ const { prefix, rest } = splitStaticGlobPrefix(sourcePath);
8568
+ if (prefix.length > 0 && rest.length > 0) return {
8569
+ base: node_path.default.resolve(base, ...prefix),
8570
+ negated,
8571
+ pattern: normalizeGlobPattern(rest.join("/"))
8572
+ };
8573
+ return {
8574
+ base,
8575
+ negated,
8576
+ pattern: normalizeGlobPattern(sourcePath)
8577
+ };
8578
+ }
8579
+ function parseSourceFileParam(params) {
8580
+ const value = params.trim();
8581
+ if (!value || value === "none" || value.startsWith("inline(")) return;
8582
+ const negated = value.startsWith("not ");
8583
+ const sourceValue = negated ? value.slice(4).trim() : value;
8584
+ if (sourceValue.startsWith("inline(")) return;
8585
+ const match = /^(['"])(.+)\1$/.exec(sourceValue);
8586
+ return match?.[2] ? {
8587
+ negated,
8588
+ sourcePath: match[2]
8589
+ } : void 0;
8590
+ }
8591
+ async function resolveCssSourceEntries(root, base, defaultPattern = createSourceScanPattern()) {
8592
+ const entries = [];
8593
+ const tasks = [];
8594
+ root.walkAtRules("source", (rule) => {
8595
+ const parsed = parseSourceFileParam(rule.params);
8596
+ if (!parsed) return;
8597
+ tasks.push(resolveTailwindSourceEntry(parsed.sourcePath, base, parsed.negated, defaultPattern));
8598
+ });
8599
+ entries.push(...await Promise.all(tasks));
8600
+ return entries;
8601
+ }
8602
+ async function expandTailwindSourceEntries(entries, options = {}) {
8603
+ if (entries.length === 0) return [];
8604
+ const files = /* @__PURE__ */ new Set();
8605
+ const entriesByBase = /* @__PURE__ */ new Map();
8606
+ for (const entry of entries) {
8607
+ const base = node_path.default.resolve(entry.base);
8608
+ const group = entriesByBase.get(base) ?? [];
8609
+ group.push({
8610
+ ...entry,
8611
+ base
8612
+ });
8613
+ entriesByBase.set(base, group);
8614
+ }
8615
+ await Promise.all([...entriesByBase.entries()].map(async ([base, group]) => {
8616
+ const ignoredSources = options.ignore?.map((pattern) => ({
8617
+ base,
8618
+ pattern: normalizeGlobPattern(pattern),
8619
+ negated: true
8620
+ }));
8621
+ const matched = await (0, tailwindcss_patch.resolveProjectSourceFiles)({
8622
+ cwd: base,
8623
+ sources: group,
8624
+ ...ignoredSources === void 0 ? {} : { ignoredSources }
8625
+ });
8626
+ for (const file of matched) files.add(node_path.default.resolve(file));
8627
+ }));
8628
+ return [...files].filter((file) => !isFileExcludedByTailwindSourceEntries(file, entries));
8629
+ }
8630
+ //#endregion
8631
+ //#region src/generator-plugin/source-files.ts
8632
+ const POSTCSS_SOURCE_PATTERN = createSourceScanPattern(DEFAULT_SOURCE_SCAN_EXTENSIONS);
8633
+ function isTailwindV4ApplyOnlyCss$1(root, options) {
8634
+ return options.version === 4 && hasTailwindApplyDirective(root.toString()) && !hasTailwindRootDirectives(root, { importFallback: true });
8635
+ }
8636
+ function getSourceExtension(file) {
8637
+ return node_path.default.extname(file).slice(1) || void 0;
8638
+ }
8639
+ function collectConfigPaths(root, base) {
8640
+ const configPaths = [];
8641
+ root.walkAtRules("config", (rule) => {
8642
+ const configPath = parseConfigParam(rule.params);
8643
+ if (configPath) configPaths.push(node_path.default.isAbsolute(configPath) ? configPath : node_path.default.resolve(base, configPath));
8644
+ });
8645
+ return [...new Set(configPaths)];
8646
+ }
8647
+ function resolveOptionConfigPath(config, base) {
8648
+ if (!config) return;
8649
+ return node_path.default.isAbsolute(config) ? config : node_path.default.resolve(base, config);
8650
+ }
8651
+ async function collectConfigContentFiles(root, base, options) {
8652
+ const configPaths = [...new Set([...resolveOptionConfigPath(options.config, base) ? [resolveOptionConfigPath(options.config, base)] : [], ...collectConfigPaths(root, base)])];
8653
+ const files = [];
8654
+ for (const configPath of configPaths) {
8655
+ const contentEntries = normalizeLegacyContentEntries((await (0, tailwindcss_config.loadConfig)({
8656
+ config: configPath,
8657
+ cwd: node_path.default.dirname(configPath)
8658
+ }))?.config.content, options.version === 3 ? options.projectRoot ?? base : node_path.default.dirname(configPath), { relativeBase: node_path.default.dirname(configPath) });
8659
+ files.push(...await expandTailwindSourceEntries(contentEntries));
8660
+ }
8661
+ return {
8662
+ configPaths,
8663
+ files: [...new Set(files)]
8664
+ };
8665
+ }
8666
+ async function collectConfiguredContentEntries(root, base, options) {
8667
+ const configPath = resolveOptionConfigPath(options.generator?.config ?? options.config, base) ?? collectConfigPaths(root, base)[0];
8668
+ if (!configPath) return [];
8669
+ const resolvedConfigPath = node_path.default.isAbsolute(configPath) ? configPath : node_path.default.resolve(base, configPath);
8670
+ return normalizeLegacyContentEntries((await (0, tailwindcss_config.loadConfig)({
8671
+ config: resolvedConfigPath,
8672
+ cwd: node_path.default.dirname(resolvedConfigPath)
8673
+ }))?.config.content, options.version === 3 ? options.projectRoot ?? base : node_path.default.dirname(resolvedConfigPath), { relativeBase: node_path.default.dirname(resolvedConfigPath) });
8674
+ }
8675
+ async function collectRawCandidatesFromSourceEntries(sourceEntries) {
8676
+ const candidates = /* @__PURE__ */ new Set();
8677
+ const files = await expandTailwindSourceEntries(sourceEntries);
8678
+ await Promise.all(files.map(async (file) => {
8679
+ const matches = await (0, tailwindcss_patch.extractRawCandidatesWithPositions)(await (0, node_fs_promises.readFile)(file, "utf8"), getSourceExtension(file));
8680
+ for (const match of matches) {
8681
+ const candidate = match?.rawCandidate;
8682
+ if (typeof candidate === "string" && candidate.length > 0) candidates.add(candidate);
8683
+ }
8684
+ }));
8685
+ return candidates;
8686
+ }
8687
+ async function collectAutoTailwindCandidates(root, result, options) {
8688
+ if (options.scanSources === false) return /* @__PURE__ */ new Set();
8689
+ const base = resolvePostcssBase(result, options);
8690
+ const projectRoot = resolvePostcssProjectRoot(result, options);
8691
+ const sourceEntries = [];
8692
+ const hasSourceNone = root.toString().includes("source(none)");
8693
+ const shouldSkipAutoScan = isTailwindV4ApplyOnlyCss$1(root, options);
8694
+ const inlineCandidates = collectCssInlineSourceCandidates(root);
8695
+ const configuredContentEntries = options.version === 3 ? await collectConfiguredContentEntries(root, base, options) : [];
8696
+ if (configuredContentEntries.length > 0) sourceEntries.push(...configuredContentEntries);
8697
+ else if (!hasSourceNone && !shouldSkipAutoScan) sourceEntries.push({
8698
+ base,
8699
+ negated: false,
8700
+ pattern: POSTCSS_SOURCE_PATTERN
8701
+ });
8702
+ sourceEntries.push(...await resolveCssSourceEntries(root, base, POSTCSS_SOURCE_PATTERN));
8703
+ const candidates = sourceEntries.length === 0 ? [] : options.version === 3 ? await collectRawCandidatesFromSourceEntries(sourceEntries) : await (0, tailwindcss_patch.extractValidCandidates)({
8704
+ base,
8705
+ css: root.toString(),
8706
+ cwd: projectRoot,
8707
+ sources: sourceEntries
8708
+ });
8709
+ return new Set([...[...candidates].filter((candidate) => !inlineCandidates.excluded.has(candidate)), ...inlineCandidates.included]);
8710
+ }
8711
+ async function collectPostcssLocalSources(root, result, options) {
8712
+ const base = resolvePostcssBase(result, options);
8713
+ const sourceEntries = await resolveCssSourceEntries(root, base, POSTCSS_SOURCE_PATTERN);
8714
+ const configContentFiles = await collectConfigContentFiles(root, base, options);
8715
+ const files = [...new Set([...await expandTailwindSourceEntries(sourceEntries), ...configContentFiles.files])];
8716
+ const sources = await Promise.all(files.map(async (file) => {
8717
+ const extension = getSourceExtension(file);
8718
+ return {
8719
+ content: await (0, node_fs_promises.readFile)(file, "utf8"),
8720
+ ...extension === void 0 ? {} : { extension }
8721
+ };
8722
+ }));
8723
+ return {
8724
+ files: [...files, ...configContentFiles.configPaths],
8725
+ sources
8726
+ };
8727
+ }
8728
+ //#endregion
8729
+ //#region src/generator-plugin/package-version.ts
8730
+ function normalizeSupportedTailwindcssMajorVersion(version) {
8731
+ return version === 3 || version === 4 ? version : void 0;
8732
+ }
8733
+ function readPackageJson(packageJsonPath) {
8734
+ try {
8735
+ return JSON.parse((0, node_fs.readFileSync)(packageJsonPath, "utf8"));
8736
+ } catch {
8737
+ return;
8738
+ }
8739
+ }
8740
+ function readDeclaredPackageVersion(packageName, pkg) {
8741
+ return pkg?.dependencies?.[packageName] ?? pkg?.devDependencies?.[packageName] ?? pkg?.peerDependencies?.[packageName] ?? pkg?.optionalDependencies?.[packageName];
8742
+ }
8743
+ function findPackageJsonDeclaringPackage(packageName, base) {
8744
+ let current = node_path.default.resolve(base);
8745
+ while (true) {
8746
+ const pkgPath = node_path.default.join(current, "package.json");
8747
+ if ((0, node_fs.existsSync)(pkgPath)) {
8748
+ const pkg = readPackageJson(pkgPath);
8749
+ if (readDeclaredPackageVersion(packageName, pkg)) return pkgPath;
8750
+ if (pkg?.name !== "weapp-tailwindcss") return;
8751
+ }
8752
+ const parent = node_path.default.dirname(current);
8753
+ if (parent === current) return;
8754
+ current = parent;
8755
+ }
8756
+ }
8757
+ function readDeclaredPackageMajorVersion(version) {
8758
+ const match = version?.match(/(?:^|\D)([34])(?:\.|\b)/);
8759
+ return normalizeSupportedTailwindcssMajorVersion(match ? Number(match[1]) : void 0);
8760
+ }
8761
+ function readInstalledPackageMajorVersion(packageName, base) {
8762
+ const packageJsonPath = findPackageJsonDeclaringPackage(packageName, base);
8763
+ if (!packageJsonPath) return;
8764
+ const declaredVersion = readDeclaredPackageVersion(packageName, readPackageJson(packageJsonPath));
8765
+ if (!declaredVersion) return;
8766
+ try {
8767
+ const pkg = (0, node_module.createRequire)(packageJsonPath)(`${packageName}/package.json`);
8768
+ return normalizeSupportedTailwindcssMajorVersion(Number(pkg.version?.split(".")[0]));
8769
+ } catch {
8770
+ return readDeclaredPackageMajorVersion(declaredVersion);
8771
+ }
8772
+ }
8773
+ //#endregion
8774
+ //#region src/generator-plugin/tailwind-version.ts
8775
+ function hasTailwindV4CssSyntax(root) {
8776
+ let hasV4Syntax = false;
8777
+ root.walkAtRules((rule) => {
8778
+ if (rule.name === "theme" || rule.name === "source" || rule.name === "custom-variant") hasV4Syntax = true;
8779
+ if (rule.name === "import" && /(['"])tailwindcss\1/.test(rule.params)) hasV4Syntax = true;
8780
+ });
8781
+ return hasV4Syntax;
8782
+ }
8783
+ function resolvePostcssTailwindVersion(root, result, options) {
8784
+ if (options.version) return options.version;
8785
+ const packageName = options.packageName ?? "tailwindcss";
8786
+ const installedVersion = readInstalledPackageMajorVersion(packageName, resolvePostcssProjectRoot(result, options));
8787
+ if (installedVersion) return installedVersion;
8788
+ if (packageName === "@tailwindcss/postcss" || packageName.includes("tailwindcss4")) return 4;
8789
+ if (packageName.includes("tailwindcss3")) return 3;
8790
+ if (hasTailwindV4CssSyntax(root)) return 4;
8791
+ return 4;
8792
+ }
8793
+ //#endregion
8794
+ //#region src/generator-plugin/index.ts
8795
+ const PLUGIN_NAME = "weapp-tailwindcss";
8796
+ function isTailwindV4ApplyOnlyCss(css, root) {
8797
+ return hasTailwindApplyDirective(css) && !hasTailwindRootDirectives(root, { importFallback: true });
8798
+ }
8799
+ function resolveTailwindV4PostcssSourceCss(css, sourceOptions, root) {
8800
+ return isTailwindV4ApplyOnlyCss(css, root) ? `@import "${sourceOptions.packageName ?? "tailwindcss"}" source(none);\n${css}` : css;
8801
+ }
8802
+ function normalizeSelector$1(selector) {
8803
+ return selector.replace(/:not\(#\\#\)/g, "").trim();
8804
+ }
8805
+ function collectApplyOnlyCssSelectors(css) {
8806
+ const selectors = /* @__PURE__ */ new Set();
8807
+ try {
8808
+ postcss.default.parse(css).walkRules((rule) => {
8809
+ if (!rule.nodes?.some((node) => node.type === "atrule" && node.name === "apply")) return;
8810
+ for (const selector of rule.selectors ?? [rule.selector]) {
8811
+ const normalized = normalizeSelector$1(selector);
8812
+ if (normalized) selectors.add(normalized);
8813
+ }
8814
+ });
8815
+ } catch {}
8816
+ return selectors;
8817
+ }
8818
+ function ruleMatchesApplyOnlySelector(rule, selectors) {
8819
+ return (rule.selectors ?? [rule.selector]).some((selector) => selectors.has(normalizeSelector$1(selector)));
8820
+ }
8821
+ function filterApplyOnlyGeneratedCss(css, rawCss) {
8822
+ const selectors = collectApplyOnlyCssSelectors(rawCss);
8823
+ if (selectors.size === 0) return css;
8824
+ try {
8825
+ const root = postcss.default.parse(css);
8826
+ root.walkRules((rule) => {
8827
+ if (!ruleMatchesApplyOnlySelector(rule, selectors) && !rule.nodes?.some((node) => node.type === "decl" && node.prop.startsWith("--"))) rule.remove();
8828
+ });
8829
+ root.walkAtRules((rule) => {
8830
+ if (rule.nodes !== void 0 && rule.nodes.length === 0) rule.remove();
8831
+ });
8832
+ return root.toString();
8833
+ } catch {
8834
+ return css;
8835
+ }
8836
+ }
8837
+ function createWeappTailwindcssPostcssPlugin(adapters) {
8838
+ const plugin = (options = {}) => {
8839
+ return {
8840
+ postcssPlugin: PLUGIN_NAME,
8841
+ async Once(root, { result }) {
8842
+ const { candidates, generator: userGeneratorOptions, scanSources, sources, styleOptions, ...sourceOptions } = options;
8843
+ const generatorOptions = adapters.normalizeGeneratorOptions(userGeneratorOptions);
8844
+ const tailwindVersion = resolvePostcssTailwindVersion(root, result, options);
8845
+ const [collectedSources, autoCandidates] = await Promise.all([collectPostcssLocalSources(root, result, options), collectAutoTailwindCandidates(root, result, options)]);
8846
+ const generatorConfig = generatorOptions.config ?? options.config;
8847
+ const rawCss = sourceOptions.css ?? root.toString();
8848
+ const isApplyOnlyTailwindV4Css = tailwindVersion === 4 && isTailwindV4ApplyOnlyCss(rawCss, root);
8849
+ const source = tailwindVersion === 3 ? await adapters.resolveTailwindV3Source({
8850
+ config: generatorConfig,
8851
+ css: rawCss,
8852
+ base: resolvePostcssBase(result, options),
8853
+ cwd: resolvePostcssProjectRoot(result, options),
8854
+ projectRoot: resolvePostcssProjectRoot(result, options),
8855
+ packageName: options.packageName,
8856
+ postcssPlugin: options.postcssPlugin
8857
+ }) : await adapters.resolveTailwindV4Source({
8858
+ ...sourceOptions,
8859
+ css: prependConfigDirective(resolveTailwindV4PostcssSourceCss(rawCss, sourceOptions, root), generatorConfig),
8860
+ base: resolvePostcssBase(result, options),
8861
+ projectRoot: resolvePostcssProjectRoot(result, options)
8862
+ });
8863
+ const generated = await adapters.createGenerator(source).generate({
8864
+ candidates: new Set([...autoCandidates, ...candidates ?? []]),
8865
+ scanSources: scanSources ?? false,
8866
+ sources: [...collectedSources.sources, ...sources ?? []],
8867
+ styleOptions: {
8868
+ ...generatorOptions.styleOptions,
8869
+ ...styleOptions
8870
+ },
8871
+ tailwindcssV3Compatibility: generatorOptions.tailwindcssV3Compatibility,
8872
+ target: generatorOptions.target
8873
+ });
8874
+ replaceRootCss(root, isApplyOnlyTailwindV4Css ? filterApplyOnlyGeneratedCss(generated.css, rawCss) : generated.css, result);
8875
+ addDependencyMessages(result, generated);
8876
+ addSourceDependencyMessages(result, collectedSources.files);
8877
+ result.messages.push({
8878
+ type: "weapp-tailwindcss:generated",
8879
+ plugin: PLUGIN_NAME,
8880
+ target: generated.target,
8881
+ classSet: generated.classSet,
8882
+ rawCss: generated.rawCss
8883
+ });
8884
+ }
8885
+ };
8886
+ };
8887
+ plugin.postcss = true;
8888
+ return plugin;
8889
+ }
8890
+ //#endregion
7936
8891
  //#region src/compat/uni-app-x.ts
7937
8892
  const UNI_APP_X_BASE_CARRIER_SELECTORS = new Set([
7938
8893
  "*",
@@ -39808,7 +40763,7 @@ const e$35 = /^\s?initial\s?$/i, n$11 = /^font$/i, r$10 = /^all$/i, i$10 = [
39808
40763
  "font-weight",
39809
40764
  "font-stretch",
39810
40765
  "line-height"
39811
- ], creator$51 = (a) => {
40766
+ ], creator$52 = (a) => {
39812
40767
  const l = Object.assign({ preserve: !0 }, a);
39813
40768
  return {
39814
40769
  postcssPlugin: "postcss-initial",
@@ -39828,7 +40783,7 @@ const e$35 = /^\s?initial\s?$/i, n$11 = /^font$/i, r$10 = /^all$/i, i$10 = [
39828
40783
  }
39829
40784
  };
39830
40785
  };
39831
- creator$51.postcss = !0;
40786
+ creator$52.postcss = !0;
39832
40787
  //#endregion
39833
40788
  //#region ../../node_modules/.pnpm/@csstools+postcss-progressive-custom-properties@5.1.0_postcss@8.5.15/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs
39834
40789
  const a$6 = [
@@ -42807,7 +43762,7 @@ function conditionsFromValue(a, t = !1) {
42807
43762
  } catch {}
42808
43763
  return t && !y ? { support: [] } : { support: Array.from(new Set(o)).sort() };
42809
43764
  }
42810
- const t$16 = /var\(/i, i$9 = /^initial$/i, o$24 = /^\s*$/, creator$50 = () => ({
43765
+ const t$16 = /var\(/i, i$9 = /^initial$/i, o$24 = /^\s*$/, creator$51 = () => ({
42811
43766
  postcssPlugin: "postcss-progressive-custom-properties",
42812
43767
  prepare() {
42813
43768
  const e = /* @__PURE__ */ new WeakMap();
@@ -42860,7 +43815,7 @@ const t$16 = /var\(/i, i$9 = /^initial$/i, o$24 = /^\s*$/, creator$50 = () => ({
42860
43815
  };
42861
43816
  }
42862
43817
  });
42863
- creator$50.postcss = !0;
43818
+ creator$51.postcss = !0;
42864
43819
  //#endregion
42865
43820
  //#region ../../node_modules/.pnpm/@csstools+utilities@3.0.0_postcss@8.5.15/node_modules/@csstools/utilities/dist/index.mjs
42866
43821
  function hasFallback$1(e) {
@@ -43101,7 +44056,7 @@ const postcssPlugin$16 = (o) => {
43101
44056
  }, o);
43102
44057
  return r.enableProgressiveCustomProperties && r.preserve ? {
43103
44058
  postcssPlugin: "postcss-color-function",
43104
- plugins: [creator$50(), basePlugin$16(r)]
44059
+ plugins: [creator$51(), basePlugin$16(r)]
43105
44060
  } : basePlugin$16(r);
43106
44061
  };
43107
44062
  postcssPlugin$16.postcss = !0;
@@ -43177,7 +44132,7 @@ function insertNode(t, s, n) {
43177
44132
  t.insertAfter(t.at(r), n);
43178
44133
  } else t.insertBefore(t.at(r), n);
43179
44134
  }
43180
- const creator$49 = (e) => {
44135
+ const creator$50 = (e) => {
43181
44136
  const t = {
43182
44137
  preserve: e?.preserve ?? !0,
43183
44138
  subFeatures: { areaHrefNeedsFixing: e?.subFeatures?.areaHrefNeedsFixing ?? !1 }
@@ -43198,7 +44153,7 @@ const creator$49 = (e) => {
43198
44153
  }
43199
44154
  };
43200
44155
  };
43201
- creator$49.postcss = !0;
44156
+ creator$50.postcss = !0;
43202
44157
  //#endregion
43203
44158
  //#region ../../node_modules/.pnpm/css-blank-pseudo@8.0.1_postcss@8.5.15/node_modules/css-blank-pseudo/dist/index.mjs
43204
44159
  const s$14 = [
@@ -43217,7 +44172,7 @@ function isValidReplacement$1(e) {
43217
44172
  for (let t = 0, o = s$14.length; t < o && n; t++) e.indexOf(s$14[t]) > -1 && (n = !1);
43218
44173
  return n;
43219
44174
  }
43220
- const n$9 = "js-blank-pseudo", t$14 = ":blank", creator$48 = (s) => {
44175
+ const n$9 = "js-blank-pseudo", t$14 = ":blank", creator$49 = (s) => {
43221
44176
  const o = Object.assign({
43222
44177
  preserve: !0,
43223
44178
  replaceWith: "[blank]",
@@ -43273,7 +44228,7 @@ const n$9 = "js-blank-pseudo", t$14 = ":blank", creator$48 = (s) => {
43273
44228
  }
43274
44229
  };
43275
44230
  };
43276
- creator$48.postcss = !0;
44231
+ creator$49.postcss = !0;
43277
44232
  //#endregion
43278
44233
  //#region ../../node_modules/.pnpm/postcss-page-break@3.0.4_postcss@8.5.15/node_modules/postcss-page-break/index.js
43279
44234
  var require_postcss_page_break = /* @__PURE__ */ require_html_transform.__commonJSMin(((exports, module) => {
@@ -43693,7 +44648,7 @@ function splitImportantStyles(e) {
43693
44648
  }), r.before(t), removeEmptyDescendantBlocks(r);
43694
44649
  });
43695
44650
  }
43696
- const creator$47 = (a) => {
44651
+ const creator$48 = (a) => {
43697
44652
  const s = Object.assign({
43698
44653
  onRevertLayerKeyword: "warn",
43699
44654
  onConditionalRulesChangingLayerOrder: "warn",
@@ -43747,7 +44702,7 @@ const creator$47 = (a) => {
43747
44702
  }
43748
44703
  };
43749
44704
  };
43750
- creator$47.postcss = !0;
44705
+ creator$48.postcss = !0;
43751
44706
  //#endregion
43752
44707
  //#region ../../node_modules/.pnpm/postcss-attribute-case-insensitive@8.0.0_postcss@8.5.15/node_modules/postcss-attribute-case-insensitive/dist/index.mjs
43753
44708
  function nodeIsInsensitiveAttribute(e) {
@@ -43792,7 +44747,7 @@ function createNewSelectors(t) {
43792
44747
  }), s = n;
43793
44748
  }), s;
43794
44749
  }
43795
- const creator$46 = (t) => {
44750
+ const creator$47 = (t) => {
43796
44751
  const s = Object.assign({ preserve: !1 }, t);
43797
44752
  return {
43798
44753
  postcssPlugin: "postcss-attribute-case-insensitive",
@@ -43821,7 +44776,7 @@ const creator$46 = (t) => {
43821
44776
  }
43822
44777
  };
43823
44778
  };
43824
- creator$46.postcss = !0;
44779
+ creator$47.postcss = !0;
43825
44780
  //#endregion
43826
44781
  //#region ../../node_modules/.pnpm/postcss-clamp@4.1.0_postcss@8.5.15/node_modules/postcss-clamp/index.js
43827
44782
  var require_postcss_clamp = /* @__PURE__ */ require_html_transform.__commonJSMin(((exports, module) => {
@@ -43926,7 +44881,7 @@ const postcssPlugin$15 = (o) => {
43926
44881
  }, o);
43927
44882
  return e.enableProgressiveCustomProperties && e.preserve ? {
43928
44883
  postcssPlugin: "postcss-color-function",
43929
- plugins: [creator$50(), basePlugin$15(e)]
44884
+ plugins: [creator$51(), basePlugin$15(e)]
43930
44885
  } : basePlugin$15(e);
43931
44886
  };
43932
44887
  postcssPlugin$15.postcss = !0;
@@ -43955,7 +44910,7 @@ const postcssPlugin$14 = (o) => {
43955
44910
  }, o);
43956
44911
  return r.enableProgressiveCustomProperties && r.preserve ? {
43957
44912
  postcssPlugin: "postcss-color-function-display-p3-linear",
43958
- plugins: [creator$50(), basePlugin$14(r)]
44913
+ plugins: [creator$51(), basePlugin$14(r)]
43959
44914
  } : basePlugin$14(r);
43960
44915
  };
43961
44916
  postcssPlugin$14.postcss = !0;
@@ -43984,7 +44939,7 @@ const postcssPlugin$13 = (o) => {
43984
44939
  }, o);
43985
44940
  return t.enableProgressiveCustomProperties && t.preserve ? {
43986
44941
  postcssPlugin: "postcss-color-functional-notation",
43987
- plugins: [creator$50(), basePlugin$13(t)]
44942
+ plugins: [creator$51(), basePlugin$13(t)]
43988
44943
  } : basePlugin$13(t);
43989
44944
  };
43990
44945
  postcssPlugin$13.postcss = !0;
@@ -44020,7 +44975,7 @@ const postcssPlugin$12 = (e) => {
44020
44975
  }, e);
44021
44976
  return r.subFeatures = Object.assign({ displayP3: !0 }, r.subFeatures), r.enableProgressiveCustomProperties && (r.preserve || r.subFeatures.displayP3) ? {
44022
44977
  postcssPlugin: "postcss-color-mix-function",
44023
- plugins: [creator$50(), basePlugin$12(r)]
44978
+ plugins: [creator$51(), basePlugin$12(r)]
44024
44979
  } : basePlugin$12(r);
44025
44980
  };
44026
44981
  postcssPlugin$12.postcss = !0;
@@ -44056,13 +45011,13 @@ const postcssPlugin$11 = (e) => {
44056
45011
  }, e);
44057
45012
  return r.subFeatures = Object.assign({ displayP3: !0 }, r.subFeatures), r.enableProgressiveCustomProperties && (r.preserve || r.subFeatures.displayP3) ? {
44058
45013
  postcssPlugin: "color-mix-variadic-function-arguments",
44059
- plugins: [creator$50(), basePlugin$11(r)]
45014
+ plugins: [creator$51(), basePlugin$11(r)]
44060
45015
  } : basePlugin$11(r);
44061
45016
  };
44062
45017
  postcssPlugin$11.postcss = !0;
44063
45018
  //#endregion
44064
45019
  //#region ../../node_modules/.pnpm/@csstools+postcss-container-rule-prelude-list@1.0.1_postcss@8.5.15/node_modules/@csstools/postcss-container-rule-prelude-list/dist/index.mjs
44065
- const t$12 = /^container$/i, creator$45 = (o) => {
45020
+ const t$12 = /^container$/i, creator$46 = (o) => {
44066
45021
  const a = Object.assign({ preserve: !1 }, o);
44067
45022
  return {
44068
45023
  postcssPlugin: "postcss-container-rule-prelude-list",
@@ -44076,7 +45031,7 @@ const t$12 = /^container$/i, creator$45 = (o) => {
44076
45031
  }
44077
45032
  };
44078
45033
  };
44079
- creator$45.postcss = !0;
45034
+ creator$46.postcss = !0;
44080
45035
  //#endregion
44081
45036
  //#region ../../node_modules/.pnpm/@csstools+postcss-content-alt-text@3.0.1_postcss@8.5.15/node_modules/@csstools/postcss-content-alt-text/dist/index.mjs
44082
45037
  function transform$3(s, t) {
@@ -44110,7 +45065,7 @@ const p$2 = { test: (s) => s.includes("content:") && s.includes("/") }, basePlug
44110
45065
  }
44111
45066
  });
44112
45067
  basePlugin$10.postcss = !0;
44113
- const creator$44 = (t) => {
45068
+ const creator$45 = (t) => {
44114
45069
  const e = Object.assign({
44115
45070
  enableProgressiveCustomProperties: !0,
44116
45071
  preserve: !0,
@@ -44118,10 +45073,10 @@ const creator$44 = (t) => {
44118
45073
  }, t);
44119
45074
  return e.enableProgressiveCustomProperties && e.preserve ? {
44120
45075
  postcssPlugin: "postcss-content-alt-text",
44121
- plugins: [creator$50(), basePlugin$10(e)]
45076
+ plugins: [creator$51(), basePlugin$10(e)]
44122
45077
  } : basePlugin$10(e);
44123
45078
  };
44124
- creator$44.postcss = !0;
45079
+ creator$45.postcss = !0;
44125
45080
  //#endregion
44126
45081
  //#region ../../node_modules/.pnpm/@csstools+postcss-contrast-color-function@3.0.4_postcss@8.5.15/node_modules/@csstools/postcss-contrast-color-function/dist/index.mjs
44127
45082
  const u$6 = /\bcontrast-color\(/i, m$4 = /^contrast-color$/i, basePlugin$9 = (s) => ({
@@ -44150,7 +45105,7 @@ const postcssPlugin$10 = (o) => {
44150
45105
  }, o);
44151
45106
  return r.enableProgressiveCustomProperties && r.preserve ? {
44152
45107
  postcssPlugin: "postcss-contrast-color-function",
44153
- plugins: [creator$50(), basePlugin$9(r)]
45108
+ plugins: [creator$51(), basePlugin$9(r)]
44154
45109
  } : basePlugin$9(r);
44155
45110
  };
44156
45111
  postcssPlugin$10.postcss = !0;
@@ -46425,7 +47380,7 @@ function mediaQueryIsSimple(e) {
46425
47380
  if (isMediaAnd(e.node) || isMediaOr(e.node) || isMediaNot(e.node) || isMediaConditionList(e.node) || isGeneralEnclosed(e.node)) return r = !1, !1;
46426
47381
  }), r;
46427
47382
  }
46428
- const creator$43 = (e) => {
47383
+ const creator$44 = (e) => {
46429
47384
  const r = e?.preserve ?? !1;
46430
47385
  if ("importFrom" in Object(e)) throw new Error("[postcss-custom-media] \"importFrom\" is no longer supported");
46431
47386
  if ("exportTo" in Object(e)) throw new Error("[postcss-custom-media] \"exportTo\" is no longer supported");
@@ -46479,7 +47434,7 @@ const creator$43 = (e) => {
46479
47434
  }
46480
47435
  };
46481
47436
  };
46482
- creator$43.postcss = !0;
47437
+ creator$44.postcss = !0;
46483
47438
  //#endregion
46484
47439
  //#region ../../node_modules/.pnpm/postcss-custom-properties@15.0.1_postcss@8.5.15/node_modules/postcss-custom-properties/dist/index.mjs
46485
47440
  const o$21 = parse$1("csstools-implicit-layer")[0];
@@ -46766,7 +47721,7 @@ function parentHasExactFallback(e, t) {
46766
47721
  const n = e.parent.index(e);
46767
47722
  return e.parent.each((o, s) => o !== e && !(s >= n) && void ("decl" === o.type && o.prop.toLowerCase() === e.prop.toLowerCase() && o.value === t && (r = !0))), r;
46768
47723
  }
46769
- const g$4 = /\bvar\(|\(top: var\(--f\)/i, creator$42 = (e) => {
47724
+ const g$4 = /\bvar\(|\(top: var\(--f\)/i, creator$43 = (e) => {
46770
47725
  const t = !("preserve" in Object(e)) || Boolean(e?.preserve);
46771
47726
  if ("importFrom" in Object(e)) throw new Error("[postcss-custom-properties] \"importFrom\" is no longer supported");
46772
47727
  if ("exportTo" in Object(e)) throw new Error("[postcss-custom-properties] \"exportTo\" is no longer supported");
@@ -46790,7 +47745,7 @@ const g$4 = /\bvar\(|\(top: var\(--f\)/i, creator$42 = (e) => {
46790
47745
  }
46791
47746
  };
46792
47747
  };
46793
- creator$42.postcss = !0;
47748
+ creator$43.postcss = !0;
46794
47749
  //#endregion
46795
47750
  //#region ../../node_modules/.pnpm/postcss-custom-selectors@9.0.1_postcss@8.5.15/node_modules/postcss-custom-selectors/dist/index.mjs
46796
47751
  const s$11 = parse$1("csstools-implicit-layer")[0];
@@ -46902,7 +47857,7 @@ function transformRule(r, t, s) {
46902
47857
  }
46903
47858
  return o;
46904
47859
  }
46905
- const creator$41 = (e) => {
47860
+ const creator$42 = (e) => {
46906
47861
  const r = e?.preserve ?? !1;
46907
47862
  if ("importFrom" in Object(e)) throw new Error("[postcss-custom-selectors] \"importFrom\" is no longer supported");
46908
47863
  if ("exportTo" in Object(e)) throw new Error("[postcss-custom-selectors] \"exportTo\" is no longer supported");
@@ -46926,10 +47881,10 @@ const creator$41 = (e) => {
46926
47881
  }
46927
47882
  };
46928
47883
  };
46929
- creator$41.postcss = !0;
47884
+ creator$42.postcss = !0;
46930
47885
  //#endregion
46931
47886
  //#region ../../node_modules/.pnpm/postcss-dir-pseudo-class@10.0.0_postcss@8.5.15/node_modules/postcss-dir-pseudo-class/dist/index.mjs
46932
- const creator$40 = (t) => {
47887
+ const creator$41 = (t) => {
46933
47888
  const r = Object.assign({
46934
47889
  dir: null,
46935
47890
  preserve: !1,
@@ -46997,7 +47952,7 @@ const creator$40 = (t) => {
46997
47952
  }
46998
47953
  };
46999
47954
  };
47000
- creator$40.postcss = !0;
47955
+ creator$41.postcss = !0;
47001
47956
  //#endregion
47002
47957
  //#region ../../node_modules/.pnpm/@csstools+postcss-normalize-display-values@5.0.1_postcss@8.5.15/node_modules/@csstools/postcss-normalize-display-values/dist/index.mjs
47003
47958
  var l$5 = new Map([
@@ -47051,7 +48006,7 @@ function transform$2(e) {
47051
48006
  if (n.length <= 1) return e;
47052
48007
  return l$5.get(n.join(",")) || e;
47053
48008
  }
47054
- const e$26 = /^display$/i, t$11 = /\b\s\b/, creator$39 = (i) => {
48009
+ const e$26 = /^display$/i, t$11 = /\b\s\b/, creator$40 = (i) => {
47055
48010
  const l = !("preserve" in Object(i)) || Boolean(i?.preserve);
47056
48011
  return {
47057
48012
  postcssPlugin: "postcss-normalize-display-values",
@@ -47065,7 +48020,7 @@ const e$26 = /^display$/i, t$11 = /\b\s\b/, creator$39 = (i) => {
47065
48020
  }
47066
48021
  };
47067
48022
  };
47068
- creator$39.postcss = !0;
48023
+ creator$40.postcss = !0;
47069
48024
  //#endregion
47070
48025
  //#region ../../node_modules/.pnpm/postcss-double-position-gradients@7.0.1_postcss@8.5.15/node_modules/postcss-double-position-gradients/dist/index.mjs
47071
48026
  const o$19 = /(?:repeating-)?(?:conic|linear|radial)-gradient\(/i, i$5 = /^(?:repeating-)?(?:conic|linear|radial)-gradient$/i, n$7 = [
@@ -47141,13 +48096,13 @@ const postcssPlugin$9 = (t) => {
47141
48096
  }, t);
47142
48097
  return s.enableProgressiveCustomProperties && s.preserve ? {
47143
48098
  postcssPlugin: "postcss-double-position-gradients",
47144
- plugins: [creator$50(), basePlugin$8(s)]
48099
+ plugins: [creator$51(), basePlugin$8(s)]
47145
48100
  } : basePlugin$8(s);
47146
48101
  };
47147
48102
  postcssPlugin$9.postcss = !0;
47148
48103
  //#endregion
47149
48104
  //#region ../../node_modules/.pnpm/@csstools+postcss-exponential-functions@3.0.3_postcss@8.5.15/node_modules/@csstools/postcss-exponential-functions/dist/index.mjs
47150
- const s$10 = /(?<![-\w])(?:exp|hypot|log|pow|sqrt)\(/i, creator$38 = (o) => {
48105
+ const s$10 = /(?<![-\w])(?:exp|hypot|log|pow|sqrt)\(/i, creator$39 = (o) => {
47151
48106
  const t = Object.assign({ preserve: !1 }, o);
47152
48107
  return {
47153
48108
  postcssPlugin: "postcss-exponential-functions",
@@ -47158,7 +48113,7 @@ const s$10 = /(?<![-\w])(?:exp|hypot|log|pow|sqrt)\(/i, creator$38 = (o) => {
47158
48113
  }
47159
48114
  };
47160
48115
  };
47161
- creator$38.postcss = !0;
48116
+ creator$39.postcss = !0;
47162
48117
  //#endregion
47163
48118
  //#region ../../node_modules/.pnpm/@csstools+postcss-logical-float-and-clear@4.0.0_postcss@8.5.15/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.mjs
47164
48119
  const t$9 = "inline-start", o$18 = "inline-end";
@@ -47182,7 +48137,7 @@ function cloneDeclaration$2(t, o, e) {
47182
48137
  })(e$25 || (e$25 = {})), function(t) {
47183
48138
  t.Top = "top", t.Right = "right", t.Bottom = "bottom", t.Left = "left";
47184
48139
  }(n$6 || (n$6 = {}));
47185
- const creator$37 = (n) => {
48140
+ const creator$38 = (n) => {
47186
48141
  const i = Object.assign({ inlineDirection: e$25.LeftToRight }, n), c = Object.values(e$25);
47187
48142
  if (!c.includes(i.inlineDirection)) throw new Error(`[postcss-logical-float-and-clear] "inlineDirection" must be one of ${c.join(", ")}`);
47188
48143
  if (![e$25.LeftToRight, e$25.RightToLeft].includes(i.inlineDirection)) return {
@@ -47202,10 +48157,10 @@ const creator$37 = (n) => {
47202
48157
  }
47203
48158
  };
47204
48159
  };
47205
- creator$37.postcss = !0;
48160
+ creator$38.postcss = !0;
47206
48161
  //#endregion
47207
48162
  //#region ../../node_modules/.pnpm/postcss-focus-visible@11.0.0_postcss@8.5.15/node_modules/postcss-focus-visible/dist/index.mjs
47208
- const s$9 = "js-focus-visible", o$17 = ":focus-visible", creator$36 = (t) => {
48163
+ const s$9 = "js-focus-visible", o$17 = ":focus-visible", creator$37 = (t) => {
47209
48164
  const r = Object.assign({
47210
48165
  preserve: !0,
47211
48166
  replaceWith: ".focus-visible",
@@ -47256,7 +48211,7 @@ const s$9 = "js-focus-visible", o$17 = ":focus-visible", creator$36 = (t) => {
47256
48211
  }
47257
48212
  };
47258
48213
  };
47259
- creator$36.postcss = !0;
48214
+ creator$37.postcss = !0;
47260
48215
  //#endregion
47261
48216
  //#region ../../node_modules/.pnpm/postcss-focus-within@10.0.0_postcss@8.5.15/node_modules/postcss-focus-within/dist/index.mjs
47262
48217
  const s$8 = [
@@ -47275,7 +48230,7 @@ function isValidReplacement(e) {
47275
48230
  for (let n = 0, o = s$8.length; n < o && t; n++) e.indexOf(s$8[n]) > -1 && (t = !1);
47276
48231
  return t;
47277
48232
  }
47278
- const t$8 = "js-focus-within", n$5 = ":focus-within", creator$35 = (s) => {
48233
+ const t$8 = "js-focus-within", n$5 = ":focus-within", creator$36 = (s) => {
47279
48234
  const o = Object.assign({
47280
48235
  preserve: !0,
47281
48236
  replaceWith: "[focus-within]",
@@ -47331,7 +48286,7 @@ const t$8 = "js-focus-within", n$5 = ":focus-within", creator$35 = (s) => {
47331
48286
  }
47332
48287
  };
47333
48288
  };
47334
- creator$35.postcss = !0;
48289
+ creator$36.postcss = !0;
47335
48290
  //#endregion
47336
48291
  //#region ../../node_modules/.pnpm/@csstools+postcss-font-format-keywords@5.0.0_postcss@8.5.15/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs
47337
48292
  const t$7 = [
@@ -47342,7 +48297,7 @@ const t$7 = [
47342
48297
  "embedded-opentype",
47343
48298
  "collection",
47344
48299
  "svg"
47345
- ], creator$34 = (r) => {
48300
+ ], creator$35 = (r) => {
47346
48301
  const s = "preserve" in Object(r) && Boolean(r?.preserve);
47347
48302
  return {
47348
48303
  postcssPlugin: "postcss-font-format-keywords",
@@ -47366,7 +48321,7 @@ const t$7 = [
47366
48321
  }
47367
48322
  };
47368
48323
  };
47369
- creator$34.postcss = !0;
48324
+ creator$35.postcss = !0;
47370
48325
  //#endregion
47371
48326
  //#region ../../node_modules/.pnpm/postcss-font-variant@5.0.0_postcss@8.5.15/node_modules/postcss-font-variant/index.js
47372
48327
  var require_postcss_font_variant = /* @__PURE__ */ require_html_transform.__commonJSMin(((exports, module) => {
@@ -47465,7 +48420,7 @@ var require_postcss_font_variant = /* @__PURE__ */ require_html_transform.__comm
47465
48420
  //#endregion
47466
48421
  //#region ../../node_modules/.pnpm/@csstools+postcss-font-width-property@1.0.0_postcss@8.5.15/node_modules/@csstools/postcss-font-width-property/dist/index.mjs
47467
48422
  var import_postcss_font_variant = /* @__PURE__ */ require_html_transform.__toESM(require_postcss_font_variant(), 1);
47468
- const e$21 = /^font-width$/i, o$16 = /\bfont-width\b/i, s$7 = /^font-stretch$/i, creator$33 = (s) => {
48423
+ const e$21 = /^font-width$/i, o$16 = /\bfont-width\b/i, s$7 = /^font-stretch$/i, creator$34 = (s) => {
47469
48424
  const r = Object.assign({ preserve: !1 }, s);
47470
48425
  return {
47471
48426
  postcssPlugin: "postcss-font-width-property",
@@ -47480,7 +48435,7 @@ function hasFallback(t) {
47480
48435
  for (const o of e.nodes) if (o !== t && "decl" === o.type && s$7.test(o.prop)) return !0;
47481
48436
  return !1;
47482
48437
  }
47483
- creator$33.postcss = !0;
48438
+ creator$34.postcss = !0;
47484
48439
  //#endregion
47485
48440
  //#region ../../node_modules/.pnpm/@csstools+postcss-gamut-mapping@3.0.4_postcss@8.5.15/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs
47486
48441
  const p = /\bcolor-gamut\b/i;
@@ -47500,7 +48455,7 @@ function sameProperty(e) {
47500
48455
  }
47501
48456
  return t;
47502
48457
  }
47503
- const d = /\b(?:color|lab|lch|oklab|oklch)\(/i, u$4 = /^(?:color|lab|lch|oklab|oklch)$/i, creator$32 = () => ({
48458
+ const d = /\b(?:color|lab|lch|oklab|oklch)\(/i, u$4 = /^(?:color|lab|lch|oklab|oklch)$/i, creator$33 = () => ({
47504
48459
  postcssPlugin: "postcss-gamut-mapping",
47505
48460
  prepare() {
47506
48461
  const p = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakSet();
@@ -47575,14 +48530,14 @@ const d = /\b(?:color|lab|lch|oklab|oklch)\(/i, u$4 = /^(?:color|lab|lch|oklab|o
47575
48530
  };
47576
48531
  }
47577
48532
  });
47578
- creator$32.postcss = !0;
48533
+ creator$33.postcss = !0;
47579
48534
  //#endregion
47580
48535
  //#region ../../node_modules/.pnpm/postcss-gap-properties@7.0.0_postcss@8.5.15/node_modules/postcss-gap-properties/dist/index.mjs
47581
48536
  const e$20 = [
47582
48537
  "column-gap",
47583
48538
  "gap",
47584
48539
  "row-gap"
47585
- ], creator$31 = (o) => {
48540
+ ], creator$32 = (o) => {
47586
48541
  const r = Object.assign({ preserve: !0 }, o);
47587
48542
  return {
47588
48543
  postcssPlugin: "postcss-gap-properties",
@@ -47594,7 +48549,7 @@ const e$20 = [
47594
48549
  }
47595
48550
  };
47596
48551
  };
47597
- creator$31.postcss = !0;
48552
+ creator$32.postcss = !0;
47598
48553
  //#endregion
47599
48554
  //#region ../../node_modules/.pnpm/@csstools+postcss-gradients-interpolation-method@6.0.4_postcss@8.5.15/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs
47600
48555
  const x = /(?:repeating-)?(?:linear|radial|conic)-gradient\(/i, W = /\bin\b/i, P$1 = { test: (o) => x.test(o) && W.test(o) }, A$1 = /^(repeating-)?(linear|radial|conic)-gradient$/i;
@@ -47879,7 +48834,7 @@ const postcssPlugin$8 = (e) => {
47879
48834
  }, e);
47880
48835
  return t.enableProgressiveCustomProperties ? {
47881
48836
  postcssPlugin: "postcss-gradients-interpolation-method",
47882
- plugins: [creator$50(), basePlugin$7(t)]
48837
+ plugins: [creator$51(), basePlugin$7(t)]
47883
48838
  } : basePlugin$7(t);
47884
48839
  };
47885
48840
  postcssPlugin$8.postcss = !0;
@@ -47914,7 +48869,7 @@ function selectorContainsHasPseudo(t) {
47914
48869
  } catch {}
47915
48870
  return s;
47916
48871
  }
47917
- const creator$30 = (t) => {
48872
+ const creator$31 = (t) => {
47918
48873
  const o = {
47919
48874
  preserve: !0,
47920
48875
  specificityMatchingName: "does-not-exist",
@@ -47993,10 +48948,10 @@ function isWithinSupportCheck(e) {
47993
48948
  }
47994
48949
  return !1;
47995
48950
  }
47996
- creator$30.postcss = !0;
48951
+ creator$31.postcss = !0;
47997
48952
  //#endregion
47998
48953
  //#region ../../node_modules/.pnpm/postcss-color-hex-alpha@11.0.0_postcss@8.5.15/node_modules/postcss-color-hex-alpha/dist/index.mjs
47999
- const creator$29 = (a) => {
48954
+ const creator$30 = (a) => {
48000
48955
  const o = Object.assign({ preserve: !1 }, a);
48001
48956
  return {
48002
48957
  postcssPlugin: "postcss-color-hex-alpha",
@@ -48013,7 +48968,7 @@ const creator$29 = (a) => {
48013
48968
  }
48014
48969
  };
48015
48970
  };
48016
- creator$29.postcss = !0;
48971
+ creator$30.postcss = !0;
48017
48972
  const t$5 = /#[0-9a-f]{4}(?:[0-9a-f]{4})?\b/i, r$7 = /^#[0-9a-f]{4}(?:[0-9a-f]{4})?$/i, a$3 = 1e5, o$15 = /[0-9a-f]/gi;
48018
48973
  function hexa2rgba(e) {
48019
48974
  const s = e.value, t = `0x${5 === s.length ? s.slice(1).replace(o$15, "$&$&") : s.slice(1)}`, [r, l, n, c] = [
@@ -48049,7 +49004,7 @@ const postcssPlugin$7 = (o) => {
48049
49004
  }, o);
48050
49005
  return e.enableProgressiveCustomProperties && e.preserve ? {
48051
49006
  postcssPlugin: "postcss-hwb-function",
48052
- plugins: [creator$50(), basePlugin$6(e)]
49007
+ plugins: [creator$51(), basePlugin$6(e)]
48053
49008
  } : basePlugin$6(e);
48054
49009
  };
48055
49010
  postcssPlugin$7.postcss = !0;
@@ -48079,7 +49034,7 @@ const postcssPlugin$6 = (e) => {
48079
49034
  }, e);
48080
49035
  return t.enableProgressiveCustomProperties && t.preserve ? {
48081
49036
  postcssPlugin: "postcss-ic-unit",
48082
- plugins: [creator$50(), basePlugin$5(t)]
49037
+ plugins: [creator$51(), basePlugin$5(t)]
48083
49038
  } : basePlugin$5(t);
48084
49039
  };
48085
49040
  postcssPlugin$6.postcss = !0;
@@ -48122,7 +49077,7 @@ const postcssPlugin$5 = (s) => {
48122
49077
  }, s);
48123
49078
  return o.enableProgressiveCustomProperties && o.preserve ? {
48124
49079
  postcssPlugin: "postcss-image-function",
48125
- plugins: [creator$50(), basePlugin$4(o)]
49080
+ plugins: [creator$51(), basePlugin$4(o)]
48126
49081
  } : basePlugin$4(o);
48127
49082
  };
48128
49083
  postcssPlugin$5.postcss = !0;
@@ -48202,7 +49157,7 @@ const handleInvalidation = (e, t, n) => {
48202
49157
  if (!l) return;
48203
49158
  const c = u.slice(1);
48204
49159
  c.length && r.after(c), n.cloneBefore({ value: l.trim() }), i.preserve || (n.remove(), r.nodes?.length || r.remove());
48205
- }, r$6 = /(?:^|[^\w-])(?:-webkit-)?image-set\(/i, o$13 = /^(?:-webkit-)?image-set$/i, creator$28 = (n) => {
49160
+ }, r$6 = /(?:^|[^\w-])(?:-webkit-)?image-set\(/i, o$13 = /^(?:-webkit-)?image-set$/i, creator$29 = (n) => {
48206
49161
  const i = !("preserve" in Object(n)) || Boolean(n?.preserve), s = "onInvalid" in Object(n) ? n?.onInvalid : "ignore";
48207
49162
  if ("oninvalid" in Object(n)) throw new Error("\"oninvalid\" was changed to \"onInvalid\" to match other plugins with similar options");
48208
49163
  return {
@@ -48245,7 +49200,7 @@ const handleInvalidation = (e, t, n) => {
48245
49200
  }
48246
49201
  };
48247
49202
  };
48248
- creator$28.postcss = !0;
49203
+ creator$29.postcss = !0;
48249
49204
  //#endregion
48250
49205
  //#region ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@6.0.0_postcss@8.5.15/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs
48251
49206
  function alwaysValidSelector(s) {
@@ -48468,7 +49423,7 @@ function cartesianProduct(...e) {
48468
49423
  }
48469
49424
  }([], 0), s;
48470
49425
  }
48471
- const n$3 = /:is\(/i, creator$27 = (e) => {
49426
+ const n$3 = /:is\(/i, creator$28 = (e) => {
48472
49427
  const s = {
48473
49428
  specificityMatchingName: "does-not-exist",
48474
49429
  ...e || {}
@@ -48514,7 +49469,7 @@ const n$3 = /:is\(/i, creator$27 = (e) => {
48514
49469
  }
48515
49470
  };
48516
49471
  };
48517
- creator$27.postcss = !0;
49472
+ creator$28.postcss = !0;
48518
49473
  //#endregion
48519
49474
  //#region ../../node_modules/.pnpm/postcss-lab-function@8.0.4_postcss@8.5.15/node_modules/postcss-lab-function/dist/index.mjs
48520
49475
  const g$2 = /\b(?:lab|lch)\(/i, f$2 = /^(?:lab|lch)$/i, basePlugin$3 = (s) => ({
@@ -48547,7 +49502,7 @@ const postcssPlugin$4 = (e) => {
48547
49502
  }, e);
48548
49503
  return t.subFeatures = Object.assign({ displayP3: !0 }, t.subFeatures), t.enableProgressiveCustomProperties && (t.preserve || t.subFeatures.displayP3) ? {
48549
49504
  postcssPlugin: "postcss-lab-function",
48550
- plugins: [creator$50(), basePlugin$3(t)]
49505
+ plugins: [creator$51(), basePlugin$3(t)]
48551
49506
  } : basePlugin$3(t);
48552
49507
  };
48553
49508
  postcssPlugin$4.postcss = !0;
@@ -48744,7 +49699,7 @@ const postcssPlugin$3 = (r) => {
48744
49699
  }, r);
48745
49700
  return t.enableProgressiveCustomProperties && t.preserve ? {
48746
49701
  postcssPlugin: "postcss-light-dark-function",
48747
- plugins: [creator$50(), basePlugin$2(t)]
49702
+ plugins: [creator$51(), basePlugin$2(t)]
48748
49703
  } : basePlugin$2(t);
48749
49704
  };
48750
49705
  postcssPlugin$3.postcss = !0;
@@ -48761,7 +49716,7 @@ function transformAxes$1(o, t) {
48761
49716
  (function(o) {
48762
49717
  o.TopToBottom = "top-to-bottom", o.BottomToTop = "bottom-to-top", o.RightToLeft = "right-to-left", o.LeftToRight = "left-to-right";
48763
49718
  })(o$11 || (o$11 = {}));
48764
- const creator$26 = (t) => {
49719
+ const creator$27 = (t) => {
48765
49720
  const e = Object.assign({ inlineDirection: o$11.LeftToRight }, t);
48766
49721
  switch (e.inlineDirection) {
48767
49722
  case o$11.LeftToRight:
@@ -48779,7 +49734,7 @@ const creator$26 = (t) => {
48779
49734
  }
48780
49735
  };
48781
49736
  };
48782
- creator$26.postcss = !0;
49737
+ creator$27.postcss = !0;
48783
49738
  //#endregion
48784
49739
  //#region ../../node_modules/.pnpm/@csstools+postcss-logical-overscroll-behavior@3.0.0_postcss@8.5.15/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.mjs
48785
49740
  var o$10;
@@ -48793,7 +49748,7 @@ function transformAxes(o, t) {
48793
49748
  (function(o) {
48794
49749
  o.TopToBottom = "top-to-bottom", o.BottomToTop = "bottom-to-top", o.RightToLeft = "right-to-left", o.LeftToRight = "left-to-right";
48795
49750
  })(o$10 || (o$10 = {}));
48796
- const creator$25 = (t) => {
49751
+ const creator$26 = (t) => {
48797
49752
  const e = Object.assign({ inlineDirection: o$10.LeftToRight }, t);
48798
49753
  switch (e.inlineDirection) {
48799
49754
  case o$10.LeftToRight:
@@ -48811,7 +49766,7 @@ const creator$25 = (t) => {
48811
49766
  }
48812
49767
  };
48813
49768
  };
48814
- creator$25.postcss = !0;
49769
+ creator$26.postcss = !0;
48815
49770
  //#endregion
48816
49771
  //#region ../../node_modules/.pnpm/postcss-logical@9.0.0_postcss@8.5.15/node_modules/postcss-logical/dist/index.mjs
48817
49772
  var e$14, n$2;
@@ -49065,7 +50020,7 @@ function prepareTransforms(e, t, i, l, a) {
49065
50020
  })(t$4 || (t$4 = {})), function(r) {
49066
50021
  r.Top = "top", r.Right = "right", r.Bottom = "bottom", r.Left = "left";
49067
50022
  }(i$2 || (i$2 = {}));
49068
- const l$4 = /var\(/i, creator$24 = (r) => {
50023
+ const l$4 = /var\(/i, creator$25 = (r) => {
49069
50024
  const e = Object.assign({
49070
50025
  blockDirection: t$4.TopToBottom,
49071
50026
  inlineDirection: t$4.LeftToRight
@@ -49171,7 +50126,7 @@ const l$4 = /var\(/i, creator$24 = (r) => {
49171
50126
  }
49172
50127
  };
49173
50128
  };
49174
- creator$24.postcss = !0;
50129
+ creator$25.postcss = !0;
49175
50130
  //#endregion
49176
50131
  //#region ../../node_modules/.pnpm/@csstools+postcss-logical-resize@4.0.0_postcss@8.5.15/node_modules/@csstools/postcss-logical-resize/dist/index.mjs
49177
50132
  var t$3, e$13, i$1;
@@ -49210,7 +50165,7 @@ function directionFlowToAxes(o) {
49210
50165
  }(e$13 || (e$13 = {})), function(o) {
49211
50166
  o.Top = "top", o.Right = "right", o.Bottom = "bottom", o.Left = "left";
49212
50167
  }(i$1 || (i$1 = {}));
49213
- const creator$23 = (o) => {
50168
+ const creator$24 = (o) => {
49214
50169
  const t = Object.assign({
49215
50170
  blockDirection: e$13.TopToBottom,
49216
50171
  inlineDirection: e$13.LeftToRight
@@ -49244,7 +50199,7 @@ const creator$23 = (o) => {
49244
50199
  };
49245
50200
  var u;
49246
50201
  };
49247
- creator$23.postcss = !0;
50202
+ creator$24.postcss = !0;
49248
50203
  //#endregion
49249
50204
  //#region ../../node_modules/.pnpm/@csstools+postcss-logical-viewport-units@4.0.0_postcss@8.5.15/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs
49250
50205
  var s$6;
@@ -49276,7 +50231,7 @@ const c$3 = /vb|vi/i, u$1 = { test(t) {
49276
50231
  if ("vb" === e || "vi" === e) return !0;
49277
50232
  }
49278
50233
  return !1;
49279
- } }, a$2 = /(?:vi|vb)\b/i, creator$22 = (e) => {
50234
+ } }, a$2 = /(?:vi|vb)\b/i, creator$23 = (e) => {
49280
50235
  const i = Object.assign({
49281
50236
  inlineDirection: s$6.LeftToRight,
49282
50237
  preserve: !0
@@ -49313,7 +50268,7 @@ const c$3 = /vb|vi/i, u$1 = { test(t) {
49313
50268
  }
49314
50269
  };
49315
50270
  };
49316
- creator$22.postcss = !0;
50271
+ creator$23.postcss = !0;
49317
50272
  //#endregion
49318
50273
  //#region ../../node_modules/.pnpm/@csstools+postcss-media-queries-aspect-ratio-number-values@4.0.0_postcss@8.5.15/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs
49319
50274
  const w = 1e5, h$1 = 2147483647;
@@ -49585,7 +50540,7 @@ function transformMediaQueryList(e, s) {
49585
50540
  return v === l || c.has(v) ? [l] : s ? [l, v] : [v];
49586
50541
  }).join(",");
49587
50542
  }
49588
- const creator$21 = (e) => {
50543
+ const creator$22 = (e) => {
49589
50544
  const t = Object.assign({ preserve: !1 }, e);
49590
50545
  return {
49591
50546
  postcssPlugin: "postcss-media-queries-aspect-ratio-number-values",
@@ -49604,7 +50559,7 @@ const creator$21 = (e) => {
49604
50559
  }
49605
50560
  };
49606
50561
  };
49607
- creator$21.postcss = !0;
50562
+ creator$22.postcss = !0;
49608
50563
  //#endregion
49609
50564
  //#region ../../node_modules/.pnpm/@csstools+postcss-media-minmax@3.0.3_postcss@8.5.15/node_modules/@csstools/postcss-media-minmax/dist/index.mjs
49610
50565
  const C = {
@@ -49961,7 +50916,7 @@ function getMediaConditionInShallowMediaQueryFromAncestry(e, t, r) {
49961
50916
  const a = i;
49962
50917
  return i = r.get(i), isMediaQuery(i) && i === t ? a : void 0;
49963
50918
  }
49964
- const creator$20 = () => ({
50919
+ const creator$21 = () => ({
49965
50920
  postcssPlugin: "postcss-media-minmax",
49966
50921
  AtRule: {
49967
50922
  media(e) {
@@ -49988,7 +50943,7 @@ const creator$20 = () => ({
49988
50943
  }
49989
50944
  }
49990
50945
  });
49991
- creator$20.postcss = !0;
50946
+ creator$21.postcss = !0;
49992
50947
  //#endregion
49993
50948
  //#region ../../node_modules/.pnpm/@csstools+postcss-mixins@1.0.0_postcss@8.5.15/node_modules/@csstools/postcss-mixins/dist/index.mjs
49994
50949
  const o$7 = /^apply$/i;
@@ -50018,7 +50973,7 @@ function processableMixinRule(s) {
50018
50973
  "atrule" === e.type && l$3.test(e.name) && (o = !0);
50019
50974
  }), !o && n.getName();
50020
50975
  }
50021
- const creator$19 = (e) => {
50976
+ const creator$20 = (e) => {
50022
50977
  const s = Object.assign({ preserve: !1 }, e);
50023
50978
  return {
50024
50979
  postcssPlugin: "postcss-mixins",
@@ -50046,11 +51001,11 @@ const creator$19 = (e) => {
50046
51001
  }
50047
51002
  };
50048
51003
  };
50049
- creator$19.postcss = !0;
51004
+ creator$20.postcss = !0;
50050
51005
  //#endregion
50051
51006
  //#region ../../node_modules/.pnpm/@csstools+postcss-nested-calc@5.0.0_postcss@8.5.15/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
50052
51007
  const r$4 = /calc\(/gi;
50053
- const creator$18 = (s) => {
51008
+ const creator$19 = (s) => {
50054
51009
  const o = Object.assign({ preserve: !0 }, s);
50055
51010
  return {
50056
51011
  postcssPlugin: "postcss-nested-calc",
@@ -50077,7 +51032,7 @@ const creator$18 = (s) => {
50077
51032
  }
50078
51033
  };
50079
51034
  };
50080
- creator$18.postcss = !0;
51035
+ creator$19.postcss = !0;
50081
51036
  //#endregion
50082
51037
  //#region ../../node_modules/.pnpm/@csstools+selector-resolve-nested@4.0.0_postcss-selector-parser@7.1.2/node_modules/@csstools/selector-resolve-nested/dist/index.mjs
50083
51038
  function sourceFrom(e) {
@@ -50545,7 +51500,7 @@ const creator$1$1 = () => ({
50545
51500
  } }
50546
51501
  });
50547
51502
  creator$1$1.postcss = !0;
50548
- const creator$17 = (e) => {
51503
+ const creator$18 = (e) => {
50549
51504
  const t = Object.assign({ edition: "2024-02" }, e);
50550
51505
  switch (t.edition) {
50551
51506
  case "2021": return creator$2$1(e);
@@ -50553,13 +51508,13 @@ const creator$17 = (e) => {
50553
51508
  default: throw new Error(`Invalid edition: ${t.edition}`);
50554
51509
  }
50555
51510
  };
50556
- creator$17.postcss = !0;
51511
+ creator$18.postcss = !0;
50557
51512
  //#endregion
50558
51513
  //#region ../../node_modules/.pnpm/postcss-selector-not@9.0.0_postcss@8.5.15/node_modules/postcss-selector-not/dist/index.mjs
50559
51514
  function cleanupWhitespace(e) {
50560
51515
  e.spaces && (e.spaces.after = "", e.spaces.before = ""), e.nodes && e.nodes.length > 0 && (e.nodes[0] && e.nodes[0].spaces && (e.nodes[0].spaces.before = ""), e.nodes[e.nodes.length - 1] && e.nodes[e.nodes.length - 1].spaces && (e.nodes[e.nodes.length - 1].spaces.after = ""));
50561
51516
  }
50562
- const creator$16 = () => ({
51517
+ const creator$17 = () => ({
50563
51518
  postcssPlugin: "postcss-selector-not",
50564
51519
  Rule(s, { result: o }) {
50565
51520
  if (s.selector && s.selector.toLowerCase().includes(":not(")) try {
@@ -50584,7 +51539,7 @@ const creator$16 = () => ({
50584
51539
  }
50585
51540
  }
50586
51541
  });
50587
- creator$16.postcss = !0;
51542
+ creator$17.postcss = !0;
50588
51543
  //#endregion
50589
51544
  //#region ../../node_modules/.pnpm/@csstools+postcss-oklab-function@5.0.4_postcss@8.5.15/node_modules/@csstools/postcss-oklab-function/dist/index.mjs
50590
51545
  const g$1 = /\b(?:oklab|oklch)\(/i, f$1 = /^(?:oklab|oklch)$/i, basePlugin$1 = (s) => ({
@@ -50617,7 +51572,7 @@ const postcssPlugin$2 = (e) => {
50617
51572
  }, e);
50618
51573
  return t.subFeatures = Object.assign({ displayP3: !0 }, t.subFeatures), t.enableProgressiveCustomProperties && (t.preserve || t.subFeatures.displayP3) ? {
50619
51574
  postcssPlugin: "postcss-oklab-function",
50620
- plugins: [creator$50(), basePlugin$1(t)]
51575
+ plugins: [creator$51(), basePlugin$1(t)]
50621
51576
  } : basePlugin$1(t);
50622
51577
  };
50623
51578
  postcssPlugin$2.postcss = !0;
@@ -50646,7 +51601,7 @@ var require_postcss_opacity_percentage = /* @__PURE__ */ require_html_transform.
50646
51601
  //#endregion
50647
51602
  //#region ../../node_modules/.pnpm/postcss-overflow-shorthand@7.0.0_postcss@8.5.15/node_modules/postcss-overflow-shorthand/dist/index.mjs
50648
51603
  var import_postcss_opacity_percentage = /* @__PURE__ */ require_html_transform.__toESM(require_postcss_opacity_percentage(), 1);
50649
- const creator$15 = (o) => {
51604
+ const creator$16 = (o) => {
50650
51605
  const r = Object.assign({ preserve: !0 }, o);
50651
51606
  return {
50652
51607
  postcssPlugin: "postcss-overflow-shorthand",
@@ -50672,7 +51627,7 @@ const creator$15 = (o) => {
50672
51627
  }
50673
51628
  };
50674
51629
  };
50675
- creator$15.postcss = !0;
51630
+ creator$16.postcss = !0;
50676
51631
  //#endregion
50677
51632
  //#region ../../node_modules/.pnpm/postcss-replace-overflow-wrap@4.0.0_postcss@8.5.15/node_modules/postcss-replace-overflow-wrap/index.js
50678
51633
  var require_postcss_replace_overflow_wrap = /* @__PURE__ */ require_html_transform.__commonJSMin(((exports, module) => {
@@ -50711,7 +51666,7 @@ function onCSSDeclaration(o, r, s) {
50711
51666
  value: l[1] || l[0]
50712
51667
  }), s.preserve || o.remove();
50713
51668
  }
50714
- const t$2 = /^place-(content|items|self)/i, creator$14 = (e) => {
51669
+ const t$2 = /^place-(content|items|self)/i, creator$15 = (e) => {
50715
51670
  const o = Object.assign({ preserve: !0 }, e);
50716
51671
  return {
50717
51672
  postcssPlugin: "postcss-place",
@@ -50720,10 +51675,10 @@ const t$2 = /^place-(content|items|self)/i, creator$14 = (e) => {
50720
51675
  }
50721
51676
  };
50722
51677
  };
50723
- creator$14.postcss = !0;
51678
+ creator$15.postcss = !0;
50724
51679
  //#endregion
50725
51680
  //#region ../../node_modules/.pnpm/@csstools+postcss-position-area-property@2.0.0_postcss@8.5.15/node_modules/@csstools/postcss-position-area-property/dist/index.mjs
50726
- const o$4 = /^position-area$/i, creator$13 = () => ({
51681
+ const o$4 = /^position-area$/i, creator$14 = () => ({
50727
51682
  postcssPlugin: "postcss-position-area-property",
50728
51683
  Declaration(s) {
50729
51684
  o$4.test(s.prop) && s.cloneBefore({
@@ -50732,10 +51687,10 @@ const o$4 = /^position-area$/i, creator$13 = () => ({
50732
51687
  });
50733
51688
  }
50734
51689
  });
50735
- creator$13.postcss = !0;
51690
+ creator$14.postcss = !0;
50736
51691
  //#endregion
50737
51692
  //#region ../../node_modules/.pnpm/css-prefers-color-scheme@11.0.0_postcss@8.5.15/node_modules/css-prefers-color-scheme/dist/index.mjs
50738
- const e$6 = /\(\s*prefers-color-scheme\s*:\s*(dark|light)\s*\)/gi, s$4 = "(color: 48842621)", r$2 = "(color: 70318723)", creator$12 = (o) => {
51693
+ const e$6 = /\(\s*prefers-color-scheme\s*:\s*(dark|light)\s*\)/gi, s$4 = "(color: 48842621)", r$2 = "(color: 70318723)", creator$13 = (o) => {
50739
51694
  const t = Object.assign({ preserve: !0 }, o);
50740
51695
  return {
50741
51696
  postcssPlugin: "postcss-prefers-color-scheme",
@@ -50753,10 +51708,10 @@ const e$6 = /\(\s*prefers-color-scheme\s*:\s*(dark|light)\s*\)/gi, s$4 = "(color
50753
51708
  }
50754
51709
  };
50755
51710
  };
50756
- creator$12.postcss = !0;
51711
+ creator$13.postcss = !0;
50757
51712
  //#endregion
50758
51713
  //#region ../../node_modules/.pnpm/@csstools+postcss-property-rule-prelude-list@2.0.0_postcss@8.5.15/node_modules/@csstools/postcss-property-rule-prelude-list/dist/index.mjs
50759
- const o$3 = /^property$/i, creator$11 = () => ({
51714
+ const o$3 = /^property$/i, creator$12 = () => ({
50760
51715
  postcssPlugin: "postcss-property-rule-prelude-list",
50761
51716
  AtRule(t) {
50762
51717
  if (!o$3.test(t.name)) return;
@@ -50767,7 +51722,7 @@ const o$3 = /^property$/i, creator$11 = () => ({
50767
51722
  }), t.remove());
50768
51723
  }
50769
51724
  });
50770
- creator$11.postcss = !0;
51725
+ creator$12.postcss = !0;
50771
51726
  //#endregion
50772
51727
  //#region ../../node_modules/.pnpm/@csstools+postcss-random-function@3.0.3_postcss@8.5.15/node_modules/@csstools/postcss-random-function/dist/index.mjs
50773
51728
  const o$2 = String.fromCodePoint(0);
@@ -50789,7 +51744,7 @@ function randomCacheKeyFromPostcssDeclaration(e) {
50789
51744
  documentID: e.source?.input.css ?? e.root().toString()
50790
51745
  };
50791
51746
  }
50792
- const r$1 = /(?<![-\w])(?:random)\(/i, creator$10 = (o) => {
51747
+ const r$1 = /(?<![-\w])(?:random)\(/i, creator$11 = (o) => {
50793
51748
  const t = Object.assign({ preserve: !1 }, o);
50794
51749
  return {
50795
51750
  postcssPlugin: "postcss-random-function",
@@ -50804,10 +51759,10 @@ const r$1 = /(?<![-\w])(?:random)\(/i, creator$10 = (o) => {
50804
51759
  }
50805
51760
  };
50806
51761
  };
50807
- creator$10.postcss = !0;
51762
+ creator$11.postcss = !0;
50808
51763
  //#endregion
50809
51764
  //#region ../../node_modules/.pnpm/postcss-color-rebeccapurple@11.0.0_postcss@8.5.15/node_modules/postcss-color-rebeccapurple/dist/index.mjs
50810
- const s$3 = /rebeccapurple/i, t$1 = /^rebeccapurple$/i, creator$9 = (o) => {
51765
+ const s$3 = /rebeccapurple/i, t$1 = /^rebeccapurple$/i, creator$10 = (o) => {
50811
51766
  const c = Object.assign({ preserve: !1 }, o);
50812
51767
  return {
50813
51768
  postcssPlugin: "postcss-color-rebeccapurple",
@@ -50823,7 +51778,7 @@ const s$3 = /rebeccapurple/i, t$1 = /^rebeccapurple$/i, creator$9 = (o) => {
50823
51778
  }
50824
51779
  };
50825
51780
  };
50826
- creator$9.postcss = !0;
51781
+ creator$10.postcss = !0;
50827
51782
  //#endregion
50828
51783
  //#region ../../node_modules/.pnpm/@csstools+postcss-relative-color-syntax@4.0.4_postcss@8.5.15/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs
50829
51784
  const g = /\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(/i, h = /\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(\s*from/i, m$1 = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)$/i, y = /from/i, basePlugin = (s) => ({
@@ -50856,13 +51811,13 @@ const postcssPlugin$1 = (e) => {
50856
51811
  }, e);
50857
51812
  return r.subFeatures = Object.assign({ displayP3: !0 }, r.subFeatures), r.enableProgressiveCustomProperties && (r.preserve || r.subFeatures.displayP3) ? {
50858
51813
  postcssPlugin: "postcss-relative-color-syntax",
50859
- plugins: [creator$50(), basePlugin(r)]
51814
+ plugins: [creator$51(), basePlugin(r)]
50860
51815
  } : basePlugin(r);
50861
51816
  };
50862
51817
  postcssPlugin$1.postcss = !0;
50863
51818
  //#endregion
50864
51819
  //#region ../../node_modules/.pnpm/@csstools+postcss-scope-pseudo-class@5.0.0_postcss@8.5.15/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.mjs
50865
- const creator$8 = (s) => {
51820
+ const creator$9 = (s) => {
50866
51821
  const r = Object.assign({ preserve: !1 }, s);
50867
51822
  return {
50868
51823
  postcssPlugin: "postcss-scope-pseudo-class",
@@ -50897,10 +51852,10 @@ const creator$8 = (s) => {
50897
51852
  }
50898
51853
  };
50899
51854
  };
50900
- creator$8.postcss = !0;
51855
+ creator$9.postcss = !0;
50901
51856
  //#endregion
50902
51857
  //#region ../../node_modules/.pnpm/@csstools+postcss-sign-functions@2.0.3_postcss@8.5.15/node_modules/@csstools/postcss-sign-functions/dist/index.mjs
50903
- const m = /(?<![-\w])(?:sign|abs)\(/i, f = /(?<![-\w])(?:sign|abs)\(/i, creator$7 = (o) => {
51858
+ const m = /(?<![-\w])(?:sign|abs)\(/i, f = /(?<![-\w])(?:sign|abs)\(/i, creator$8 = (o) => {
50904
51859
  const n = Object.assign({ preserve: !1 }, o);
50905
51860
  return {
50906
51861
  postcssPlugin: "postcss-sign-functions",
@@ -51007,10 +51962,10 @@ function replacer(e) {
51007
51962
  ], parseListOfComponentValues(s.flatMap((e) => e.tokens())))
51008
51963
  ])];
51009
51964
  }
51010
- creator$7.postcss = !0;
51965
+ creator$8.postcss = !0;
51011
51966
  //#endregion
51012
51967
  //#region ../../node_modules/.pnpm/@csstools+postcss-stepped-value-functions@5.0.3_postcss@8.5.15/node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs
51013
- const s$2 = /(?<![-\w])(?:mod|rem|round)\(/i, creator$6 = (o) => {
51968
+ const s$2 = /(?<![-\w])(?:mod|rem|round)\(/i, creator$7 = (o) => {
51014
51969
  const t = Object.assign({ preserve: !1 }, o);
51015
51970
  return {
51016
51971
  postcssPlugin: "postcss-stepped-value-functions",
@@ -51024,10 +51979,10 @@ const s$2 = /(?<![-\w])(?:mod|rem|round)\(/i, creator$6 = (o) => {
51024
51979
  }
51025
51980
  };
51026
51981
  };
51027
- creator$6.postcss = !0;
51982
+ creator$7.postcss = !0;
51028
51983
  //#endregion
51029
51984
  //#region ../../node_modules/.pnpm/@csstools+postcss-syntax-descriptor-syntax-production@2.0.0_postcss@8.5.15/node_modules/@csstools/postcss-syntax-descriptor-syntax-production/dist/index.mjs
51030
- const o$1 = /^property$/i, n$1 = /^syntax$/i, creator$5 = (i) => {
51985
+ const o$1 = /^property$/i, n$1 = /^syntax$/i, creator$6 = (i) => {
51031
51986
  const p = Object.assign({ preserve: !1 }, i);
51032
51987
  return {
51033
51988
  postcssPlugin: "postcss-syntax-descriptor-syntax-production",
@@ -51095,7 +52050,7 @@ const o$1 = /^property$/i, n$1 = /^syntax$/i, creator$5 = (i) => {
51095
52050
  }
51096
52051
  };
51097
52052
  };
51098
- creator$5.postcss = !0;
52053
+ creator$6.postcss = !0;
51099
52054
  //#endregion
51100
52055
  //#region ../../node_modules/.pnpm/@csstools+postcss-system-ui-font-family@2.0.0_postcss@8.5.15/node_modules/@csstools/postcss-system-ui-font-family/dist/index.mjs
51101
52056
  const a = /^font(?:-family)?$/i, c$2 = [
@@ -51108,7 +52063,7 @@ const a = /^font(?:-family)?$/i, c$2 = [
51108
52063
  "Noto Sans",
51109
52064
  "sans-serif"
51110
52065
  ];
51111
- const u = c$2.join(","), creator$4 = (p) => {
52066
+ const u = c$2.join(","), creator$5 = (p) => {
51112
52067
  const f = Object.assign({ preserve: !0 }, p);
51113
52068
  return {
51114
52069
  postcssPlugin: "postcss-system-ui-font-family",
@@ -51149,10 +52104,10 @@ const u = c$2.join(","), creator$4 = (p) => {
51149
52104
  }
51150
52105
  };
51151
52106
  };
51152
- creator$4.postcss = !0;
52107
+ creator$5.postcss = !0;
51153
52108
  //#endregion
51154
52109
  //#region ../../node_modules/.pnpm/@csstools+postcss-text-decoration-shorthand@5.0.3_postcss@8.5.15/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.mjs
51155
- const o = /^text-decoration$/i, creator$3 = (t) => {
52110
+ const o = /^text-decoration$/i, creator$4 = (t) => {
51156
52111
  const c = Object.assign({ preserve: !0 }, t);
51157
52112
  return {
51158
52113
  postcssPlugin: "postcss-text-decoration-shorthand",
@@ -51316,7 +52271,7 @@ const o = /^text-decoration$/i, creator$3 = (t) => {
51316
52271
  function nodeIsAColor(e) {
51317
52272
  return !("word" !== e.type || !e.value.startsWith("#")) || !("word" !== e.type || !i.includes(e.value.toLowerCase())) || !("function" !== e.type || !c$1.includes(e.value.toLowerCase()));
51318
52273
  }
51319
- creator$3.postcss = !0;
52274
+ creator$4.postcss = !0;
51320
52275
  const r = [
51321
52276
  "unset",
51322
52277
  "inherit",
@@ -51363,7 +52318,7 @@ function genericNodeParts() {
51363
52318
  }
51364
52319
  //#endregion
51365
52320
  //#region ../../node_modules/.pnpm/@csstools+postcss-trigonometric-functions@5.0.3_postcss@8.5.15/node_modules/@csstools/postcss-trigonometric-functions/dist/index.mjs
51366
- const e$2 = /(?<![-\w])(?:asin|acos|atan|atan2|sin|cos|tan)\(/i, creator$2 = (o) => {
52321
+ const e$2 = /(?<![-\w])(?:asin|acos|atan|atan2|sin|cos|tan)\(/i, creator$3 = (o) => {
51367
52322
  const t = Object.assign({ preserve: !1 }, o);
51368
52323
  return {
51369
52324
  postcssPlugin: "postcss-trigonometric-functions",
@@ -51377,7 +52332,7 @@ const e$2 = /(?<![-\w])(?:asin|acos|atan|atan2|sin|cos|tan)\(/i, creator$2 = (o)
51377
52332
  }
51378
52333
  };
51379
52334
  };
51380
- creator$2.postcss = !0;
52335
+ creator$3.postcss = !0;
51381
52336
  //#endregion
51382
52337
  //#region ../../node_modules/.pnpm/@csstools+postcss-unset-value@5.0.0_postcss@8.5.15/node_modules/@csstools/postcss-unset-value/dist/index.mjs
51383
52338
  const e$1 = new Set([
@@ -51801,7 +52756,7 @@ const e$1 = new Set([
51801
52756
  "x",
51802
52757
  "y",
51803
52758
  "z-index"
51804
- ]), creator$1 = (o) => {
52759
+ ]), creator$2 = (o) => {
51805
52760
  const i = Object.assign({ preserve: !1 }, o);
51806
52761
  return {
51807
52762
  postcssPlugin: "postcss-unset-value",
@@ -51815,7 +52770,7 @@ const e$1 = new Set([
51815
52770
  }
51816
52771
  };
51817
52772
  };
51818
- creator$1.postcss = !0;
52773
+ creator$2.postcss = !0;
51819
52774
  //#endregion
51820
52775
  //#region ../../node_modules/.pnpm/postcss-preset-env@11.3.0_postcss@8.5.15/node_modules/postcss-preset-env/dist/index.mjs
51821
52776
  const ks = {
@@ -51957,78 +52912,78 @@ function featureIsLess(s, o) {
51957
52912
  return s.id === o.id ? s[xs] && o[xs] || s[Fs] && o[Fs] ? clamp(-1, s[Os] - o[Os], 1) : s[xs] || o[Fs] ? -1 : s[Fs] || o[xs] ? 1 : 0 : clamp(-1, Cs.indexOf(s.id) - Cs.indexOf(o.id), 1);
51958
52913
  }
51959
52914
  const $s = new Map([
51960
- ["all-property", creator$51],
52915
+ ["all-property", creator$52],
51961
52916
  ["alpha-function", postcssPlugin$16],
51962
- ["any-link-pseudo-class", creator$49],
51963
- ["blank-pseudo-class", creator$48],
52917
+ ["any-link-pseudo-class", creator$50],
52918
+ ["blank-pseudo-class", creator$49],
51964
52919
  ["break-properties", import_postcss_page_break.default],
51965
- ["cascade-layers", creator$47],
51966
- ["case-insensitive-attributes", creator$46],
52920
+ ["cascade-layers", creator$48],
52921
+ ["case-insensitive-attributes", creator$47],
51967
52922
  ["clamp", import_postcss_clamp.default],
51968
52923
  ["color-function", postcssPlugin$15],
51969
52924
  ["color-function-display-p3-linear", postcssPlugin$14],
51970
52925
  ["color-functional-notation", postcssPlugin$13],
51971
52926
  ["color-mix", postcssPlugin$12],
51972
52927
  ["color-mix-variadic-function-arguments", postcssPlugin$11],
51973
- ["container-rule-prelude-list", creator$45],
51974
- ["content-alt-text", creator$44],
52928
+ ["container-rule-prelude-list", creator$46],
52929
+ ["content-alt-text", creator$45],
51975
52930
  ["contrast-color-function", postcssPlugin$10],
51976
- ["custom-media-queries", creator$43],
51977
- ["custom-properties", creator$42],
51978
- ["custom-selectors", creator$41],
51979
- ["dir-pseudo-class", creator$40],
51980
- ["display-two-values", creator$39],
52931
+ ["custom-media-queries", creator$44],
52932
+ ["custom-properties", creator$43],
52933
+ ["custom-selectors", creator$42],
52934
+ ["dir-pseudo-class", creator$41],
52935
+ ["display-two-values", creator$40],
51981
52936
  ["double-position-gradients", postcssPlugin$9],
51982
- ["exponential-functions", creator$38],
51983
- ["float-clear-logical-values", creator$37],
51984
- ["focus-visible-pseudo-class", creator$36],
51985
- ["focus-within-pseudo-class", creator$35],
51986
- ["font-format-keywords", creator$34],
52937
+ ["exponential-functions", creator$39],
52938
+ ["float-clear-logical-values", creator$38],
52939
+ ["focus-visible-pseudo-class", creator$37],
52940
+ ["focus-within-pseudo-class", creator$36],
52941
+ ["font-format-keywords", creator$35],
51987
52942
  ["font-variant-property", import_postcss_font_variant.default],
51988
- ["font-width-property", creator$33],
51989
- ["gamut-mapping", creator$32],
51990
- ["gap-properties", creator$31],
52943
+ ["font-width-property", creator$34],
52944
+ ["gamut-mapping", creator$33],
52945
+ ["gap-properties", creator$32],
51991
52946
  ["gradients-interpolation-method", postcssPlugin$8],
51992
- ["has-pseudo-class", creator$30],
51993
- ["hexadecimal-alpha-notation", creator$29],
52947
+ ["has-pseudo-class", creator$31],
52948
+ ["hexadecimal-alpha-notation", creator$30],
51994
52949
  ["hwb-function", postcssPlugin$7],
51995
52950
  ["ic-unit", postcssPlugin$6],
51996
52951
  ["image-function", postcssPlugin$5],
51997
- ["image-set-function", creator$28],
51998
- ["is-pseudo-class", creator$27],
52952
+ ["image-set-function", creator$29],
52953
+ ["is-pseudo-class", creator$28],
51999
52954
  ["lab-function", postcssPlugin$4],
52000
52955
  ["light-dark-function", postcssPlugin$3],
52001
- ["logical-overflow", creator$26],
52002
- ["logical-overscroll-behavior", creator$25],
52003
- ["logical-properties-and-values", creator$24],
52004
- ["logical-resize", creator$23],
52005
- ["logical-viewport-units", creator$22],
52006
- ["media-queries-aspect-ratio-number-values", creator$21],
52007
- ["media-query-ranges", creator$20],
52008
- ["mixins", creator$19],
52009
- ["nested-calc", creator$18],
52010
- ["nesting-rules", creator$17],
52011
- ["not-pseudo-class", creator$16],
52956
+ ["logical-overflow", creator$27],
52957
+ ["logical-overscroll-behavior", creator$26],
52958
+ ["logical-properties-and-values", creator$25],
52959
+ ["logical-resize", creator$24],
52960
+ ["logical-viewport-units", creator$23],
52961
+ ["media-queries-aspect-ratio-number-values", creator$22],
52962
+ ["media-query-ranges", creator$21],
52963
+ ["mixins", creator$20],
52964
+ ["nested-calc", creator$19],
52965
+ ["nesting-rules", creator$18],
52966
+ ["not-pseudo-class", creator$17],
52012
52967
  ["oklab-function", postcssPlugin$2],
52013
52968
  ["opacity-percentage", import_postcss_opacity_percentage.default],
52014
- ["overflow-property", creator$15],
52969
+ ["overflow-property", creator$16],
52015
52970
  ["overflow-wrap-property", import_postcss_replace_overflow_wrap.default],
52016
- ["place-properties", creator$14],
52017
- ["position-area-property", creator$13],
52018
- ["prefers-color-scheme-query", creator$12],
52019
- ["progressive-custom-properties", creator$50],
52020
- ["property-rule-prelude-list", creator$11],
52021
- ["random-function", creator$10],
52022
- ["rebeccapurple-color", creator$9],
52971
+ ["place-properties", creator$15],
52972
+ ["position-area-property", creator$14],
52973
+ ["prefers-color-scheme-query", creator$13],
52974
+ ["progressive-custom-properties", creator$51],
52975
+ ["property-rule-prelude-list", creator$12],
52976
+ ["random-function", creator$11],
52977
+ ["rebeccapurple-color", creator$10],
52023
52978
  ["relative-color-syntax", postcssPlugin$1],
52024
- ["scope-pseudo-class", creator$8],
52025
- ["sign-functions", creator$7],
52026
- ["stepped-value-functions", creator$6],
52027
- ["syntax-descriptor-syntax-production", creator$5],
52028
- ["system-ui-font-family", creator$4],
52029
- ["text-decoration-shorthand", creator$3],
52030
- ["trigonometric-functions", creator$2],
52031
- ["unset-value", creator$1]
52979
+ ["scope-pseudo-class", creator$9],
52980
+ ["sign-functions", creator$8],
52981
+ ["stepped-value-functions", creator$7],
52982
+ ["syntax-descriptor-syntax-production", creator$6],
52983
+ ["system-ui-font-family", creator$5],
52984
+ ["text-decoration-shorthand", creator$4],
52985
+ ["trigonometric-functions", creator$3],
52986
+ ["unset-value", creator$2]
52032
52987
  ]);
52033
52988
  function featureIsInsertedOrHasAPlugin(s) {
52034
52989
  return !!s[xs] || !!s[Fs] || !!$s.has(s.id);
@@ -52572,7 +53527,7 @@ function levenshteinDistance(s, o) {
52572
53527
  }
52573
53528
  return e[o.length][s.length];
52574
53529
  }
52575
- const creator = (e) => {
53530
+ const creator$1 = (e) => {
52576
53531
  const t = new Logger(), r = Object(e), i = Object.keys(Object(r.features)), a = r.browsers ? void 0 : r.env, c = r.browsers, n = listFeatures(cssdb_default, r, initializeSharedOptions(r), t), l = n.map((s) => s.plugin);
52577
53532
  !1 !== r.autoprefixer && l.push((0, autoprefixer$1.default)(Object.assign({
52578
53533
  env: a,
@@ -52589,7 +53544,7 @@ const creator = (e) => {
52589
53544
  plugins: [...l, internalPlugin()]
52590
53545
  };
52591
53546
  };
52592
- creator.postcss = !0;
53547
+ creator$1.postcss = !0;
52593
53548
  //#endregion
52594
53549
  //#region src/autoprefixer.ts
52595
53550
  const WEAPP_AUTOPREFIXER_BROWSERS = [
@@ -53309,6 +54264,7 @@ const EMPTY_FUNCTIONAL_PSEUDO_CLEANUP_SET = new Set([
53309
54264
  ":-moz-any",
53310
54265
  ":lang"
53311
54266
  ]);
54267
+ const EXPANDABLE_FUNCTIONAL_PSEUDO_SET = new Set([":is", ":where"]);
53312
54268
  const UNSUPPORTED_PSEUDO_ELEMENT_SELECTOR_SET = new Set([
53313
54269
  ":after",
53314
54270
  ":before",
@@ -53353,14 +54309,100 @@ function stripUnsupportedRtlLanguagePseudo(node) {
53353
54309
  function shouldRemoveEmptyFunctionalPseudo(node) {
53354
54310
  return node.type === "pseudo" && EMPTY_FUNCTIONAL_PSEUDO_CLEANUP_SET.has(node.value) && Array.isArray(node.nodes) && node.nodes.length === 0;
53355
54311
  }
54312
+ function replaceSelectorNode(target, index, replacement) {
54313
+ const cloned = target.clone();
54314
+ const targetNode = cloned.nodes[index];
54315
+ if (!targetNode || targetNode.type !== "pseudo" || targetNode.value !== ":where") return;
54316
+ targetNode.replaceWith(...replacement.nodes.map((item) => item.clone()));
54317
+ return cloned;
54318
+ }
54319
+ function getNodePath(root, target) {
54320
+ const path = [];
54321
+ let current = target;
54322
+ while (current && current !== root) {
54323
+ const parent = current.parent;
54324
+ if (!parent || !("nodes" in parent) || !Array.isArray(parent.nodes)) return;
54325
+ const index = parent.nodes.indexOf(current);
54326
+ if (index < 0) return;
54327
+ path.unshift(index);
54328
+ current = parent;
54329
+ }
54330
+ return current === root ? path : void 0;
54331
+ }
54332
+ function getNodeByPath(root, path) {
54333
+ let current = root;
54334
+ for (const index of path) {
54335
+ if (!("nodes" in current) || !Array.isArray(current.nodes)) return;
54336
+ const next = current.nodes[index];
54337
+ if (!next) return;
54338
+ current = next;
54339
+ }
54340
+ return current;
54341
+ }
54342
+ function findExpandableFunctionalPseudo(selector) {
54343
+ let target;
54344
+ selector.walkPseudos((pseudo) => {
54345
+ if (!target && EXPANDABLE_FUNCTIONAL_PSEUDO_SET.has(pseudo.value) && Array.isArray(pseudo.nodes) && pseudo.nodes.some((item) => item.type === "selector")) target = pseudo;
54346
+ });
54347
+ return target;
54348
+ }
54349
+ function expandNestedFunctionalPseudoBranches(selector) {
54350
+ const pending = [selector.clone()];
54351
+ const expanded = [];
54352
+ while (pending.length > 0) {
54353
+ const current = pending.shift();
54354
+ if (!current) continue;
54355
+ const target = findExpandableFunctionalPseudo(current);
54356
+ if (!target) {
54357
+ expanded.push(current);
54358
+ continue;
54359
+ }
54360
+ const path = getNodePath(current, target);
54361
+ const branches = target.nodes.filter((item) => item.type === "selector");
54362
+ if (!path || branches.length === 0) {
54363
+ target.remove();
54364
+ pending.push(current);
54365
+ continue;
54366
+ }
54367
+ for (const branch of branches) {
54368
+ const next = current.clone();
54369
+ const nextTarget = getNodeByPath(next, path);
54370
+ if (nextTarget?.type === "pseudo") {
54371
+ nextTarget.replaceWith(...branch.nodes.map((item) => item.clone()));
54372
+ pending.push(next);
54373
+ }
54374
+ }
54375
+ }
54376
+ return expanded;
54377
+ }
54378
+ function transformExpandedSelectorNodes(selector, context) {
54379
+ selector.walk((node) => {
54380
+ if (node.type === "class") node.value = context.selectorReplacerOptions === void 0 ? internalCssSelectorReplacer(node.value) : internalCssSelectorReplacer(node.value, context.selectorReplacerOptions);
54381
+ else if (node.type === "universal" && context.universalReplacement) node.value = context.universalReplacement;
54382
+ });
54383
+ }
54384
+ function appendExpandedWhereSelectors(parent, index, branches, context) {
54385
+ const root = parent.parent;
54386
+ if (!root) return false;
54387
+ for (const branch of branches) {
54388
+ const expanded = replaceSelectorNode(parent, index, branch);
54389
+ if (expanded) {
54390
+ transformExpandedSelectorNodes(expanded, context);
54391
+ root.insertBefore(parent, expanded);
54392
+ }
54393
+ }
54394
+ parent.remove();
54395
+ return true;
54396
+ }
53356
54397
  function flattenWherePseudo(node, context, index, parent) {
53357
54398
  if (isUniAppXEnabled(context.options)) node.value = ":is";
53358
- if (index === 0 && node.length === 1) {
53359
- const targetSelector = node.nodes?.[0];
53360
- if (targetSelector && targetSelector.type === "selector" && transformSpacingSelector(targetSelector.nodes, context.options)) context.requiresSpacingNormalization = true;
53361
- node.replaceWith(...node.nodes);
53362
- if (parent && parent.type === "selector" && parent.length === 0) parent.remove();
53363
- }
54399
+ if (!parent || node.length === 0) return;
54400
+ const branches = node.nodes.filter((item) => item.type === "selector").flatMap(expandNestedFunctionalPseudoBranches);
54401
+ for (const branch of branches) if (transformSpacingSelector(branch.nodes, context.options)) context.requiresSpacingNormalization = true;
54402
+ if (branches.length > 1 && appendExpandedWhereSelectors(parent, index, branches, context)) return;
54403
+ const targetSelector = branches[0];
54404
+ if (targetSelector) node.replaceWith(...targetSelector.nodes.map((item) => item.clone()));
54405
+ if (parent.type === "selector" && parent.length === 0) parent.remove();
53364
54406
  }
53365
54407
  function shouldRemoveUnsupportedPseudoElementSelector(selector, options) {
53366
54408
  if (!isUniAppXEnabled(options)) return selector.nodes.some((node) => node.type === "pseudo" && MINI_PROGRAM_UNSUPPORTED_PSEUDO_ELEMENT_SELECTOR_SET.has(node.value));
@@ -54440,7 +55482,7 @@ function createPreparedNodes(options, signal) {
54440
55482
  preparedNodes.push(createPreparedNode(`pre:user-${index}`, "pre", () => plugin));
54441
55483
  });
54442
55484
  preparedNodes.push(createPreparedNode("pre:core", "pre", () => postcssWeappTailwindcssPrePlugin(options)));
54443
- if (!signal || signal.hasPresetEnvFeatures) preparedNodes.push(createPreparedNode("normal:preset-env", "normal", () => creator(presetEnvOptions)));
55485
+ if (!signal || signal.hasPresetEnvFeatures) preparedNodes.push(createPreparedNode("normal:preset-env", "normal", () => creator$1(presetEnvOptions)));
54444
55486
  if (!signal || signal.hasModernColorFunction) preparedNodes.push(createPreparedNode("normal:color-functional-fallback", "normal", () => createColorFunctionalFallback()));
54445
55487
  const unitsToPxPlugin = getUnitsToPxPlugin(options);
54446
55488
  if (unitsToPxPlugin) preparedNodes.push(createPreparedNode("normal:units-to-px", "normal", () => unitsToPxPlugin));
@@ -54695,22 +55737,443 @@ function createStyleHandler(options) {
54695
55737
  return handler;
54696
55738
  }
54697
55739
  //#endregion
55740
+ //#region src/postcss-config.ts
55741
+ const tailwindPostcssPluginNames = new Set(["tailwindcss", "@tailwindcss/postcss"]);
55742
+ function getPostcssPluginName(plugin) {
55743
+ if (!plugin) return;
55744
+ if (typeof plugin === "function" && "postcss" in plugin) try {
55745
+ return getPostcssPluginName(plugin());
55746
+ } catch {
55747
+ return;
55748
+ }
55749
+ if (typeof plugin !== "object" || !("postcssPlugin" in plugin)) return;
55750
+ const { postcssPlugin } = plugin;
55751
+ return typeof postcssPlugin === "string" ? postcssPlugin : void 0;
55752
+ }
55753
+ function isTailwindPostcssPlugin(plugin) {
55754
+ const name = getPostcssPluginName(plugin);
55755
+ return typeof name === "string" && tailwindPostcssPluginNames.has(name);
55756
+ }
55757
+ function removeTailwindPostcssPlugins(plugins) {
55758
+ let removed = 0;
55759
+ for (let i = plugins.length - 1; i >= 0; i--) if (isTailwindPostcssPlugin(plugins[i])) {
55760
+ plugins.splice(i, 1);
55761
+ removed++;
55762
+ }
55763
+ return removed;
55764
+ }
55765
+ async function resolveFilteredPostcssConfig(root) {
55766
+ try {
55767
+ const loaded = await (0, postcss_load_config.default)({}, root);
55768
+ const plugins = Array.isArray(loaded.plugins) ? [...loaded.plugins] : [];
55769
+ const removed = removeTailwindPostcssPlugins(plugins);
55770
+ if (removed === 0) return;
55771
+ return {
55772
+ options: loaded.options,
55773
+ plugins,
55774
+ removed
55775
+ };
55776
+ } catch (error) {
55777
+ if ((error instanceof Error ? error.message : String(error)).includes("No PostCSS Config found")) return;
55778
+ throw error;
55779
+ }
55780
+ }
55781
+ //#endregion
55782
+ //#region src/vite-css-rules.ts
55783
+ const MINI_PROGRAM_PREFLIGHT_SELECTOR_KEY = "view,text,::after,::before";
55784
+ const MINI_PROGRAM_PREFLIGHT_SELECTOR_KEYS = new Set([
55785
+ "view",
55786
+ "text",
55787
+ "::after",
55788
+ "::before"
55789
+ ]);
55790
+ const MINI_PROGRAM_THEME_SCOPE_SELECTOR_KEY = ":host,page,.tw-root,wx-root-portal-content";
55791
+ const MINI_PROGRAM_THEME_SCOPE_SELECTOR_KEYS = new Set([
55792
+ ":host",
55793
+ "page",
55794
+ ".tw-root",
55795
+ "wx-root-portal-content"
55796
+ ]);
55797
+ function normalizeCssForContainment(css) {
55798
+ return css.replace(/\/\*[\s\S]*?\*\//g, "").replace(/::(before|after)\b/g, ":$1").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~()])\s*/g, "$1").replace(/;\}/g, "}").trim();
55799
+ }
55800
+ function collectNormalizedCssNodes(css) {
55801
+ try {
55802
+ return (postcss.default.parse(css).nodes ?? []).filter((node) => node.type !== "comment").map((node) => normalizeCssForContainment(node.toString())).filter(Boolean);
55803
+ } catch {
55804
+ const normalizedCss = normalizeCssForContainment(css);
55805
+ return normalizedCss ? [normalizedCss] : [];
55806
+ }
55807
+ }
55808
+ function normalizeCssRuleKeyPart(value) {
55809
+ return value.replace(/::(before|after)\b/g, ":$1").replace(/\s+/g, " ").replace(/\s*([>+~(),])\s*/g, "$1").trim();
55810
+ }
55811
+ function getRuleAtRuleChain(rule) {
55812
+ const chain = [];
55813
+ let parent = rule.parent;
55814
+ while (parent && parent.type !== "root") {
55815
+ if (parent.type === "atrule") chain.unshift(`@${parent.name} ${normalizeCssRuleKeyPart(parent.params)}`);
55816
+ parent = parent.parent;
55817
+ }
55818
+ return chain;
55819
+ }
55820
+ function getCssRuleStructuralKey(rule) {
55821
+ const selector = normalizeCssRuleKeyPart(rule.selector);
55822
+ if (selector.length === 0) return;
55823
+ return [...getRuleAtRuleChain(rule), selector].join("|");
55824
+ }
55825
+ function getCssRuleStructuralKeyWithSelectorKey(rule, selectorKey) {
55826
+ return [...getRuleAtRuleChain(rule), selectorKey].join("|");
55827
+ }
55828
+ function getCssRuleContentKey(rule) {
55829
+ const structuralKey = getCssRuleStructuralKey(rule);
55830
+ if (!structuralKey) return;
55831
+ return [structuralKey, normalizeCssForContainment(rule.toString())].join("|");
55832
+ }
55833
+ function collectCssRuleContentKeys(css) {
55834
+ const keys = /* @__PURE__ */ new Set();
55835
+ try {
55836
+ postcss.default.parse(css).walkRules((rule) => {
55837
+ const key = getCssRuleContentKey(rule);
55838
+ if (key) keys.add(key);
55839
+ });
55840
+ } catch {}
55841
+ return keys;
55842
+ }
55843
+ function normalizeCssDeclarationKey(decl) {
55844
+ return [
55845
+ decl.prop.trim(),
55846
+ normalizeCssForContainment(decl.value),
55847
+ decl.important ? "!important" : ""
55848
+ ].join(":");
55849
+ }
55850
+ function collectCssRuleDeclarationKeys(rule) {
55851
+ const keys = /* @__PURE__ */ new Set();
55852
+ for (const node of rule.nodes ?? []) if (node.type === "decl") keys.add(normalizeCssDeclarationKey(node));
55853
+ return keys;
55854
+ }
55855
+ function collectCssRuleDeclarationProps(rule) {
55856
+ const props = /* @__PURE__ */ new Set();
55857
+ for (const node of rule.nodes ?? []) if (node.type === "decl") props.add(node.prop.trim());
55858
+ return props;
55859
+ }
55860
+ function collectCssRuleDeclarations(rule) {
55861
+ return (rule.nodes ?? []).filter((node) => node.type === "decl");
55862
+ }
55863
+ function collectCssRuleDeclarationKeyMap(css) {
55864
+ const map = /* @__PURE__ */ new Map();
55865
+ try {
55866
+ postcss.default.parse(css).walkRules((rule) => {
55867
+ const key = getCssRuleStructuralKey(rule);
55868
+ if (!key) return;
55869
+ const declarations = collectCssRuleDeclarationKeys(rule);
55870
+ if (declarations.size === 0) return;
55871
+ let existing = map.get(key);
55872
+ if (!existing) {
55873
+ existing = /* @__PURE__ */ new Set();
55874
+ map.set(key, existing);
55875
+ }
55876
+ for (const declaration of declarations) existing.add(declaration);
55877
+ });
55878
+ } catch {}
55879
+ return map;
55880
+ }
55881
+ function collectCssRuleDeclarationRecords(root, resolveRuleKey = getCssRuleStructuralKey) {
55882
+ const map = /* @__PURE__ */ new Map();
55883
+ root.walkRules((rule) => {
55884
+ const key = resolveRuleKey(rule);
55885
+ if (!key) return;
55886
+ const keys = collectCssRuleDeclarationKeys(rule);
55887
+ if (keys.size === 0) return;
55888
+ const records = map.get(key) ?? [];
55889
+ records.push({
55890
+ rule,
55891
+ keys,
55892
+ props: collectCssRuleDeclarationProps(rule)
55893
+ });
55894
+ map.set(key, records);
55895
+ });
55896
+ return map;
55897
+ }
55898
+ function normalizeSimpleMiniProgramSelectorNode(node) {
55899
+ if (node.type === "tag") {
55900
+ const value = node.value.toLowerCase();
55901
+ if (value === "view" || value === "text" || value === "page" || value === "wx-root-portal-content") return value;
55902
+ return;
55903
+ }
55904
+ if (node.type === "class") return node.value.toLowerCase() === "tw-root" ? ".tw-root" : void 0;
55905
+ if (node.type === "pseudo") {
55906
+ if (node.nodes && node.nodes.length > 0) return;
55907
+ const value = node.value.toLowerCase();
55908
+ if (value === ":before" || value === "::before") return "::before";
55909
+ if (value === ":after" || value === "::after") return "::after";
55910
+ if (value === ":host") return ":host";
55911
+ }
55912
+ }
55913
+ function normalizeSimpleMiniProgramSelector(selector) {
55914
+ if (selector.nodes.length !== 1) return;
55915
+ return normalizeSimpleMiniProgramSelectorNode(selector.nodes[0]);
55916
+ }
55917
+ function collectMiniProgramSelectorSet(selector) {
55918
+ try {
55919
+ const selectorSet = /* @__PURE__ */ new Set();
55920
+ const ast = (0, postcss_selector_parser.default)().astSync(selector);
55921
+ for (const child of ast.nodes) {
55922
+ const key = normalizeSimpleMiniProgramSelector(child);
55923
+ if (!key || selectorSet.has(key)) return;
55924
+ selectorSet.add(key);
55925
+ }
55926
+ return selectorSet;
55927
+ } catch {
55928
+ return;
55929
+ }
55930
+ }
55931
+ function isSameSelectorSet(actual, expected) {
55932
+ return actual?.size === expected.size && [...expected].every((key) => actual.has(key));
55933
+ }
55934
+ function getMiniProgramPreflightRuleStructuralKey(rule) {
55935
+ if (!isSameSelectorSet(collectMiniProgramSelectorSet(rule.selector), MINI_PROGRAM_PREFLIGHT_SELECTOR_KEYS)) return;
55936
+ return getCssRuleStructuralKeyWithSelectorKey(rule, MINI_PROGRAM_PREFLIGHT_SELECTOR_KEY);
55937
+ }
55938
+ function getMiniProgramThemeScopeRuleStructuralKey(rule) {
55939
+ if (!isSameSelectorSet(collectMiniProgramSelectorSet(rule.selector), MINI_PROGRAM_THEME_SCOPE_SELECTOR_KEYS)) return;
55940
+ return getCssRuleStructuralKeyWithSelectorKey(rule, MINI_PROGRAM_THEME_SCOPE_SELECTOR_KEY);
55941
+ }
55942
+ function mergeMiniProgramPreflightRuleDeclarations(baseCss, css) {
55943
+ try {
55944
+ const baseRoot = postcss.default.parse(baseCss);
55945
+ const root = postcss.default.parse(css);
55946
+ const baseRuleRecords = collectCssRuleDeclarationRecords(baseRoot, getMiniProgramPreflightRuleStructuralKey);
55947
+ let changedBase = false;
55948
+ let changedCss = false;
55949
+ root.walkRules((rule) => {
55950
+ const key = getMiniProgramPreflightRuleStructuralKey(rule);
55951
+ if (!key) return;
55952
+ const records = baseRuleRecords.get(key);
55953
+ const targetRecord = records?.[0];
55954
+ if (!targetRecord) return;
55955
+ const existingProps = new Set(records.flatMap((record) => [...record.props]));
55956
+ for (const decl of collectCssRuleDeclarations(rule)) {
55957
+ const prop = decl.prop.trim();
55958
+ if (existingProps.has(prop)) continue;
55959
+ targetRecord.rule.append(decl.clone());
55960
+ targetRecord.keys.add(normalizeCssDeclarationKey(decl));
55961
+ targetRecord.props.add(prop);
55962
+ existingProps.add(prop);
55963
+ changedBase = true;
55964
+ }
55965
+ rule.remove();
55966
+ changedCss = true;
55967
+ });
55968
+ if (!changedBase && !changedCss) return {
55969
+ baseCss,
55970
+ css,
55971
+ changed: false
55972
+ };
55973
+ removeEmptyAtRules(root);
55974
+ return {
55975
+ baseCss: changedBase ? baseRoot.toString() : baseCss,
55976
+ css: changedCss ? root.toString().trim() : css,
55977
+ changed: true
55978
+ };
55979
+ } catch {
55980
+ return {
55981
+ baseCss,
55982
+ css,
55983
+ changed: false
55984
+ };
55985
+ }
55986
+ }
55987
+ function mergeMiniProgramThemeScopeRuleDeclarations(baseCss, css) {
55988
+ try {
55989
+ const baseRoot = postcss.default.parse(baseCss);
55990
+ const root = postcss.default.parse(css);
55991
+ const baseRuleRecords = collectCssRuleDeclarationRecords(baseRoot, getMiniProgramThemeScopeRuleStructuralKey);
55992
+ let changedBase = false;
55993
+ let changedCss = false;
55994
+ root.walkRules((rule) => {
55995
+ const key = getMiniProgramThemeScopeRuleStructuralKey(rule);
55996
+ if (!key) return;
55997
+ const records = baseRuleRecords.get(key);
55998
+ const targetRecord = records?.[0];
55999
+ if (!targetRecord) return;
56000
+ const incomingDeclarations = collectCssRuleDeclarations(rule);
56001
+ if (incomingDeclarations.length === 0) return;
56002
+ const existingKeys = new Set(records.flatMap((record) => [...record.keys]));
56003
+ const existingProps = new Set(records.flatMap((record) => [...record.props]));
56004
+ if (incomingDeclarations.some((decl) => {
56005
+ const prop = decl.prop.trim();
56006
+ return existingProps.has(prop) && !existingKeys.has(normalizeCssDeclarationKey(decl));
56007
+ })) return;
56008
+ for (const decl of incomingDeclarations) {
56009
+ const declarationKey = normalizeCssDeclarationKey(decl);
56010
+ if (existingKeys.has(declarationKey)) continue;
56011
+ targetRecord.rule.append(decl.clone());
56012
+ targetRecord.keys.add(declarationKey);
56013
+ targetRecord.props.add(decl.prop.trim());
56014
+ existingKeys.add(declarationKey);
56015
+ existingProps.add(decl.prop.trim());
56016
+ changedBase = true;
56017
+ }
56018
+ rule.remove();
56019
+ changedCss = true;
56020
+ });
56021
+ if (!changedBase && !changedCss) return {
56022
+ baseCss,
56023
+ css,
56024
+ changed: false
56025
+ };
56026
+ removeEmptyAtRules(root);
56027
+ return {
56028
+ baseCss: changedBase ? baseRoot.toString() : baseCss,
56029
+ css: changedCss ? root.toString().trim() : css,
56030
+ changed: true
56031
+ };
56032
+ } catch {
56033
+ return {
56034
+ baseCss,
56035
+ css,
56036
+ changed: false
56037
+ };
56038
+ }
56039
+ }
56040
+ function isCssRuleCoveredByDeclarations(rule, baseRuleDeclarationKeys) {
56041
+ const key = getCssRuleStructuralKey(rule);
56042
+ if (!key) return false;
56043
+ const baseDeclarations = baseRuleDeclarationKeys.get(key);
56044
+ if (!baseDeclarations) return false;
56045
+ const declarations = collectCssRuleDeclarationKeys(rule);
56046
+ return declarations.size > 0 && [...declarations].every((declaration) => baseDeclarations.has(declaration));
56047
+ }
56048
+ function mergeCoveredCssRuleDeclarations(baseCss, css) {
56049
+ try {
56050
+ const baseRoot = postcss.default.parse(baseCss);
56051
+ const root = postcss.default.parse(css);
56052
+ const baseRuleRecords = collectCssRuleDeclarationRecords(baseRoot);
56053
+ let changedBase = false;
56054
+ let changedCss = false;
56055
+ root.walkRules((rule) => {
56056
+ const key = getCssRuleStructuralKey(rule);
56057
+ const records = key ? baseRuleRecords.get(key) : void 0;
56058
+ if (!records || records.length === 0) return;
56059
+ const incomingDeclarations = collectCssRuleDeclarations(rule);
56060
+ if (incomingDeclarations.length === 0) return;
56061
+ const baseKeys = new Set(records.flatMap((record) => [...record.keys]));
56062
+ if (incomingDeclarations.filter((decl) => baseKeys.has(normalizeCssDeclarationKey(decl))).length === 0) return;
56063
+ const missingDeclarations = incomingDeclarations.filter((decl) => !baseKeys.has(normalizeCssDeclarationKey(decl)));
56064
+ if (missingDeclarations.length === 0) {
56065
+ rule.remove();
56066
+ changedCss = true;
56067
+ return;
56068
+ }
56069
+ const baseProps = new Set(records.flatMap((record) => [...record.props]));
56070
+ if (missingDeclarations.filter((decl) => baseProps.has(decl.prop.trim())).length > 0) return;
56071
+ const targetRecord = records[0];
56072
+ if (!targetRecord) return;
56073
+ for (const decl of missingDeclarations) {
56074
+ targetRecord.rule.append(decl.clone());
56075
+ targetRecord.keys.add(normalizeCssDeclarationKey(decl));
56076
+ targetRecord.props.add(decl.prop.trim());
56077
+ }
56078
+ rule.remove();
56079
+ changedBase = true;
56080
+ changedCss = true;
56081
+ });
56082
+ if (!changedBase && !changedCss) return {
56083
+ baseCss,
56084
+ css,
56085
+ changed: false
56086
+ };
56087
+ removeEmptyAtRules(root);
56088
+ return {
56089
+ baseCss: changedBase ? baseRoot.toString() : baseCss,
56090
+ css: changedCss ? root.toString().trim() : css,
56091
+ changed: true
56092
+ };
56093
+ } catch {
56094
+ return {
56095
+ baseCss,
56096
+ css,
56097
+ changed: false
56098
+ };
56099
+ }
56100
+ }
56101
+ function removeEmptyAtRules(root) {
56102
+ root.walkAtRules((atRule) => {
56103
+ if (atRule.nodes && atRule.nodes.every((node) => node.type === "comment")) atRule.remove();
56104
+ });
56105
+ }
56106
+ function filterExistingCssRules(baseCss, css) {
56107
+ const baseRuleKeys = collectCssRuleContentKeys(baseCss);
56108
+ if (baseRuleKeys.size === 0) return css;
56109
+ try {
56110
+ const root = postcss.default.parse(css);
56111
+ const baseRuleDeclarationKeys = collectCssRuleDeclarationKeyMap(baseCss);
56112
+ let changed = false;
56113
+ root.walkRules((rule) => {
56114
+ const key = getCssRuleContentKey(rule);
56115
+ if (key && baseRuleKeys.has(key) || isCssRuleCoveredByDeclarations(rule, baseRuleDeclarationKeys)) {
56116
+ rule.remove();
56117
+ changed = true;
56118
+ }
56119
+ });
56120
+ if (!changed) return css;
56121
+ removeEmptyAtRules(root);
56122
+ return root.toString().trim();
56123
+ } catch {
56124
+ return css;
56125
+ }
56126
+ }
56127
+ function containsCssAfterMinify(baseCss, css) {
56128
+ if (baseCss.includes(css)) return true;
56129
+ const normalizedBaseCss = normalizeCssForContainment(baseCss);
56130
+ const normalizedCss = normalizeCssForContainment(css);
56131
+ if (normalizedCss.length > 0 && normalizedBaseCss.includes(normalizedCss)) return true;
56132
+ const normalizedNodes = collectNormalizedCssNodes(css);
56133
+ if (normalizedNodes.length > 0 && normalizedNodes.every((node) => normalizedBaseCss.includes(node))) return true;
56134
+ const baseRuleKeys = collectCssRuleContentKeys(baseCss);
56135
+ const ruleKeys = collectCssRuleContentKeys(css);
56136
+ return ruleKeys.size > 0 && [...ruleKeys].every((key) => baseRuleKeys.has(key));
56137
+ }
56138
+ //#endregion
56139
+ exports.CSS_MACRO_POSTCSS_PLUGIN_NAME = require_postcss.CSS_MACRO_POSTCSS_PLUGIN_NAME;
56140
+ exports.CSS_MACRO_STYLE_OPTIONS_MARKER = CSS_MACRO_STYLE_OPTIONS_MARKER;
56141
+ exports.compileCssMacroConditionalComments = compileCssMacroConditionalComments;
56142
+ exports.containsCssAfterMinify = containsCssAfterMinify;
54698
56143
  exports.createFallbackPlaceholderReplacer = createFallbackPlaceholderReplacer;
54699
56144
  exports.createInjectPreflight = createInjectPreflight;
54700
56145
  exports.createStyleHandler = createStyleHandler;
54701
56146
  exports.createStylePipeline = createStylePipeline;
56147
+ exports.createWeappTailwindcssPostcssPlugin = createWeappTailwindcssPostcssPlugin;
56148
+ exports.cssMacroPostcssPlugin = require_postcss.creator;
56149
+ exports.filterExistingCssRules = filterExistingCssRules;
54702
56150
  exports.finalizeMiniProgramCss = finalizeMiniProgramCss;
56151
+ exports.getPostcssPluginName = getPostcssPluginName;
56152
+ exports.hasCssMacroStyleOptions = hasCssMacroStyleOptions;
56153
+ exports.hasCssMacroTailwindV4Directive = hasCssMacroTailwindV4Directive;
54703
56154
  exports.hoistTailwindPreflightBase = hoistTailwindPreflightBase;
54704
56155
  exports.internalCssSelectorReplacer = internalCssSelectorReplacer;
56156
+ exports.mergeCoveredCssRuleDeclarations = mergeCoveredCssRuleDeclarations;
56157
+ exports.mergeMiniProgramPreflightRuleDeclarations = mergeMiniProgramPreflightRuleDeclarations;
56158
+ exports.mergeMiniProgramThemeScopeRuleDeclarations = mergeMiniProgramThemeScopeRuleDeclarations;
54705
56159
  exports.normalizeMiniProgramPrefixedDeclaration = normalizeMiniProgramPrefixedDeclaration;
54706
56160
  exports.normalizeModernColorValue = normalizeModernColorValue;
56161
+ Object.defineProperty(exports, "postcss", {
56162
+ enumerable: true,
56163
+ get: function() {
56164
+ return postcss.default;
56165
+ }
56166
+ });
54707
56167
  exports.postcssHtmlTransform = require_html_transform.postcssHtmlTransform;
54708
56168
  exports.protectDynamicColorMixAlpha = protectDynamicColorMixAlpha;
54709
56169
  exports.pruneMiniProgramGeneratedCss = pruneMiniProgramGeneratedCss;
56170
+ exports.removeTailwindPostcssPlugins = removeTailwindPostcssPlugins;
54710
56171
  exports.removeUnsupportedAtSupports = removeUnsupportedAtSupports;
54711
56172
  exports.removeUnsupportedCascadeLayers = removeUnsupportedCascadeLayers;
54712
56173
  exports.removeUnsupportedMiniProgramAtRules = removeUnsupportedMiniProgramAtRules;
54713
56174
  exports.removeUnsupportedMiniProgramPrefixedAtRule = removeUnsupportedMiniProgramPrefixedAtRule;
56175
+ exports.resolveFilteredPostcssConfig = resolveFilteredPostcssConfig;
56176
+ exports.transformCssMacroCss = transformCssMacroCss;
54714
56177
  Object.defineProperty(exports, "unitConversionComposeRules", {
54715
56178
  enumerable: true,
54716
56179
  get: function() {
@@ -54723,3 +56186,4 @@ Object.defineProperty(exports, "unitConversionPresets", {
54723
56186
  return postcss_rule_unit_converter.presets;
54724
56187
  }
54725
56188
  });
56189
+ exports.withCssMacroStyleOptions = withCssMacroStyleOptions;