yd-admin 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +2273 -178
  2. package/dist/style.css +337 -325
  3. package/package.json +4 -1
package/dist/index.js CHANGED
@@ -848,7 +848,7 @@ var export_helper_default = (sfc, props) => {
848
848
  };
849
849
  //#endregion
850
850
  //#region src/components/base/button/button.vue
851
- const _hoisted_1$58 = ["disabled", "type"];
851
+ const _hoisted_1$59 = ["disabled", "type"];
852
852
  const _hoisted_2$38 = {
853
853
  key: 0,
854
854
  class: "yd-button__loading"
@@ -910,7 +910,7 @@ var button_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
910
910
  "stroke-width": "3",
911
911
  "stroke-dasharray": "31.4 31.4",
912
912
  "stroke-linecap": "round"
913
- })], -1)])])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_3$29, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 10, _hoisted_1$58);
913
+ })], -1)])])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_3$29, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 10, _hoisted_1$59);
914
914
  };
915
915
  }
916
916
  }), [["__scopeId", "data-v-08fa2dc1"]]);
@@ -943,7 +943,7 @@ function getIconRegistry() {
943
943
  }
944
944
  //#endregion
945
945
  //#region src/components/base/icon/icon.vue
946
- const _hoisted_1$57 = ["innerHTML"];
946
+ const _hoisted_1$58 = ["innerHTML"];
947
947
  var icon_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
948
948
  name: "YdIcon",
949
949
  inheritAttrs: false,
@@ -1004,13 +1004,13 @@ var icon_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
1004
1004
  fill: "none",
1005
1005
  xmlns: "http://www.w3.org/2000/svg",
1006
1006
  innerHTML: svgContent.value
1007
- }, null, 10, _hoisted_1$57)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Slot Fallback "), renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2112))], 16);
1007
+ }, null, 10, _hoisted_1$58)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Slot Fallback "), renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2112))], 16);
1008
1008
  };
1009
1009
  }
1010
1010
  }), [["__scopeId", "data-v-bb6b8302"]]);
1011
1011
  //#endregion
1012
1012
  //#region src/components/base/input/input.vue
1013
- const _hoisted_1$56 = [
1013
+ const _hoisted_1$57 = [
1014
1014
  "type",
1015
1015
  "value",
1016
1016
  "placeholder",
@@ -1119,7 +1119,7 @@ var input_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
1119
1119
  onFocus: handleFocus,
1120
1120
  onBlur: handleBlur,
1121
1121
  onKeydown: handleKeydown
1122
- }, null, 42, _hoisted_1$56),
1122
+ }, null, 42, _hoisted_1$57),
1123
1123
  __props.clearable && __props.modelValue && !__props.disabled ? (openBlock(), createElementBlock("span", {
1124
1124
  key: 1,
1125
1125
  class: normalizeClass(e("clear")),
@@ -1142,7 +1142,7 @@ var input_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
1142
1142
  }), [["__scopeId", "data-v-5c21184f"]]);
1143
1143
  //#endregion
1144
1144
  //#region src/components/base/textarea/textarea.vue
1145
- const _hoisted_1$55 = [
1145
+ const _hoisted_1$56 = [
1146
1146
  "value",
1147
1147
  "placeholder",
1148
1148
  "disabled",
@@ -1236,7 +1236,7 @@ var textarea_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
1236
1236
  onChange: handleChange,
1237
1237
  onFocus: handleFocus,
1238
1238
  onBlur: handleBlur
1239
- }, null, 42, _hoisted_1$55), __props.showWordLimit && __props.maxlength ? (openBlock(), createElementBlock("span", {
1239
+ }, null, 42, _hoisted_1$56), __props.showWordLimit && __props.maxlength ? (openBlock(), createElementBlock("span", {
1240
1240
  key: 0,
1241
1241
  class: normalizeClass(e("word-limit"))
1242
1242
  }, toDisplayString(String(__props.modelValue).length) + "/" + toDisplayString(__props.maxlength), 3)) : createCommentVNode("v-if", true)], 2);
@@ -1245,7 +1245,7 @@ var textarea_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
1245
1245
  }), [["__scopeId", "data-v-13af2da6"]]);
1246
1246
  //#endregion
1247
1247
  //#region src/components/base/input-number/input-number.vue
1248
- const _hoisted_1$54 = ["disabled"];
1248
+ const _hoisted_1$55 = ["disabled"];
1249
1249
  const _hoisted_2$37 = ["value", "disabled"];
1250
1250
  const _hoisted_3$28 = ["disabled"];
1251
1251
  var input_number_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
@@ -1342,7 +1342,7 @@ var input_number_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
1342
1342
  y1: "12",
1343
1343
  x2: "19",
1344
1344
  y2: "12"
1345
- })], -1)])], 10, _hoisted_1$54),
1345
+ })], -1)])], 10, _hoisted_1$55),
1346
1346
  createElementVNode("input", {
1347
1347
  ref_key: "inputRef",
1348
1348
  ref: inputRef,
@@ -1430,7 +1430,7 @@ var empty_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
1430
1430
  }), [["__scopeId", "data-v-ed413d74"]]);
1431
1431
  //#endregion
1432
1432
  //#region src/components/base/select/select.vue
1433
- const _hoisted_1$53 = [
1433
+ const _hoisted_1$54 = [
1434
1434
  "value",
1435
1435
  "placeholder",
1436
1436
  "disabled"
@@ -1494,6 +1494,7 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1494
1494
  const visible = ref(false);
1495
1495
  const searchText = ref("");
1496
1496
  const loading = ref(false);
1497
+ const focusedIndex = ref(-1);
1497
1498
  const cachedDropdownStyle = ref({});
1498
1499
  function updateDropdownPosition() {
1499
1500
  if (!selectRef.value || !visible.value) return;
@@ -1559,6 +1560,36 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1559
1560
  return opt.label.toLowerCase().includes(query) ? opt : null;
1560
1561
  }).filter(Boolean);
1561
1562
  }
1563
+ function handleKeydown(e) {
1564
+ if (props.disabled) return;
1565
+ const flatOptions = flattenOptions(filteredOptions.value);
1566
+ if (!flatOptions.length) return;
1567
+ switch (e.key) {
1568
+ case "ArrowDown":
1569
+ e.preventDefault();
1570
+ if (!visible.value) visible.value = true;
1571
+ else focusedIndex.value = Math.min(focusedIndex.value + 1, flatOptions.length - 1);
1572
+ break;
1573
+ case "ArrowUp":
1574
+ e.preventDefault();
1575
+ if (!visible.value) visible.value = true;
1576
+ else focusedIndex.value = Math.max(focusedIndex.value - 1, 0);
1577
+ break;
1578
+ case "Enter":
1579
+ e.preventDefault();
1580
+ if (focusedIndex.value >= 0 && flatOptions[focusedIndex.value]) handleSelect(flatOptions[focusedIndex.value]);
1581
+ break;
1582
+ case "Escape":
1583
+ e.preventDefault();
1584
+ visible.value = false;
1585
+ focusedIndex.value = -1;
1586
+ break;
1587
+ case "Tab":
1588
+ visible.value = false;
1589
+ focusedIndex.value = -1;
1590
+ break;
1591
+ }
1592
+ }
1562
1593
  function isSelected(value) {
1563
1594
  return props.multiple ? Array.isArray(props.modelValue) && props.modelValue.includes(value) : props.modelValue === value;
1564
1595
  }
@@ -1675,11 +1706,16 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1675
1706
  value: searchText.value,
1676
1707
  placeholder: displayPlaceholder.value,
1677
1708
  disabled: __props.disabled,
1709
+ tabindex: "0",
1710
+ role: "combobox",
1711
+ "aria-expanded": "visible",
1712
+ "aria-haspopup": "listbox",
1713
+ "aria-label": "选择器",
1678
1714
  onInput: handleSearch,
1679
1715
  onFocus: handleFocus,
1680
1716
  onBlur: handleBlur,
1681
- onKeydown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
1682
- }, null, 42, _hoisted_1$53)) : (openBlock(), createElementBlock("div", {
1717
+ onKeydown: handleKeydown
1718
+ }, null, 42, _hoisted_1$54)) : (openBlock(), createElementBlock("div", {
1683
1719
  key: 1,
1684
1720
  class: normalizeClass([e("display"), { [e("display--placeholder")]: !selectedLabel.value }])
1685
1721
  }, toDisplayString(selectedLabel.value || __props.placeholder), 3)),
@@ -1706,7 +1742,7 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1706
1742
  key: 0,
1707
1743
  class: normalizeClass(e("dropdown")),
1708
1744
  style: normalizeStyle(dropdownStyle.value),
1709
- onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
1745
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
1710
1746
  }, [loading.value ? (openBlock(), createElementBlock("div", {
1711
1747
  key: 0,
1712
1748
  class: normalizeClass(e("loading"))
@@ -1749,10 +1785,10 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1749
1785
  ], 2);
1750
1786
  };
1751
1787
  }
1752
- }), [["__scopeId", "data-v-8cade129"]]);
1788
+ }), [["__scopeId", "data-v-90548156"]]);
1753
1789
  //#endregion
1754
1790
  //#region src/components/base/switch/switch.vue
1755
- const _hoisted_1$52 = ["aria-checked", "disabled"];
1791
+ const _hoisted_1$53 = ["aria-checked", "disabled"];
1756
1792
  var switch_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
1757
1793
  name: "YdSwitch",
1758
1794
  __name: "switch",
@@ -1788,13 +1824,13 @@ var switch_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1788
1824
  class: normalizeClass(switchClasses.value),
1789
1825
  disabled: __props.disabled,
1790
1826
  onClick: toggle
1791
- }, [createElementVNode("span", { class: normalizeClass(e("thumb")) }, null, 2)], 10, _hoisted_1$52);
1827
+ }, [createElementVNode("span", { class: normalizeClass(e("thumb")) }, null, 2)], 10, _hoisted_1$53);
1792
1828
  };
1793
1829
  }
1794
1830
  }), [["__scopeId", "data-v-178da0de"]]);
1795
1831
  //#endregion
1796
1832
  //#region src/components/base/checkbox/checkbox.vue
1797
- const _hoisted_1$51 = [
1833
+ const _hoisted_1$52 = [
1798
1834
  "checked",
1799
1835
  "disabled",
1800
1836
  "value"
@@ -1847,7 +1883,7 @@ var checkbox_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
1847
1883
  disabled: __props.disabled,
1848
1884
  value: __props.value,
1849
1885
  onChange: handleChange
1850
- }, null, 42, _hoisted_1$51),
1886
+ }, null, 42, _hoisted_1$52),
1851
1887
  createElementVNode("span", { class: normalizeClass(e("box")) }, [__props.modelValue ? (openBlock(), createElementBlock("svg", {
1852
1888
  key: 0,
1853
1889
  class: normalizeClass(e("icon")),
@@ -1914,7 +1950,7 @@ var checkbox_group_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
1914
1950
  }), [["__scopeId", "data-v-3dce3e2c"]]);
1915
1951
  //#endregion
1916
1952
  //#region src/components/base/radio/radio.vue
1917
- const _hoisted_1$50 = [
1953
+ const _hoisted_1$51 = [
1918
1954
  "checked",
1919
1955
  "disabled",
1920
1956
  "value",
@@ -1970,7 +2006,7 @@ var radio_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
1970
2006
  value: __props.value,
1971
2007
  name: __props.name,
1972
2008
  onChange: handleChange
1973
- }, null, 42, _hoisted_1$50),
2009
+ }, null, 42, _hoisted_1$51),
1974
2010
  createElementVNode("span", { class: normalizeClass(e("dot")) }, null, 2),
1975
2011
  _ctx.$slots.default || __props.label ? (openBlock(), createElementBlock("span", {
1976
2012
  key: 0,
@@ -2090,7 +2126,7 @@ var tag_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineCo
2090
2126
  }), [["__scopeId", "data-v-ae4235fd"]]);
2091
2127
  //#endregion
2092
2128
  //#region src/components/base/avatar/avatar.vue
2093
- const _hoisted_1$49 = ["src", "alt"];
2129
+ const _hoisted_1$50 = ["src", "alt"];
2094
2130
  var avatar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
2095
2131
  name: "YdAvatar",
2096
2132
  __name: "avatar",
@@ -2118,7 +2154,7 @@ var avatar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
2118
2154
  src: __props.src,
2119
2155
  alt: __props.alt,
2120
2156
  onError: handleError
2121
- }, null, 40, _hoisted_1$49)) : _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
2157
+ }, null, 40, _hoisted_1$50)) : _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
2122
2158
  key: 1,
2123
2159
  class: normalizeClass(e("text"))
2124
2160
  }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2)) : (openBlock(), createElementBlock("span", {
@@ -2178,7 +2214,7 @@ var badge_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
2178
2214
  }), [["__scopeId", "data-v-9b63f1ae"]]);
2179
2215
  //#endregion
2180
2216
  //#region src/components/base/rate/rate.vue
2181
- const _hoisted_1$48 = ["onClick", "onMouseenter"];
2217
+ const _hoisted_1$49 = ["onClick", "onMouseenter"];
2182
2218
  var rate_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
2183
2219
  name: "YdRate",
2184
2220
  __name: "rate",
@@ -2243,7 +2279,7 @@ var rate_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
2243
2279
  viewBox: "0 0 24 24",
2244
2280
  fill: "currentColor",
2245
2281
  stroke: "none"
2246
- }, [..._cache[1] || (_cache[1] = [createElementVNode("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }, null, -1)])], 2))], 42, _hoisted_1$48);
2282
+ }, [..._cache[1] || (_cache[1] = [createElementVNode("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }, null, -1)])], 2))], 42, _hoisted_1$49);
2247
2283
  }), 128)), __props.showText ? (openBlock(), createElementBlock("span", {
2248
2284
  key: 0,
2249
2285
  class: normalizeClass(e("text"))
@@ -2251,6 +2287,14 @@ var rate_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
2251
2287
  };
2252
2288
  }
2253
2289
  }), [["__scopeId", "data-v-52b27a1b"]]);
2290
+ //#endregion
2291
+ //#region src/components/base/slider/slider.vue
2292
+ const _hoisted_1$48 = [
2293
+ "aria-valuenow",
2294
+ "aria-valuemin",
2295
+ "aria-valuemax",
2296
+ "aria-disabled"
2297
+ ];
2254
2298
  var slider_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
2255
2299
  name: "YdSlider",
2256
2300
  __name: "slider",
@@ -2310,9 +2354,47 @@ var slider_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
2310
2354
  document.addEventListener("mousemove", onMove);
2311
2355
  document.addEventListener("mouseup", onUp);
2312
2356
  }
2357
+ function handleKeydown(e) {
2358
+ if (props.disabled) return;
2359
+ switch (e.key) {
2360
+ case "ArrowLeft":
2361
+ case "ArrowDown":
2362
+ e.preventDefault();
2363
+ const newValueLeft = Math.max(props.min, props.modelValue - props.step);
2364
+ emit("update:modelValue", newValueLeft);
2365
+ emit("change", newValueLeft);
2366
+ break;
2367
+ case "ArrowRight":
2368
+ case "ArrowUp":
2369
+ e.preventDefault();
2370
+ const newValueRight = Math.min(props.max, props.modelValue + props.step);
2371
+ emit("update:modelValue", newValueRight);
2372
+ emit("change", newValueRight);
2373
+ break;
2374
+ case "Home":
2375
+ e.preventDefault();
2376
+ emit("update:modelValue", props.min);
2377
+ emit("change", props.min);
2378
+ break;
2379
+ case "End":
2380
+ e.preventDefault();
2381
+ emit("update:modelValue", props.max);
2382
+ emit("change", props.max);
2383
+ break;
2384
+ }
2385
+ }
2313
2386
  onUnmounted(() => {});
2314
2387
  return (_ctx, _cache) => {
2315
- return openBlock(), createElementBlock("div", { class: normalizeClass(sliderClasses.value) }, [createElementVNode("div", {
2388
+ return openBlock(), createElementBlock("div", {
2389
+ class: normalizeClass(sliderClasses.value),
2390
+ role: "slider",
2391
+ "aria-valuenow": __props.modelValue,
2392
+ "aria-valuemin": __props.min,
2393
+ "aria-valuemax": __props.max,
2394
+ "aria-disabled": __props.disabled,
2395
+ tabindex: "0",
2396
+ onKeydown: handleKeydown
2397
+ }, [createElementVNode("div", {
2316
2398
  class: normalizeClass(e("rail")),
2317
2399
  onClick: handleRailClick
2318
2400
  }, [createElementVNode("div", {
@@ -2326,10 +2408,10 @@ var slider_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
2326
2408
  key: 0,
2327
2409
  class: normalizeClass(e("tooltip")),
2328
2410
  style: normalizeStyle({ left: `${percent.value}%` })
2329
- }, toDisplayString(__props.modelValue), 7)) : createCommentVNode("v-if", true)], 2);
2411
+ }, toDisplayString(__props.modelValue), 7)) : createCommentVNode("v-if", true)], 42, _hoisted_1$48);
2330
2412
  };
2331
2413
  }
2332
- }), [["__scopeId", "data-v-51e82523"]]);
2414
+ }), [["__scopeId", "data-v-57b592ff"]]);
2333
2415
  //#endregion
2334
2416
  //#region src/components/base/date-picker/date-picker.vue
