@automattic/charts 4.13.0 → 4.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,8 +3,7 @@ import { formatNumber, formatNumberCompact } from "@automattic/number-formatters
3
3
  import { AnimatedAreaSeries, AnimatedAreaStack, AreaSeries, Axis, BarGroup, BarSeries, DataContext, GlyphSeries, Grid, TooltipContext, XYChart, buildChartTheme, useEventEmitter } from "@visx/xychart";
4
4
  import { __, _n, _x, sprintf } from "@wordpress/i18n";
5
5
  import clsx from "clsx";
6
- import * as React from "react";
7
- import { Children, Fragment, createContext, createContext as createContext$1, createElement, forwardRef, forwardRef as forwardRef$1, isValidElement, memo, useCallback, useCallback as useCallback$1, useContext, useContext as useContext$1, useEffect, useEffect as useEffect$1, useId, useImperativeHandle, useLayoutEffect, useMemo, useMemo as useMemo$1, useRef, useRef as useRef$1, useState, useState as useState$1, version } from "react";
6
+ import { Children, Fragment, createContext, createContext as createContext$1, createElement, forwardRef, forwardRef as forwardRef$1, isValidElement, memo, useCallback, useContext, useContext as useContext$1, useEffect, useEffect as useEffect$1, useId, useImperativeHandle, useLayoutEffect, useMemo, useMemo as useMemo$1, useRef, useRef as useRef$1, useState, useState as useState$1, version } from "react";
8
7
  import { differenceInHours, differenceInYears, isValid, parse, parseISO } from "date-fns";
9
8
  import { tzOffset } from "@date-fns/tz";
10
9
  import { Text, getStringWidth } from "@visx/text";
@@ -26,8 +25,6 @@ import { bisector } from "@visx/vendor/d3-array";
26
25
  import { PatternCircles, PatternHexagons, PatternLines, PatternWaves } from "@visx/pattern";
27
26
  import { Chart } from "react-google-charts";
28
27
  import DOMPurify from "dompurify";
29
- import { __assign } from "tslib";
30
- import "@babel/runtime/helpers/esm/extends";
31
28
  import { Icon, chevronRight } from "@wordpress/icons";
32
29
  import { arc, pie } from "@visx/shape";
33
30
  // \0rolldown/runtime.js