2335
2417
  const _hoisted_1$47 = [
@@ -2339,7 +2421,11 @@ const _hoisted_1$47 = [
2339
2421
  ];
2340
2422
  const _hoisted_2$35 = ["onClick"];
2341
2423
  const _hoisted_3$26 = ["onClick"];
2342
- const _hoisted_4$24 = ["disabled", "onClick"];
2424
+ const _hoisted_4$24 = [
2425
+ "tabindex",
2426
+ "disabled",
2427
+ "onClick"
2428
+ ];
2343
2429
  var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
2344
2430
  name: "YdDatePicker",
2345
2431
  __name: "date-picker",
@@ -2359,6 +2445,7 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2359
2445
  const visible = ref(false);
2360
2446
  const triggerRef = ref();
2361
2447
  const view = ref("date");
2448
+ const focusedDate = ref(0);
2362
2449
  const positionKey = ref(0);
2363
2450
  const now = /* @__PURE__ */ new Date();
2364
2451
  const currentYear = ref(now.getFullYear());
@@ -2456,9 +2543,59 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2456
2543
  currentMonth.value = m - 1;
2457
2544
  yearRangeStart.value = Math.floor(y / 12) * 12;
2458
2545
  }
2546
+ const selectedIdx = calendarDays.value.findIndex((d) => d.selected && d.current);
2547
+ focusedDate.value = selectedIdx >= 0 ? selectedIdx : calendarDays.value.findIndex((d) => d.today && d.current);
2459
2548
  }
2460
2549
  }
2461
2550
  }
2551
+ function handleKeydown(e) {
2552
+ if (props.disabled) return;
2553
+ if (!visible.value) {
2554
+ if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
2555
+ e.preventDefault();
2556
+ visible.value = true;
2557
+ view.value = props.type === "year" ? "year" : props.type === "month" ? "month" : "date";
2558
+ }
2559
+ return;
2560
+ }
2561
+ switch (e.key) {
2562
+ case "ArrowLeft":
2563
+ e.preventDefault();
2564
+ if (view.value === "date") focusedDate.value = Math.max(0, focusedDate.value - 1);
2565
+ else if (view.value === "month") prevMonth();
2566
+ else prevYearRange();
2567
+ break;
2568
+ case "ArrowRight":
2569
+ e.preventDefault();
2570
+ if (view.value === "date") focusedDate.value = Math.min(calendarDays.value.length - 1, focusedDate.value + 1);
2571
+ else if (view.value === "month") nextMonth();
2572
+ else nextYearRange();
2573
+ break;
2574
+ case "ArrowUp":
2575
+ e.preventDefault();
2576
+ if (view.value === "date") focusedDate.value = Math.max(0, focusedDate.value - 7);
2577
+ break;
2578
+ case "ArrowDown":
2579
+ e.preventDefault();
2580
+ if (view.value === "date") focusedDate.value = Math.min(calendarDays.value.length - 1, focusedDate.value + 7);
2581
+ break;
2582
+ case "Enter":
2583
+ e.preventDefault();
2584
+ if (view.value === "date") {
2585
+ const day = calendarDays.value[focusedDate.value];
2586
+ if (day && day.current) selectDate(day);
2587
+ } else if (view.value === "month") selectMonth(currentMonth.value);
2588
+ else selectYear(currentYear.value);
2589
+ break;
2590
+ case "Escape":
2591
+ e.preventDefault();
2592
+ visible.value = false;
2593
+ break;
2594
+ case "Tab":
2595
+ visible.value = false;
2596
+ break;
2597
+ }
2598
+ }
2462
2599
  function prevMonth() {
2463
2600
  if (currentMonth.value === 0) {
2464
2601
  currentMonth.value = 11;
@@ -2553,8 +2690,14 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2553
2690
  placeholder: __props.placeholder,
2554
2691
  disabled: __props.disabled,
2555
2692
  readonly: "",
2556
- onClick: withModifiers(togglePicker, ["stop"])
2557
- }, null, 10, _hoisted_1$47),
2693
+ tabindex: "0",
2694
+ role: "combobox",
2695
+ "aria-expanded": "visible",
2696
+ "aria-haspopup": "grid",
2697
+ "aria-label": "选择日期",
2698
+ onClick: withModifiers(togglePicker, ["stop"]),
2699
+ onKeydown: handleKeydown
2700
+ }, null, 42, _hoisted_1$47),
2558
2701
  createElementVNode("span", {
2559
2702
  class: normalizeClass(e("icon")),
2560
2703
  onClick: withModifiers(togglePicker, ["stop"])
@@ -2605,14 +2748,16 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2605
2748
  ], (d) => {
2606
2749
  return createElementVNode("span", { key: d }, toDisplayString(d), 1);
2607
2750
  }), 64))], 2),
2608
- createElementVNode("div", { class: normalizeClass(e("days")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(calendarDays.value, (day) => {
2751
+ createElementVNode("div", { class: normalizeClass(e("days")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(calendarDays.value, (day, idx) => {
2609
2752
  return openBlock(), createElementBlock("button", {
2610
2753
  key: day.date,
2611
2754
  class: normalizeClass([e("day"), {
2612
2755
  [e("day--other")]: !day.current,
2613
2756
  [e("day--selected")]: day.selected,
2614
- [e("day--today")]: day.today
2757
+ [e("day--today")]: day.today,
2758
+ [e("day--focused")]: idx === focusedDate.value && day.current
2615
2759
  }]),
2760
+ tabindex: idx === focusedDate.value && day.current ? 0 : -1,
2616
2761
  disabled: !day.current,
2617
2762
  onClick: withModifiers(($event) => selectDate(day), ["stop"])
2618
2763
  }, toDisplayString(day.date.getDate()), 11, _hoisted_4$24);
@@ -2621,7 +2766,7 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2621
2766
  ], 2);
2622
2767
  };
2623
2768
  }
2624
- }), [["__scopeId", "data-v-23f9364e"]]);
2769
+ }), [["__scopeId", "data-v-1692914b"]]);
2625
2770
  //#endregion
2626
2771
  //#region src/components/base/date-picker/date-range-picker.vue
2627
2772
  const _hoisted_1$46 = [
@@ -2875,6 +3020,7 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2875
3020
  const selectedHour = ref(0);
2876
3021
  const selectedMinute = ref(0);
2877
3022
  const selectedSecond = ref(0);
3023
+ const activeColumn = ref(0);
2878
3024
  const panelStyle = computed(() => {
2879
3025
  if (!triggerRef.value) return {};
2880
3026
  const rect = triggerRef.value.getBoundingClientRect();
@@ -2888,6 +3034,51 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2888
3034
  function togglePanel() {
2889
3035
  if (!props.disabled) visible.value = !visible.value;
2890
3036
  }
3037
+ function handleKeydown(e) {
3038
+ if (props.disabled) return;
3039
+ if (!visible.value) {
3040
+ if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
3041
+ e.preventDefault();
3042
+ visible.value = true;
3043
+ }
3044
+ return;
3045
+ }
3046
+ switch (e.key) {
3047
+ case "ArrowLeft":
3048
+ e.preventDefault();
3049
+ if (activeColumn.value > 0) activeColumn.value--;
3050
+ break;
3051
+ case "ArrowRight":
3052
+ e.preventDefault();
3053
+ if (activeColumn.value < (props.showSeconds ? 2 : 1)) activeColumn.value++;
3054
+ break;
3055
+ case "ArrowUp":
3056
+ e.preventDefault();
3057
+ if (activeColumn.value === 0) selectedHour.value = (selectedHour.value - 1 + 24) % 24;
3058
+ else if (activeColumn.value === 1) selectedMinute.value = (selectedMinute.value - 1 + 60) % 60;
3059
+ else selectedSecond.value = (selectedSecond.value - 1 + 60) % 60;
3060
+ updateValue();
3061
+ break;
3062
+ case "ArrowDown":
3063
+ e.preventDefault();
3064
+ if (activeColumn.value === 0) selectedHour.value = (selectedHour.value + 1) % 24;
3065
+ else if (activeColumn.value === 1) selectedMinute.value = (selectedMinute.value + 1) % 60;
3066
+ else selectedSecond.value = (selectedSecond.value + 1) % 60;
3067
+ updateValue();
3068
+ break;
3069
+ case "Enter":
3070
+ e.preventDefault();
3071
+ visible.value = false;
3072
+ break;
3073
+ case "Escape":
3074
+ e.preventDefault();
3075
+ visible.value = false;
3076
+ break;
3077
+ case "Tab":
3078
+ visible.value = false;
3079
+ break;
3080
+ }
3081
+ }
2891
3082
  function selectHour(h) {
2892
3083
  selectedHour.value = h;
2893
3084
  updateValue();
@@ -2918,15 +3109,21 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2918
3109
  return openBlock(), createElementBlock("div", {
2919
3110
  class: normalizeClass(unref(cn)("yd-time-picker")),
2920
3111
  ref_key: "triggerRef",
2921
- ref: triggerRef,
2922
- onClick: togglePanel
3112
+ ref: triggerRef
2923
3113
  }, [createElementVNode("input", {
2924
3114
  class: normalizeClass(e("input")),
2925
3115
  value: __props.modelValue,
2926
3116
  placeholder: __props.placeholder,
2927
3117
  disabled: __props.disabled,
2928
- readonly: ""
2929
- }, null, 10, _hoisted_1$45), (openBlock(), createBlock(Teleport, { to: "body" }, [visible.value ? (openBlock(), createElementBlock("div", {
3118
+ readonly: "",
3119
+ tabindex: "0",
3120
+ role: "combobox",
3121
+ "aria-expanded": "visible",
3122
+ "aria-haspopup": "listbox",
3123
+ "aria-label": "选择时间",
3124
+ onClick: withModifiers(togglePanel, ["stop"]),
3125
+ onKeydown: handleKeydown
3126
+ }, null, 42, _hoisted_1$45), (openBlock(), createBlock(Teleport, { to: "body" }, [visible.value ? (openBlock(), createElementBlock("div", {
2930
3127
  key: 0,
2931
3128
  class: normalizeClass(e("panel")),
2932
3129
  style: normalizeStyle(panelStyle.value)
@@ -2958,7 +3155,7 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2958
3155
  ], 2)], 6)) : createCommentVNode("v-if", true)]))], 2);
2959
3156
  };
2960
3157
  }
2961
- }), [["__scopeId", "data-v-a6fe401a"]]);
3158
+ }), [["__scopeId", "data-v-9ebec461"]]);
2962
3159
  //#endregion
2963
3160
  //#region src/components/base/cascader/cascader.vue
2964
3161
  const _hoisted_1$44 = [
@@ -3238,7 +3435,11 @@ var cascader_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
3238
3435
  }), [["__scopeId", "data-v-01225c10"]]);
3239
3436
  //#endregion
3240
3437
  //#region src/components/base/auto-complete/auto-complete.vue
3241
- const _hoisted_1$43 = ["onClick", "onMouseenter"];
3438
+ const _hoisted_1$43 = [
3439
+ "aria-selected",
3440
+ "onClick",
3441
+ "onMouseenter"
3442
+ ];
3242
3443
  var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
3243
3444
  name: "YdAutoComplete",
3244
3445
  __name: "auto-complete",
@@ -3294,6 +3495,26 @@ var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
3294
3495
  emit("update:modelValue", option.label);
3295
3496
  emit("select", option);
3296
3497
  }
3498
+ function handleKeydown(e) {
3499
+ if (!visible.value || !filteredOptions.value.length) return;
3500
+ const maxIndex = filteredOptions.value.length - 1;
3501
+ switch (e.key) {
3502
+ case "ArrowDown":
3503
+ e.preventDefault();
3504
+ activeIndex.value = activeIndex.value < maxIndex ? activeIndex.value + 1 : 0;
3505
+ break;
3506
+ case "ArrowUp":
3507
+ e.preventDefault();
3508
+ activeIndex.value = activeIndex.value > 0 ? activeIndex.value - 1 : maxIndex;
3509
+ break;
3510
+ case "Enter":
3511
+ if (filteredOptions.value[activeIndex.value]) selectOption(filteredOptions.value[activeIndex.value]);
3512
+ break;
3513
+ case "Escape":
3514
+ visible.value = false;
3515
+ break;
3516
+ }
3517
+ }
3297
3518
  function handleClickOutside(event) {
3298
3519
  const el = document.querySelector(".yd-auto-complete");
3299
3520
  if (el && !el.contains(event.target)) visible.value = false;
@@ -3307,7 +3528,8 @@ var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
3307
3528
  placeholder: __props.placeholder,
3308
3529
  disabled: __props.disabled,
3309
3530
  onInput: handleInput,
3310
- onFocus: handleFocus
3531
+ onFocus: handleFocus,
3532
+ onKeydown: handleKeydown
3311
3533
  }, null, 8, [
3312
3534
  "modelValue",
3313
3535
  "placeholder",
@@ -3315,18 +3537,21 @@ var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
3315
3537
  ]), (openBlock(), createBlock(Teleport, { to: "body" }, [visible.value && filteredOptions.value.length ? (openBlock(), createElementBlock("div", {
3316
3538
  key: 0,
3317
3539
  class: normalizeClass(e("dropdown")),
3318
- style: normalizeStyle(dropdownStyle.value)
3540
+ style: normalizeStyle(dropdownStyle.value),
3541
+ role: "listbox"
3319
3542
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option, index) => {
3320
3543
  return openBlock(), createElementBlock("div", {
3321
3544
  key: option.value,
3322
3545
  class: normalizeClass([e("option"), { [e("option--active")]: index === activeIndex.value }]),
3546
+ role: "option",
3547
+ "aria-selected": index === activeIndex.value,
3323
3548
  onClick: ($event) => selectOption(option),
3324
3549
  onMouseenter: ($event) => activeIndex.value = index
3325
3550
  }, toDisplayString(option.label), 43, _hoisted_1$43);
3326
3551
  }), 128))], 6)) : createCommentVNode("v-if", true)]))], 2);
3327
3552
  };
3328
3553
  }
3329
- }), [["__scopeId", "data-v-0251e526"]]);
3554
+ }), [["__scopeId", "data-v-4cddacd2"]]);
3330
3555
  //#endregion
3331
3556
  //#region src/components/base/transfer/transfer.vue
3332
3557
  const _hoisted_1$42 = ["onClick"];
@@ -4922,7 +5147,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
4922
5147
  "check"
4923
5148
  ],