@@ -2125,16 +2122,17 @@ const BaseLegend = forwardRef(({ items: allItems, className, orientation = "hori
2125
2122
  chartId,
2126
2123
  context
2127
2124
  ]);
2128
- const createClickHandler = useCallback((seriesLabels, itemInteractive) => {
2125
+ const createClickHandler = useCallback((seriesLabels, itemInteractive, onToggle) => {
2129
2126
  if (!itemInteractive) return;
2130
- return () => handleLegendClick(seriesLabels);
2127
+ return onToggle ? () => onToggle() : () => handleLegendClick(seriesLabels);
2131
2128
  }, [handleLegendClick]);
2132
- const createKeyDownHandler = useCallback((seriesLabels, itemInteractive) => {
2129
+ const createKeyDownHandler = useCallback((seriesLabels, itemInteractive, onToggle) => {
2133
2130
  if (!itemInteractive) return;
2131
+ const toggle = onToggle ?? (() => handleLegendClick(seriesLabels));
2134
2132
  return (event) => {
2135
2133
  if (event.key === "Enter" || event.key === " ") {
2136
2134
  event.preventDefault();
2137
- handleLegendClick(seriesLabels);
2135
+ if (!event.repeat) toggle();
2138
2136
  }
2139
2137
  };
2140
2138
  }, [handleLegendClick]);
@@ -2158,10 +2156,11 @@ const BaseLegend = forwardRef(({ items: allItems, className, orientation = "hori
2158
2156
  children: labels.map((label, i) => {
2159
2157
  const matchedItem = items[i];
2160
2158
  const seriesLabels = matchedItem?.seriesLabels?.length ? matchedItem.seriesLabels : [label.text];
2161
- const visible = matchedItem?.interactive === false || isSeriesVisible(seriesLabels[0]);
2162
2159
  const itemInteractive = interactive && matchedItem?.interactive !== false;
2163
- const handleClick = createClickHandler(seriesLabels, itemInteractive);
2164
- const handleKeyDown = createKeyDownHandler(seriesLabels, itemInteractive);
2160
+ const onToggle = itemInteractive ? matchedItem?.onToggle : void 0;
2161
+ const visible = matchedItem?.onToggle ? matchedItem.pressed : matchedItem?.interactive === false || isSeriesVisible(seriesLabels[0]);
2162
+ const handleClick = createClickHandler(seriesLabels, itemInteractive, onToggle);
2163
+ const handleKeyDown = createKeyDownHandler(seriesLabels, itemInteractive, onToggle);
2165
2164
  return /* @__PURE__ */ jsxs(LegendItem, {
2166
2165
  className: clsx("visx-legend-item", base_legend_module_default["legend-item"], itemInteractive && base_legend_module_default["legend-item--interactive"], !visible && base_legend_module_default["legend-item--inactive"], itemClassName),
2167
2166
  margin: itemMargin,
@@ -9851,51 +9850,9 @@ function isPlainObject(o) {
9851
9850
  if (prot.hasOwnProperty("isPrototypeOf") === false) return false;
9852
9851
  return true;
9853
9852
  }
9854
- // ../../../node_modules/.pnpm/lower-case@2.0.2/node_modules/lower-case/dist.es2015/index.js
9855
- /**
9856
- * Lower case as a function.
9857
- */
9858
- function lowerCase(str) {
9859
- return str.toLowerCase();
9860
- }
9861
- // ../../../node_modules/.pnpm/no-case@3.0.4/node_modules/no-case/dist.es2015/index.js
9862
- var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
9863
- var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
9864
- /**
9865
- * Normalize the string into something other libraries can manipulate easier.
9866
- */
9867
- function noCase(input, options) {
9868
- if (options === void 0) options = {};
9869
- var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
9870
- var result = replace$1(replace$1(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
9871
- var start = 0;
9872
- var end = result.length;
9873
- while (result.charAt(start) === "\0") start++;
9874
- while (result.charAt(end - 1) === "\0") end--;
9875
- return result.slice(start, end).split("\0").map(transform).join(delimiter);
9876
- }
9877
- /**
9878
- * Replace `re` in the input string with the replacement value.
9879
- */
9880
- function replace$1(input, re, value) {
9881
- if (re instanceof RegExp) return input.replace(re, value);
9882
- return re.reduce(function(input, re) {
9883
- return input.replace(re, value);
9884
- }, input);
9885
- }
9886
- // ../../../node_modules/.pnpm/dot-case@3.0.4/node_modules/dot-case/dist.es2015/index.js
9887
- function dotCase(input, options) {
9888
- if (options === void 0) options = {};
9889
- return noCase(input, __assign({ delimiter: "." }, options));
9890
- }
9891
- // ../../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js
9892
- function paramCase(input, options) {
9893
- if (options === void 0) options = {};
9894
- return dotCase(input, __assign({ delimiter: "-" }, options));
9895
- }
9896
- // ../../../node_modules/.pnpm/@wordpress+warning@3.57.0/node_modules/@wordpress/warning/build-module/utils.mjs
9853
+ // ../../../node_modules/.pnpm/@wordpress+warning@4.0.0/node_modules/@wordpress/warning/build-module/utils.mjs
9897
9854
  var logged = /* @__PURE__ */ new Set();
9898
- // ../../../node_modules/.pnpm/@wordpress+warning@3.57.0/node_modules/@wordpress/warning/build-module/index.mjs
9855
+ // ../../../node_modules/.pnpm/@wordpress+warning@4.0.0/node_modules/@wordpress/warning/build-module/index.mjs
9899
9856
  function isDev() {
9900
9857
  return globalThis.SCRIPT_DEBUG === true;
9901
9858
  }
@@ -9908,7 +9865,53 @@ function warning(message) {
9908
9865
  } catch {}
9909
9866
  logged.add(message);
9910
9867
  }
9911
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
9868
+ // ../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/es6/index.js
9869
+ var require_es6 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9870
+ module.exports = function equal(a, b) {
9871
+ if (a === b) return true;
9872
+ if (a && b && typeof a == "object" && typeof b == "object") {
9873
+ if (a.constructor !== b.constructor) return false;
9874
+ var length, i, keys;
9875
+ if (Array.isArray(a)) {
9876
+ length = a.length;
9877
+ if (length != b.length) return false;
9878
+ for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;
9879
+ return true;
9880
+ }
9881
+ if (a instanceof Map && b instanceof Map) {
9882
+ if (a.size !== b.size) return false;
9883
+ for (i of a.entries()) if (!b.has(i[0])) return false;
9884
+ for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false;
9885
+ return true;
9886
+ }
9887
+ if (a instanceof Set && b instanceof Set) {
9888
+ if (a.size !== b.size) return false;
9889
+ for (i of a.entries()) if (!b.has(i[0])) return false;
9890
+ return true;
9891
+ }
9892
+ if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
9893
+ length = a.length;
9894
+ if (length != b.length) return false;
9895
+ for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false;
9896
+ return true;
9897
+ }
9898
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
9899
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
9900
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
9901
+ keys = Object.keys(a);
9902
+ length = keys.length;
9903
+ if (length !== Object.keys(b).length) return false;
9904
+ for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
9905
+ for (i = length; i-- !== 0;) {
9906
+ var key = keys[i];
9907
+ if (!equal(a[key], b[key])) return false;
9908
+ }
9909
+ return true;
9910
+ }
9911
+ return a !== a && b !== b;
9912
+ };
9913
+ }));
9914
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
9912
9915
  function useUpdateEffect(effect, deps) {
9913
9916
  const mountedRef = useRef$1(false);
9914
9917
  useEffect$1(() => {
@@ -9920,1147 +9923,33 @@ function useUpdateEffect(effect, deps) {
9920
9923
  }, []);
9921
9924
  }
9922
9925
  var use_update_effect_default = useUpdateEffect;
9923
- // ../../../node_modules/.pnpm/@emotion+sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
9924
- function sheetForTag(tag) {
9925
- if (tag.sheet) return tag.sheet;
9926
- /* istanbul ignore next */
9927
- for (var i = 0; i < document.styleSheets.length; i++) if (document.styleSheets[i].ownerNode === tag) return document.styleSheets[i];
9928
- }
9929
- function createStyleElement(options) {
9930
- var tag = document.createElement("style");
9931
- tag.setAttribute("data-emotion", options.key);
9932
- if (options.nonce !== void 0) tag.setAttribute("nonce", options.nonce);
9933
- tag.appendChild(document.createTextNode(""));
9934
- tag.setAttribute("data-s", "");
9935
- return tag;
9936
- }
9937
- var StyleSheet = /*#__PURE__*/ function() {
9938
- function StyleSheet(options) {
9939
- var _this = this;
9940
- this._insertTag = function(tag) {
9941
- var before;
9942
- if (_this.tags.length === 0) {
9943
- if (_this.insertionPoint) before = _this.insertionPoint.nextSibling;
9944
- else if (_this.prepend) before = _this.container.firstChild;
9945
- else before = _this.before;
9946
- } else before = _this.tags[_this.tags.length - 1].nextSibling;
9947
- _this.container.insertBefore(tag, before);
9948
- _this.tags.push(tag);
9949
- };
9950
- this.isSpeedy = options.speedy === void 0 ? true : options.speedy;
9951
- this.tags = [];
9952
- this.ctr = 0;
9953
- this.nonce = options.nonce;
9954
- this.key = options.key;
9955
- this.container = options.container;
9956
- this.prepend = options.prepend;
9957
- this.insertionPoint = options.insertionPoint;
9958
- this.before = null;
9959
- }
9960
- var _proto = StyleSheet.prototype;
9961
- _proto.hydrate = function hydrate(nodes) {
9962
- nodes.forEach(this._insertTag);
9963
- };
9964
- _proto.insert = function insert(rule) {
9965
- if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) this._insertTag(createStyleElement(this));
9966
- var tag = this.tags[this.tags.length - 1];
9967
- if (this.isSpeedy) {
9968
- var sheet = sheetForTag(tag);
9969
- try {
9970
- sheet.insertRule(rule, sheet.cssRules.length);
9971
- } catch (e) {}
9972
- } else tag.appendChild(document.createTextNode(rule));
9973
- this.ctr++;
9974
- };
9975
- _proto.flush = function flush() {
9976
- this.tags.forEach(function(tag) {
9977
- var _tag$parentNode;
9978
- return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
9979
- });
9980
- this.tags = [];
9981
- this.ctr = 0;
9982
- };
9983
- return StyleSheet;
9984
- }();
9985
- // ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js
9986
- var MS = "-ms-";
9987
- var MOZ = "-moz-";
9988
- var WEBKIT = "-webkit-";
9989
- var COMMENT = "comm";
9990
- var RULESET = "rule";
9991
- var DECLARATION = "decl";
9992
- var IMPORT = "@import";
9993
- var KEYFRAMES = "@keyframes";
9994
- var LAYER = "@layer";
9995
- // ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js
9996
- /**
9997
- * @param {number}
9998
- * @return {number}
9999
- */
10000
- var abs = Math.abs;
10001
- /**
10002
- * @param {number}
10003
- * @return {string}
10004
- */
10005
- var from = String.fromCharCode;
10006
- /**
10007
- * @param {object}
10008
- * @return {object}
10009
- */
10010
- var assign = Object.assign;
10011
- /**
10012
- * @param {string} value
10013
- * @param {number} length
10014
- * @return {number}
10015
- */
10016
- function hash(value, length) {
10017
- return charat(value, 0) ^ 45 ? (((length << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
10018
- }
10019
- /**
10020
- * @param {string} value
10021
- * @return {string}
10022
- */
10023
- function trim(value) {
10024
- return value.trim();
10025
- }
10026
- /**
10027
- * @param {string} value
10028
- * @param {RegExp} pattern
10029
- * @return {string?}
10030
- */
10031
- function match(value, pattern) {
10032
- return (value = pattern.exec(value)) ? value[0] : value;
10033
- }
10034
- /**
10035
- * @param {string} value
10036
- * @param {(string|RegExp)} pattern
10037
- * @param {string} replacement
10038
- * @return {string}
10039
- */
10040
- function replace(value, pattern, replacement) {
10041
- return value.replace(pattern, replacement);
10042
- }
10043
- /**
10044
- * @param {string} value
10045
- * @param {string} search
10046
- * @return {number}
10047
- */
10048
- function indexof(value, search) {
10049
- return value.indexOf(search);
10050
- }
10051
- /**
10052
- * @param {string} value
10053
- * @param {number} index
10054
- * @return {number}
10055
- */
10056
- function charat(value, index) {
10057
- return value.charCodeAt(index) | 0;
10058
- }
10059
- /**
10060
- * @param {string} value
10061
- * @param {number} begin
10062
- * @param {number} end
10063
- * @return {string}
10064
- */
10065
- function substr(value, begin, end) {
10066
- return value.slice(begin, end);
10067
- }
10068
- /**
10069
- * @param {string} value
10070
- * @return {number}
10071
- */
10072
- function strlen(value) {
10073
- return value.length;
10074
- }
10075
- /**
10076
- * @param {any[]} value
10077
- * @return {number}
10078
- */
10079
- function sizeof(value) {
10080
- return value.length;
10081
- }
10082
- /**
10083
- * @param {any} value
10084
- * @param {any[]} array
10085
- * @return {any}
10086
- */
10087
- function append(value, array) {
10088
- return array.push(value), value;
10089
- }
10090
- /**
10091
- * @param {string[]} array
10092
- * @param {function} callback
10093
- * @return {string}
10094
- */
10095
- function combine(array, callback) {
10096
- return array.map(callback).join("");
10097
- }
10098
- // ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js
10099
- var line = 1;
10100
- var column = 1;
10101
- var length = 0;
10102
- var position = 0;
10103
- var character = 0;
10104
- var characters = "";
10105
- /**
10106
- * @param {string} value
10107
- * @param {object | null} root
10108
- * @param {object | null} parent
10109
- * @param {string} type
10110
- * @param {string[] | string} props
10111
- * @param {object[] | string} children
10112
- * @param {number} length
10113
- */
10114
- function node(value, root, parent, type, props, children, length) {
10115
- return {
10116
- value,
10117
- root,
10118
- parent,
10119
- type,
10120
- props,
10121
- children,
10122
- line,
10123
- column,
10124
- length,
10125
- return: ""
10126
- };
10127
- }
10128
- /**
10129
- * @param {object} root
10130
- * @param {object} props
10131
- * @return {object}
10132
- */
10133
- function copy(root, props) {
10134
- return assign(node("", null, null, "", null, null, 0), root, { length: -root.length }, props);
10135
- }
10136
- /**
10137
- * @return {number}
10138
- */
10139
- function char() {
10140
- return character;
10141
- }
10142
- /**
10143
- * @return {number}
10144
- */
10145
- function prev() {
10146
- character = position > 0 ? charat(characters, --position) : 0;
10147
- if (column--, character === 10) column = 1, line--;
10148
- return character;
10149
- }
10150
- /**
10151
- * @return {number}
10152
- */
10153
- function next() {
10154
- character = position < length ? charat(characters, position++) : 0;
10155
- if (column++, character === 10) column = 1, line++;
10156
- return character;
10157
- }
10158
- /**
10159
- * @return {number}
10160
- */
10161
- function peek() {
10162
- return charat(characters, position);
10163
- }
10164
- /**
10165
- * @return {number}
10166
- */
10167
- function caret() {
10168
- return position;
10169
- }
10170
- /**
10171
- * @param {number} begin
10172
- * @param {number} end
10173
- * @return {string}
10174
- */
10175
- function slice(begin, end) {
10176
- return substr(characters, begin, end);
10177
- }
10178
- /**
10179
- * @param {number} type
10180
- * @return {number}
10181
- */
10182
- function token(type) {
10183
- switch (type) {
10184
- case 0:
10185
- case 9:
10186
- case 10:
10187
- case 13:
10188
- case 32: return 5;
10189
- case 33:
10190
- case 43:
10191
- case 44:
10192
- case 47:
10193
- case 62:
10194
- case 64:
10195
- case 126:
10196
- case 59:
10197
- case 123:
10198
- case 125: return 4;
10199
- case 58: return 3;
10200
- case 34:
10201
- case 39:
10202
- case 40:
10203
- case 91: return 2;
10204
- case 41:
10205
- case 93: return 1;
10206
- }
10207
- return 0;
10208
- }
10209
- /**
10210
- * @param {string} value
10211
- * @return {any[]}
10212
- */
10213
- function alloc(value) {
10214
- return line = column = 1, length = strlen(characters = value), position = 0, [];
10215
- }
10216
- /**
10217
- * @param {any} value
10218
- * @return {any}
10219
- */
10220
- function dealloc(value) {
10221
- return characters = "", value;
10222
- }
10223
- /**
10224
- * @param {number} type
10225
- * @return {string}
10226
- */
10227
- function delimit(type) {
10228
- return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
10229
- }
10230
- /**
10231
- * @param {number} type
10232
- * @return {string}
10233
- */
10234
- function whitespace(type) {
10235
- while (character = peek()) if (character < 33) next();
10236
- else break;
10237
- return token(type) > 2 || token(character) > 3 ? "" : " ";
10238
- }
10239
- /**
10240
- * @param {number} index
10241
- * @param {number} count
10242
- * @return {string}
10243
- */
10244
- function escaping(index, count) {
10245
- while (--count && next()) if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) break;
10246
- return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
10247
- }
10248
- /**
10249
- * @param {number} type
10250
- * @return {number}
10251
- */
10252
- function delimiter(type) {
10253
- while (next()) switch (character) {
10254
- case type: return position;
10255
- case 34:
10256
- case 39:
10257
- if (type !== 34 && type !== 39) delimiter(character);
10258
- break;
10259
- case 40:
10260
- if (type === 41) delimiter(type);
10261
- break;
10262
- case 92: next();
10263
- }
10264
- return position;
10265
- }
10266
- /**
10267
- * @param {number} type
10268
- * @param {number} index
10269
- * @return {number}
10270
- */
10271
- function commenter(type, index) {
10272
- while (next()) if (type + character === 57) break;
10273
- else if (type + character === 84 && peek() === 47) break;
10274
- return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
10275
- }
10276
- /**
10277
- * @param {number} index
10278
- * @return {string}
10279
- */
10280
- function identifier(index) {
10281
- while (!token(peek())) next();
10282
- return slice(index, position);
10283
- }
10284
- // ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js
10285
- /**
10286
- * @param {string} value
10287
- * @return {object[]}
10288
- */
10289
- function compile(value) {
10290
- return dealloc(parse$1("", null, null, null, [""], value = alloc(value), 0, [0], value));
10291
- }
10292
- /**
10293
- * @param {string} value
10294
- * @param {object} root
10295
- * @param {object?} parent
10296
- * @param {string[]} rule
10297
- * @param {string[]} rules
10298
- * @param {string[]} rulesets
10299
- * @param {number[]} pseudo
10300
- * @param {number[]} points
10301
- * @param {string[]} declarations
10302
- * @return {object}
10303
- */
10304
- function parse$1(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
10305
- var index = 0;
10306
- var offset = 0;
10307
- var length = pseudo;
10308
- var atrule = 0;
10309
- var property = 0;
10310
- var previous = 0;
10311
- var variable = 1;
10312
- var scanning = 1;
10313
- var ampersand = 1;
10314
- var character = 0;
10315
- var type = "";
10316
- var props = rules;
10317
- var children = rulesets;
10318
- var reference = rule;
10319
- var characters = type;
10320
- while (scanning) switch (previous = character, character = next()) {
10321
- case 40: if (previous != 108 && charat(characters, length - 1) == 58) {
10322
- if (indexof(characters += replace(delimit(character), "&", "&\f"), "&\f") != -1) ampersand = -1;
10323
- break;
10324
- }
10325
- case 34:
10326
- case 39:
10327
- case 91:
10328
- characters += delimit(character);
10329
- break;
10330
- case 9:
10331
- case 10:
10332
- case 13:
10333
- case 32:
10334
- characters += whitespace(previous);
10335
- break;
10336
- case 92:
10337
- characters += escaping(caret() - 1, 7);
10338
- continue;
10339
- case 47:
10340
- switch (peek()) {
10341
- case 42:
10342
- case 47:
10343
- append(comment(commenter(next(), caret()), root, parent), declarations);
10344
- break;
10345
- default: characters += "/";
10346
- }
10347
- break;
10348
- case 123 * variable: points[index++] = strlen(characters) * ampersand;
10349
- case 125 * variable:
10350
- case 59:
10351
- case 0:
10352
- switch (character) {
10353
- case 0:
10354
- case 125: scanning = 0;
10355
- case 59 + offset:
10356
- if (ampersand == -1) characters = replace(characters, /\f/g, "");
10357
- if (property > 0 && strlen(characters) - length) append(property > 32 ? declaration(characters + ";", rule, parent, length - 1) : declaration(replace(characters, " ", "") + ";", rule, parent, length - 2), declarations);
10358
- break;
10359
- case 59: characters += ";";
10360
- default:
10361
- append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
10362
- if (character === 123) if (offset === 0) parse$1(characters, root, reference, reference, props, rulesets, length, points, children);
10363
- else switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
10364
- case 100:
10365
- case 108:
10366
- case 109:
10367
- case 115:
10368
- parse$1(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children);
10369
- break;
10370
- default: parse$1(characters, reference, reference, reference, [""], children, 0, points, children);
10371
- }
10372
- }
10373
- index = offset = property = 0, variable = ampersand = 1, type = characters = "", length = pseudo;
10374
- break;
10375
- case 58: length = 1 + strlen(characters), property = previous;
10376
- default:
10377
- if (variable < 1) {
10378
- if (character == 123) --variable;
10379
- else if (character == 125 && variable++ == 0 && prev() == 125) continue;
10380
- }
10381
- switch (characters += from(character), character * variable) {
10382
- case 38:
10383
- ampersand = offset > 0 ? 1 : (characters += "\f", -1);
10384
- break;
10385
- case 44:
10386
- points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
10387
- break;
10388
- case 64:
10389
- if (peek() === 45) characters += delimit(next());
10390
- atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
10391
- break;
10392
- case 45: if (previous === 45 && strlen(characters) == 2) variable = 0;
10393
- }
10394
- }
10395
- return rulesets;
10396
- }
10397
- /**
10398
- * @param {string} value
10399
- * @param {object} root
10400
- * @param {object?} parent
10401
- * @param {number} index
10402
- * @param {number} offset
10403
- * @param {string[]} rules
10404
- * @param {number[]} points
10405
- * @param {string} type
10406
- * @param {string[]} props
10407
- * @param {string[]} children
10408
- * @param {number} length
10409
- * @return {object}
10410
- */
10411
- function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length) {
10412
- var post = offset - 1;
10413
- var rule = offset === 0 ? rules : [""];
10414
- var size = sizeof(rule);
10415
- for (var i = 0, j = 0, k = 0; i < index; ++i) for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x]))) props[k++] = z;
10416
- return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length);
10417
- }
10418
- /**
10419
- * @param {number} value
10420
- * @param {object} root
10421
- * @param {object?} parent
10422
- * @return {object}
10423
- */
10424
- function comment(value, root, parent) {
10425
- return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
10426
- }
10427
- /**
10428
- * @param {string} value
10429
- * @param {object} root
10430
- * @param {object?} parent
10431
- * @param {number} length
10432
- * @return {object}
10433
- */
10434
- function declaration(value, root, parent, length) {
10435
- return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length);
10436
- }
10437
- // ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js
10438
- /**
10439
- * @param {object[]} children
10440
- * @param {function} callback
10441
- * @return {string}
10442
- */
10443
- function serialize(children, callback) {
10444
- var output = "";
10445
- var length = sizeof(children);
10446
- for (var i = 0; i < length; i++) output += callback(children[i], i, children, callback) || "";
10447
- return output;
10448
- }
10449
- /**
10450
- * @param {object} element
10451
- * @param {number} index
10452
- * @param {object[]} children
10453
- * @param {function} callback
10454
- * @return {string}
10455
- */
10456
- function stringify(element, index, children, callback) {
10457
- switch (element.type) {
10458
- case LAYER: if (element.children.length) break;
10459
- case IMPORT:
10460
- case DECLARATION: return element.return = element.return || element.value;
10461
- case COMMENT: return "";
10462
- case KEYFRAMES: return element.return = element.value + "{" + serialize(element.children, callback) + "}";
10463
- case RULESET: element.value = element.props.join(",");
10464
- }
10465
- return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
10466
- }
10467
- // ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js
10468
- /**
10469
- * @param {function[]} collection
10470
- * @return {function}
10471
- */
10472
- function middleware(collection) {
10473
- var length = sizeof(collection);
10474
- return function(element, index, children, callback) {
10475
- var output = "";
10476
- for (var i = 0; i < length; i++) output += collection[i](element, index, children, callback) || "";
10477
- return output;
10478
- };
10479
- }
10480
- /**
10481
- * @param {function} callback
10482
- * @return {function}
10483
- */
10484
- function rulesheet(callback) {
10485
- return function(element) {
10486
- if (!element.root) {
10487
- if (element = element.return) callback(element);
10488
- }
10489
- };
10490
- }
10491
- // ../../../node_modules/.pnpm/@emotion+memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
10492
- function memoize(fn) {
10493
- var cache = Object.create(null);
10494
- return function(arg) {
10495
- if (cache[arg] === void 0) cache[arg] = fn(arg);
10496
- return cache[arg];
10497
- };
10498
- }
10499
- // ../../../node_modules/.pnpm/@emotion+cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
10500
- var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
10501
- var previous = 0;
10502
- var character = 0;
10503
- while (true) {
10504
- previous = character;
10505
- character = peek();
10506
- if (previous === 38 && character === 12) points[index] = 1;
10507
- if (token(character)) break;
10508
- next();
10509
- }
10510
- return slice(begin, position);
10511
- };
10512
- var toRules = function toRules(parsed, points) {
10513
- var index = -1;
10514
- var character = 44;
10515
- do
10516
- switch (token(character)) {
10517
- case 0:
10518
- if (character === 38 && peek() === 12) points[index] = 1;
10519
- parsed[index] += identifierWithPointTracking(position - 1, points, index);
10520
- break;
10521
- case 2:
10522
- parsed[index] += delimit(character);
10523
- break;
10524
- case 4: if (character === 44) {
10525
- parsed[++index] = peek() === 58 ? "&\f" : "";
10526
- points[index] = parsed[index].length;
10527
- break;
10528
- }
10529
- default: parsed[index] += from(character);
10530
- }
10531
- while (character = next());
10532
- return parsed;
10533
- };
10534
- var getRules = function getRules(value, points) {
10535
- return dealloc(toRules(alloc(value), points));
10536
- };
10537
- var fixedElements = /* #__PURE__ */ new WeakMap();
10538
- var compat = function compat(element) {
10539
- if (element.type !== "rule" || !element.parent || element.length < 1) return;
10540
- var value = element.value;
10541
- var parent = element.parent;
10542
- var isImplicitRule = element.column === parent.column && element.line === parent.line;
10543
- while (parent.type !== "rule") {
10544
- parent = parent.parent;
10545
- if (!parent) return;
10546
- }
10547
- if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) return;
10548
- if (isImplicitRule) return;
10549
- fixedElements.set(element, true);
10550
- var points = [];
10551
- var rules = getRules(value, points);
10552
- var parentRules = parent.props;
10553
- for (var i = 0, k = 0; i < rules.length; i++) for (var j = 0; j < parentRules.length; j++, k++) element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
10554
- };
10555
- var removeLabel = function removeLabel(element) {
10556
- if (element.type === "decl") {
10557
- var value = element.value;
10558
- if (value.charCodeAt(0) === 108 && value.charCodeAt(2) === 98) {
10559
- element["return"] = "";
10560
- element.value = "";
10561
- }
10562
- }
10563
- };
10564
- function prefix(value, length) {
10565
- switch (hash(value, length)) {
10566
- case 5103: return WEBKIT + "print-" + value + value;
10567
- case 5737:
10568
- case 4201:
10569
- case 3177:
10570
- case 3433:
10571
- case 1641:
10572
- case 4457:
10573
- case 2921:
10574
- case 5572:
10575
- case 6356:
10576
- case 5844:
10577
- case 3191:
10578
- case 6645:
10579
- case 3005:
10580
- case 6391:
10581
- case 5879:
10582
- case 5623:
10583
- case 6135:
10584
- case 4599:
10585
- case 4855:
10586
- case 4215:
10587
- case 6389:
10588
- case 5109:
10589
- case 5365:
10590
- case 5621:
10591
- case 3829: return WEBKIT + value + value;
10592
- case 5349:
10593
- case 4246:
10594
- case 4810:
10595
- case 6968:
10596
- case 2756: return WEBKIT + value + MOZ + value + MS + value + value;
10597
- case 6828:
10598
- case 4268: return WEBKIT + value + MS + value + value;
10599
- case 6165: return WEBKIT + value + MS + "flex-" + value + value;
10600
- case 5187: return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
10601
- case 5443: return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
10602
- case 4675: return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
10603
- case 5548: return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
10604
- case 5292: return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
10605
- case 6060: return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
10606
- case 4554: return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
10607
- case 6187: return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
10608
- case 5495:
10609
- case 3959: return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
10610
- case 4968: return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
10611
- case 4095:
10612
- case 3583:
10613
- case 4068:
10614
- case 2532: return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
10615
- case 8116:
10616
- case 7059:
10617
- case 5753:
10618
- case 5535:
10619
- case 5445:
10620
- case 5701:
10621
- case 4933:
10622
- case 4677:
10623
- case 5533:
10624
- case 5789:
10625
- case 5021:
10626
- case 4765:
10627
- if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
10628
- case 109: if (charat(value, length + 4) !== 45) break;
10629
- case 102: return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length + 3) == 108 ? "$3" : "$2-$3")) + value;
10630
- case 115: return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length) + value : value;
10631
- }
10632
- break;
10633
- case 4949: if (charat(value, length + 1) !== 115) break;
10634
- case 6444:
10635
- switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
10636
- case 107: return replace(value, ":", ":" + WEBKIT) + value;
10637
- case 101: return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
10638
- }
10639
- break;
10640
- case 5936:
10641
- switch (charat(value, length + 11)) {
10642
- case 114: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
10643
- case 108: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
10644
- case 45: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
10645
- }
10646
- return WEBKIT + value + MS + value + value;
10647
- }
10648
- return value;
9926
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
9927
+ var import_es6 = /* @__PURE__ */ __toESM(require_es6(), 1);
9928
+ var ComponentsContext = createContext$1({});
9929
+ ComponentsContext.displayName = "ComponentsContext";
9930
+ var useComponentsContext = () => useContext$1(ComponentsContext);
9931
+ function useContextSystemBridge({ value }) {
9932
+ const parentContext = useComponentsContext();
9933
+ const valueRef = useRef$1(value);
9934
+ use_update_effect_default(() => {
9935
+ if ((0, import_es6.default)(valueRef.current, value) && valueRef.current !== value) warning(`Please memoize your context: ${JSON.stringify(value)}`);
9936
+ }, [value]);
9937
+ return useMemo$1(() => {
9938
+ return deepmerge(parentContext ?? {}, value ?? {}, { isMergeableObject: isPlainObject });
9939
+ }, [parentContext, value]);
10649
9940
  }