4924
5149
  setup(__props, { emit: __emit }) {
4925
- useCssVars((_ctx) => ({ "v23cc09d6": _ctx.dropdownHeight + "px" }));
5150
+ useCssVars((_ctx) => ({ "f4998178": _ctx.dropdownHeight + "px" }));
4926
5151
  const props = __props;
4927
5152
  const emit = __emit;
4928
5153
  const selectRef = ref();
@@ -4931,7 +5156,56 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
4931
5156
  const expandedKeys = ref(props.defaultExpandedKeys);
4932
5157
  const checkedKeys = ref([...props.defaultCheckedKeys]);
4933
5158
  const indeterminateKeys = ref([]);
5159
+ const focusedIndex = ref(-1);
4934
5160
  const scrollTop = ref(0);
5161
+ function handleKeydown(e) {
5162
+ if (props.disabled) return;
5163
+ const nodes = filteredNodes.value;
5164
+ if (!nodes.length) return;
5165
+ switch (e.key) {
5166
+ case "ArrowDown":
5167
+ e.preventDefault();
5168
+ focusedIndex.value = Math.min(focusedIndex.value + 1, nodes.length - 1);
5169
+ if (props.virtualScroll && focusedIndex.value >= 0) {
5170
+ const container = selectRef.value?.querySelector(".yd-tree-select__virtual-wrapper");
5171
+ if (container) container.scrollTop = focusedIndex.value * props.rowHeight;
5172
+ }
5173
+ break;
5174
+ case "ArrowUp":
5175
+ e.preventDefault();
5176
+ focusedIndex.value = Math.max(focusedIndex.value - 1, 0);
5177
+ if (props.virtualScroll && focusedIndex.value >= 0) {
5178
+ const container = selectRef.value?.querySelector(".yd-tree-select__virtual-wrapper");
5179
+ if (container) container.scrollTop = focusedIndex.value * props.rowHeight;
5180
+ }
5181
+ break;
5182
+ case "Enter":
5183
+ e.preventDefault();
5184
+ if (focusedIndex.value >= 0 && nodes[focusedIndex.value]) handleNodeClick(nodes[focusedIndex.value]);
5185
+ break;
5186
+ case "ArrowRight":
5187
+ e.preventDefault();
5188
+ if (focusedIndex.value >= 0 && nodes[focusedIndex.value]) {
5189
+ const node = nodes[focusedIndex.value];
5190
+ if (node.children && !expandedKeys.value.includes(node.key)) handleToggle(node);
5191
+ }
5192
+ break;
5193
+ case "ArrowLeft":
5194
+ e.preventDefault();
5195
+ if (focusedIndex.value >= 0 && nodes[focusedIndex.value]) {
5196
+ const node = nodes[focusedIndex.value];
5197
+ if (expandedKeys.value.includes(node.key)) handleToggle(node);
5198
+ }
5199
+ break;
5200
+ case "Escape":
5201
+ e.preventDefault();
5202
+ visible.value = false;
5203
+ break;
5204
+ case "Tab":
5205
+ visible.value = false;
5206
+ break;
5207
+ }
5208
+ }
4935
5209
  const cachedDropdownStyle = ref({});
4936
5210
  function updateDropdownPosition() {
4937
5211
  if (!selectRef.value || !visible.value) return;
@@ -5169,10 +5443,15 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5169
5443
  value: searchText.value,
5170
5444
  placeholder: displayPlaceholder.value,
5171
5445
  disabled: __props.disabled,
5446
+ tabindex: "0",
5447
+ role: "combobox",
5448
+ "aria-expanded": "visible",
5449
+ "aria-haspopup": "tree",
5450
+ "aria-label": "树形选择器",
5172
5451
  onInput: handleSearch,
5173
5452
  onFocus: handleFocus,
5174
5453
  onBlur: handleBlur,
5175
- onKeydown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
5454
+ onKeydown: withModifiers(handleKeydown, ["stop"])
5176
5455
  }, null, 42, _hoisted_1$35)) : (openBlock(), createElementBlock("div", {
5177
5456
  key: 1,
5178
5457
  class: normalizeClass([e("display"), { [e("display--placeholder")]: !selectedTitle.value }])
@@ -5181,7 +5460,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5181
5460
  key: 2,
5182
5461
  class: normalizeClass(e("clear")),
5183
5462
  onClick: withModifiers(handleClear, ["stop"])
5184
- }, [..._cache[2] || (_cache[2] = [createElementVNode("svg", {
5463
+ }, [..._cache[1] || (_cache[1] = [createElementVNode("svg", {
5185
5464
  xmlns: "http://www.w3.org/2000/svg",
5186
5465
  width: "14",
5187
5466
  height: "14",
@@ -5202,7 +5481,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5202
5481
  x2: "18",
5203
5482
  y2: "18"
5204
5483
  })], -1)])], 2)) : createCommentVNode("v-if", true),
5205
- createElementVNode("span", { class: normalizeClass(e("arrow")) }, [..._cache[3] || (_cache[3] = [createElementVNode("svg", {
5484
+ createElementVNode("span", { class: normalizeClass(e("arrow")) }, [..._cache[2] || (_cache[2] = [createElementVNode("svg", {
5206
5485
  xmlns: "http://www.w3.org/2000/svg",
5207
5486
  width: "12",
5208
5487
  height: "12",
@@ -5224,7 +5503,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5224
5503
  key: 0,
5225
5504
  class: normalizeClass(e("dropdown")),
5226
5505
  style: normalizeStyle(dropdownStyle.value),
5227
- onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
5506
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
5228
5507
  }, [createCommentVNode(" Virtual scroll wrapper "), __props.virtualScroll ? (openBlock(), createElementBlock("div", {
5229
5508
  key: 0,
5230
5509
  class: normalizeClass(e("virtual-wrapper")),
@@ -5330,7 +5609,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5330
5609
  ], 2);
5331
5610
  };
5332
5611
  }
5333
- }), [["__scopeId", "data-v-f36bc312"]]);
5612
+ }), [["__scopeId", "data-v-338c5a59"]]);
5334
5613
  //#endregion
5335
5614
  //#region src/components/base/color-picker/color-picker.vue
5336
5615
  const _hoisted_1$34 = [
@@ -6196,6 +6475,1684 @@ var calendar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
6196
6475
  }
6197
6476
  }), [["__scopeId", "data-v-b7db4b77"]]);
6198
6477
  //#endregion
6478
+ //#region node_modules/.pnpm/dompurify@3.4.2/node_modules/dompurify/dist/purify.es.mjs
6479
+ /*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */
6480
+ const { entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor } = Object;
6481
+ let { freeze, seal, create } = Object;
6482
+ let { apply, construct } = typeof Reflect !== "undefined" && Reflect;
6483
+ if (!freeze) freeze = function freeze(x) {
6484
+ return x;
6485
+ };
6486
+ if (!seal) seal = function seal(x) {
6487
+ return x;
6488
+ };
6489
+ if (!apply) apply = function apply(func, thisArg) {
6490
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
6491
+ return func.apply(thisArg, args);
6492
+ };
6493
+ if (!construct) construct = function construct(Func) {
6494
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
6495
+ return new Func(...args);
6496
+ };
6497
+ const arrayForEach = unapply(Array.prototype.forEach);
6498
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
6499
+ const arrayPop = unapply(Array.prototype.pop);
6500
+ const arrayPush = unapply(Array.prototype.push);
6501
+ const arraySplice = unapply(Array.prototype.splice);
6502
+ const arrayIsArray = Array.isArray;
6503
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
6504
+ const stringToString = unapply(String.prototype.toString);
6505
+ const stringMatch = unapply(String.prototype.match);
6506
+ const stringReplace = unapply(String.prototype.replace);
6507
+ const stringIndexOf = unapply(String.prototype.indexOf);
6508
+ const stringTrim = unapply(String.prototype.trim);
6509
+ const numberToString = unapply(Number.prototype.toString);
6510
+ const booleanToString = unapply(Boolean.prototype.toString);
6511
+ const bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString);
6512
+ const symbolToString = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString);
6513
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
6514
+ const objectToString = unapply(Object.prototype.toString);
6515
+ const regExpTest = unapply(RegExp.prototype.test);
6516
+ const typeErrorCreate = unconstruct(TypeError);
6517
+ /**
6518
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
6519
+ *
6520
+ * @param func - The function to be wrapped and called.
6521
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
6522
+ */
6523
+ function unapply(func) {
6524
+ return function(thisArg) {
6525
+ if (thisArg instanceof RegExp) thisArg.lastIndex = 0;
6526
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
6527
+ return apply(func, thisArg, args);
6528
+ };
6529
+ }
6530
+ /**
6531
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
6532
+ *
6533
+ * @param func - The constructor function to be wrapped and called.
6534
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
6535
+ */
6536
+ function unconstruct(Func) {
6537
+ return function() {
6538
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
6539
+ return construct(Func, args);
6540
+ };
6541
+ }
6542
+ /**
6543
+ * Add properties to a lookup table
6544
+ *
6545
+ * @param set - The set to which elements will be added.
6546
+ * @param array - The array containing elements to be added to the set.
6547
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
6548
+ * @returns The modified set with added elements.
6549
+ */
6550
+ function addToSet(set, array) {
6551
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
6552
+ if (setPrototypeOf) setPrototypeOf(set, null);
6553
+ if (!arrayIsArray(array)) return set;
6554
+ let l = array.length;
6555
+ while (l--) {
6556
+ let element = array[l];
6557
+ if (typeof element === "string") {
6558
+ const lcElement = transformCaseFunc(element);
6559
+ if (lcElement !== element) {
6560
+ if (!isFrozen(array)) array[l] = lcElement;
6561
+ element = lcElement;
6562
+ }
6563
+ }
6564
+ set[element] = true;
6565
+ }
6566
+ return set;
6567
+ }
6568
+ /**
6569
+ * Clean up an array to harden against CSPP
6570
+ *
6571
+ * @param array - The array to be cleaned.
6572
+ * @returns The cleaned version of the array
6573
+ */
6574
+ function cleanArray(array) {
6575
+ for (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;
6576
+ return array;
6577
+ }
6578
+ /**
6579
+ * Shallow clone an object
6580
+ *
6581
+ * @param object - The object to be cloned.
6582
+ * @returns A new object that copies the original.
6583
+ */
6584
+ function clone(object) {
6585
+ const newObject = create(null);
6586
+ for (const [property, value] of entries(object)) if (objectHasOwnProperty(object, property)) if (arrayIsArray(value)) newObject[property] = cleanArray(value);
6587
+ else if (value && typeof value === "object" && value.constructor === Object) newObject[property] = clone(value);
6588
+ else newObject[property] = value;
6589
+ return newObject;
6590
+ }
6591
+ /**
6592
+ * Convert non-node values into strings without depending on direct property access.
6593
+ *
6594
+ * @param value - The value to stringify.
6595
+ * @returns A string representation of the provided value.
6596
+ */
6597
+ function stringifyValue(value) {
6598
+ switch (typeof value) {
6599
+ case "string": return value;
6600
+ case "number": return numberToString(value);
6601
+ case "boolean": return booleanToString(value);
6602
+ case "bigint": return bigintToString ? bigintToString(value) : "0";
6603
+ case "symbol": return symbolToString ? symbolToString(value) : "Symbol()";
6604
+ case "undefined": return objectToString(value);
6605
+ case "function":
6606
+ case "object": {
6607
+ if (value === null) return objectToString(value);
6608
+ const valueAsRecord = value;
6609
+ const valueToString = lookupGetter(valueAsRecord, "toString");
6610
+ if (typeof valueToString === "function") {
6611
+ const stringified = valueToString(valueAsRecord);
6612
+ return typeof stringified === "string" ? stringified : objectToString(stringified);
6613
+ }
6614
+ return objectToString(value);
6615
+ }
6616
+ default: return objectToString(value);
6617
+ }
6618
+ }
6619
+ /**
6620
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
6621
+ *
6622
+ * @param object - The object to look up the getter function in its prototype chain.
6623
+ * @param prop - The property name for which to find the getter function.
6624
+ * @returns The getter function found in the prototype chain or a fallback function.
6625
+ */
6626
+ function lookupGetter(object, prop) {
6627
+ while (object !== null) {
6628
+ const desc = getOwnPropertyDescriptor(object, prop);
6629
+ if (desc) {
6630
+ if (desc.get) return unapply(desc.get);
6631
+ if (typeof desc.value === "function") return unapply(desc.value);
6632
+ }
6633
+ object = getPrototypeOf(object);
6634
+ }
6635
+ function fallbackValue() {
6636
+ return null;
6637
+ }
6638
+ return fallbackValue;
6639
+ }
6640
+ function isRegex(value) {
6641
+ try {
6642
+ regExpTest(value, "");
6643
+ return true;
6644
+ } catch (_unused) {
6645
+ return false;
6646
+ }
6647
+ }
6648
+ const html$1 = freeze([
6649
+ "a",
6650
+ "abbr",
6651
+ "acronym",
6652
+ "address",
6653
+ "area",
6654
+ "article",
6655
+ "aside",
6656
+ "audio",
6657
+ "b",
6658
+ "bdi",
6659
+ "bdo",
6660
+ "big",
6661
+ "blink",
6662
+ "blockquote",
6663
+ "body",
6664
+ "br",
6665
+ "button",
6666
+ "canvas",
6667
+ "caption",
6668
+ "center",
6669
+ "cite",
6670
+ "code",
6671
+ "col",
6672
+ "colgroup",
6673
+ "content",
6674
+ "data",
6675
+ "datalist",
6676
+ "dd",
6677
+ "decorator",
6678
+ "del",
6679
+ "details",
6680
+ "dfn",
6681
+ "dialog",
6682
+ "dir",
6683
+ "div",
6684
+ "dl",
6685
+ "dt",
6686
+ "element",
6687
+ "em",
6688
+ "fieldset",
6689
+ "figcaption",
6690
+ "figure",
6691
+ "font",
6692
+ "footer",
6693
+ "form",
6694
+ "h1",
6695
+ "h2",
6696
+ "h3",
6697
+ "h4",
6698
+ "h5",
6699
+ "h6",
6700
+ "head",
6701
+ "header",
6702
+ "hgroup",
6703
+ "hr",
6704
+ "html",
6705
+ "i",
6706
+ "img",
6707
+ "input",
6708
+ "ins",
6709
+ "kbd",
6710
+ "label",
6711
+ "legend",
6712
+ "li",
6713
+ "main",
6714
+ "map",
6715
+ "mark",
6716
+ "marquee",
6717
+ "menu",
6718
+ "menuitem",
6719
+ "meter",
6720
+ "nav",
6721
+ "nobr",
6722
+ "ol",
6723
+ "optgroup",
6724
+ "option",
6725
+ "output",
6726
+ "p",
6727
+ "picture",
6728
+ "pre",
6729
+ "progress",
6730
+ "q",
6731
+ "rp",
6732
+ "rt",
6733
+ "ruby",
6734
+ "s",
6735
+ "samp",
6736
+ "search",
6737
+ "section",
6738
+ "select",
6739
+ "shadow",
6740
+ "slot",
6741
+ "small",
6742
+ "source",
6743
+ "spacer",
6744
+ "span",
6745
+ "strike",
6746
+ "strong",
6747
+ "style",
6748
+ "sub",
6749
+ "summary",
6750
+ "sup",
6751
+ "table",
6752
+ "tbody",
6753
+ "td",
6754
+ "template",
6755
+ "textarea",
6756
+ "tfoot",
6757
+ "th",
6758
+ "thead",
6759
+ "time",
6760
+ "tr",
6761
+ "track",
6762
+ "tt",
6763
+ "u",
6764
+ "ul",
6765
+ "var",
6766
+ "video",
6767
+ "wbr"
6768
+ ]);
6769
+ const svg$1 = freeze([
6770
+ "svg",
6771
+ "a",
6772
+ "altglyph",
6773
+ "altglyphdef",
6774
+ "altglyphitem",
6775
+ "animatecolor",
6776
+ "animatemotion",
6777
+ "animatetransform",
6778
+ "circle",
6779
+ "clippath",
6780
+ "defs",
6781
+ "desc",
6782
+ "ellipse",
6783
+ "enterkeyhint",
6784
+ "exportparts",
6785
+ "filter",
6786
+ "font",
6787
+ "g",
6788
+ "glyph",
6789
+ "glyphref",
6790
+ "hkern",
6791
+ "image",
6792
+ "inputmode",
6793
+ "line",
6794
+ "lineargradient",
6795
+ "marker",
6796
+ "mask",
6797
+ "metadata",
6798
+ "mpath",
6799
+ "part",
6800
+ "path",
6801
+ "pattern",
6802
+ "polygon",
6803
+ "polyline",
6804
+ "radialgradient",
6805
+ "rect",
6806
+ "stop",
6807
+ "style",
6808
+ "switch",
6809
+ "symbol",
6810
+ "text",
6811
+ "textpath",
6812
+ "title",
6813
+ "tref",
6814
+ "tspan",
6815
+ "view",
6816
+ "vkern"
6817
+ ]);
6818
+ const svgFilters = freeze([
6819
+ "feBlend",
6820
+ "feColorMatrix",
6821
+ "feComponentTransfer",
6822
+ "feComposite",
6823
+ "feConvolveMatrix",
6824
+ "feDiffuseLighting",
6825
+ "feDisplacementMap",
6826
+ "feDistantLight",
6827
+ "feDropShadow",
6828
+ "feFlood",
6829
+ "feFuncA",
6830
+ "feFuncB",
6831
+ "feFuncG",
6832
+ "feFuncR",
6833
+ "feGaussianBlur",
6834
+ "feImage",
6835
+ "feMerge",
6836
+ "feMergeNode",
6837
+ "feMorphology",
6838
+ "feOffset",
6839
+ "fePointLight",
6840
+ "feSpecularLighting",
6841
+ "feSpotLight",
6842
+ "feTile",
6843
+ "feTurbulence"
6844
+ ]);
6845
+ const svgDisallowed = freeze([
6846
+ "animate",
6847
+ "color-profile",
6848
+ "cursor",
6849
+ "discard",
6850
+ "font-face",
6851
+ "font-face-format",
6852
+ "font-face-name",
6853
+ "font-face-src",
6854
+ "font-face-uri",
6855
+ "foreignobject",
6856
+ "hatch",
6857
+ "hatchpath",
6858
+ "mesh",
6859
+ "meshgradient",
6860
+ "meshpatch",
6861
+ "meshrow",
6862
+ "missing-glyph",
6863
+ "script",
6864
+ "set",
6865
+ "solidcolor",
6866
+ "unknown",
6867
+ "use"
6868
+ ]);
6869
+ const mathMl$1 = freeze([
6870
+ "math",
6871
+ "menclose",
6872
+ "merror",
6873
+ "mfenced",
6874
+ "mfrac",
6875
+ "mglyph",
6876
+ "mi",
6877
+ "mlabeledtr",
6878
+ "mmultiscripts",
6879
+ "mn",
6880
+ "mo",
6881
+ "mover",
6882
+ "mpadded",
6883
+ "mphantom",
6884
+ "mroot",
6885
+ "mrow",
6886
+ "ms",
6887
+ "mspace",
6888
+ "msqrt",
6889
+ "mstyle",
6890
+ "msub",
6891
+ "msup",
6892
+ "msubsup",
6893
+ "mtable",
6894
+ "mtd",
6895
+ "mtext",
6896
+ "mtr",
6897
+ "munder",
6898
+ "munderover",
6899
+ "mprescripts"
6900
+ ]);
6901
+ const mathMlDisallowed = freeze([
6902
+ "maction",
6903
+ "maligngroup",
6904
+ "malignmark",
6905
+ "mlongdiv",
6906
+ "mscarries",
6907
+ "mscarry",
6908
+ "msgroup",
6909
+ "mstack",
6910
+ "msline",
6911
+ "msrow",
6912
+ "semantics",
6913
+ "annotation",
6914
+ "annotation-xml",
6915
+ "mprescripts",
6916
+ "none"
6917
+ ]);
6918
+ const text = freeze(["#text"]);
6919
+ const html = freeze([
6920
+ "accept",
6921
+ "action",
6922
+ "align",
6923
+ "alt",
6924
+ "autocapitalize",
6925
+ "autocomplete",
6926
+ "autopictureinpicture",
6927
+ "autoplay",
6928
+ "background",
6929
+ "bgcolor",
6930
+ "border",
6931
+ "capture",
6932
+ "cellpadding",
6933
+ "cellspacing",
6934
+ "checked",
6935
+ "cite",
6936
+ "class",
6937
+ "clear",
6938
+ "color",
6939
+ "cols",
6940
+ "colspan",
6941
+ "controls",
6942
+ "controlslist",
6943
+ "coords",
6944
+ "crossorigin",
6945
+ "datetime",
6946
+ "decoding",
6947
+ "default",
6948
+ "dir",
6949
+ "disabled",
6950
+ "disablepictureinpicture",
6951
+ "disableremoteplayback",
6952
+ "download",
6953
+ "draggable",
6954
+ "enctype",
6955
+ "enterkeyhint",
6956
+ "exportparts",
6957
+ "face",
6958
+ "for",
6959
+ "headers",
6960
+ "height",
6961
+ "hidden",
6962
+ "high",
6963
+ "href",
6964
+ "hreflang",
6965
+ "id",
6966
+ "inert",
6967
+ "inputmode",
6968
+ "integrity",
6969
+ "ismap",
6970
+ "kind",
6971
+ "label",
6972
+ "lang",
6973
+ "list",
6974
+ "loading",
6975
+ "loop",
6976
+ "low",
6977
+ "max",
6978
+ "maxlength",
6979
+ "media",
6980
+ "method",
6981
+ "min",
6982
+ "minlength",
6983
+ "multiple",
6984
+ "muted",
6985
+ "name",
6986
+ "nonce",
6987
+ "noshade",
6988
+ "novalidate",
6989
+ "nowrap",
6990
+ "open",
6991
+ "optimum",
6992
+ "part",
6993
+ "pattern",
6994
+ "placeholder",
6995
+ "playsinline",
6996
+ "popover",
6997
+ "popovertarget",
6998
+ "popovertargetaction",
6999
+ "poster",
7000
+ "preload",
7001
+ "pubdate",
7002
+ "radiogroup",
7003
+ "readonly",
7004
+ "rel",
7005
+ "required",
7006
+ "rev",
7007
+ "reversed",
7008
+ "role",
7009
+ "rows",
7010
+ "rowspan",
7011
+ "spellcheck",
7012
+ "scope",
7013
+ "selected",
7014
+ "shape",
7015
+ "size",
7016
+ "sizes",
7017
+ "slot",
7018
+ "span",
7019
+ "srclang",
7020
+ "start",
7021
+ "src",
7022
+ "srcset",
7023
+ "step",
7024
+ "style",
7025
+ "summary",
7026
+ "tabindex",
7027
+ "title",
7028
+ "translate",
7029
+ "type",
7030
+ "usemap",
7031
+ "valign",
7032
+ "value",
7033
+ "width",
7034
+ "wrap",
7035
+ "xmlns"
7036
+ ]);
7037
+ const svg = freeze([
7038
+ "accent-height",
7039
+ "accumulate",
7040
+ "additive",
7041
+ "alignment-baseline",
7042
+ "amplitude",
7043
+ "ascent",
7044
+ "attributename",
7045
+ "attributetype",
7046
+ "azimuth",
7047
+ "basefrequency",
7048
+ "baseline-shift",
7049
+ "begin",
7050
+ "bias",
7051
+ "by",
7052
+ "class",
7053
+ "clip",
7054
+ "clippathunits",
7055
+ "clip-path",
7056
+ "clip-rule",
7057
+ "color",
7058
+ "color-interpolation",
7059
+ "color-interpolation-filters",
7060
+ "color-profile",
7061
+ "color-rendering",
7062
+ "cx",
7063
+ "cy",
7064
+ "d",
7065
+ "dx",
7066
+ "dy",
7067
+ "diffuseconstant",
7068
+ "direction",
7069
+ "display",
7070
+ "divisor",
7071
+ "dur",
7072
+ "edgemode",
7073
+ "elevation",
7074
+ "end",
7075
+ "exponent",
7076
+ "fill",
7077
+ "fill-opacity",
7078
+ "fill-rule",
7079
+ "filter",
7080
+ "filterunits",
7081
+ "flood-color",
7082
+ "flood-opacity",
7083
+ "font-family",
7084
+ "font-size",
7085
+ "font-size-adjust",
7086
+ "font-stretch",
7087
+ "font-style",
7088
+ "font-variant",
7089
+ "font-weight",
7090
+ "fx",
7091
+ "fy",
7092
+ "g1",
7093
+ "g2",
7094
+ "glyph-name",
7095
+ "glyphref",
7096
+ "gradientunits",
7097
+ "gradienttransform",
7098
+ "height",
7099
+ "href",
7100
+ "id",
7101
+ "image-rendering",
7102
+ "in",
7103
+ "in2",
7104
+ "intercept",
7105
+ "k",
7106
+ "k1",
7107
+ "k2",
7108
+ "k3",
7109
+ "k4",
7110
+ "kerning",
7111
+ "keypoints",
7112
+ "keysplines",
7113
+ "keytimes",
7114
+ "lang",
7115
+ "lengthadjust",
7116
+ "letter-spacing",
7117
+ "kernelmatrix",
7118
+ "kernelunitlength",
7119
+ "lighting-color",
7120
+ "local",
7121
+ "marker-end",
7122
+ "marker-mid",
7123
+ "marker-start",
7124
+ "markerheight",
7125
+ "markerunits",
7126
+ "markerwidth",
7127
+ "maskcontentunits",
7128
+ "maskunits",
7129
+ "max",
7130
+ "mask",
7131
+ "mask-type",
7132
+ "media",
7133
+ "method",
7134
+ "mode",
7135
+ "min",
7136
+ "name",
7137
+ "numoctaves",
7138
+ "offset",
7139
+ "operator",
7140
+ "opacity",
7141
+ "order",
7142
+ "orient",
7143
+ "orientation",
7144
+ "origin",
7145
+ "overflow",
7146
+ "paint-order",
7147
+ "path",
7148
+ "pathlength",
7149
+ "patterncontentunits",
7150
+ "patterntransform",
7151
+ "patternunits",
7152
+ "points",
7153
+ "preservealpha",
7154
+ "preserveaspectratio",
7155
+ "primitiveunits",
7156
+ "r",
7157
+ "rx",
7158
+ "ry",
7159
+ "radius",
7160
+ "refx",
7161
+ "refy",
7162
+ "repeatcount",
7163
+ "repeatdur",
7164
+ "restart",
7165
+ "result",
7166
+ "rotate",
7167
+ "scale",
7168
+ "seed",
7169
+ "shape-rendering",
7170
+ "slope",
7171
+ "specularconstant",
7172
+ "specularexponent",
7173
+ "spreadmethod",
7174
+ "startoffset",
7175
+ "stddeviation",
7176
+ "stitchtiles",
7177
+ "stop-color",
7178
+ "stop-opacity",
7179
+ "stroke-dasharray",
7180
+ "stroke-dashoffset",
7181
+ "stroke-linecap",
7182
+ "stroke-linejoin",
7183
+ "stroke-miterlimit",
7184
+ "stroke-opacity",
7185
+ "stroke",
7186
+ "stroke-width",
7187
+ "style",
7188
+ "surfacescale",
7189
+ "systemlanguage",
7190
+ "tabindex",
7191
+ "tablevalues",
7192
+ "targetx",
7193
+ "targety",
7194
+ "transform",
7195
+ "transform-origin",
7196
+ "text-anchor",
7197
+ "text-decoration",
7198
+ "text-rendering",
7199
+ "textlength",
7200
+ "type",
7201
+ "u1",
7202
+ "u2",
7203
+ "unicode",
7204
+ "values",
7205
+ "viewbox",
7206
+ "visibility",
7207
+ "version",
7208
+ "vert-adv-y",
7209
+ "vert-origin-x",
7210
+ "vert-origin-y",
7211
+ "width",
7212
+ "word-spacing",
7213
+ "wrap",
7214
+ "writing-mode",
7215
+ "xchannelselector",
7216
+ "ychannelselector",
7217
+ "x",
7218
+ "x1",
7219
+ "x2",
7220
+ "xmlns",
7221
+ "y",
7222
+ "y1",
7223
+ "y2",
7224
+ "z",
7225
+ "zoomandpan"
7226
+ ]);
7227
+ const mathMl = freeze([
7228
+ "accent",
7229
+ "accentunder",
7230
+ "align",
7231
+ "bevelled",
7232
+ "close",
7233
+ "columnalign",
7234
+ "columnlines",
7235
+ "columnspacing",
7236
+ "columnspan",
7237
+ "denomalign",
7238
+ "depth",
7239
+ "dir",
7240
+ "display",
7241
+ "displaystyle",
7242
+ "encoding",
7243
+ "fence",
7244
+ "frame",
7245
+ "height",
7246
+ "href",
7247
+ "id",
7248
+ "largeop",
7249
+ "length",
7250
+ "linethickness",
7251
+ "lquote",
7252
+ "lspace",
7253
+ "mathbackground",
7254
+ "mathcolor",
7255
+ "mathsize",
7256
+ "mathvariant",
7257
+ "maxsize",
7258
+ "minsize",
7259
+ "movablelimits",
7260
+ "notation",
7261
+ "numalign",
7262
+ "open",
7263
+ "rowalign",
7264
+ "rowlines",
7265
+ "rowspacing",
7266
+ "rowspan",
7267
+ "rspace",
7268
+ "rquote",
7269
+ "scriptlevel",
7270
+ "scriptminsize",
7271
+ "scriptsizemultiplier",
7272
+ "selection",
7273
+ "separator",
7274
+ "separators",
7275
+ "stretchy",
7276
+ "subscriptshift",
7277
+ "supscriptshift",
7278
+ "symmetric",
7279
+ "voffset",
7280
+ "width",
7281
+ "xmlns"
7282
+ ]);
7283
+ const xml = freeze([
7284
+ "xlink:href",
7285
+ "xml:id",
7286
+ "xlink:title",
7287
+ "xml:space",
7288
+ "xmlns:xlink"
7289
+ ]);
7290
+ const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
7291
+ const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
7292
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
7293
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
7294
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
7295
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
7296
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
7297
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
7298
+ const DOCTYPE_NAME = seal(/^html$/i);
7299
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
7300
+ var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
7301
+ __proto__: null,
7302
+ ARIA_ATTR,
7303
+ ATTR_WHITESPACE,
7304
+ CUSTOM_ELEMENT,
7305
+ DATA_ATTR,
7306
+ DOCTYPE_NAME,
7307
+ ERB_EXPR,
7308
+ IS_ALLOWED_URI,
7309
+ IS_SCRIPT_OR_DATA,
7310
+ MUSTACHE_EXPR,
7311
+ TMPLIT_EXPR
7312
+ });
7313
+ const NODE_TYPE = {
7314
+ element: 1,
7315
+ text: 3,
7316
+ progressingInstruction: 7,
7317
+ comment: 8,
7318
+ document: 9
7319
+ };
7320
+ const getGlobal = function getGlobal() {
7321
+ return typeof window === "undefined" ? null : window;
7322
+ };
7323
+ /**
7324
+ * Creates a no-op policy for internal use only.
7325
+ * Don't export this function outside this module!
7326
+ * @param trustedTypes The policy factory.
7327
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
7328
+ * @return The policy created (or null, if Trusted Types
7329
+ * are not supported or creating the policy failed).
7330
+ */
7331
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
7332
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null;
7333
+ let suffix = null;
7334
+ const ATTR_NAME = "data-tt-policy-suffix";
7335
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);
7336
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
7337
+ try {
7338
+ return trustedTypes.createPolicy(policyName, {
7339
+ createHTML(html) {
7340
+ return html;
7341
+ },
7342
+ createScriptURL(scriptUrl) {
7343
+ return scriptUrl;
7344
+ }
7345
+ });
7346
+ } catch (_) {
7347
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
7348
+ return null;
7349
+ }
7350
+ };
7351
+ const _createHooksMap = function _createHooksMap() {
7352
+ return {
7353
+ afterSanitizeAttributes: [],
7354
+ afterSanitizeElements: [],
7355
+ afterSanitizeShadowDOM: [],
7356
+ beforeSanitizeAttributes: [],
7357
+ beforeSanitizeElements: [],
7358
+ beforeSanitizeShadowDOM: [],
7359
+ uponSanitizeAttribute: [],
7360
+ uponSanitizeElement: [],
7361
+ uponSanitizeShadowNode: []
7362
+ };
7363
+ };
7364
+ function createDOMPurify() {
7365
+ let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
7366
+ const DOMPurify = (root) => createDOMPurify(root);
7367
+ DOMPurify.version = "3.4.2";
7368
+ DOMPurify.removed = [];
7369
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
7370
+ DOMPurify.isSupported = false;
7371
+ return DOMPurify;
7372
+ }
7373
+ let { document } = window;
7374
+ const originalDocument = document;
7375
+ const currentScript = originalDocument.currentScript;
7376
+ const { DocumentFragment, HTMLTemplateElement, Node, Element, NodeFilter, NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap, HTMLFormElement, DOMParser, trustedTypes } = window;
7377
+ const ElementPrototype = Element.prototype;
7378
+ const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
7379
+ const remove = lookupGetter(ElementPrototype, "remove");
7380
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
7381
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
7382
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
7383
+ if (typeof HTMLTemplateElement === "function") {
7384
+ const template = document.createElement("template");
7385
+ if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
7386
+ }
7387
+ let trustedTypesPolicy;
7388
+ let emptyHTML = "";
7389
+ const { implementation, createNodeIterator, createDocumentFragment, getElementsByTagName } = document;
7390
+ const { importNode } = originalDocument;
7391
+ let hooks = _createHooksMap();
7392
+ /**
7393
+ * Expose whether this browser supports running the full DOMPurify.
7394
+ */
7395
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
7396
+ const { MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR, DATA_ATTR, ARIA_ATTR, IS_SCRIPT_OR_DATA, ATTR_WHITESPACE, CUSTOM_ELEMENT } = EXPRESSIONS;
7397
+ let { IS_ALLOWED_URI: IS_ALLOWED_URI$1 } = EXPRESSIONS;
7398
+ /**
7399
+ * We consider the elements and attributes below to be safe. Ideally
7400
+ * don't add any new ones but feel free to remove unwanted ones.
7401
+ */
7402
+ let ALLOWED_TAGS = null;
7403
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [
7404
+ ...html$1,
7405
+ ...svg$1,
7406
+ ...svgFilters,
7407
+ ...mathMl$1,
7408
+ ...text
7409
+ ]);
7410
+ let ALLOWED_ATTR = null;
7411
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [
7412
+ ...html,
7413
+ ...svg,
7414
+ ...mathMl,
7415
+ ...xml
7416
+ ]);
7417
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
7418
+ tagNameCheck: {
7419
+ writable: true,
7420
+ configurable: false,
7421
+ enumerable: true,
7422
+ value: null
7423
+ },
7424
+ attributeNameCheck: {
7425
+ writable: true,
7426
+ configurable: false,
7427
+ enumerable: true,
7428
+ value: null
7429
+ },
7430
+ allowCustomizedBuiltInElements: {
7431
+ writable: true,
7432
+ configurable: false,
7433
+ enumerable: true,
7434
+ value: false
7435
+ }
7436
+ }));
7437
+ let FORBID_TAGS = null;
7438
+ let FORBID_ATTR = null;
7439
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
7440
+ tagCheck: {
7441
+ writable: true,
7442
+ configurable: false,
7443
+ enumerable: true,
7444
+ value: null
7445
+ },
7446
+ attributeCheck: {
7447
+ writable: true,
7448
+ configurable: false,
7449
+ enumerable: true,
7450
+ value: null
7451
+ }
7452
+ }));
7453
+ let ALLOW_ARIA_ATTR = true;
7454
+ let ALLOW_DATA_ATTR = true;
7455
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
7456
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
7457
+ let SAFE_FOR_TEMPLATES = false;
7458
+ let SAFE_FOR_XML = true;
7459
+ let WHOLE_DOCUMENT = false;
7460
+ let SET_CONFIG = false;
7461
+ let FORCE_BODY = false;
7462
+ let RETURN_DOM = false;
7463
+ let RETURN_DOM_FRAGMENT = false;
7464
+ let RETURN_TRUSTED_TYPE = false;
7465
+ let SANITIZE_DOM = true;
7466
+ let SANITIZE_NAMED_PROPS = false;
7467
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
7468
+ let KEEP_CONTENT = true;
7469
+ let IN_PLACE = false;
7470
+ let USE_PROFILES = {};
7471
+ let FORBID_CONTENTS = null;
7472
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, [
7473
+ "annotation-xml",
7474
+ "audio",
7475
+ "colgroup",
7476
+ "desc",
7477
+ "foreignobject",
7478
+ "head",
7479
+ "iframe",
7480
+ "math",
7481
+ "mi",
7482
+ "mn",
7483
+ "mo",
7484
+ "ms",
7485
+ "mtext",
7486
+ "noembed",
7487
+ "noframes",
7488
+ "noscript",
7489
+ "plaintext",
7490
+ "script",
7491
+ "style",
7492
+ "svg",
7493
+ "template",
7494
+ "thead",
7495
+ "title",
7496
+ "video",
7497
+ "xmp"
7498
+ ]);
7499
+ let DATA_URI_TAGS = null;
7500
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, [
7501
+ "audio",
7502
+ "video",
7503
+ "img",
7504
+ "source",
7505
+ "image",
7506
+ "track"
7507
+ ]);
7508
+ let URI_SAFE_ATTRIBUTES = null;
7509
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
7510
+ "alt",
7511
+ "class",
7512
+ "for",
7513
+ "id",
7514
+ "label",
7515
+ "name",
7516
+ "pattern",
7517
+ "placeholder",
7518
+ "role",
7519
+ "summary",
7520
+ "title",
7521
+ "value",
7522
+ "style",
7523
+ "xmlns"
7524
+ ]);
7525
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
7526
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
7527
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
7528
+ let NAMESPACE = HTML_NAMESPACE;
7529
+ let IS_EMPTY_INPUT = false;
7530
+ let ALLOWED_NAMESPACES = null;
7531
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
7532
+ MATHML_NAMESPACE,
7533
+ SVG_NAMESPACE,
7534
+ HTML_NAMESPACE
7535
+ ], stringToString);
7536
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [
7537
+ "mi",
7538
+ "mo",
7539
+ "mn",
7540
+ "ms",
7541
+ "mtext"
7542
+ ]);
7543
+ let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
7544
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
7545
+ "title",
7546
+ "style",
7547
+ "font",
7548
+ "a",
7549
+ "script"
7550
+ ]);
7551
+ let PARSER_MEDIA_TYPE = null;
7552
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
7553
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
7554
+ let transformCaseFunc = null;
7555
+ let CONFIG = null;
7556
+ const formElement = document.createElement("form");
7557
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
7558
+ return testValue instanceof RegExp || testValue instanceof Function;
7559
+ };
7560
+ /**
7561
+ * _parseConfig
7562
+ *
7563
+ * @param cfg optional config literal
7564
+ */
7565
+ const _parseConfig = function _parseConfig() {
7566
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
7567
+ if (CONFIG && CONFIG === cfg) return;
7568
+ if (!cfg || typeof cfg !== "object") cfg = {};
7569
+ cfg = clone(cfg);
7570
+ PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
7571
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
7572
+ ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") && arrayIsArray(cfg.ALLOWED_TAGS) ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
7573
+ ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") && arrayIsArray(cfg.ALLOWED_ATTR) ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
7574
+ ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") && arrayIsArray(cfg.ALLOWED_NAMESPACES) ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
7575
+ URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") && arrayIsArray(cfg.ADD_URI_SAFE_ATTR) ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
7576
+ DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") && arrayIsArray(cfg.ADD_DATA_URI_TAGS) ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
7577
+ FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") && arrayIsArray(cfg.FORBID_CONTENTS) ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
7578
+ FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") && arrayIsArray(cfg.FORBID_TAGS) ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
7579
+ FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") && arrayIsArray(cfg.FORBID_ATTR) ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
7580
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
7581
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
7582
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
7583
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
7584
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
7585
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
7586
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
7587
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
7588
+ RETURN_DOM = cfg.RETURN_DOM || false;
7589
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
7590
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
7591
+ FORCE_BODY = cfg.FORCE_BODY || false;
7592
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
7593
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
7594
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
7595
+ IN_PLACE = cfg.IN_PLACE || false;
7596
+ IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
7597
+ NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
7598
+ MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "MATHML_TEXT_INTEGRATION_POINTS") && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === "object" ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, [
7599
+ "mi",
7600
+ "mo",
7601
+ "mn",
7602
+ "ms",
7603
+ "mtext"
7604
+ ]);
7605
+ HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "HTML_INTEGRATION_POINTS") && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === "object" ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, ["annotation-xml"]);
7606
+ const customElementHandling = objectHasOwnProperty(cfg, "CUSTOM_ELEMENT_HANDLING") && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === "object" ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
7607
+ CUSTOM_ELEMENT_HANDLING = create(null);
7608
+ if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
7609
+ if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
7610
+ if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
7611
+ if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;
7612
+ if (RETURN_DOM_FRAGMENT) RETURN_DOM = true;
7613
+ if (USE_PROFILES) {
7614
+ ALLOWED_TAGS = addToSet({}, text);
7615
+ ALLOWED_ATTR = create(null);
7616
+ if (USE_PROFILES.html === true) {
7617
+ addToSet(ALLOWED_TAGS, html$1);
7618
+ addToSet(ALLOWED_ATTR, html);
7619
+ }
7620
+ if (USE_PROFILES.svg === true) {
7621
+ addToSet(ALLOWED_TAGS, svg$1);
7622
+ addToSet(ALLOWED_ATTR, svg);
7623
+ addToSet(ALLOWED_ATTR, xml);
7624
+ }
7625
+ if (USE_PROFILES.svgFilters === true) {
7626
+ addToSet(ALLOWED_TAGS, svgFilters);
7627
+ addToSet(ALLOWED_ATTR, svg);
7628
+ addToSet(ALLOWED_ATTR, xml);
7629
+ }
7630
+ if (USE_PROFILES.mathMl === true) {
7631
+ addToSet(ALLOWED_TAGS, mathMl$1);
7632
+ addToSet(ALLOWED_ATTR, mathMl);
7633
+ addToSet(ALLOWED_ATTR, xml);
7634
+ }
7635
+ }
7636
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
7637
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
7638
+ if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
7639
+ if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
7640
+ else if (arrayIsArray(cfg.ADD_TAGS)) {
7641
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);
7642
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
7643
+ }
7644
+ }
7645
+ if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
7646
+ if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
7647
+ else if (arrayIsArray(cfg.ADD_ATTR)) {
7648
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);
7649
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
7650
+ }
7651
+ }
7652
+ if (objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
7653
+ if (objectHasOwnProperty(cfg, "FORBID_CONTENTS") && arrayIsArray(cfg.FORBID_CONTENTS)) {
7654
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
7655
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
7656
+ }
7657
+ if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
7658
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
7659
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
7660
+ }
7661
+ if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true;
7662
+ if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [
7663
+ "html",
7664
+ "head",
7665
+ "body"
7666
+ ]);
7667
+ if (ALLOWED_TAGS.table) {
7668
+ addToSet(ALLOWED_TAGS, ["tbody"]);
7669
+ delete FORBID_TAGS.tbody;
7670
+ }
7671
+ if (cfg.TRUSTED_TYPES_POLICY) {
7672
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
7673
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
7674
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
7675
+ emptyHTML = trustedTypesPolicy.createHTML("");
7676
+ } else {
7677
+ if (trustedTypesPolicy === void 0) trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
7678
+ if (trustedTypesPolicy !== null && typeof emptyHTML === "string") emptyHTML = trustedTypesPolicy.createHTML("");
7679
+ }
7680
+ if (freeze) freeze(cfg);
7681
+ CONFIG = cfg;
7682
+ };
7683
+ const ALL_SVG_TAGS = addToSet({}, [
7684
+ ...svg$1,
7685
+ ...svgFilters,
7686
+ ...svgDisallowed
7687
+ ]);
7688
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
7689
+ /**
7690
+ * @param element a DOM element whose namespace is being checked
7691
+ * @returns Return false if the element has a
7692
+ * namespace that a spec-compliant parser would never
7693
+ * return. Return true otherwise.
7694
+ */
7695
+ const _checkValidNamespace = function _checkValidNamespace(element) {
7696
+ let parent = getParentNode(element);
7697
+ if (!parent || !parent.tagName) parent = {
7698
+ namespaceURI: NAMESPACE,
7699
+ tagName: "template"
7700
+ };
7701
+ const tagName = stringToLowerCase(element.tagName);
7702
+ const parentTagName = stringToLowerCase(parent.tagName);
7703
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) return false;
7704
+ if (element.namespaceURI === SVG_NAMESPACE) {
7705
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "svg";
7706
+ if (parent.namespaceURI === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
7707
+ return Boolean(ALL_SVG_TAGS[tagName]);
7708
+ }
7709
+ if (element.namespaceURI === MATHML_NAMESPACE) {
7710
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "math";
7711
+ if (parent.namespaceURI === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
7712
+ return Boolean(ALL_MATHML_TAGS[tagName]);
7713
+ }
7714
+ if (element.namespaceURI === HTML_NAMESPACE) {
7715
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;
7716
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;
7717
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
7718
+ }
7719
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) return true;
7720
+ return false;
7721
+ };
7722
+ /**
7723
+ * _forceRemove
7724
+ *
7725
+ * @param node a DOM node
7726
+ */
7727
+ const _forceRemove = function _forceRemove(node) {
7728
+ arrayPush(DOMPurify.removed, { element: node });
7729
+ try {
7730
+ getParentNode(node).removeChild(node);
7731
+ } catch (_) {
7732
+ remove(node);
7733
+ }
7734
+ };
7735
+ /**
7736
+ * _removeAttribute
7737
+ *
7738
+ * @param name an Attribute name
7739
+ * @param element a DOM node
7740
+ */
7741
+ const _removeAttribute = function _removeAttribute(name, element) {
7742
+ try {
7743
+ arrayPush(DOMPurify.removed, {
7744
+ attribute: element.getAttributeNode(name),
7745
+ from: element
7746
+ });
7747
+ } catch (_) {
7748
+ arrayPush(DOMPurify.removed, {
7749
+ attribute: null,
7750
+ from: element
7751
+ });
7752
+ }
7753
+ element.removeAttribute(name);
7754
+ if (name === "is") if (RETURN_DOM || RETURN_DOM_FRAGMENT) try {
7755
+ _forceRemove(element);
7756
+ } catch (_) {}
7757
+ else try {
7758
+ element.setAttribute(name, "");
7759
+ } catch (_) {}
7760
+ };
7761
+ /**
7762
+ * _initDocument
7763
+ *
7764
+ * @param dirty - a string of dirty markup
7765
+ * @return a DOM, filled with the dirty markup
7766
+ */
7767
+ const _initDocument = function _initDocument(dirty) {
7768
+ let doc = null;
7769
+ let leadingWhitespace = null;
7770
+ if (FORCE_BODY) dirty = "<remove></remove>" + dirty;
7771
+ else {
7772
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
7773
+ leadingWhitespace = matches && matches[0];
7774
+ }
7775
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) dirty = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + dirty + "</body></html>";
7776
+ const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
7777
+ if (NAMESPACE === HTML_NAMESPACE) try {
7778
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
7779
+ } catch (_) {}
7780
+ if (!doc || !doc.documentElement) {
7781
+ doc = implementation.createDocument(NAMESPACE, "template", null);
7782
+ try {
7783
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
7784
+ } catch (_) {}
7785
+ }
7786
+ const body = doc.body || doc.documentElement;
7787
+ if (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
7788
+ if (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
7789
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
7790
+ };
7791
+ /**
7792
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
7793
+ *
7794
+ * @param root The root element or node to start traversing on.
7795
+ * @return The created NodeIterator
7796
+ */
7797
+ const _createNodeIterator = function _createNodeIterator(root) {
7798
+ return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
7799
+ };
7800
+ /**
7801
+ * _isClobbered
7802
+ *
7803
+ * @param element element to check for clobbering attacks
7804
+ * @return true if clobbered, false if safe
7805
+ */
7806
+ const _isClobbered = function _isClobbered(element) {
7807
+ return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function");
7808
+ };
7809
+ /**
7810
+ * Checks whether the given object is a DOM node.
7811
+ *
7812
+ * @param value object to check whether it's a DOM node
7813
+ * @return true is object is a DOM node
7814
+ */
7815
+ const _isNode = function _isNode(value) {
7816
+ return typeof Node === "function" && value instanceof Node;
7817
+ };
7818
+ function _executeHooks(hooks, currentNode, data) {
7819
+ arrayForEach(hooks, (hook) => {
7820
+ hook.call(DOMPurify, currentNode, data, CONFIG);
7821
+ });
7822
+ }
7823
+ /**
7824
+ * _sanitizeElements
7825
+ *
7826
+ * @protect nodeName
7827
+ * @protect textContent
7828
+ * @protect removeChild
7829
+ * @param currentNode to check for permission to exist
7830
+ * @return true if node was killed, false if left alive
7831
+ */
7832
+ const _sanitizeElements = function _sanitizeElements(currentNode) {
7833
+ let content = null;
7834
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
7835
+ if (_isClobbered(currentNode)) {
7836
+ _forceRemove(currentNode);
7837
+ return true;
7838
+ }
7839
+ const tagName = transformCaseFunc(currentNode.nodeName);
7840
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
7841
+ tagName,
7842
+ allowedTags: ALLOWED_TAGS
7843
+ });
7844
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
7845
+ _forceRemove(currentNode);
7846
+ return true;
7847
+ }
7848
+ if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === "style" && _isNode(currentNode.firstElementChild)) {
7849
+ _forceRemove(currentNode);
7850
+ return true;
7851
+ }
7852
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
7853
+ _forceRemove(currentNode);
7854
+ return true;
7855
+ }
7856
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
7857
+ _forceRemove(currentNode);
7858
+ return true;
7859
+ }
7860
+ if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
7861
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
7862
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
7863
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) return false;
7864
+ }
7865
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
7866
+ const parentNode = getParentNode(currentNode) || currentNode.parentNode;
7867
+ const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
7868
+ if (childNodes && parentNode) {
7869
+ const childCount = childNodes.length;
7870
+ for (let i = childCount - 1; i >= 0; --i) {
7871
+ const childClone = cloneNode(childNodes[i], true);
7872
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
7873
+ }
7874
+ }
7875
+ }
7876
+ _forceRemove(currentNode);
7877
+ return true;
7878
+ }
7879
+ if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
7880
+ _forceRemove(currentNode);
7881
+ return true;
7882
+ }
7883
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
7884
+ _forceRemove(currentNode);
7885
+ return true;
7886
+ }
7887
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
7888
+ content = currentNode.textContent;
7889
+ arrayForEach([
7890
+ MUSTACHE_EXPR,
7891
+ ERB_EXPR,
7892
+ TMPLIT_EXPR
7893
+ ], (expr) => {
7894
+ content = stringReplace(content, expr, " ");
7895
+ });
7896
+ if (currentNode.textContent !== content) {
7897
+ arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
7898
+ currentNode.textContent = content;
7899
+ }
7900
+ }
7901
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
7902
+ return false;
7903
+ };
7904
+ /**
7905
+ * _isValidAttribute
7906
+ *
7907
+ * @param lcTag Lowercase tag name of containing element.
7908
+ * @param lcName Lowercase attribute name.
7909
+ * @param value Attribute value.
7910
+ * @return Returns true if `value` is valid, otherwise false.
7911
+ */
7912
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
7913
+ if (FORBID_ATTR[lcName]) return false;
7914
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) return false;
7915
+ const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
7916
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName));
7917
+ else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName));
7918
+ else if (!nameIsPermitted || FORBID_ATTR[lcName]) if (_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)));
7919
+ else return false;
7920
+ else if (URI_SAFE_ATTRIBUTES[lcName]);
7921
+ else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, "")));
7922
+ else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]);
7923
+ else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, "")));
7924
+ else if (value) return false;
7925
+ return true;
7926
+ };
7927
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [
7928
+ "annotation-xml",
7929
+ "color-profile",
7930
+ "font-face",
7931
+ "font-face-format",
7932
+ "font-face-name",
7933
+ "font-face-src",
7934
+ "font-face-uri",
7935
+ "missing-glyph"
7936
+ ]);
7937
+ /**
7938
+ * _isBasicCustomElement
7939
+ * checks if at least one dash is included in tagName, and it's not the first char
7940
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
7941
+ *
7942
+ * @param tagName name of the tag of the node to sanitize
7943
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
7944
+ */
7945
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
7946
+ return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT, tagName);
7947
+ };
7948
+ /**
7949
+ * _sanitizeAttributes
7950
+ *
7951
+ * @protect attributes
7952
+ * @protect nodeName
7953
+ * @protect removeAttribute
7954
+ * @protect setAttribute
7955
+ *
7956
+ * @param currentNode to sanitize
7957
+ */
7958
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
7959
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
7960
+ const { attributes } = currentNode;
7961
+ if (!attributes || _isClobbered(currentNode)) return;
7962
+ const hookEvent = {
7963
+ attrName: "",
7964
+ attrValue: "",
7965
+ keepAttr: true,
7966
+ allowedAttributes: ALLOWED_ATTR,
7967
+ forceKeepAttr: void 0
7968
+ };
7969
+ let l = attributes.length;
7970
+ while (l--) {
7971
+ const { name, namespaceURI, value: attrValue } = attributes[l];
7972
+ const lcName = transformCaseFunc(name);
7973
+ const initValue = attrValue;
7974
+ let value = name === "value" ? initValue : stringTrim(initValue);
7975
+ hookEvent.attrName = lcName;
7976
+ hookEvent.attrValue = value;
7977
+ hookEvent.keepAttr = true;
7978
+ hookEvent.forceKeepAttr = void 0;
7979
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
7980
+ value = hookEvent.attrValue;
7981
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
7982
+ _removeAttribute(name, currentNode);
7983
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
7984
+ }
7985
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
7986
+ _removeAttribute(name, currentNode);
7987
+ continue;
7988
+ }
7989
+ if (lcName === "attributename" && stringMatch(value, "href")) {
7990
+ _removeAttribute(name, currentNode);
7991
+ continue;
7992
+ }
7993
+ if (hookEvent.forceKeepAttr) continue;
7994
+ if (!hookEvent.keepAttr) {
7995
+ _removeAttribute(name, currentNode);
7996
+ continue;
7997
+ }
7998
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
7999
+ _removeAttribute(name, currentNode);
8000
+ continue;
8001
+ }
8002
+ if (SAFE_FOR_TEMPLATES) arrayForEach([
8003
+ MUSTACHE_EXPR,
8004
+ ERB_EXPR,
8005
+ TMPLIT_EXPR
8006
+ ], (expr) => {
8007
+ value = stringReplace(value, expr, " ");
8008
+ });
8009
+ const lcTag = transformCaseFunc(currentNode.nodeName);
8010
+ if (!_isValidAttribute(lcTag, lcName, value)) {
8011
+ _removeAttribute(name, currentNode);
8012
+ continue;
8013
+ }
8014
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") if (namespaceURI);
8015
+ else switch (trustedTypes.getAttributeType(lcTag, lcName)) {
8016
+ case "TrustedHTML":
8017
+ value = trustedTypesPolicy.createHTML(value);
8018
+ break;
8019
+ case "TrustedScriptURL":
8020
+ value = trustedTypesPolicy.createScriptURL(value);
8021
+ break;
8022
+ }
8023
+ if (value !== initValue) try {
8024
+ if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);
8025
+ else currentNode.setAttribute(name, value);
8026
+ if (_isClobbered(currentNode)) _forceRemove(currentNode);
8027
+ else arrayPop(DOMPurify.removed);
8028
+ } catch (_) {
8029
+ _removeAttribute(name, currentNode);
8030
+ }
8031
+ }
8032
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
8033
+ };
8034
+ /**
8035
+ * _sanitizeShadowDOM
8036
+ *
8037
+ * @param fragment to iterate over recursively
8038
+ */
8039
+ const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
8040
+ let shadowNode = null;
8041
+ const shadowIterator = _createNodeIterator(fragment);
8042
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
8043
+ while (shadowNode = shadowIterator.nextNode()) {
8044
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
8045
+ _sanitizeElements(shadowNode);
8046
+ _sanitizeAttributes(shadowNode);
8047
+ if (shadowNode.content instanceof DocumentFragment) _sanitizeShadowDOM2(shadowNode.content);
8048
+ }
8049
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
8050
+ };
8051
+ DOMPurify.sanitize = function(dirty) {
8052
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
8053
+ let body = null;
8054
+ let importedNode = null;
8055
+ let currentNode = null;
8056
+ let returnNode = null;
8057
+ IS_EMPTY_INPUT = !dirty;
8058
+ if (IS_EMPTY_INPUT) dirty = "<!-->";
8059
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
8060
+ dirty = stringifyValue(dirty);
8061
+ if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting");
8062
+ }
8063
+ if (!DOMPurify.isSupported) return dirty;
8064
+ if (!SET_CONFIG) _parseConfig(cfg);
8065
+ DOMPurify.removed = [];
8066
+ if (typeof dirty === "string") IN_PLACE = false;
8067
+ if (IN_PLACE) {
8068
+ const nn = dirty.nodeName;
8069
+ if (typeof nn === "string") {
8070
+ const tagName = transformCaseFunc(nn);
8071
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
8072
+ }
8073
+ } else if (dirty instanceof Node) {
8074
+ body = _initDocument("<!---->");
8075
+ importedNode = body.ownerDocument.importNode(dirty, true);
8076
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
8077
+ else if (importedNode.nodeName === "HTML") body = importedNode;
8078
+ else body.appendChild(importedNode);
8079
+ } else {
8080
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
8081
+ body = _initDocument(dirty);
8082
+ if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
8083
+ }
8084
+ if (body && FORCE_BODY) _forceRemove(body.firstChild);
8085
+ const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
8086
+ while (currentNode = nodeIterator.nextNode()) {
8087
+ _sanitizeElements(currentNode);
8088
+ _sanitizeAttributes(currentNode);
8089
+ if (currentNode.content instanceof DocumentFragment) _sanitizeShadowDOM2(currentNode.content);
8090
+ }
8091
+ if (IN_PLACE) return dirty;
8092
+ if (RETURN_DOM) {
8093
+ if (SAFE_FOR_TEMPLATES) {
8094
+ body.normalize();
8095
+ let html = body.innerHTML;
8096
+ arrayForEach([
8097
+ MUSTACHE_EXPR,
8098
+ ERB_EXPR,
8099
+ TMPLIT_EXPR
8100
+ ], (expr) => {
8101
+ html = stringReplace(html, expr, " ");
8102
+ });
8103
+ body.innerHTML = html;
8104
+ }
8105
+ if (RETURN_DOM_FRAGMENT) {
8106
+ returnNode = createDocumentFragment.call(body.ownerDocument);
8107
+ while (body.firstChild) returnNode.appendChild(body.firstChild);
8108
+ } else returnNode = body;
8109
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);
8110
+ return returnNode;
8111
+ }
8112
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
8113
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
8114
+ if (SAFE_FOR_TEMPLATES) arrayForEach([
8115
+ MUSTACHE_EXPR,
8116
+ ERB_EXPR,
8117
+ TMPLIT_EXPR
8118
+ ], (expr) => {
8119
+ serializedHTML = stringReplace(serializedHTML, expr, " ");
8120
+ });
8121
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
8122
+ };
8123
+ DOMPurify.setConfig = function() {
8124
+ _parseConfig(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {});
8125
+ SET_CONFIG = true;
8126
+ };
8127
+ DOMPurify.clearConfig = function() {
8128
+ CONFIG = null;
8129
+ SET_CONFIG = false;
8130
+ };
8131
+ DOMPurify.isValidAttribute = function(tag, attr, value) {
8132
+ if (!CONFIG) _parseConfig({});
8133
+ return _isValidAttribute(transformCaseFunc(tag), transformCaseFunc(attr), value);
8134
+ };
8135
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
8136
+ if (typeof hookFunction !== "function") return;
8137
+ arrayPush(hooks[entryPoint], hookFunction);
8138
+ };
8139
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
8140
+ if (hookFunction !== void 0) {
8141
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
8142
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
8143
+ }
8144
+ return arrayPop(hooks[entryPoint]);
8145
+ };
8146
+ DOMPurify.removeHooks = function(entryPoint) {
8147
+ hooks[entryPoint] = [];
8148
+ };
8149
+ DOMPurify.removeAllHooks = function() {
8150
+ hooks = _createHooksMap();
8151
+ };
8152
+ return DOMPurify;
8153
+ }
8154
+ var purify = createDOMPurify();
8155
+ //#endregion
6199
8156
  //#region src/components/base/markdown/markdown.vue
6200
8157
  const _hoisted_1$32 = {
6201
8158
  key: 0,
@@ -6259,7 +8216,8 @@ var markdown_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
6259
8216
  const renderedHtml = computed(() => {
6260
8217
  if (!localValue.value) return "";
6261
8218
  try {
6262
- return marked.parse(localValue.value);
8219
+ const html = marked.parse(localValue.value);
8220
+ return purify.sanitize(html);
6263
8221
  } catch (e) {
6264
8222
  console.error("Markdown parse error:", e);
6265
8223
  return localValue.value;
@@ -6338,7 +8296,7 @@ var markdown_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
6338
8296
  ], 2);
6339
8297
  };
6340
8298
  }
6341
- }), [["__scopeId", "data-v-068d968a"]]);
8299
+ }), [["__scopeId", "data-v-2a88fddd"]]);
6342
8300
  //#endregion
6343
8301
  //#region src/components/base/chat-page/chat-page.vue
6344
8302
  const _hoisted_1$31 = { class: "yd-chat-page__header" };
@@ -6373,7 +8331,7 @@ const _hoisted_20$1 = {
6373
8331
  key: 0,
6374
8332
  class: "yd-chat-page__reasoning"
6375
8333
  };
6376
- const _hoisted_21 = { class: "yd-chat-page__reasoning-content" };
8334
+ const _hoisted_21$1 = { class: "yd-chat-page__reasoning-content" };
6377
8335
  const _hoisted_22 = { class: "yd-chat-page__message-bubble" };