10650
- var defaultStylisPlugins = [function prefixer(element, index, children, callback) {
10651
- if (element.length > -1) {
10652
- if (!element["return"]) switch (element.type) {
10653
- case DECLARATION:
10654
- element["return"] = prefix(element.value, element.length);
10655
- break;
10656
- case KEYFRAMES: return serialize([copy(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback);
10657
- case RULESET: if (element.length) return combine(element.props, function(value) {
10658
- switch (match(value, /(::plac\w+|:read-\w+)/)) {
10659
- case ":read-only":
10660
- case ":read-write": return serialize([copy(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] })], callback);
10661
- case "::placeholder": return serialize([
10662
- copy(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] }),
10663
- copy(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] }),
10664
- copy(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] })
10665
- ], callback);
10666
- }
10667
- return "";
10668
- });
10669
- }
10670
- }
10671
- }];
10672
- var createCache = function createCache(options) {
10673
- var key = options.key;
10674
- if (key === "css") {
10675
- var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
10676
- Array.prototype.forEach.call(ssrStyles, function(node) {
10677
- if (node.getAttribute("data-emotion").indexOf(" ") === -1) return;
10678
- document.head.appendChild(node);
10679
- node.setAttribute("data-s", "");
10680
- });
10681
- }
10682
- var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
10683
- var inserted = {};
10684
- var container;
10685
- var nodesToHydrate = [];
10686
- container = options.container || document.head;
10687
- Array.prototype.forEach.call(document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function(node) {
10688
- var attrib = node.getAttribute("data-emotion").split(" ");
10689
- for (var i = 1; i < attrib.length; i++) inserted[attrib[i]] = true;
10690
- nodesToHydrate.push(node);
10691
- });
10692
- var _insert;
10693
- var omnipresentPlugins = [compat, removeLabel];
10694
- var currentSheet;
10695
- var finalizingPlugins = [stringify, rulesheet(function(rule) {
10696
- currentSheet.insert(rule);
10697
- })];
10698
- var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
10699
- var stylis = function stylis(styles) {
10700
- return serialize(compile(styles), serializer);
10701
- };
10702
- _insert = function insert(selector, serialized, sheet, shouldCache) {
10703
- currentSheet = sheet;
10704
- stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
10705
- if (shouldCache) cache.inserted[serialized.name] = true;
10706
- };
10707
- var cache = {
10708
- key,
10709
- sheet: new StyleSheet({
10710
- key,
10711
- container,
10712
- nonce: options.nonce,
10713
- speedy: options.speedy,
10714
- prepend: options.prepend,
10715
- insertionPoint: options.insertionPoint
10716
- }),
10717
- nonce: options.nonce,
10718
- inserted,
10719
- registered: {},
10720
- insert: _insert
10721
- };
10722
- cache.sheet.hydrate(nodesToHydrate);
10723
- return cache;
10724
- };
10725
- // ../../../node_modules/.pnpm/@emotion+utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
10726
- function getRegisteredStyles$1(registered, registeredStyles, classNames) {
10727
- var rawClassName = "";
10728
- classNames.split(" ").forEach(function(className) {
10729
- if (registered[className] !== void 0) registeredStyles.push(registered[className] + ";");
10730
- else if (className) rawClassName += className + " ";
9941
+ var BaseContextSystemProvider = ({ children, value }) => {
9942
+ const contextValue = useContextSystemBridge({ value });
9943
+ return /* @__PURE__ */ jsx(ComponentsContext.Provider, {
9944
+ value: contextValue,
9945
+ children
10731
9946
  });
10732
- return rawClassName;
10733
- }
10734
- var registerStyles = function registerStyles(cache, serialized, isStringTag) {
10735
- var className = cache.key + "-" + serialized.name;
10736
- if ((isStringTag === false || false) && cache.registered[className] === void 0) cache.registered[className] = serialized.styles;
10737
- };
10738
- var insertStyles = function insertStyles(cache, serialized, isStringTag) {
10739
- registerStyles(cache, serialized, isStringTag);
10740
- var className = cache.key + "-" + serialized.name;
10741
- if (cache.inserted[serialized.name] === void 0) {
10742
- var current = serialized;
10743
- do {
10744
- cache.insert(serialized === current ? "." + className : "", current, cache.sheet, true);
10745
- current = current.next;
10746
- } while (current !== void 0);
10747
- }
10748
- };
10749
- // ../../../node_modules/.pnpm/@emotion+hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js
10750
- function murmur2(str) {
10751
- var h = 0;
10752
- var k, i = 0, len = str.length;
10753
- for (; len >= 4; ++i, len -= 4) {
10754
- k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
10755
- k = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
10756
- k ^= k >>> 24;
10757
- h = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
10758
- }
10759
- switch (len) {
10760
- case 3: h ^= (str.charCodeAt(i + 2) & 255) << 16;
10761
- case 2: h ^= (str.charCodeAt(i + 1) & 255) << 8;
10762
- case 1:
10763
- h ^= str.charCodeAt(i) & 255;
10764
- h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
10765
- }
10766
- h ^= h >>> 13;
10767
- h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
10768
- return ((h ^ h >>> 15) >>> 0).toString(36);
10769
- }
10770
- // ../../../node_modules/.pnpm/@emotion+unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
10771
- var unitlessKeys = {
10772
- animationIterationCount: 1,
10773
- aspectRatio: 1,
10774
- borderImageOutset: 1,
10775
- borderImageSlice: 1,
10776
- borderImageWidth: 1,
10777
- boxFlex: 1,
10778
- boxFlexGroup: 1,
10779
- boxOrdinalGroup: 1,
10780
- columnCount: 1,
10781
- columns: 1,
10782
- flex: 1,
10783
- flexGrow: 1,
10784
- flexPositive: 1,
10785
- flexShrink: 1,
10786
- flexNegative: 1,
10787
- flexOrder: 1,
10788
- gridRow: 1,
10789
- gridRowEnd: 1,
10790
- gridRowSpan: 1,
10791
- gridRowStart: 1,
10792
- gridColumn: 1,
10793
- gridColumnEnd: 1,
10794
- gridColumnSpan: 1,
10795
- gridColumnStart: 1,
10796
- msGridRow: 1,
10797
- msGridRowSpan: 1,
10798
- msGridColumn: 1,
10799
- msGridColumnSpan: 1,
10800
- fontWeight: 1,
10801
- lineHeight: 1,
10802
- opacity: 1,
10803
- order: 1,
10804
- orphans: 1,
10805
- scale: 1,
10806
- tabSize: 1,
10807
- widows: 1,
10808
- zIndex: 1,
10809
- zoom: 1,
10810
- WebkitLineClamp: 1,
10811
- fillOpacity: 1,
10812
- floodOpacity: 1,
10813
- stopOpacity: 1,
10814
- strokeDasharray: 1,
10815
- strokeDashoffset: 1,
10816
- strokeMiterlimit: 1,
10817
- strokeOpacity: 1,
10818
- strokeWidth: 1
10819
- };
10820
- // ../../../node_modules/.pnpm/@emotion+serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js
10821
- var isDevelopment = false;
10822
- var hyphenateRegex = /[A-Z]|^ms/g;
10823
- var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
10824
- var isCustomProperty = function isCustomProperty(property) {
10825
- return property.charCodeAt(1) === 45;
10826
- };
10827
- var isProcessableValue = function isProcessableValue(value) {
10828
- return value != null && typeof value !== "boolean";
10829
- };
10830
- var processStyleName = /* #__PURE__ */ memoize(function(styleName) {
10831
- return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
10832
- });
10833
- var processStyleValue = function processStyleValue(key, value) {
10834
- switch (key) {
10835
- case "animation":
10836
- case "animationName": if (typeof value === "string") return value.replace(animationRegex, function(match, p1, p2) {
10837
- cursor = {
10838
- name: p1,
10839
- styles: p2,
10840
- next: cursor
10841
- };
10842
- return p1;
10843
- });
10844
- }
10845
- if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) return value + "px";
10846
- return value;
10847
- };
10848
- var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
10849
- function handleInterpolation(mergedProps, registered, interpolation) {
10850
- if (interpolation == null) return "";
10851
- var componentSelector = interpolation;
10852
- if (componentSelector.__emotion_styles !== void 0) return componentSelector;
10853
- switch (typeof interpolation) {
10854
- case "boolean": return "";
10855
- case "object":
10856
- var keyframes = interpolation;
10857
- if (keyframes.anim === 1) {
10858
- cursor = {
10859
- name: keyframes.name,
10860
- styles: keyframes.styles,
10861
- next: cursor
10862
- };
10863
- return keyframes.name;
10864
- }
10865
- var serializedStyles = interpolation;
10866
- if (serializedStyles.styles !== void 0) {
10867
- var next = serializedStyles.next;
10868
- if (next !== void 0) while (next !== void 0) {
10869
- cursor = {
10870
- name: next.name,
10871
- styles: next.styles,
10872
- next: cursor
10873
- };
10874
- next = next.next;
10875
- }
10876
- return serializedStyles.styles + ";";
10877
- }
10878
- return createStringFromObject(mergedProps, registered, interpolation);
10879
- case "function": if (mergedProps !== void 0) {
10880
- var previousCursor = cursor;
10881
- var result = interpolation(mergedProps);
10882
- cursor = previousCursor;
10883
- return handleInterpolation(mergedProps, registered, result);
10884
- }
10885
- }
10886
- var asString = interpolation;
10887
- if (registered == null) return asString;
10888
- var cached = registered[asString];
10889
- return cached !== void 0 ? cached : asString;
10890
- }
10891
- function createStringFromObject(mergedProps, registered, obj) {
10892
- var string = "";
10893
- if (Array.isArray(obj)) for (var i = 0; i < obj.length; i++) string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
10894
- else for (var key in obj) {
10895
- var value = obj[key];
10896
- if (typeof value !== "object") {
10897
- var asString = value;
10898
- if (registered != null && registered[asString] !== void 0) string += key + "{" + registered[asString] + "}";
10899
- else if (isProcessableValue(asString)) string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
10900
- } else {
10901
- if (key === "NO_COMPONENT_SELECTOR" && isDevelopment) throw new Error(noComponentSelectorMessage);
10902
- if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
10903
- for (var _i = 0; _i < value.length; _i++) if (isProcessableValue(value[_i])) string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
10904
- } else {
10905
- var interpolated = handleInterpolation(mergedProps, registered, value);
10906
- switch (key) {
10907
- case "animation":
10908
- case "animationName":
10909
- string += processStyleName(key) + ":" + interpolated + ";";
10910
- break;
10911
- default: string += key + "{" + interpolated + "}";
10912
- }
10913
- }
10914
- }
10915
- }
10916
- return string;
10917
- }
10918
- var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g;
10919
- var cursor;
10920
- function serializeStyles(args, registered, mergedProps) {
10921
- if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) return args[0];
10922
- var stringMode = true;
10923
- var styles = "";
10924
- cursor = void 0;
10925
- var strings = args[0];
10926
- if (strings == null || strings.raw === void 0) {
10927
- stringMode = false;
10928
- styles += handleInterpolation(mergedProps, registered, strings);
10929
- } else styles += strings[0];
10930
- for (var i = 1; i < args.length; i++) {
10931
- styles += handleInterpolation(mergedProps, registered, args[i]);
10932
- if (stringMode) styles += strings[i];
10933
- }
10934
- labelPattern.lastIndex = 0;
10935
- var identifierName = "";
10936
- var match;
10937
- while ((match = labelPattern.exec(styles)) !== null) identifierName += "-" + match[1];
10938
- return {
10939
- name: murmur2(styles) + identifierName,
10940
- styles,
10941
- next: cursor
10942
- };
10943
- }
10944
- React["useInsertionEffect"] && React["useInsertionEffect"] || React.useLayoutEffect;
10945
- // ../../../node_modules/.pnpm/@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js
10946
- var EmotionCacheContext = /* #__PURE__ */ React.createContext(typeof HTMLElement !== "undefined" ? /* #__PURE__ */ createCache({ key: "css" }) : null);
10947
- EmotionCacheContext.Provider;
10948
- var __unsafe_useEmotionCache = function useEmotionCache() {
10949
- return useContext(EmotionCacheContext);
10950
- };
10951
- ({}).hasOwnProperty;
10952
- // ../../../node_modules/.pnpm/@emotion+css@11.13.5/node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js
10953
- function insertWithoutScoping(cache, serialized) {
10954
- if (cache.inserted[serialized.name] === void 0) return cache.insert("", serialized, cache.sheet, true);
10955
- }
10956
- function merge$1(registered, css, className) {
10957
- var registeredStyles = [];
10958
- var rawClassName = getRegisteredStyles$1(registered, registeredStyles, className);
10959
- if (registeredStyles.length < 2) return className;
10960
- return rawClassName + css(registeredStyles);
10961
- }
10962
- var createEmotion = function createEmotion(options) {
10963
- var cache = createCache(options);
10964
- cache.sheet.speedy = function(value) {
10965
- this.isSpeedy = value;
10966
- };
10967
- cache.compat = true;
10968
- var css = function css() {
10969
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
10970
- var serialized = serializeStyles(args, cache.registered, void 0);
10971
- insertStyles(cache, serialized, false);
10972
- return cache.key + "-" + serialized.name;
10973
- };
10974
- return {
10975
- css,
10976
- cx: function cx() {
10977
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
10978
- return merge$1(cache.registered, css, classnames(args));
10979
- },
10980
- injectGlobal: function injectGlobal() {
10981
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) args[_key3] = arguments[_key3];
10982
- insertWithoutScoping(cache, serializeStyles(args, cache.registered));
10983
- },
10984
- keyframes: function keyframes() {
10985
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];
10986
- var serialized = serializeStyles(args, cache.registered);
10987
- var animation = "animation-" + serialized.name;
10988
- insertWithoutScoping(cache, {
10989
- name: serialized.name,
10990
- styles: "@keyframes " + animation + "{" + serialized.styles + "}"
10991
- });
10992
- return animation;
10993
- },
10994
- hydrate: function hydrate(ids) {
10995
- ids.forEach(function(key) {
10996
- cache.inserted[key] = true;
10997
- });
10998
- },
10999
- flush: function flush() {
11000
- cache.registered = {};
11001
- cache.inserted = {};
11002
- cache.sheet.flush();
11003
- },
11004
- sheet: cache.sheet,
11005
- cache,
11006
- getRegisteredStyles: getRegisteredStyles$1.bind(null, cache.registered),
11007
- merge: merge$1.bind(null, cache.registered, css)
11008
- };
11009
- };
11010
- var classnames = function classnames(args) {
11011
- var cls = "";
11012
- for (var i = 0; i < args.length; i++) {
11013
- var arg = args[i];
11014
- if (arg == null) continue;
11015
- var toAdd = void 0;
11016
- switch (typeof arg) {
11017
- case "boolean": break;
11018
- case "object":
11019
- if (Array.isArray(arg)) toAdd = classnames(arg);
11020
- else {
11021
- toAdd = "";
11022
- for (var k in arg) if (arg[k] && k) {
11023
- toAdd && (toAdd += " ");
11024
- toAdd += k;
11025
- }
11026
- }
11027
- break;
11028
- default: toAdd = arg;
11029
- }
11030
- if (toAdd) {
11031
- cls && (cls += " ");
11032
- cls += toAdd;
11033
- }
11034
- }
11035
- return cls;
11036
- };
11037
- // ../../../node_modules/.pnpm/@emotion+css@11.13.5/node_modules/@emotion/css/dist/emotion-css.esm.js
11038
- var _createEmotion = createEmotion({ key: "css" });
11039
- _createEmotion.flush;
11040
- _createEmotion.hydrate;
11041
- var cx = _createEmotion.cx;
11042
- _createEmotion.merge;
11043
- _createEmotion.getRegisteredStyles;
11044
- _createEmotion.injectGlobal;
11045
- _createEmotion.keyframes;
11046
- _createEmotion.css;
11047
- _createEmotion.sheet;
11048
- _createEmotion.cache;
11049
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/utils/hooks/use-cx.mjs
11050
- var isSerializedStyles = (o) => typeof o !== "undefined" && o !== null && ["name", "styles"].every((p) => typeof o[p] !== "undefined");
11051
- var useCx = () => {
11052
- const cache = __unsafe_useEmotionCache();
11053
- return useCallback$1((...classNames) => {
11054
- if (cache === null) throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");
11055
- return cx(...classNames.map((arg) => {
11056
- if (isSerializedStyles(arg)) {
11057
- insertStyles(cache, arg, false);
11058
- return `${cache.key}-${arg.name}`;
11059
- }
11060
- return arg;
11061
- }));
11062
- }, [cache]);
11063
9947
  };