6378
8336
  const _hoisted_23 = { class: "yd-chat-page__message-actions" };
6379
8337
  const _hoisted_24 = ["onClick", "title"];
@@ -6637,7 +8595,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ de
6637
8595
  fill: "currentColor",
6638
8596
  width: "14",
6639
8597
  height: "14"
6640
- }, [createElementVNode("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm0-4h-2V7h2v8z" })]), createElementVNode("span", null, "思考中")], -1)), createElementVNode("div", _hoisted_21, toDisplayString(msg.reasoning), 1)])) : createCommentVNode("v-if", true),
8598
+ }, [createElementVNode("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm0-4h-2V7h2v8z" })]), createElementVNode("span", null, "思考中")], -1)), createElementVNode("div", _hoisted_21$1, toDisplayString(msg.reasoning), 1)])) : createCommentVNode("v-if", true),
6641
8599
  createCommentVNode(" Message Content with Markdown "),
6642
8600
  createElementVNode("div", _hoisted_22, [
6643
8601
  createVNode(markdown_default, {
@@ -9253,7 +11211,11 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9253
11211
  type: Boolean,
9254
11212
  default: false
9255
11213
  },
9256
- roles: { default: [] }
11214
+ roles: { default: [] },
11215
+ showCollapseTrigger: {
11216
+ type: Boolean,
11217
+ default: true
11218
+ }
9257
11219
  },
9258
11220
  emits: [
9259
11221
  "collapse",
@@ -9291,6 +11253,10 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9291
11253
  onMounted(() => {
9292
11254
  localWidth.value = props.expandedWidth;
9293
11255
  });
11256
+ onUnmounted(() => {
11257
+ document.removeEventListener("mousemove", handleDragMove);
11258
+ document.removeEventListener("mouseup", handleDragEnd);
11259
+ });
9294
11260
  watch(() => props.expandedWidth, (val) => {
9295
11261
  if (val && val !== localWidth.value) localWidth.value = val;
9296
11262
  });
@@ -9363,7 +11329,7 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9363
11329
  createCommentVNode(" Logo 区域 "),
9364
11330
  createElementVNode("div", {
9365
11331
  class: normalizeClass(el("logo").value),
9366
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("collapse", !__props.collapsed))
11332
+ onClick: _cache[0] || (_cache[0] = ($event) => __props.showCollapseTrigger && _ctx.$emit("collapse", !__props.collapsed))
9367
11333
  }, [renderSlot(_ctx.$slots, "logo", {}, () => [__props.logo ? (openBlock(), createElementBlock("img", {
9368
11334
  key: 0,
9369
11335
  src: __props.logo,
@@ -9448,10 +11414,10 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9448
11414
  class: normalizeClass(el("search-empty").value)
9449
11415
  }, " 无匹配结果 ", 2)) : createCommentVNode("v-if", true)], true)], 2),
9450
11416
  createCommentVNode(" 底部支持信息 "),
9451
- __props.footerText && !__props.collapsed ? (openBlock(), createElementBlock("div", {
11417
+ (__props.footerText || _ctx.$slots.footer) && !__props.collapsed ? (openBlock(), createElementBlock("div", {
9452
11418
  key: 1,
9453
11419
  class: normalizeClass(el("footer").value)
9454
- }, [createElementVNode("div", { class: normalizeClass(el("footer-content").value) }, toDisplayString(__props.footerText), 3)], 2)) : createCommentVNode("v-if", true),
11420
+ }, [renderSlot(_ctx.$slots, "footer", {}, () => [createElementVNode("div", { class: normalizeClass(el("footer-content").value) }, toDisplayString(__props.footerText), 3)], true)], 2)) : createCommentVNode("v-if", true),
9455
11421
  createCommentVNode(" 拖拽调整手柄 "),
9456
11422
  __props.resizable && !__props.collapsed && !__props.isMobile ? (openBlock(), createElementBlock("div", {
9457
11423
  key: 2,
@@ -9461,7 +11427,7 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9461
11427
  ], 6);
9462
11428
  };
9463
11429
  }
9464
- }), [["__scopeId", "data-v-38d5b5bc"]]);
11430
+ }), [["__scopeId", "data-v-c55533fa"]]);
9465
11431
  //#endregion