9948
+ memo(BaseContextSystemProvider);
9949
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/constants.mjs
9950
+ var COMPONENT_NAMESPACE = "data-wp-component";
9951
+ var CONNECTED_NAMESPACE = "data-wp-c16t";
9952
+ var CONNECT_STATIC_NAMESPACE = "__contextSystemKey__";
11064
9953
  // ../../../node_modules/.pnpm/memize@2.1.1/node_modules/memize/dist/index.js
11065
9954
  /**
11066
9955
  * Memize options object.
@@ -11151,89 +10040,18 @@ function memize(fn, options) {
11151
10040
  };
11152
10041
  return memoized;
11153
10042
  }
11154
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
11155
- var import_es6 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
11156
- module.exports = function equal(a, b) {
11157
- if (a === b) return true;
11158
- if (a && b && typeof a == "object" && typeof b == "object") {
11159
- if (a.constructor !== b.constructor) return false;
11160
- var length, i, keys;
11161
- if (Array.isArray(a)) {
11162
- length = a.length;
11163
- if (length != b.length) return false;
11164
- for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;
11165
- return true;
11166
- }
11167
- if (a instanceof Map && b instanceof Map) {
11168
- if (a.size !== b.size) return false;
11169
- for (i of a.entries()) if (!b.has(i[0])) return false;
11170
- for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false;
11171
- return true;
11172
- }
11173
- if (a instanceof Set && b instanceof Set) {
11174
- if (a.size !== b.size) return false;
11175
- for (i of a.entries()) if (!b.has(i[0])) return false;
11176
- return true;
11177
- }
11178
- if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
11179
- length = a.length;
11180
- if (length != b.length) return false;
11181
- for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false;
11182
- return true;
11183
- }
11184
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
11185
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
11186
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
11187
- keys = Object.keys(a);
11188
- length = keys.length;
11189
- if (length !== Object.keys(b).length) return false;
11190
- for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
11191
- for (i = length; i-- !== 0;) {
11192
- var key = keys[i];
11193
- if (!equal(a[key], b[key])) return false;
11194
- }
11195
- return true;
11196
- }
11197
- return a !== a && b !== b;
11198
- };
11199
- })))(), 1);
11200
- var ComponentsContext = createContext$1({});
11201
- ComponentsContext.displayName = "ComponentsContext";
11202
- var useComponentsContext = () => useContext$1(ComponentsContext);
11203
- function useContextSystemBridge({ value }) {
11204
- const parentContext = useComponentsContext();
11205
- const valueRef = useRef$1(value);
11206
- use_update_effect_default(() => {
11207
- if ((0, import_es6.default)(valueRef.current, value) && valueRef.current !== value) globalThis.SCRIPT_DEBUG === true && warning(`Please memoize your context: ${JSON.stringify(value)}`);
11208
- }, [value]);
11209
- return useMemo$1(() => {
11210
- return deepmerge(parentContext ?? {}, value ?? {}, { isMergeableObject: isPlainObject });
11211
- }, [parentContext, value]);
11212
- }
11213
- var BaseContextSystemProvider = ({ children, value }) => {
11214
- const contextValue = useContextSystemBridge({ value });
11215
- return /* @__PURE__ */ jsx(ComponentsContext.Provider, {
11216
- value: contextValue,
11217
- children
11218
- });
11219
- };
11220
- memo(BaseContextSystemProvider);
11221
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/constants.mjs
11222
- var COMPONENT_NAMESPACE = "data-wp-component";
11223
- var CONNECTED_NAMESPACE = "data-wp-c16t";
11224
- var CONNECT_STATIC_NAMESPACE = "__contextSystemKey__";
11225
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
10043
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
11226
10044
  function getStyledClassName(namespace) {
11227
- return `components-${paramCase(namespace)}`;
10045
+ return `components-${namespace.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").replace(/[^A-Z0-9]+/gi, "-").replace(/^-|-$/g, "").toLowerCase()}`;
11228
10046
  }
11229
10047
  var getStyledClassNameFromKey = memize(getStyledClassName);
11230
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/context-connect.mjs
10048
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/context-connect.mjs
11231
10049
  function contextConnect(Component, namespace) {
11232
10050
  return _contextConnect(Component, namespace, { forwardsRef: true });
11233
10051
  }
11234
10052
  function _contextConnect(Component, namespace, options) {
11235
10053
  const WrappedComponent = options?.forwardsRef ? forwardRef$1(Component) : Component;
11236
- if (typeof namespace === "undefined") globalThis.SCRIPT_DEBUG === true && warning("contextConnect: Please provide a namespace");
10054
+ if (typeof namespace === "undefined") warning("contextConnect: Please provide a namespace");
11237
10055
  let mergedNamespace = WrappedComponent["__contextSystemKey__"] || [namespace];
11238
10056
  if (Array.isArray(namespace)) mergedNamespace = [...mergedNamespace, ...namespace];
11239
10057
  if (typeof namespace === "string") mergedNamespace = [...mergedNamespace, namespace];
@@ -11243,17 +10061,17 @@ function _contextConnect(Component, namespace, options) {
11243
10061
  selector: `.${getStyledClassNameFromKey(namespace)}`
11244
10062
  });
11245
10063
  }
11246
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/utils.mjs
10064
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/utils.mjs
11247
10065
  function getNamespace(componentName) {
11248
10066
  return { [COMPONENT_NAMESPACE]: componentName };
11249
10067
  }