9466
11432
  //#region src/components/navigation/tabs/tabs.vue
9467
11433
  const _hoisted_1$20 = [
@@ -10468,35 +12434,23 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10468
12434
  showSettings: {
10469
12435
  type: Boolean,
10470
12436
  default: true
10471
- }
10472
- },
10473
- emits: [
10474
- "tab-change",
10475
- "tab-close",
10476
- "tab-add",
10477
- "tab-reorder",
10478
- "update:modelTabs",
10479
- "language-change",
10480
- "user-command",
10481
- "notification-click",
10482
- "settings-click",
10483
- "toggle-sider"
10484
- ],
10485
- setup(__props, { emit: __emit }) {
10486
- const props = __props;
10487
- const emit = __emit;
10488
- const isMobile = computed(() => {
10489
- if (typeof window === "undefined") return false;
10490
- return window.innerWidth < 768;
10491
- });
10492
- const languageItems = [{
12437
+ },
12438
+ showLanguage: {
12439
+ type: Boolean,
12440
+ default: true
12441
+ },
12442
+ showNotification: {
12443
+ type: Boolean,
12444
+ default: true
12445
+ },
12446
+ languageItems: { default: () => [{
10493
12447
  key: "zh",
10494
12448
  label: "简体中文"
10495
12449
  }, {
10496
12450
  key: "en",
10497
12451
  label: "English"
10498
- }];
10499
- const userMenuItems = [
12452
+ }] },
12453
+ userMenuItems: { default: () => [
10500
12454
  {
10501
12455
  key: "profile",
10502
12456
  label: "个人中心"
@@ -10517,7 +12471,27 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10517
12471
  key: "logout",
10518
12472
  label: "退出登录"
10519
12473
  }
10520
- ];
12474
+ ] }
12475
+ },
12476
+ emits: [
12477
+ "tab-change",
12478
+ "tab-close",
12479
+ "tab-add",
12480
+ "tab-reorder",
12481
+ "update:modelTabs",
12482
+ "language-change",
12483
+ "user-command",
12484
+ "notification-click",
12485
+ "settings-click",
12486
+ "toggle-sider"
12487
+ ],
12488
+ setup(__props, { emit: __emit }) {
12489
+ const props = __props;
12490
+ const emit = __emit;
12491
+ const isMobile = computed(() => {
12492
+ if (typeof window === "undefined") return false;
12493
+ return window.innerWidth < 768;
12494
+ });
10521
12495
  const mobileUserMenuItems = computed(() => [
10522
12496
  {
10523
12497
  key: "language",
@@ -10577,7 +12551,7 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10577
12551
  return [];
10578
12552
  });
10579
12553
  const currentLanguageLabel = computed(() => {
10580
- return languageItems.find((item) => item.key === props.currentLanguage)?.label || "中文";
12554
+ return props.languageItems.find((item) => item.key === props.currentLanguage)?.label || "中文";
10581
12555
  });
10582
12556
  const headerClasses = computed(() => cn("yd-layout-header", `yd-layout-header--${props.theme}`));
10583
12557
  function el(name) {
@@ -10680,7 +12654,7 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10680
12654
  !isMobile.value ? (openBlock(), createElementBlock("div", {
10681
12655
  key: 1,
10682
12656
  class: normalizeClass(el("tabs"))
10683
- }, [renderSlot(_ctx.$slots, "tabs", {}, () => [__props.tabs.length > 0 ? (openBlock(), createBlock(tabs_default, {
12657
+ }, [renderSlot(_ctx.$slots, "prefix", {}, void 0, true), renderSlot(_ctx.$slots, "tabs", {}, () => [__props.tabs.length > 0 ? (openBlock(), createBlock(tabs_default, {
10684
12658
  key: 0,
10685
12659
  "model-value": __props.activeTab,
10686
12660
  "model-tabs": normalizedModelTabs.value,
@@ -10702,9 +12676,12 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10702
12676
  key: 2,
10703
12677
  class: normalizeClass(el("actions"))
10704
12678
  }, [
12679
+ createCommentVNode(" 自定义操作按钮区域 "),
12680
+ renderSlot(_ctx.$slots, "actions", {}, void 0, true),
10705
12681
  createCommentVNode(" 语言切换 "),
10706
- renderSlot(_ctx.$slots, "language", {}, () => [createVNode(dropdown_default, {
10707
- items: languageItems,
12682
+ renderSlot(_ctx.$slots, "language", {}, () => [__props.showLanguage ? (openBlock(), createBlock(dropdown_default, {
12683
+ key: 0,
12684
+ items: __props.languageItems,
10708
12685
  placement: "bottom",
10709
12686
  trigger: "hover",
10710
12687
  onSelect: handleLanguageSelect
@@ -10737,9 +12714,10 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10737
12714
  createElementVNode("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
10738
12715
  ], -1)])], 10, _hoisted_1$18)]),
10739
12716
  _: 1
10740
- })], true),
12717
+ }, 8, ["items"])) : createCommentVNode("v-if", true)], true),
10741
12718
  createCommentVNode(" 消息通知 "),
10742
- renderSlot(_ctx.$slots, "notification", {}, () => [createElementVNode("div", {
12719
+ renderSlot(_ctx.$slots, "notification", {}, () => [__props.showNotification ? (openBlock(), createElementBlock("div", {
12720
+ key: 0,
10743
12721
  class: normalizeClass(el("action-btn")),
10744
12722
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("notification-click"))
10745
12723
  }, [createVNode(badge_default, {
@@ -10759,11 +12737,11 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10759
12737
  "stroke-linejoin": "round"
10760
12738
  }, [createElementVNode("path", { d: "M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" }), createElementVNode("path", { d: "M13.73 21a2 2 0 0 1-3.46 0" })], -1)])]),
10761
12739
  _: 1
10762
- }, 8, ["value", "show"])], 2)], true),
12740
+ }, 8, ["value", "show"])], 2)) : createCommentVNode("v-if", true)], true),
10763
12741
  createCommentVNode(" 用户中心 "),
10764
12742
  renderSlot(_ctx.$slots, "user", {}, () => [__props.userInfo ? (openBlock(), createBlock(dropdown_default, {
10765
12743
  key: 0,
10766
- items: userMenuItems,
12744
+ items: __props.userMenuItems,
10767
12745
  placement: "bottom",
10768
12746
  trigger: "hover",
10769
12747
  onSelect: handleUserCommand
@@ -10789,7 +12767,7 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10789
12767
  }, [createElementVNode("polyline", { points: "6 9 12 15 18 9" })], -1))
10790
12768
  ], 2)]),
10791
12769
  _: 1
10792
- })) : createCommentVNode("v-if", true)], true),
12770
+ }, 8, ["items"])) : createCommentVNode("v-if", true)], true),
10793
12771
  createCommentVNode(" 设置 "),
10794
12772
  __props.showSettings ? renderSlot(_ctx.$slots, "settings", { key: 0 }, () => [createElementVNode("div", {
10795
12773
  class: normalizeClass(el("action-btn")),
@@ -10829,15 +12807,24 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10829
12807
  ], 6);
10830
12808
  };
10831
12809
  }
10832
- }), [["__scopeId", "data-v-f6d06be3"]]);
12810
+ }), [["__scopeId", "data-v-0e3d094c"]]);
10833
12811
  var layout_content_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