11250
10068
  function getConnectedNamespace() {
11251
10069
  return { [CONNECTED_NAMESPACE]: true };
11252
10070
  }
11253
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/use-context-system.mjs
10071
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/use-context-system.mjs
11254
10072
  function useContextSystem(props, namespace) {
11255
10073
  const contextSystemProps = useComponentsContext();
11256
- if (typeof namespace === "undefined") globalThis.SCRIPT_DEBUG === true && warning("useContextSystem: Please provide a namespace");
10074
+ if (typeof namespace === "undefined") warning("useContextSystem: Please provide a namespace");
11257
10075
  const contextProps = contextSystemProps?.[namespace] || {};
11258
10076
  const finalComponentProps = {
11259
10077
  ...getConnectedNamespace(),
@@ -11263,7 +10081,7 @@ function useContextSystem(props, namespace) {
11263
10081
  const overrideProps = _overrides;
11264
10082
  const initialMergedProps = Object.entries(otherContextProps).length ? Object.assign({}, otherContextProps, props) : props;
11265
10083
  const propsWithChildren = initialMergedProps;
11266
- const classes = useCx()(getStyledClassNameFromKey(namespace), props.className);
10084
+ const classes = clsx(getStyledClassNameFromKey(namespace), props.className);
11267
10085
  const rendered = typeof propsWithChildren.renderChildren === "function" ? propsWithChildren.renderChildren(initialMergedProps) : propsWithChildren.children;
11268
10086
  for (const key in initialMergedProps) finalComponentProps[key] = initialMergedProps[key];
11269
10087
  for (const key in overrideProps) finalComponentProps[key] = overrideProps[key];
@@ -11271,7 +10089,7 @@ function useContextSystem(props, namespace) {
11271
10089
  finalComponentProps.className = classes;
11272
10090
  return finalComponentProps;
11273
10091
  }
11274
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/visually-hidden/styles.mjs
10092
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/visually-hidden/styles.mjs
11275
10093
  var visuallyHidden = {
11276
10094
  border: 0,
11277
10095
  clip: "rect(1px, 1px, 1px, 1px)",
@@ -11286,7 +10104,7 @@ var visuallyHidden = {
11286
10104
  wordWrap: "normal",
11287
10105
  wordBreak: "normal"
11288
10106
  };
11289
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/utils/polymorphic-element.mjs
10107
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/utils/polymorphic-element.mjs
11290
10108
  var customAttributeRegExp = /^(data|aria|x)-/i;
11291
10109
  var eventHandlerRegExp = /^on[A-Z]/;
11292
10110
  var svgElementNames = new Set(`animate animateMotion animateTransform circle clipPath defs desc ellipse
@@ -11375,7 +10193,7 @@ function UnforwardedPolymorphicElement({ as, ...props }, ref) {
11375
10193
  });
11376
10194
  }
11377
10195
  var PolymorphicElement = forwardRef$1(UnforwardedPolymorphicElement);
11378
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/view/component.mjs
10196
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/view/component.mjs
11379
10197
  function UnforwardedView({ css, ...restProps }, ref) {
11380
10198
  return /* @__PURE__ */ jsx(PolymorphicElement, {
11381
10199
  ref,
@@ -11383,7 +10201,7 @@ function UnforwardedView({ css, ...restProps }, ref) {
11383
10201
  });
11384
10202
  }
11385
10203
  var component_default$2 = Object.assign(forwardRef$1(UnforwardedView), { selector: ".components-view" });
11386
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/visually-hidden/component.mjs
10204
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/visually-hidden/component.mjs
11387
10205
  function UnconnectedVisuallyHidden(props, forwardedRef) {
11388
10206
  const { style: styleProp, ...contextProps } = useContextSystem(props, "VisuallyHidden");
11389
10207
  return /* @__PURE__ */ jsx(component_default$2, {
@@ -11397,7 +10215,7 @@ function UnconnectedVisuallyHidden(props, forwardedRef) {
11397
10215
  });
11398
10216
  }
11399
10217
  var component_default$1 = contextConnect(UnconnectedVisuallyHidden, "VisuallyHidden");
11400
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/utils/use-responsive-value.mjs
10218
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/utils/use-responsive-value.mjs
11401
10219
  var breakpoints = [
11402
10220
  "40em",
11403
10221
  "52em",
@@ -11435,15 +10253,15 @@ function useResponsiveValue(values, options = {}) {
11435
10253
  const array = values || [];
11436
10254
  return array[index >= array.length ? array.length - 1 : index];
11437
10255
  }
11438
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/grid/utils.mjs
10256
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/grid/utils.mjs
11439
10257
  var ALIGNMENTS = {
11440
10258
  bottom: {
11441
10259
  alignItems: "flex-end",
11442
10260
  justifyContent: "center"
11443
10261
  },
11444
10262
  bottomLeft: {
11445
- alignItems: "flex-start",
11446
- justifyContent: "flex-end"
10263
+ alignItems: "flex-end",
10264
+ justifyContent: "flex-start"
11447
10265
  },
11448
10266
  bottomRight: {
11449
10267
  alignItems: "flex-end",
@@ -11482,7 +10300,7 @@ var ALIGNMENTS = {
11482
10300
  function getAlignmentProps(alignment) {
11483
10301
  return alignment ? ALIGNMENTS[alignment] ?? {} : {};
11484
10302
  }
11485
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/grid/hook.mjs
10303
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/grid/hook.mjs
11486
10304
  var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
11487
10305
  function getRuntime() {
11488
10306
  const globalScope = globalThis;
@@ -11626,7 +10444,7 @@ function useGrid(props) {
11626
10444
  }
11627
10445
  };
11628
10446
  }
11629
- // ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/grid/component.mjs
10447
+ // ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/grid/component.mjs
11630
10448
  function UnconnectedGrid(props, forwardedRef) {
11631
10449
  const gridProps = useGrid(props);
11632
10450
  return /* @__PURE__ */ jsx(component_default$2, {
@@ -11798,6 +10616,41 @@ var leaderboard_chart_module_default = {
11798
10616
  "stretch": "a8ccharts-GovfoW-stretch",
11799
10617
  "valueContainer": "a8ccharts-GovfoW-valueContainer"
11800
10618
  };
10619
+ // src/charts/leaderboard-chart/private/resolve-leaderboard-entries.ts
10620
+ const toShare = (value, max) => max === 0 ? 0 : value / max * 100;
10621
+ const toDelta = (currentValue, previousValue) => {
10622
+ if (previousValue == null) return;
10623
+ if (previousValue === 0) return currentValue === 0 ? 0 : void 0;
10624
+ return (currentValue - previousValue) / Math.abs(previousValue) * 100;
10625
+ };
10626
+ /**
10627
+ * Fills in the shares and delta an entry omits, derived from its values.
10628
+ *
10629
+ * @param data - Leaderboard entries; passed shares and delta win over derived ones.
10630
+ * @param options - Resolver options.
10631
+ * @param options.includePrevious - Whether previous values count toward the shared max.
10632
+ * @param options.clampNegative - Whether a negative share draws as an empty bar instead of below zero.
10633
+ * @return Entries with `currentShare` always set.
10634
+ */
10635
+ function resolveLeaderboardEntries(data, { includePrevious, clampNegative = false }) {
10636
+ const magnitude = clampNegative ? (value) => Math.max(value, 0) : Math.abs;
10637
+ const clamp = (share) => clampNegative ? Math.max(share, 0) : share;
10638
+ const max = data.reduce((largest, { currentValue, previousValue }) => {
10639
+ const previous = includePrevious && previousValue != null ? magnitude(previousValue) : 0;
10640
+ return Math.max(largest, magnitude(currentValue), previous);
10641
+ }, 0);
10642
+ return data.map((entry) => {
10643
+ const passedOrDerivedPrevious = entry.previousShare ?? (entry.previousValue != null ? toShare(entry.previousValue, max) : void 0);
10644
+ const previousShare = passedOrDerivedPrevious !== void 0 ? clamp(passedOrDerivedPrevious) : void 0;
10645
+ const delta = entry.delta ?? toDelta(entry.currentValue, entry.previousValue);
10646
+ return {
10647
+ ...entry,
10648
+ currentShare: clamp(entry.currentShare ?? toShare(entry.currentValue, max)),
10649
+ ...previousShare !== void 0 && { previousShare },
10650
+ ...delta !== void 0 && { delta }
10651
+ };
10652
+ });
10653
+ }
11801
10654
  // src/charts/leaderboard-chart/leaderboard-chart.tsx
11802
10655
  const ROW_GAP = "var(--a8c-charts-dimension-leaderboard-row-gap, 12px)";
11803
10656
  const COLUMN_GAP = "var(--a8c-charts-dimension-leaderboard-column-gap, 4px)";
@@ -11908,6 +10761,7 @@ const BarWithLabel = ({ entry, withComparison, withOverlayLabel, primaryColor, s
11908
10761
  * @param props.height - Optional height of the chart container in pixels
11909
10762
  * @param props.withComparison - Whether to show comparison data
11910
10763
  * @param props.withOverlayLabel - Whether to overlay the label on top of the bar
10764
+ * @param props.negativeBars - How a negative value draws: from a shared zero point, or as an empty bar
11911
10765
  * @param props.primaryColor - Primary color for current period bars
11912
10766
  * @param props.secondaryColor - Secondary color for comparison period bars
11913
10767
  * @param props.valueFormatter - Custom formatter for values
@@ -11925,7 +10779,7 @@ const BarWithLabel = ({ entry, withComparison, withOverlayLabel, primaryColor, s
11925
10779
  * @param props.ariaLabel - Accessible name for the list, defaulting to "Leaderboard chart"
11926
10780
  * @return JSX element representing the leaderboard chart
11927
10781
  */
11928
- const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propWidth, height: propHeight, withComparison = false, withOverlayLabel = false, primaryColor, secondaryColor, valueFormatter = defaultValueFormatter, deltaFormatter = defaultDeltaFormatter, animation, loading = false, fitRows = false, showLegend = false, legend = {}, legendLabels, gap = "md", ariaLabel, className, style, children }) => {
10782
+ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propWidth, height: propHeight, withComparison = false, withOverlayLabel = false, negativeBars = "diverge", primaryColor, secondaryColor, valueFormatter = defaultValueFormatter, deltaFormatter = defaultDeltaFormatter, animation, loading = false, fitRows = false, showLegend = false, legend = {}, legendLabels, gap = "md", ariaLabel, className, style, children }) => {
11929
10783
  const legendInteractive = legend.interactive ?? false;
11930
10784
  const legendPosition = legend.position ?? "bottom";
11931
10785
  const chartId = useChartId(providedChartId);
@@ -11979,13 +10833,21 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
11979
10833
  withComparison,
11980
10834
  withOverlayLabel
11981
10835
  ]);
10836
+ const withComparisonBars = withComparison && !withOverlayLabel;
10837
+ const resolvedData = useMemo(() => resolveLeaderboardEntries(data ?? [], {
10838
+ includePrevious: withComparisonBars,
10839
+ clampNegative: negativeBars === "clamp"
10840
+ }), [
10841
+ data,
10842
+ withComparisonBars,
10843
+ negativeBars
10844
+ ]);
11982
10845
  const divergingScale = useMemo(() => {
11983
- const withComparisonBars = withComparison && !withOverlayLabel;
11984
10846
  const scale = {
11985
10847
  negative: 0,
11986
10848
  positive: 0
11987
10849
  };
11988
- for (const entry of data ?? []) {
10850
+ for (const entry of resolvedData) {
11989
10851
  const shares = [entry.currentShare];
11990
10852
  if (withComparisonBars && hasPreviousValue(entry)) shares.push(entry.previousShare);
11991
10853
  for (const share of shares) {
@@ -11994,11 +10856,7 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
11994
10856
  }
11995
10857
  }
11996
10858
  return scale.negative > 0 ? scale : void 0;
11997
- }, [
11998
- data,
11999
- withComparison,
12000
- withOverlayLabel
12001
- ]);
10859
+ }, [resolvedData, withComparisonBars]);
12002
10860
  const isDataValid = Boolean(data && data.length > 0);
12003
10861
  const chartMetadata = useMemo(() => ({
12004
10862
  withComparison,
@@ -12084,7 +10942,7 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
12084
10942
  rowGap: ROW_GAP,
12085
10943
  columnGap: COLUMN_GAP,
12086
10944
  "data-leaderboard-grid": true,
12087
- children: data.map((entry, rowIndex) => {
10945
+ children: resolvedData.map((entry, rowIndex) => {
12088
10946
  const rowStyle = shouldFitRows && rowIndex >= fittedCount ? { visibility: "hidden" } : void 0;
12089
10947
  const hasPreviousPeriodValue = hasPreviousValue(entry);
12090
10948
  const hasDelta = hasDeltaValue(entry);