10834
12812
  name: "YdLayoutContent",
10835
12813
  __name: "layout-content",
10836
- props: { style: {} },
12814
+ props: {
12815
+ style: { default: () => ({}) },
12816
+ class: { default: "" },
12817
+ padding: { default: 16 }
12818
+ },
10837
12819
  setup(__props) {
10838
12820
  const props = __props;
10839
- const contentClasses = computed(() => cn("yd-layout-content"));
10840
- const contentStyle = computed(() => ({ ...props.style }));
12821
+ const contentClasses = computed(() => cn("yd-layout-content", props.class));
12822
+ const contentStyle = computed(() => {
12823
+ return {
12824
+ padding: typeof props.padding === "number" ? `${props.padding}px` : props.padding,
12825
+ ...props.style
12826
+ };
12827
+ });
10841
12828
  return (_ctx, _cache) => {
10842
12829
  return openBlock(), createElementBlock("main", {
10843
12830
  class: normalizeClass(contentClasses.value),
@@ -10845,7 +12832,7 @@ var layout_content_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
10845
12832
  }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 6);
10846
12833
  };
10847
12834
  }
10848
- }), [["__scopeId", "data-v-254cc3f6"]]);
12835
+ }), [["__scopeId", "data-v-bedd80a3"]]);
10849
12836
  //#endregion
10850
12837
  //#region src/components/data-display/watermark/watermark.vue
10851
12838
  const _hoisted_1$17 = ["src"];
@@ -11381,7 +13368,9 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11381
13368
  modelTabs: { default: () => [] },
11382
13369
  activeTab: { default: "" },
11383
13370
  userInfo: {},
13371
+ notificationCount: { default: 0 },
11384
13372
  contentPadding: { default: 16 },
13373
+ contentClass: { default: "" },
11385
13374
  hasSider: {
11386
13375
  type: Boolean,
11387
13376
  default: true
@@ -11418,7 +13407,53 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11418
13407
  menuPreset: {},
11419
13408
  tabsPreset: {},
11420
13409
  settingsPreset: {},
11421
- preset: {}
13410
+ preset: {},
13411
+ searchable: {
13412
+ type: Boolean,
13413
+ default: false
13414
+ },
13415
+ roles: { default: [] },
13416
+ showCollapseTrigger: {
13417
+ type: Boolean,
13418
+ default: true
13419
+ },
13420
+ showLanguage: {
13421
+ type: Boolean,
13422
+ default: true
13423
+ },
13424
+ showNotification: {
13425
+ type: Boolean,
13426
+ default: true
13427
+ },
13428
+ languageItems: { default: () => [{
13429
+ key: "zh",
13430
+ label: "简体中文"
13431
+ }, {
13432
+ key: "en",
13433
+ label: "English"
13434
+ }] },
13435
+ userMenuItems: { default: () => [
13436
+ {
13437
+ key: "profile",
13438
+ label: "个人中心"
13439
+ },
13440
+ {
13441
+ key: "message",
13442
+ label: "消息中心"
13443
+ },
13444
+ {
13445
+ key: "settings",
13446
+ label: "个人设置"
13447
+ },
13448
+ {
13449
+ key: "divider",
13450
+ label: "-"
13451
+ },
13452
+ {
13453
+ key: "logout",
13454
+ label: "退出登录"
13455
+ }
13456
+ ] }
11422
13457
  },
11423
13458
  emits: [
11424
13459
  "update:collapsed",
@@ -11431,6 +13466,7 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11431
13466
  "update:modelTabs",
11432
13467
  "language-change",
11433
13468
  "user-command",
13469
+ "notification-click",
11434
13470
  "settings-click",
11435
13471
  "update:theme",
11436
13472
  "theme-change",
@@ -11439,7 +13475,7 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11439
13475
  "update:headerHeight",
11440
13476
  "header-height-change"
11441
13477
  ],
11442
- setup(__props, { emit: __emit }) {
13478
+ setup(__props, { expose: __expose, emit: __emit }) {
11443
13479
  const props = __props;
11444
13480
  const emit = __emit;
11445
13481
  const internalCollapsed = ref(props.collapsed);
@@ -11589,6 +13625,26 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11589
13625
  watch(internalPopupAlign, (val) => {
11590
13626
  emit("update:popupAlign", val);
11591
13627
  });
13628
+ __expose({
13629
+ toggleCollapsed: () => handleCollapse(!mergedCollapsed.value),
13630
+ setCollapsed: (collapsed) => handleCollapse(collapsed),
13631
+ getCollapsed: () => mergedCollapsed.value,
13632
+ getTheme: () => mergedTheme.value,
13633
+ setTheme: (theme) => {
13634
+ internalTheme.value = theme;
13635
+ },
13636
+ getSiderWidth: () => mergedSiderWidth.value,
13637
+ setSiderWidth: (width) => {
13638
+ internalSiderWidth.value = width;
13639
+ },
13640
+ getHeaderHeight: () => mergedHeaderHeight.value,
13641
+ openSettings: () => {
13642
+ settingsVisible.value = true;
13643
+ },
13644
+ closeSettings: () => {
13645
+ settingsVisible.value = false;
13646
+ }
13647
+ });
11592
13648
  return (_ctx, _cache) => {
11593
13649
  return openBlock(), createElementBlock("div", {
11594
13650
  class: normalizeClass(layoutClasses.value),
@@ -11611,18 +13667,29 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11611
13667
  "popup-align": mergedPopupAlign.value,
11612
13668
  "footer-text": mergedFooterText.value,
11613
13669
  resizable: __props.siderResizable,
13670
+ searchable: __props.searchable,
13671
+ roles: __props.roles,
13672
+ "show-collapse-trigger": __props.showCollapseTrigger,
11614
13673
  onCollapse: handleCollapse,
11615
13674
  onMenuClick: handleMenuClick,
11616
13675
  onWidthChange: handleSiderWidthChange
11617
- }, createSlots({ _: 2 }, [_ctx.$slots.logo ? {
11618
- name: "logo",
11619
- fn: withCtx(() => [renderSlot(_ctx.$slots, "logo", {}, void 0, true)]),
11620
- key: "0"
11621
- } : void 0, _ctx.$slots.sider ? {
11622
- name: "sider",
11623
- fn: withCtx(() => [renderSlot(_ctx.$slots, "sider", {}, void 0, true)]),
11624
- key: "1"
11625
- } : void 0]), 1032, [
13676
+ }, createSlots({ _: 2 }, [
13677
+ _ctx.$slots.logo ? {
13678
+ name: "logo",
13679
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "logo", {}, void 0, true)]),
13680
+ key: "0"
13681
+ } : void 0,
13682
+ _ctx.$slots.sider ? {
13683
+ name: "sider",
13684
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "sider", {}, void 0, true)]),
13685
+ key: "1"
13686
+ } : void 0,
13687
+ _ctx.$slots["sidebar-footer"] ? {
13688
+ name: "footer",
13689
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "sidebar-footer", {}, void 0, true)]),
13690
+ key: "2"
13691
+ } : void 0
13692
+ ]), 1032, [
11626
13693
  "logo",
11627
13694
  "title",
11628
13695
  "collapsed",
@@ -11635,7 +13702,10 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11635
13702
  "waterfall",
11636
13703
  "popup-align",
11637
13704
  "footer-text",
11638
- "resizable"
13705
+ "resizable",
13706
+ "searchable",
13707
+ "roles",
13708
+ "show-collapse-trigger"
11639
13709
  ])) : createCommentVNode("v-if", true),
11640
13710
  createCommentVNode(" 主内容区 "),
11641
13711
  createElementVNode("div", {
@@ -11655,6 +13725,11 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11655
13725
  "is-mobile": isMobileMode.value,
11656
13726
  fixed: __props.headerFixed,
11657
13727
  "show-settings": __props.showSettings,
13728
+ "notification-count": __props.notificationCount,
13729
+ "show-language": __props.showLanguage,
13730
+ "show-notification": __props.showNotification,
13731
+ "language-items": __props.languageItems,
13732
+ "user-menu-items": __props.userMenuItems,
11658
13733
  onTabChange: handleTabChange,
11659
13734
  onTabClose: handleTabClose,
11660
13735
  onTabAdd: handleTabAdd,
@@ -11662,9 +13737,14 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11662
13737
  "onUpdate:modelTabs": handleModelTabsUpdate,
11663
13738
  onLanguageChange: handleLanguageChange,
11664
13739
  onUserCommand: handleUserCommand,
11665
- onToggleSider: handleCollapse,
13740
+ onNotificationClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("notification-click")),
13741
+ onToggleSider: _cache[1] || (_cache[1] = ($event) => handleCollapse(true)),
11666
13742
  onSettingsClick: handleSettingsClick
11667
- }, createSlots({ _: 2 }, [_ctx.$slots.header ? {
13743
+ }, createSlots({
13744
+ prefix: withCtx(() => [renderSlot(_ctx.$slots, "header-prefix", {}, void 0, true)]),
13745
+ actions: withCtx(() => [renderSlot(_ctx.$slots, "header-actions", {}, void 0, true)]),
13746
+ _: 2
13747
+ }, [_ctx.$slots.header ? {
11668
13748
  name: "header",
11669
13749
  fn: withCtx(() => [renderSlot(_ctx.$slots, "header", {}, void 0, true)]),
11670
13750
  key: "0"
@@ -11678,22 +13758,31 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11678
13758
  "header-height",
11679
13759
  "is-mobile",
11680
13760
  "fixed",
11681
- "show-settings"
13761
+ "show-settings",
13762
+ "notification-count",
13763
+ "show-language",
13764
+ "show-notification",
13765
+ "language-items",
13766
+ "user-menu-items"
11682
13767
  ])) : createCommentVNode("v-if", true),
11683
13768
  createCommentVNode(" 内容区 "),
11684
13769
  __props.hasContent && __props.watermark ? (openBlock(), createBlock(watermark_default, normalizeProps(mergeProps({ key: 1 }, __props.watermark)), {
11685
- default: withCtx(() => [createVNode(layout_content_default, { style: normalizeStyle(contentStyle.value) }, {
13770
+ default: withCtx(() => [createVNode(layout_content_default, {
13771
+ class: normalizeClass(__props.contentClass),
13772
+ style: normalizeStyle(contentStyle.value)
13773
+ }, {
11686
13774
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
11687
13775
  _: 3
11688
- }, 8, ["style"])]),
13776
+ }, 8, ["class", "style"])]),
11689
13777
  _: 3
11690
13778
  }, 16)) : __props.hasContent ? (openBlock(), createBlock(layout_content_default, {
11691
13779
  key: 2,
13780
+ class: normalizeClass(__props.contentClass),
11692
13781
  style: normalizeStyle(contentStyle.value)
11693
13782
  }, {
11694
13783
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
11695
13784
  _: 3
11696
- }, 8, ["style"])) : createCommentVNode("v-if", true)
13785
+ }, 8, ["class", "style"])) : createCommentVNode("v-if", true)
11697
13786
  ], 6),
11698
13787
  createCommentVNode(" 移动端遮罩层 "),
11699
13788
  maskVisible.value ? (openBlock(), createElementBlock("div", {
@@ -11703,7 +13792,7 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11703
13792
  })) : createCommentVNode("v-if", true),
11704
13793
  createVNode(drawer_default, {
11705
13794
  modelValue: settingsVisible.value,
11706
- "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => settingsVisible.value = $event),
13795
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => settingsVisible.value = $event),
11707
13796
  title: "设置",
11708
13797
  placement: "right",
11709
13798
  width: 320,
@@ -11719,25 +13808,25 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11719
13808
  createVNode(button_default, {
11720
13809
  size: "small",
11721
13810
  variant: internalTheme.value === "light" ? "primary" : "text",
11722
- onClick: _cache[0] || (_cache[0] = ($event) => internalTheme.value = "light")
13811
+ onClick: _cache[2] || (_cache[2] = ($event) => internalTheme.value = "light")
11723
13812
  }, {
11724
- default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode(" 浅色 ", -1)])]),
13813
+ default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" 浅色 ", -1)])]),
11725
13814
  _: 1
11726
13815
  }, 8, ["variant"]),
11727
13816
  createVNode(button_default, {
11728
13817
  size: "small",
11729
13818
  variant: internalTheme.value === "dark" ? "primary" : "text",
11730
- onClick: _cache[1] || (_cache[1] = ($event) => internalTheme.value = "dark")
13819
+ onClick: _cache[3] || (_cache[3] = ($event) => internalTheme.value = "dark")
11731
13820
  }, {
11732
- default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode(" 深色 ", -1)])]),
13821
+ default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" 深色 ", -1)])]),
11733
13822
  _: 1
11734
13823
  }, 8, ["variant"]),
11735
13824
  createVNode(button_default, {
11736
13825
  size: "small",
11737
13826
  variant: internalTheme.value === "corporate" ? "primary" : "text",
11738
- onClick: _cache[2] || (_cache[2] = ($event) => internalTheme.value = "corporate")
13827
+ onClick: _cache[4] || (_cache[4] = ($event) => internalTheme.value = "corporate")
11739
13828
  }, {
11740
- default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" 公司 ", -1)])]),
13829
+ default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" 公司 ", -1)])]),
11741
13830
  _: 1
11742
13831
  }, 8, ["variant"])
11743
13832
  ]),
@@ -11750,32 +13839,32 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11750
13839
  createVNode(button_default, {
11751
13840
  size: "small",
11752
13841
  variant: internalSiderWidth.value === 160 ? "primary" : "text",
11753
- onClick: _cache[3] || (_cache[3] = ($event) => internalSiderWidth.value = 160)
13842
+ onClick: _cache[5] || (_cache[5] = ($event) => internalSiderWidth.value = 160)
11754
13843
  }, {
11755
- default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" 窄 ", -1)])]),
13844
+ default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" 窄 ", -1)])]),
11756
13845
  _: 1
11757
13846
  }, 8, ["variant"]),
11758
13847
  createVNode(button_default, {
11759
13848
  size: "small",
11760
13849
  variant: internalSiderWidth.value === 200 ? "primary" : "text",
11761
- onClick: _cache[4] || (_cache[4] = ($event) => internalSiderWidth.value = 200)
13850
+ onClick: _cache[6] || (_cache[6] = ($event) => internalSiderWidth.value = 200)
11762
13851
  }, {
11763
- default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" 中 ", -1)])]),
13852
+ default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" 中 ", -1)])]),
11764
13853
  _: 1
11765
13854
  }, 8, ["variant"]),
11766
13855
  createVNode(button_default, {
11767
13856
  size: "small",
11768
13857
  variant: internalSiderWidth.value === 240 ? "primary" : "text",
11769
- onClick: _cache[5] || (_cache[5] = ($event) => internalSiderWidth.value = 240)
13858
+ onClick: _cache[7] || (_cache[7] = ($event) => internalSiderWidth.value = 240)
11770
13859
  }, {
11771
- default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" 宽 ", -1)])]),
13860
+ default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" 宽 ", -1)])]),
11772
13861
  _: 1
11773
13862
  }, 8, ["variant"])
11774
13863
  ]),
11775
13864
  _: 1
11776
13865
  })])])], 2112)) : item.type === "collapsed" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" 折叠侧边栏设置 "), createElementVNode("div", _hoisted_9$2, [createElementVNode("div", _hoisted_10$2, [createElementVNode("span", _hoisted_11$2, toDisplayString(item.label), 1), createVNode(switch_default, {
11777
13866
  modelValue: internalCollapsed.value,
11778
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => internalCollapsed.value = $event)
13867
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => internalCollapsed.value = $event)
11779
13868
  }, null, 8, ["modelValue"])])])], 2112)) : item.type === "waterfall" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [createCommentVNode(" 菜单模式设置 "), createElementVNode("div", _hoisted_12$2, [createElementVNode("div", _hoisted_13$2, [createElementVNode("span", _hoisted_14$1, toDisplayString(item.label), 1), createVNode(space_default, {
11780
13869
  size: 4,
11781
13870
  direction: "horizontal"
@@ -11784,38 +13873,38 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11784
13873
  createVNode(button_default, {
11785
13874
  size: "small",
11786
13875
  variant: !internalWaterfall.value ? "primary" : "text",
11787
- onClick: _cache[7] || (_cache[7] = ($event) => internalWaterfall.value = false)
13876
+ onClick: _cache[9] || (_cache[9] = ($event) => internalWaterfall.value = false)
11788
13877
  }, {
11789
- default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" 传��� ", -1)])]),
13878
+ default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode(" 传统 ", -1)])]),
11790
13879
  _: 1
11791
13880
  }, 8, ["variant"]),
11792
13881
  createVNode(button_default, {
11793
13882
  size: "small",
11794
13883
  variant: internalWaterfall.value && internalPopupAlign.value === "container" ? "primary" : "text",
11795
- onClick: _cache[8] || (_cache[8] = ($event) => {
13884
+ onClick: _cache[10] || (_cache[10] = ($event) => {
11796
13885
  internalWaterfall.value = true;
11797
13886
  internalPopupAlign.value = "container";
11798
13887
  })
11799
13888
  }, {
11800
- default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" 容器 ", -1)])]),
13889
+ default: withCtx(() => [..._cache[21] || (_cache[21] = [createTextVNode(" 容器 ", -1)])]),
11801
13890
  _: 1
11802
13891
  }, 8, ["variant"]),
11803
13892
  createVNode(button_default, {
11804
13893
  size: "small",
11805
13894
  variant: internalWaterfall.value && internalPopupAlign.value === "trigger" ? "primary" : "text",
11806
- onClick: _cache[9] || (_cache[9] = ($event) => {
13895
+ onClick: _cache[11] || (_cache[11] = ($event) => {
11807
13896
  internalWaterfall.value = true;
11808
13897
  internalPopupAlign.value = "trigger";
11809
13898
  })
11810
13899
  }, {
11811
- default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode(" 浮动 ", -1)])]),
13900
+ default: withCtx(() => [..._cache[22] || (_cache[22] = [createTextVNode(" 浮动 ", -1)])]),
11812
13901
  _: 1
11813
13902
  }, 8, ["variant"])
11814
13903
  ]),
11815
13904
  _: 1
11816
13905
  })])])], 2112)) : item.type === "footerText" ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [createCommentVNode(" 底部支持设置 "), createElementVNode("div", _hoisted_15$1, [createElementVNode("div", _hoisted_16$1, [createElementVNode("span", _hoisted_17$1, toDisplayString(item.label), 1), createVNode(input_default, {
11817
13906
  modelValue: internalFooterText.value,
11818
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => internalFooterText.value = $event),
13907
+ "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => internalFooterText.value = $event),
11819
13908
  placeholder: "显示在侧边栏底部",
11820
13909
  clearable: "",
11821
13910
  style: { "width": "140px" }
@@ -11826,7 +13915,7 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11826
13915
  ], 14, _hoisted_1$15);
11827
13916
  };
11828
13917
  }
11829
- }), [["__scopeId", "data-v-7b7fc384"]]);
13918
+ }), [["__scopeId", "data-v-904a9ea8"]]);
11830
13919
  var card_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
11831
13920
  name: "YdCard",
11832
13921
  inheritAttrs: false,
@@ -11955,44 +14044,45 @@ var tooltip_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defi
11955
14044
  }), [["__scopeId", "data-v-65560d25"]]);
11956
14045
  //#endregion
11957
14046
  //#region src/components/data-display/table/table.vue
11958
- const _hoisted_1$14 = { key: 0 };
11959
- const _hoisted_2$9 = [
14047
+ const _hoisted_1$14 = ["aria-label"];
14048
+ const _hoisted_2$9 = { key: 0 };
14049
+ const _hoisted_3$6 = [
11960
14050
  "draggable",
11961
14051
  "onDragstart",
11962
14052
  "onDragover",
11963
14053
  "onDrop"
11964
14054
  ];
11965
- const _hoisted_3$6 = ["onClick"];
11966
- const _hoisted_4$5 = ["onMousedown"];
11967
- const _hoisted_5$2 = ["onClick"];
14055
+ const _hoisted_4$5 = ["onClick"];
14056
+ const _hoisted_5$2 = ["onMousedown"];
11968
14057
  const _hoisted_6$2 = ["onClick"];
11969
- const _hoisted_7$1 = [
14058
+ const _hoisted_7$1 = ["onClick"];
14059
+ const _hoisted_8$1 = [
11970
14060
  "title",
11971
14061
  "onMouseenter",
11972
14062
  "onMouseleave"
11973
14063
  ];
11974
- const _hoisted_8$1 = ["colspan"];
11975
- const _hoisted_9$1 = [
14064
+ const _hoisted_9$1 = ["colspan"];
14065
+ const _hoisted_10$1 = [
11976
14066
  "draggable",
11977
14067
  "onDragstart",
11978
14068
  "onDragover",
11979
14069
  "onDrop"
11980
14070
  ];
11981
- const _hoisted_10$1 = ["onClick"];
11982
- const _hoisted_11$1 = ["onMousedown"];
11983
- const _hoisted_12$1 = ["onClick"];
14071
+ const _hoisted_11$1 = ["onClick"];
14072
+ const _hoisted_12$1 = ["onMousedown"];
11984
14073
  const _hoisted_13$1 = ["onClick"];
11985
- const _hoisted_14 = [
14074
+ const _hoisted_14 = ["onClick"];
14075
+ const _hoisted_15 = [
11986
14076
  "title",
11987
14077
  "onMouseenter",
11988
14078
  "onMouseleave"
11989
14079
  ];
11990
- const _hoisted_15 = ["colspan"];
11991
- const _hoisted_16 = { key: 0 };
11992
- const _hoisted_17 = ["colspan"];
11993
- const _hoisted_18 = ["disabled"];
11994
- const _hoisted_19 = ["onClick"];
11995
- const _hoisted_20 = ["disabled"];
14080
+ const _hoisted_16 = ["colspan"];
14081
+ const _hoisted_17 = { key: 0 };
14082
+ const _hoisted_18 = ["colspan"];
14083
+ const _hoisted_19 = ["disabled"];
14084
+ const _hoisted_20 = ["onClick"];
14085
+ const _hoisted_21 = ["disabled"];
11996
14086
  var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
11997
14087
  name: "YdTable",
11998
14088
  __name: "table",
@@ -12378,7 +14468,12 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12378
14468
  exportToJSON
12379
14469
  });
12380
14470
  return (_ctx, _cache) => {
12381
- return openBlock(), createElementBlock("div", { class: normalizeClass(tableClasses.value) }, [
14471
+ return openBlock(), createElementBlock("div", {
14472
+ class: normalizeClass(tableClasses.value),
14473
+ role: "table",
14474
+ "aria-busy": "loading",
14475
+ "aria-label": _ctx.ariaLabel || "数据表格"
14476
+ }, [
12382
14477
  createCommentVNode(" Loading overlay "),
12383
14478
  __props.loading ? (openBlock(), createElementBlock("div", {
12384
14479
  key: 0,
@@ -12391,7 +14486,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12391
14486
  __props.skeleton ? (openBlock(), createElementBlock("div", {
12392
14487
  key: 1,
12393
14488
  class: normalizeClass(e("skeleton-wrapper"))
12394
- }, [createElementVNode("table", { class: normalizeClass(e("skeleton-table")) }, [__props.stickyHeader || __props.columns.length > 0 ? (openBlock(), createElementBlock("thead", _hoisted_1$14, [createElementVNode("tr", { class: normalizeClass(e("skeleton-header-row")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col, index) => {
14489
+ }, [createElementVNode("table", { class: normalizeClass(e("skeleton-table")) }, [__props.stickyHeader || __props.columns.length > 0 ? (openBlock(), createElementBlock("thead", _hoisted_2$9, [createElementVNode("tr", { class: normalizeClass(e("skeleton-header-row")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col, index) => {
12395
14490
  return openBlock(), createElementBlock("th", {
12396
14491
  key: index,
12397
14492
  class: normalizeClass(e("skeleton-cell")),
@@ -12467,14 +14562,14 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12467
14562
  key: 0,
12468
14563
  class: normalizeClass(e("sort-btn")),
12469
14564
  onClick: ($event) => handleSort(col.key, $event)
12470
- }, [createElementVNode("span", { class: normalizeClass([e("sort-icon"), { [e("sort-icon--active")]: isColumnSorted(col.key) }]) }, [getSortPriority(col.key) > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(getSortPriority(col.key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(isColumnSorted(col.key) ? getSortOrder(col.key) === "asc" ? "↑" : "↓" : "↕"), 1)], 64))], 2)], 10, _hoisted_3$6)) : createCommentVNode("v-if", true)], 2),
14565
+ }, [createElementVNode("span", { class: normalizeClass([e("sort-icon"), { [e("sort-icon--active")]: isColumnSorted(col.key) }]) }, [getSortPriority(col.key) > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(getSortPriority(col.key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(isColumnSorted(col.key) ? getSortOrder(col.key) === "asc" ? "↑" : "↓" : "↕"), 1)], 64))], 2)], 10, _hoisted_4$5)) : createCommentVNode("v-if", true)], 2),
12471
14566
  createCommentVNode(" Resize handle "),
12472
14567
  col.resizable ? (openBlock(), createElementBlock("div", {
12473
14568
  key: 0,
12474
14569
  class: normalizeClass(e("resize-handle")),
12475
14570
  onMousedown: withModifiers(($event) => startResize($event, col.key), ["stop"])
12476
- }, null, 42, _hoisted_4$5)) : createCommentVNode("v-if", true)
12477
- ], 46, _hoisted_2$9);
14571
+ }, null, 42, _hoisted_5$2)) : createCommentVNode("v-if", true)
14572
+ ], 46, _hoisted_3$6);
12478
14573
  }), 128))], 2)) : createCommentVNode("v-if", true),
12479
14574
  createCommentVNode(" Visible rows "),
12480
14575
  (openBlock(true), createElementBlock(Fragment, null, renderList(visibleRows.value, (row, index) => {
@@ -12502,7 +14597,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12502
14597
  }, [createElementVNode("span", {
12503
14598
  class: normalizeClass([e("expand-icon"), { [e("expand-icon--expanded")]: expandedRows.value.has(startIndex.value + index) }]),
12504
14599
  onClick: withModifiers(($event) => toggleExpand(startIndex.value + index), ["stop"])
12505
- }, toDisplayString(expandedRows.value.has(startIndex.value + index) ? "▾" : "▸"), 11, _hoisted_6$2)], 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
14600
+ }, toDisplayString(expandedRows.value.has(startIndex.value + index) ? "▾" : "▸"), 11, _hoisted_7$1)], 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
12506
14601
  return openBlock(), createElementBlock("div", {
12507
14602
  key: col.key,
12508
14603
  class: normalizeClass([
@@ -12523,8 +14618,8 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12523
14618
  row,
12524
14619
  column: col,
12525
14620
  index: startIndex.value + index
12526
- }, () => [createTextVNode(toDisplayString(row[col.key]), 1)], true)], 46, _hoisted_7$1);
12527
- }), 128))], 14, _hoisted_5$2),
14621
+ }, () => [createTextVNode(toDisplayString(row[col.key]), 1)], true)], 46, _hoisted_8$1);
14622
+ }), 128))], 14, _hoisted_6$2),
12528
14623
  createCommentVNode(" Expand row "),
12529
14624
  __props.expandable && expandedRows.value.has(startIndex.value + index) ? (openBlock(), createElementBlock("div", {
12530
14625
  key: 0,
@@ -12540,7 +14635,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12540
14635
  }, [renderSlot(_ctx.$slots, "expand", {
12541
14636
  row,
12542
14637
  index: startIndex.value + index
12543
- }, void 0, true)], 10, _hoisted_8$1)], 6)) : createCommentVNode("v-if", true)
14638
+ }, void 0, true)], 10, _hoisted_9$1)], 6)) : createCommentVNode("v-if", true)
12544
14639
  ], 64);
12545
14640
  }), 128)),
12546
14641
  displayData.value.length === 0 && !__props.loading ? (openBlock(), createElementBlock("div", {
@@ -12584,14 +14679,14 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12584
14679
  key: 0,
12585
14680
  class: normalizeClass(e("sort-btn")),
12586
14681
  onClick: ($event) => handleSort(col.key, $event)
12587
- }, [createElementVNode("span", { class: normalizeClass([e("sort-icon"), { [e("sort-icon--active")]: isColumnSorted(col.key) }]) }, [getSortPriority(col.key) > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(getSortPriority(col.key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(isColumnSorted(col.key) ? getSortOrder(col.key) === "asc" ? "↑" : "↓" : "↕"), 1)], 64))], 2)], 10, _hoisted_10$1)) : createCommentVNode("v-if", true)], 2),
14682
+ }, [createElementVNode("span", { class: normalizeClass([e("sort-icon"), { [e("sort-icon--active")]: isColumnSorted(col.key) }]) }, [getSortPriority(col.key) > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(getSortPriority(col.key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(isColumnSorted(col.key) ? getSortOrder(col.key) === "asc" ? "↑" : "↓" : "↕"), 1)], 64))], 2)], 10, _hoisted_11$1)) : createCommentVNode("v-if", true)], 2),
12588
14683
  createCommentVNode(" Resize handle "),
12589
14684
  col.resizable ? (openBlock(), createElementBlock("div", {
12590
14685
  key: 0,
12591
14686
  class: normalizeClass(e("resize-handle")),
12592
14687
  onMousedown: withModifiers(($event) => startResize($event, col.key), ["stop"])
12593
- }, null, 42, _hoisted_11$1)) : createCommentVNode("v-if", true)
12594
- ], 46, _hoisted_9$1);
14688
+ }, null, 42, _hoisted_12$1)) : createCommentVNode("v-if", true)
14689
+ ], 46, _hoisted_10$1);
12595
14690
  }), 128))])], 2), createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(displayData.value, (row, index) => {
12596
14691
  return openBlock(), createElementBlock(Fragment, { key: index }, [
12597
14692
  createElementVNode("tr", {
@@ -12607,7 +14702,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12607
14702
  }, [createElementVNode("span", {
12608
14703
  class: normalizeClass([e("expand-icon"), { [e("expand-icon--expanded")]: expandedRows.value.has(index) }]),
12609
14704
  onClick: withModifiers(($event) => toggleExpand(index), ["stop"])
12610
- }, toDisplayString(expandedRows.value.has(index) ? "▾" : "▸"), 11, _hoisted_13$1)], 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
14705
+ }, toDisplayString(expandedRows.value.has(index) ? "▾" : "▸"), 11, _hoisted_14)], 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
12611
14706
  return openBlock(), createElementBlock("td", {
12612
14707
  key: col.key,
12613
14708
  class: normalizeClass([
@@ -12623,8 +14718,8 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12623
14718
  row,
12624
14719
  column: col,
12625
14720
  index
12626
- }, () => [createTextVNode(toDisplayString(row[col.key]), 1)], true)], 42, _hoisted_14);
12627
- }), 128))], 10, _hoisted_12$1),
14721
+ }, () => [createTextVNode(toDisplayString(row[col.key]), 1)], true)], 42, _hoisted_15);
14722
+ }), 128))], 10, _hoisted_13$1),
12628
14723
  createCommentVNode(" Expand row "),
12629
14724
  __props.expandable && expandedRows.value.has(index) ? (openBlock(), createElementBlock("tr", {
12630
14725
  key: 0,
@@ -12635,12 +14730,12 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12635
14730
  }, [renderSlot(_ctx.$slots, "expand", {
12636
14731
  row,
12637
14732
  index
12638
- }, void 0, true)], 10, _hoisted_15)], 2)) : createCommentVNode("v-if", true)
14733
+ }, void 0, true)], 10, _hoisted_16)], 2)) : createCommentVNode("v-if", true)
12639
14734
  ], 64);
12640
- }), 128)), displayData.value.length === 0 && !__props.loading ? (openBlock(), createElementBlock("tr", _hoisted_16, [createElementVNode("td", {
14735
+ }), 128)), displayData.value.length === 0 && !__props.loading ? (openBlock(), createElementBlock("tr", _hoisted_17, [createElementVNode("td", {
12641
14736
  class: normalizeClass(e("empty")),
12642
14737
  colspan: __props.columns.length + (__props.expandable ? 1 : 0)
12643
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createVNode(empty_default, { description: __props.emptyText }, null, 8, ["description"])], true)], 10, _hoisted_17)])) : createCommentVNode("v-if", true)])], 2)], 64))], 38),
14738
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createVNode(empty_default, { description: __props.emptyText }, null, 8, ["description"])], true)], 10, _hoisted_18)])) : createCommentVNode("v-if", true)])], 2)], 64))], 38),
12644
14739
  createCommentVNode(" Export toolbar "),
12645
14740
  __props.exportable ? (openBlock(), createElementBlock("div", {
12646
14741
  key: 2,
@@ -12668,7 +14763,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12668
14763
  class: normalizeClass(e("page-btn")),
12669
14764
  disabled: currentPage.value === 1,
12670
14765
  onClick: _cache[3] || (_cache[3] = ($event) => handlePageChange(currentPage.value - 1))
12671
- }, " ‹ ", 10, _hoisted_18),
14766
+ }, " ‹ ", 10, _hoisted_19),
12672
14767
  (openBlock(true), createElementBlock(Fragment, null, renderList(visiblePages.value, (page) => {
12673
14768
  return openBlock(), createElementBlock(Fragment, { key: page }, [page === "..." ? (openBlock(), createElementBlock("button", {
12674
14769
  key: 0,
@@ -12678,13 +14773,13 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12678
14773
  key: 1,
12679
14774
  class: normalizeClass([e("page-btn"), { [e("page-btn--active")]: page === currentPage.value }]),
12680
14775
  onClick: ($event) => handlePageChange(page)
12681
- }, toDisplayString(page), 11, _hoisted_19))], 64);
14776
+ }, toDisplayString(page), 11, _hoisted_20))], 64);
12682
14777
  }), 128)),
12683
14778
  createElementVNode("button", {
12684
14779
  class: normalizeClass(e("page-btn")),
12685
14780
  disabled: currentPage.value === totalPages.value,
12686
14781
  onClick: _cache[4] || (_cache[4] = ($event) => handlePageChange(currentPage.value + 1))
12687
- }, " › ", 10, _hoisted_20),
14782
+ }, " › ", 10, _hoisted_21),
12688
14783
  createElementVNode("span", { class: normalizeClass(e("page-info")) }, "共 " + toDisplayString(total.value) + " 条", 3)
12689
14784
  ], 2)) : createCommentVNode("v-if", true),
12690
14785
  createCommentVNode(" Cell overflow tooltip "),
@@ -12696,10 +14791,10 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12696
14791
  }, toDisplayString(tooltipContent.value), 7)) : createCommentVNode("v-if", true)]),
12697
14792
  _: 1
12698
14793
  })
12699
- ], 2);
14794
+ ], 10, _hoisted_1$14);
12700
14795
  };
12701
14796
  }
12702
- }), [["__scopeId", "data-v-0736270c"]]);
14797
+ }), [["__scopeId", "data-v-eba68bff"]]);
12703
14798
  //#endregion
12704
14799
  //#region src/components/data-display/progress/progress.vue
12705
14800
  const _hoisted_1$13 = ["stroke-width"];