kui-vue 5.2.2 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/index.js +2 -2
  2. package/es/index.js +3385 -363
  3. package/es/locale/de.js +7 -1
  4. package/es/locale/el.js +7 -1
  5. package/es/locale/en.js +7 -1
  6. package/es/locale/fr.js +7 -1
  7. package/es/locale/it.js +7 -1
  8. package/es/locale/ja.js +7 -1
  9. package/es/locale/ko.js +7 -1
  10. package/es/locale/ru.js +7 -1
  11. package/es/locale/th.js +7 -1
  12. package/es/locale/uk.js +7 -1
  13. package/es/locale/vi.js +7 -1
  14. package/es/locale/zh-CN.js +7 -1
  15. package/es/locale/zh-TW.js +7 -1
  16. package/lib/index.js +2 -2
  17. package/lib/locale/de.js +2 -2
  18. package/lib/locale/el.js +2 -2
  19. package/lib/locale/en.js +2 -2
  20. package/lib/locale/fr.js +2 -2
  21. package/lib/locale/it.js +2 -2
  22. package/lib/locale/ja.js +2 -2
  23. package/lib/locale/ko.js +2 -2
  24. package/lib/locale/ru.js +2 -2
  25. package/lib/locale/th.js +2 -2
  26. package/lib/locale/uk.js +2 -2
  27. package/lib/locale/vi.js +2 -2
  28. package/lib/locale/zh-CN.js +2 -2
  29. package/lib/locale/zh-TW.js +2 -2
  30. package/package.json +20 -19
  31. package/style/index.css +2 -2
  32. package/types/avatar/avatar-group.d.ts +1 -1
  33. package/types/badge/index.d.ts +4 -4
  34. package/types/color-picker/index.d.ts +1 -1
  35. package/types/components.d.ts +6 -2
  36. package/types/date-picker/index.d.ts +1 -1
  37. package/types/descriptions/descriptions-item.d.ts +1 -1
  38. package/types/descriptions/descriptions.d.ts +1 -1
  39. package/types/divider/index.d.ts +1 -1
  40. package/types/drawer/index.d.ts +1 -1
  41. package/types/dropdown/dropdown-button.d.ts +1 -1
  42. package/types/dropdown/dropdown.d.ts +1 -1
  43. package/types/empty/index.d.ts +1 -1
  44. package/types/flex/index.d.ts +1 -1
  45. package/types/global.d.ts +8 -4
  46. package/types/input/input-box.d.ts +1 -1
  47. package/types/input/input-group.d.ts +1 -1
  48. package/types/input/input.d.ts +3 -3
  49. package/types/input/textarea.d.ts +2 -2
  50. package/types/input-number/index.d.ts +1 -1
  51. package/types/layout/index.d.ts +2 -2
  52. package/types/loading/index.d.ts +1 -1
  53. package/types/locale/de.d.ts +6 -0
  54. package/types/locale/el.d.ts +6 -0
  55. package/types/locale/en.d.ts +6 -0
  56. package/types/locale/fr.d.ts +6 -0
  57. package/types/locale/it.d.ts +6 -0
  58. package/types/locale/ja.d.ts +6 -0
  59. package/types/locale/ko.d.ts +6 -0
  60. package/types/locale/ru.d.ts +6 -0
  61. package/types/locale/th.d.ts +6 -0
  62. package/types/locale/uk.d.ts +6 -0
  63. package/types/locale/vi.d.ts +6 -0
  64. package/types/locale/zh-CN.d.ts +6 -0
  65. package/types/locale/zh-TW.d.ts +6 -0
  66. package/types/menu/menu-group.d.ts +1 -1
  67. package/types/menu/menu-item.d.ts +1 -1
  68. package/types/menu/menu.d.ts +1 -1
  69. package/types/menu/sub-menu.d.ts +1 -1
  70. package/types/modal/modal.d.ts +27 -7
  71. package/types/page/index.d.ts +1 -1
  72. package/types/popconfirm/index.d.ts +1 -1
  73. package/types/poptip/index.d.ts +1 -1
  74. package/types/progress/index.d.ts +1 -1
  75. package/types/qrcode/index.d.ts +165 -0
  76. package/types/radio/radio-button.d.ts +1 -1
  77. package/types/radio/radio-group.d.ts +1 -1
  78. package/types/radio/radio.d.ts +1 -1
  79. package/types/rate/index.d.ts +1 -1
  80. package/types/rate/star.d.ts +1 -1
  81. package/types/row-col/col.d.ts +1 -1
  82. package/types/row-col/row.d.ts +1 -1
  83. package/types/select/option.d.ts +1 -1
  84. package/types/select/select.d.ts +1 -1
  85. package/types/slider/index.d.ts +1 -1
  86. package/types/space/index.d.ts +1 -1
  87. package/types/spin/index.d.ts +1 -1
  88. package/types/stat-card/stat-card.d.ts +1 -1
  89. package/types/stat-card/stat-number.d.ts +1 -1
  90. package/types/switch/index.d.ts +1 -1
  91. package/types/table/index.d.ts +2 -2
  92. package/types/tabs/tab-panel.d.ts +1 -1
  93. package/types/tabs/tabs.d.ts +1 -4
  94. package/types/tag/index.d.ts +1 -1
  95. package/types/time-line/timeline-item.d.ts +1 -1
  96. package/types/time-line/timeline.d.ts +1 -1
  97. package/types/tooltip/index.d.ts +1 -1
  98. package/types/tree/index.d.ts +1 -1
  99. package/types/tree-select/index.d.ts +1 -1
  100. package/types/upload/file-list.d.ts +1 -1
  101. package/types/upload/index.d.ts +1 -1
  102. package/types/upload/selector.d.ts +1 -1
  103. package/types/utils/share.d.ts +12 -0
  104. package/types/watermark/index.d.ts +197 -0
  105. package/vetur/attributes.json +149 -37
  106. package/vetur/tags.json +52 -18
  107. package/vetur/web-types.json +282 -68
  108. package/es/affix/index.d.ts +0 -49
  109. package/es/alert/index.d.ts +0 -61
  110. package/es/anchor/anchor-link.d.ts +0 -23
  111. package/es/anchor/anchor.d.ts +0 -67
  112. package/es/anchor/index.d.ts +0 -5
  113. package/es/avatar/avatar-group.d.ts +0 -39
  114. package/es/avatar/avatar.d.ts +0 -43
  115. package/es/avatar/index.d.ts +0 -5
  116. package/es/back-top/index.d.ts +0 -46
  117. package/es/badge/index.d.ts +0 -49
  118. package/es/base/transition.d.ts +0 -3
  119. package/es/breadcrumb/breadcrumb-item.d.ts +0 -15
  120. package/es/breadcrumb/breadcrumb.d.ts +0 -22
  121. package/es/breadcrumb/index.d.ts +0 -5
  122. package/es/button/button-group.d.ts +0 -21
  123. package/es/button/button.d.ts +0 -39
  124. package/es/button/index.d.ts +0 -5
  125. package/es/card/index.d.ts +0 -30
  126. package/es/carousel/carousel-item.d.ts +0 -2
  127. package/es/carousel/carousel.d.ts +0 -84
  128. package/es/carousel/index.d.ts +0 -4
  129. package/es/checkbox/checkbox-group.d.ts +0 -79
  130. package/es/checkbox/checkbox.d.ts +0 -105
  131. package/es/checkbox/index.d.ts +0 -6
  132. package/es/collapse/collapse-panel.d.ts +0 -15
  133. package/es/collapse/collapse.d.ts +0 -32
  134. package/es/collapse/index.d.ts +0 -6
  135. package/es/color-picker/alpha.d.ts +0 -15
  136. package/es/color-picker/hue.d.ts +0 -17
  137. package/es/color-picker/index.d.ts +0 -110
  138. package/es/color-picker/mode.d.ts +0 -25
  139. package/es/color-picker/paint.d.ts +0 -26
  140. package/es/color-picker/presets.d.ts +0 -20
  141. package/es/components.d.ts +0 -113
  142. package/es/config/context.d.ts +0 -10
  143. package/es/config/index.d.ts +0 -16
  144. package/es/const/types.d.ts +0 -19
  145. package/es/const/var.d.ts +0 -1
  146. package/es/date-picker/index.d.ts +0 -277
  147. package/es/descriptions/descriptions-item.d.ts +0 -35
  148. package/es/descriptions/descriptions.d.ts +0 -54
  149. package/es/descriptions/index.d.ts +0 -4
  150. package/es/directives/outsiteclick.d.ts +0 -2
  151. package/es/directives/resize.d.ts +0 -3
  152. package/es/directives/scroll.d.ts +0 -2
  153. package/es/directives/transfer.d.ts +0 -2
  154. package/es/divider/index.d.ts +0 -42
  155. package/es/drawer/index.d.ts +0 -177
  156. package/es/dropdown/dropdown-button.d.ts +0 -45
  157. package/es/dropdown/dropdown.d.ts +0 -72
  158. package/es/dropdown/index.d.ts +0 -4
  159. package/es/dropdown/trigger.d.ts +0 -11
  160. package/es/empty/index.d.ts +0 -9
  161. package/es/flex/index.d.ts +0 -45
  162. package/es/form/form-item.d.ts +0 -24
  163. package/es/form/form.d.ts +0 -92
  164. package/es/form/index.d.ts +0 -6
  165. package/es/form/types.d.ts +0 -14
  166. package/es/grid/grid-item.d.ts +0 -22
  167. package/es/grid/grid.d.ts +0 -39
  168. package/es/grid/index.d.ts +0 -5
  169. package/es/grid/useBreakpoint.d.ts +0 -3
  170. package/es/icon/demo/search.d.ts +0 -2
  171. package/es/icon/demo/tags.d.ts +0 -4
  172. package/es/icon/index.d.ts +0 -45
  173. package/es/image/group.d.ts +0 -11
  174. package/es/image/image.d.ts +0 -45
  175. package/es/image/index.d.ts +0 -5
  176. package/es/image/instance.d.ts +0 -2
  177. package/es/image/preview.d.ts +0 -36
  178. package/es/image/utils.d.ts +0 -6
  179. package/es/index.d.ts +0 -10
  180. package/es/input/index.d.ts +0 -8
  181. package/es/input/input-box.d.ts +0 -39
  182. package/es/input/input-group.d.ts +0 -58
  183. package/es/input/input.d.ts +0 -56
  184. package/es/input/textarea.d.ts +0 -25
  185. package/es/input-number/index.d.ts +0 -127
  186. package/es/layout/index.d.ts +0 -136
  187. package/es/loading/index.d.ts +0 -16
  188. package/es/locale/de.d.ts +0 -59
  189. package/es/locale/el.d.ts +0 -59
  190. package/es/locale/en.d.ts +0 -59
  191. package/es/locale/fr.d.ts +0 -59
  192. package/es/locale/it.d.ts +0 -59
  193. package/es/locale/ja.d.ts +0 -59
  194. package/es/locale/ko.d.ts +0 -59
  195. package/es/locale/ru.d.ts +0 -59
  196. package/es/locale/th.d.ts +0 -59
  197. package/es/locale/uk.d.ts +0 -59
  198. package/es/locale/vi.d.ts +0 -59
  199. package/es/locale/zh-CN.d.ts +0 -59
  200. package/es/locale/zh-TW.d.ts +0 -59
  201. package/es/menu/index.d.ts +0 -7
  202. package/es/menu/menu-divider.d.ts +0 -2
  203. package/es/menu/menu-group.d.ts +0 -20
  204. package/es/menu/menu-item.d.ts +0 -22
  205. package/es/menu/menu.d.ts +0 -92
  206. package/es/menu/recursive-menu.d.ts +0 -17
  207. package/es/menu/sub-menu.d.ts +0 -24
  208. package/es/message/index.d.ts +0 -23
  209. package/es/modal/index.d.ts +0 -26
  210. package/es/modal/modal.d.ts +0 -176
  211. package/es/modal/toast.d.ts +0 -32
  212. package/es/notice/container.d.ts +0 -6
  213. package/es/notice/content.d.ts +0 -54
  214. package/es/notice/index.d.ts +0 -23
  215. package/es/notice/instance.d.ts +0 -8
  216. package/es/page/index.d.ts +0 -115
  217. package/es/popconfirm/index.d.ts +0 -75
  218. package/es/poptip/index.d.ts +0 -66
  219. package/es/progress/index.d.ts +0 -125
  220. package/es/radio/index.d.ts +0 -7
  221. package/es/radio/radio-button.d.ts +0 -76
  222. package/es/radio/radio-group.d.ts +0 -77
  223. package/es/radio/radio.d.ts +0 -73
  224. package/es/radio/types.d.ts +0 -5
  225. package/es/rate/index.d.ts +0 -99
  226. package/es/rate/star.d.ts +0 -65
  227. package/es/row-col/col.d.ts +0 -17
  228. package/es/row-col/index.d.ts +0 -5
  229. package/es/row-col/row.d.ts +0 -43
  230. package/es/select/index.d.ts +0 -5
  231. package/es/select/option.d.ts +0 -23
  232. package/es/select/select.d.ts +0 -150
  233. package/es/skeleton/index.d.ts +0 -7
  234. package/es/skeleton/skeleton-avatar.d.ts +0 -58
  235. package/es/skeleton/skeleton-button.d.ts +0 -58
  236. package/es/skeleton/skeleton-image.d.ts +0 -58
  237. package/es/skeleton/skeleton-text.d.ts +0 -58
  238. package/es/skeleton/skeleton.d.ts +0 -61
  239. package/es/skeleton/types.d.ts +0 -29
  240. package/es/slider/index.d.ts +0 -112
  241. package/es/slider/thumb.d.ts +0 -58
  242. package/es/space/index.d.ts +0 -50
  243. package/es/spin/index.d.ts +0 -58
  244. package/es/splitter/index.d.ts +0 -4
  245. package/es/splitter/splitter-panel.d.ts +0 -35
  246. package/es/splitter/splitter.d.ts +0 -32
  247. package/es/stat-card/countup.d.ts +0 -56
  248. package/es/stat-card/index.d.ts +0 -5
  249. package/es/stat-card/rollup.d.ts +0 -32
  250. package/es/stat-card/stat-card.d.ts +0 -72
  251. package/es/stat-card/stat-number.d.ts +0 -100
  252. package/es/stat-card/utils/countup.d.ts +0 -127
  253. package/es/stat-card/utils/odometer.d.ts +0 -13
  254. package/es/switch/index.d.ts +0 -72
  255. package/es/table/index.d.ts +0 -185
  256. package/es/tabs/index.d.ts +0 -5
  257. package/es/tabs/tab-panel.d.ts +0 -22
  258. package/es/tabs/tabs.d.ts +0 -44
  259. package/es/tabs/types.d.ts +0 -16
  260. package/es/tag/index.d.ts +0 -57
  261. package/es/time-line/index.d.ts +0 -5
  262. package/es/time-line/timeline-item.d.ts +0 -20
  263. package/es/time-line/timeline.d.ts +0 -26
  264. package/es/tooltip/index.d.ts +0 -42
  265. package/es/tree/index.d.ts +0 -179
  266. package/es/tree/utils.d.ts +0 -32
  267. package/es/tree-select/index.d.ts +0 -224
  268. package/es/upload/file-list.d.ts +0 -59
  269. package/es/upload/index.d.ts +0 -190
  270. package/es/upload/selector.d.ts +0 -73
  271. package/es/utils/checked.d.ts +0 -2
  272. package/es/utils/color.d.ts +0 -1
  273. package/es/utils/element.d.ts +0 -4
  274. package/es/utils/mouse.d.ts +0 -1
  275. package/es/utils/number.d.ts +0 -6
  276. package/es/utils/placement.d.ts +0 -16
  277. package/es/utils/theme.d.ts +0 -5
  278. package/es/utils/vnode.d.ts +0 -5
  279. package/es/utils/vue.d.ts +0 -5
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * kui-vue v5.2.2
2
+ * kui-vue v5.3.0
3
3
  * Copyright 2017-present, kui-vue.
4
4
  * All rights reserved.
5
5
  * Homepage: https://k-ui.cn
@@ -163,6 +163,13 @@ var Affix = /* @__PURE__ */ defineComponent({
163
163
  });
164
164
  //#endregion
165
165
  //#region node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js
166
+ /*!
167
+ * kui-icons v5.0.0
168
+ * Copyright 2017-present, kui-icons.
169
+ * All rights reserved.
170
+ * Homepage: https://k-ui.cn
171
+ * Author: Qiu / https://chuchur.com
172
+ */
166
173
  var ArrowDown = [{
167
174
  d: "M12 5V19 M19 12L12 19L5 12",
168
175
  s: "fill:none;stroke:currentcolor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
@@ -656,8 +663,10 @@ var Avatar = /* @__PURE__ */ defineComponent({
656
663
  if (innerRef.value && rootRef.value) {
657
664
  const max = rootRef.value.offsetWidth - 8;
658
665
  const innerWidth = innerRef.value.offsetWidth || innerRef.value.scrollWidth;
659
- if (innerWidth > 0 && innerWidth > max) textStyles.value = { transform: `scale(${Math.min(max / innerWidth, 1)}) translateX(-50%)` };
660
- else textStyles.value = { transform: "scale(1) translateX(-50%)" };
666
+ if (innerWidth > 0 && innerWidth > max) {
667
+ const scale = Math.min(max / innerWidth, 1);
668
+ textStyles.value = { transform: `scale(${scale}) translateX(-50%)` };
669
+ } else textStyles.value = { transform: "scale(1) translateX(-50%)" };
661
670
  }
662
671
  };
663
672
  onMounted(() => {
@@ -764,6 +773,8 @@ var toggleContainerScroll = (target, lock) => {
764
773
  }
765
774
  }
766
775
  };
776
+ //#endregion
777
+ //#region components/avatar/avatar-group.tsx
767
778
  var AvatarGroup = /* @__PURE__ */ defineComponent({
768
779
  name: "AvatarGroup",
769
780
  props: {
@@ -869,7 +880,8 @@ var BackTop = /* @__PURE__ */ defineComponent({
869
880
  setup(props, { emit, slots }) {
870
881
  const visible = ref(false);
871
882
  const onScroll = () => {
872
- visible.value = (document.body.scrollTop || document.documentElement.scrollTop || window.scrollY) >= props.height;
883
+ const scrollTop = document.body.scrollTop || document.documentElement.scrollTop || window.scrollY;
884
+ visible.value = scrollTop >= props.height;
873
885
  };
874
886
  const handleClick = (e) => {
875
887
  emit("click", e);
@@ -1174,7 +1186,8 @@ var Carousel = /* @__PURE__ */ defineComponent({
1174
1186
  return result;
1175
1187
  };
1176
1188
  const children = computed(() => {
1177
- return flatten(slots.default?.() || []);
1189
+ const raw = slots.default?.() || [];
1190
+ return flatten(raw);
1178
1191
  });
1179
1192
  watch(() => props.modelValue, (val) => {
1180
1193
  currentIndex.value = val;
@@ -3878,12 +3891,17 @@ function setPlacement({ refSelection, refPopper, currentPlacement, position = nu
3878
3891
  calcLeft = rect.left + (rect.width - pickerW) / 2;
3879
3892
  originX = "center";
3880
3893
  }
3894
+ if (calcLeft < 0) calcLeft = 0;
3895
+ else if (calcLeft + pickerW > clientWidth) calcLeft = clientWidth - pickerW;
3896
+ if (calcTop < 0) calcTop = 0;
3897
+ else if (calcTop + pickerH > clientHeight) calcTop = clientHeight - pickerH;
3881
3898
  top.value = calcTop + scrollTop;
3882
3899
  left.value = calcLeft + scrollLeft;
3883
3900
  transOrigin.value = `${originX} ${originY}`;
3884
3901
  if (currentPlacement.value !== finalPlacement) currentPlacement.value = finalPlacement;
3885
3902
  }
3886
- typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
3903
+ //#endregion
3904
+ //#region components/utils/share.ts
3887
3905
  var clamp = (n, min, max) => Math.min(max, Math.max(min, n));
3888
3906
  //#endregion
3889
3907
  //#region components/color-picker/alpha.tsx
@@ -3915,7 +3933,8 @@ var alpha_default = /* @__PURE__ */ defineComponent({
3915
3933
  ctx.fillRect(0, 0, width, height);
3916
3934
  };
3917
3935
  const updatePos = () => {
3918
- dotPos.value = Color(props.modelValue).alpha() * 190 - 7;
3936
+ const a = Color(props.modelValue).alpha();
3937
+ dotPos.value = a * 190 - 7;
3919
3938
  };
3920
3939
  const handleMove = (e) => {
3921
3940
  const canvas = refPaint.value;
@@ -4028,7 +4047,21 @@ var hue_default = /* @__PURE__ */ defineComponent({
4028
4047
  //#endregion
4029
4048
  //#region node_modules/.pnpm/big.js@7.0.1/node_modules/big.js/big.mjs
4030
4049
  /************************************** EDITABLE DEFAULTS *****************************************/
4031
- var DP = 20, RM = 1, MAX_DP = 1e6, MAX_POWER = 1e6, NE = -7, PE = 21, STRICT = false, NAME = "[big.js] ", INVALID = NAME + "Invalid ", INVALID_DP = INVALID + "decimal places", INVALID_RM = INVALID + "rounding mode", DIV_BY_ZERO = NAME + "Division by zero", P = {}, UNDEFINED = void 0, NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
4050
+ var DP = 20;
4051
+ var RM = 1;
4052
+ var MAX_DP = 1e6;
4053
+ var MAX_POWER = 1e6;
4054
+ var NE = -7;
4055
+ var PE = 21;
4056
+ var STRICT = false;
4057
+ var NAME = "[big.js] ";
4058
+ var INVALID = NAME + "Invalid ";
4059
+ var INVALID_DP = INVALID + "decimal places";
4060
+ var INVALID_RM = INVALID + "rounding mode";
4061
+ var DIV_BY_ZERO = NAME + "Division by zero";
4062
+ var P = {};
4063
+ var UNDEFINED = void 0;
4064
+ var NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
4032
4065
  function _Big_() {
4033
4066
  function Big(n) {
4034
4067
  var x = this;
@@ -4317,7 +4350,7 @@ P.plus = P.add = function(y) {
4317
4350
  };
4318
4351
  P.pow = function(n) {
4319
4352
  var x = this, one = new x.constructor("1"), y = one, isneg = n < 0;
4320
- if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) throw Error(INVALID + "exponent");
4353
+ if (n !== ~~n || n < -1e6 || n > MAX_POWER) throw Error(INVALID + "exponent");
4321
4354
  if (isneg) n = -n;
4322
4355
  for (;;) {
4323
4356
  if (n & 1) y = y.times(x);
@@ -4333,7 +4366,7 @@ P.prec = function(sd, rm) {
4333
4366
  };
4334
4367
  P.round = function(dp, rm) {
4335
4368
  if (dp === UNDEFINED) dp = 0;
4336
- else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) throw Error(INVALID_DP);
4369
+ else if (dp !== ~~dp || dp < -1e6 || dp > MAX_DP) throw Error(INVALID_DP);
4337
4370
  return round(new this.constructor(this), dp + this.e + 1, rm);
4338
4371
  };
4339
4372
  P.sqrt = function() {
@@ -4546,6 +4579,8 @@ var input_box_default = /* @__PURE__ */ defineComponent({
4546
4579
  };
4547
4580
  }
4548
4581
  });
4582
+ //#endregion
4583
+ //#region components/input/input-group.tsx
4549
4584
  var InputGroup = /* @__PURE__ */ defineComponent({
4550
4585
  name: "InputGroup",
4551
4586
  props: {
@@ -4613,6 +4648,12 @@ var Input = /* @__PURE__ */ defineComponent({
4613
4648
  default: true
4614
4649
  },
4615
4650
  size: { type: String },
4651
+ value: { type: [
4652
+ String,
4653
+ Number,
4654
+ Array,
4655
+ Object
4656
+ ] },
4616
4657
  modelValue: { type: [
4617
4658
  String,
4618
4659
  Number,
@@ -4645,13 +4686,12 @@ var Input = /* @__PURE__ */ defineComponent({
4645
4686
  default: "input"
4646
4687
  },
4647
4688
  onSearch: { type: Function },
4648
- maxlength: Number,
4649
4689
  onIconClick: { type: Function },
4650
4690
  onClear: { type: Function },
4651
4691
  onChange: { type: Function }
4652
4692
  },
4653
4693
  setup(props, { slots, emit, attrs, expose }) {
4654
- const currentValue = ref(props.modelValue);
4694
+ const currentValue = ref(props.modelValue ?? props.value);
4655
4695
  const focused = ref(false);
4656
4696
  const showPassword = ref(false);
4657
4697
  const inputRef = ref();
@@ -4789,9 +4829,17 @@ var Input = /* @__PURE__ */ defineComponent({
4789
4829
  };
4790
4830
  }
4791
4831
  });
4832
+ //#endregion
4833
+ //#region components/input/textarea.tsx
4792
4834
  var TextArea = /* @__PURE__ */ defineComponent({
4793
4835
  name: "TextArea",
4794
4836
  props: {
4837
+ value: [
4838
+ String,
4839
+ Number,
4840
+ Object,
4841
+ Array
4842
+ ],
4795
4843
  modelValue: [
4796
4844
  String,
4797
4845
  Number,
@@ -4813,7 +4861,7 @@ var TextArea = /* @__PURE__ */ defineComponent({
4813
4861
  onChange: { type: Function }
4814
4862
  },
4815
4863
  setup(props, { attrs, emit }) {
4816
- const currentValue = ref(props.modelValue);
4864
+ const currentValue = ref(props.modelValue ?? props.value);
4817
4865
  watch(() => props.modelValue, (v) => {
4818
4866
  currentValue.value = v;
4819
4867
  });
@@ -4842,6 +4890,8 @@ var TextArea = /* @__PURE__ */ defineComponent({
4842
4890
  };
4843
4891
  }
4844
4892
  });
4893
+ //#endregion
4894
+ //#region components/input-number/index.tsx
4845
4895
  var InputNumber = /* @__PURE__ */ defineComponent({
4846
4896
  inheritAttrs: false,
4847
4897
  name: "InputNumber",
@@ -4913,7 +4963,8 @@ var InputNumber = /* @__PURE__ */ defineComponent({
4913
4963
  const clampedStr = clamp(String(parsed));
4914
4964
  innerValue.value = clampedStr;
4915
4965
  userInput.value = null;
4916
- emitValue(clampedStr === "" ? void 0 : Number(clampedStr));
4966
+ const output = clampedStr === "" ? void 0 : Number(clampedStr);
4967
+ emitValue(output);
4917
4968
  };
4918
4969
  const handleInput = (val) => {
4919
4970
  userInput.value = val;
@@ -4940,7 +4991,8 @@ var InputNumber = /* @__PURE__ */ defineComponent({
4940
4991
  const stepAction = (type) => {
4941
4992
  if (props.disabled || props.readonly) return;
4942
4993
  const current = isValidBig(innerValue.value) ? innerValue.value : 0;
4943
- triggerUpdate((type === "up" ? new Big(current).plus(props.step) : new Big(current).minus(props.step)).toFixed());
4994
+ const next = type === "up" ? new Big(current).plus(props.step) : new Big(current).minus(props.step);
4995
+ triggerUpdate(next.toFixed());
4944
4996
  };
4945
4997
  return () => {
4946
4998
  const inputProps = {
@@ -4985,6 +5037,8 @@ var InputNumber = /* @__PURE__ */ defineComponent({
4985
5037
  };
4986
5038
  }
4987
5039
  });
5040
+ //#endregion
5041
+ //#region components/select/option.tsx
4988
5042
  var Option = /* @__PURE__ */ defineComponent({
4989
5043
  name: "Option",
4990
5044
  props: {
@@ -5027,6 +5081,8 @@ var Option = /* @__PURE__ */ defineComponent({
5027
5081
  };
5028
5082
  }
5029
5083
  });
5084
+ //#endregion
5085
+ //#region components/empty/index.tsx
5030
5086
  var Empty = /* @__PURE__ */ defineComponent({
5031
5087
  name: "Empty",
5032
5088
  props: {
@@ -5065,6 +5121,8 @@ var Empty = /* @__PURE__ */ defineComponent({
5065
5121
  };
5066
5122
  }
5067
5123
  });
5124
+ //#endregion
5125
+ //#region components/select/select.tsx
5068
5126
  var Select = /* @__PURE__ */ defineComponent({
5069
5127
  name: "Select",
5070
5128
  directives: {
@@ -5203,6 +5261,7 @@ var Select = /* @__PURE__ */ defineComponent({
5203
5261
  document.removeEventListener("click", outsideClick);
5204
5262
  });
5205
5263
  const labelText = computed(() => {
5264
+ if (!optionsData.value || optionsData.value.length == 0) return [];
5206
5265
  const lookup = /* @__PURE__ */ new Map();
5207
5266
  optionsData.value.forEach((item) => {
5208
5267
  lookup.set(item.value, item.label);
@@ -5301,12 +5360,16 @@ var Select = /* @__PURE__ */ defineComponent({
5301
5360
  nextTick(() => {
5302
5361
  visible.value = true;
5303
5362
  emit("openChange", true);
5304
- updatePosition();
5363
+ nextTick(() => {
5364
+ updatePosition();
5365
+ });
5305
5366
  });
5306
5367
  } else {
5307
5368
  visible.value = true;
5308
5369
  emit("openChange", true);
5309
- updatePosition();
5370
+ nextTick(() => {
5371
+ updatePosition();
5372
+ });
5310
5373
  }
5311
5374
  emit("search", e);
5312
5375
  }, 500);
@@ -5498,7 +5561,7 @@ var Select = /* @__PURE__ */ defineComponent({
5498
5561
  }
5499
5562
  return tags;
5500
5563
  };
5501
- const labelsNode = multiple ? createVNode("div", { "class": "k-select-labels" }, [renderTags(), queryNode]) : !isEmpty(labelText.value) ? withDirectives(createVNode("div", { "class": "k-select-label" }, [labelText.value[0]]), [[vShow, !queryKey.value.length]]) : null;
5564
+ const labelsNode = multiple ? createVNode("div", { "class": "k-select-labels" }, [renderTags(), queryNode]) : withDirectives(createVNode("div", { "class": "k-select-label" }, [labelText.value[0]]), [[vShow, !isEmpty(labelText.value) && !queryKey.value.length]]);
5502
5565
  childNode.push(labelsNode);
5503
5566
  placeNode && childNode.push(placeNode);
5504
5567
  if ((filterable || hasSearchEvent) && !multiple) childNode.push(queryNode);
@@ -5835,6 +5898,8 @@ var presets_default = /* @__PURE__ */ defineComponent({
5835
5898
  };
5836
5899
  }
5837
5900
  });
5901
+ //#endregion
5902
+ //#region components/color-picker/index.tsx
5838
5903
  var ColorPicker = /* @__PURE__ */ defineComponent({
5839
5904
  name: "ColorPicker",
5840
5905
  directives: {
@@ -5920,11 +5985,15 @@ var ColorPicker = /* @__PURE__ */ defineComponent({
5920
5985
  document.addEventListener("click", outsideClick);
5921
5986
  nextTick(() => {
5922
5987
  openChange(true);
5923
- updatePopPosition();
5988
+ nextTick(() => {
5989
+ updatePopPosition();
5990
+ });
5924
5991
  });
5925
5992
  } else {
5926
5993
  openChange(true);
5927
- updatePopPosition();
5994
+ nextTick(() => {
5995
+ updatePopPosition();
5996
+ });
5928
5997
  }
5929
5998
  else openChange(false);
5930
5999
  };
@@ -5947,20 +6016,23 @@ var ColorPicker = /* @__PURE__ */ defineComponent({
5947
6016
  emit("change", value);
5948
6017
  };
5949
6018
  const onUpdateRGB = ({ r, g, b }) => {
5950
- onUpdate(Color({
6019
+ const color = Color({
5951
6020
  r,
5952
6021
  g,
5953
6022
  b,
5954
6023
  alpha: currentAlpha.value
5955
- }).rgb());
6024
+ });
6025
+ onUpdate(color.rgb());
5956
6026
  };
5957
6027
  const onUpdateHue = (hue) => {
5958
6028
  currentHue.value = hue;
5959
- onUpdate(Color(currentColor.value).hue(hue).rgb());
6029
+ const value = Color(currentColor.value).hue(hue).rgb();
6030
+ onUpdate(value);
5960
6031
  };
5961
6032
  const onUpdateAlpha = (a) => {
5962
6033
  currentAlpha.value = a;
5963
- onUpdate(Color(currentColor.value).alpha(a).rgb());
6034
+ const value = Color(currentColor.value).alpha(a).rgb();
6035
+ onUpdate(value);
5964
6036
  };
5965
6037
  const onUpdateMode = (mode) => {
5966
6038
  currentMode.value = mode;
@@ -6072,7 +6144,7 @@ var ColorPicker = /* @__PURE__ */ defineComponent({
6072
6144
  }
6073
6145
  });
6074
6146
  //#endregion
6075
- //#region node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/customParseFormat.js
6147
+ //#region node_modules/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/customParseFormat.js
6076
6148
  var require_customParseFormat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6077
6149
  (function(e, t) {
6078
6150
  "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
@@ -6235,7 +6307,7 @@ var require_customParseFormat = /* @__PURE__ */ __commonJSMin(((exports, module)
6235
6307
  }));
6236
6308
  }));
6237
6309
  //#endregion
6238
- //#region node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/isBetween.js
6310
+ //#region node_modules/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/isBetween.js
6239
6311
  var require_isBetween = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6240
6312
  (function(e, i) {
6241
6313
  "object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isBetween = i();
@@ -6250,7 +6322,7 @@ var require_isBetween = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6250
6322
  }));
6251
6323
  }));
6252
6324
  //#endregion
6253
- //#region node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/localeData.js
6325
+ //#region node_modules/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/localeData.js
6254
6326
  var require_localeData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6255
6327
  (function(n, e) {
6256
6328
  "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (n = "undefined" != typeof globalThis ? globalThis : n || self).dayjs_plugin_localeData = e();
@@ -6660,11 +6732,15 @@ var DatePicker = /* @__PURE__ */ defineComponent({
6660
6732
  document.addEventListener("click", handleClickOutside);
6661
6733
  nextTick(() => {
6662
6734
  updatePanelState();
6663
- updatePosition();
6735
+ nextTick(() => {
6736
+ updatePosition();
6737
+ });
6664
6738
  });
6665
6739
  } else {
6666
6740
  updatePanelState();
6667
- updatePosition();
6741
+ nextTick(() => {
6742
+ updatePosition();
6743
+ });
6668
6744
  }
6669
6745
  };
6670
6746
  const handleClickOutside = (e) => {
@@ -6906,7 +6982,8 @@ var DatePicker = /* @__PURE__ */ defineComponent({
6906
6982
  "class": "k-picker-time-col",
6907
6983
  "ref": (el) => timeColRefs.value[type] = el
6908
6984
  }, [Array.from({ length: max }).map((_, i) => {
6909
- const isDisabled = checkTimeDisabled(activeDate.set(type, i));
6985
+ const tempDate = activeDate.set(type, i);
6986
+ const isDisabled = checkTimeDisabled(tempDate);
6910
6987
  return createVNode("li", {
6911
6988
  "key": i,
6912
6989
  "class": [
@@ -7127,6 +7204,8 @@ var DatePicker = /* @__PURE__ */ defineComponent({
7127
7204
  };
7128
7205
  }
7129
7206
  });
7207
+ //#endregion
7208
+ //#region components/descriptions/descriptions-item.tsx
7130
7209
  var DescriptionsItem = /* @__PURE__ */ defineComponent({
7131
7210
  name: "DescriptionsItem",
7132
7211
  props: {
@@ -7281,6 +7360,8 @@ var Descriptions = /* @__PURE__ */ defineComponent({
7281
7360
  };
7282
7361
  }
7283
7362
  });
7363
+ //#endregion
7364
+ //#region components/drawer/index.tsx
7284
7365
  var Drawer = /* @__PURE__ */ defineComponent({
7285
7366
  name: "Drawer",
7286
7367
  directives: { transfer },
@@ -7440,6 +7521,8 @@ var Drawer = /* @__PURE__ */ defineComponent({
7440
7521
  };
7441
7522
  }
7442
7523
  });
7524
+ //#endregion
7525
+ //#region components/dropdown/dropdown.tsx
7443
7526
  var Dropdown = /* @__PURE__ */ defineComponent({
7444
7527
  name: "Dropdown",
7445
7528
  directives: {
@@ -7524,12 +7607,16 @@ var Dropdown = /* @__PURE__ */ defineComponent({
7524
7607
  nextTick(() => {
7525
7608
  openChange(true);
7526
7609
  emit("update:show", true);
7527
- updatePosition(e);
7610
+ nextTick(() => {
7611
+ updatePosition(e);
7612
+ });
7528
7613
  });
7529
7614
  } else {
7530
7615
  emit("update:show", true);
7531
- updatePosition(e);
7532
7616
  openChange(true);
7617
+ nextTick(() => {
7618
+ updatePosition(e);
7619
+ });
7533
7620
  }
7534
7621
  else {
7535
7622
  openChange(false);
@@ -7640,6 +7727,8 @@ var trigger_default = /* @__PURE__ */ defineComponent({
7640
7727
  };
7641
7728
  }
7642
7729
  });
7730
+ //#endregion
7731
+ //#region components/dropdown/dropdown-button.tsx
7643
7732
  var DropdownButton = /* @__PURE__ */ defineComponent({
7644
7733
  name: "DropdownButton",
7645
7734
  props: {
@@ -7684,6 +7773,8 @@ var DropdownButton = /* @__PURE__ */ defineComponent({
7684
7773
  };
7685
7774
  }
7686
7775
  });
7776
+ //#endregion
7777
+ //#region components/divider/index.tsx
7687
7778
  var Divider = /* @__PURE__ */ defineComponent({
7688
7779
  name: "Divider",
7689
7780
  props: {
@@ -7838,13 +7929,14 @@ var Form = /* @__PURE__ */ defineComponent({
7838
7929
  provide("Form", form);
7839
7930
  return () => {
7840
7931
  const { layout, size, name } = props;
7932
+ const classes = ["k-form", {
7933
+ [`k-form-${layout}`]: layout,
7934
+ "k-form-lg": size === "large",
7935
+ "k-form-sm": size === "small"
7936
+ }];
7841
7937
  return createVNode("form", {
7842
7938
  "ref": formRef,
7843
- "class": ["k-form", {
7844
- [`k-form-${layout}`]: layout,
7845
- "k-form-lg": size === "large",
7846
- "k-form-sm": size === "small"
7847
- }],
7939
+ "class": classes,
7848
7940
  "id": name,
7849
7941
  "onSubmit": onSubmit,
7850
7942
  "onReset": reset,
@@ -7853,6 +7945,8 @@ var Form = /* @__PURE__ */ defineComponent({
7853
7945
  };
7854
7946
  }
7855
7947
  });
7948
+ //#endregion
7949
+ //#region components/row-col/col.tsx
7856
7950
  var Col = /* @__PURE__ */ defineComponent({
7857
7951
  name: "Col",
7858
7952
  props: {
@@ -7897,6 +7991,8 @@ var Col = /* @__PURE__ */ defineComponent({
7897
7991
  };
7898
7992
  }
7899
7993
  });
7994
+ //#endregion
7995
+ //#region components/row-col/row.tsx
7900
7996
  var Row = /* @__PURE__ */ defineComponent({
7901
7997
  name: "Row",
7902
7998
  props: {
@@ -8097,6 +8193,8 @@ var FormItem = /* @__PURE__ */ defineComponent({
8097
8193
  };
8098
8194
  }
8099
8195
  });
8196
+ //#endregion
8197
+ //#region components/flex/index.tsx
8100
8198
  var Flex = /* @__PURE__ */ defineComponent({
8101
8199
  name: "Flex",
8102
8200
  props: {
@@ -8349,6 +8447,8 @@ var getMousePoint = () => {
8349
8447
  y: 0
8350
8448
  };
8351
8449
  };
8450
+ //#endregion
8451
+ //#region components/tooltip/index.tsx
8352
8452
  var Tooltip = /* @__PURE__ */ defineComponent({
8353
8453
  name: "Tooltip",
8354
8454
  directives: { transfer },
@@ -8416,12 +8516,16 @@ var Tooltip = /* @__PURE__ */ defineComponent({
8416
8516
  rendered.value = true;
8417
8517
  nextTick(() => {
8418
8518
  updateShow(true);
8419
- updatePosition();
8519
+ nextTick(() => {
8520
+ updatePosition();
8521
+ });
8420
8522
  });
8421
8523
  } else {
8422
8524
  clearTimeout(showTimer.value);
8423
8525
  updateShow(true);
8424
- updatePosition();
8526
+ nextTick(() => {
8527
+ updatePosition();
8528
+ });
8425
8529
  }
8426
8530
  };
8427
8531
  const hide = () => {
@@ -8586,6 +8690,8 @@ var getPosition = (e) => {
8586
8690
  }
8587
8691
  return [clientX, clientY];
8588
8692
  };
8693
+ //#endregion
8694
+ //#region components/slider/index.tsx
8589
8695
  var Slider = /* @__PURE__ */ defineComponent({
8590
8696
  name: "Slider",
8591
8697
  props: {
@@ -8637,7 +8743,10 @@ var Slider = /* @__PURE__ */ defineComponent({
8637
8743
  return val;
8638
8744
  };
8639
8745
  const formatValue = (val) => {
8640
- if (props.range) return sortValue((Array.isArray(val) ? [...val] : [props.min, props.min]).map((v) => getClosestStep(v, props)));
8746
+ if (props.range) {
8747
+ const arr = Array.isArray(val) ? [...val] : [props.min, props.min];
8748
+ return sortValue(arr.map((v) => getClosestStep(v, props)));
8749
+ }
8641
8750
  return getClosestStep(val, props);
8642
8751
  };
8643
8752
  const updateSize = () => {
@@ -9116,7 +9225,7 @@ var ImagePreview = /* @__PURE__ */ defineComponent({
9116
9225
  });
9117
9226
  onMounted(() => {
9118
9227
  if (typeof window !== "undefined") {
9119
- const touch = "ontouchstart" in window || navigator.maxTouchPoints > 0 || window.TouchEvent !== void 0;
9228
+ const touch = "ontouchstart" in window || navigator.maxTouchPoints > 0 || window.matchMedia && window.matchMedia("(pointer: coarse)").matches;
9120
9229
  state.touch = touch;
9121
9230
  const event = touch ? "touchstart" : "mousedown";
9122
9231
  document.addEventListener(event, mousedown, { passive: false });
@@ -9362,7 +9471,7 @@ var KImage = /* @__PURE__ */ defineComponent({
9362
9471
  const showPreview = (e) => {
9363
9472
  const { origin, src } = props;
9364
9473
  if (!src && !origin || showPlaceholder.value || loading.value) return;
9365
- show({
9474
+ const options = {
9366
9475
  onClose: () => {
9367
9476
  emit("close");
9368
9477
  setTimeout(() => {
@@ -9375,7 +9484,8 @@ var KImage = /* @__PURE__ */ defineComponent({
9375
9484
  src: origin || src,
9376
9485
  showPanel: props.showPanel,
9377
9486
  type: props.type
9378
- }, slots);
9487
+ };
9488
+ show(options, slots);
9379
9489
  e.preventDefault();
9380
9490
  };
9381
9491
  const reload = () => {
@@ -9517,6 +9627,8 @@ Layout.Header = Header;
9517
9627
  Layout.Footer = Footer;
9518
9628
  Layout.Content = Content;
9519
9629
  Layout.Sider = Sider;
9630
+ //#endregion
9631
+ //#region components/loading/index.tsx
9520
9632
  var LoadingComponent = /* @__PURE__ */ defineComponent({
9521
9633
  name: "LoadingBar",
9522
9634
  props: { height: {
@@ -9629,6 +9741,8 @@ var loading = {
9629
9741
  loadInstance?.destroy?.();
9630
9742
  }
9631
9743
  };
9744
+ //#endregion
9745
+ //#region components/menu/menu-item.tsx
9632
9746
  var MenuItem = /* @__PURE__ */ defineComponent({
9633
9747
  name: "MenuItem",
9634
9748
  props: {
@@ -9681,6 +9795,8 @@ var MenuItem = /* @__PURE__ */ defineComponent({
9681
9795
  };
9682
9796
  }
9683
9797
  });
9798
+ //#endregion
9799
+ //#region components/menu/sub-menu.tsx
9684
9800
  var SubMenu = /* @__PURE__ */ defineComponent({
9685
9801
  name: "SubMenu",
9686
9802
  directives: { transfer },
@@ -9712,7 +9828,8 @@ var SubMenu = /* @__PURE__ */ defineComponent({
9712
9828
  const rendered = ref(false);
9713
9829
  onMounted(() => {
9714
9830
  nextTick(() => {
9715
- minWidth.value = `${refSelection.value?.offsetWidth}px`;
9831
+ const width = refSelection.value?.offsetWidth;
9832
+ minWidth.value = `${width}px`;
9716
9833
  if (openKeys.value.indexOf(key) >= 0) updatePosition();
9717
9834
  });
9718
9835
  });
@@ -9870,6 +9987,8 @@ var RecursiveMenu = /* @__PURE__ */ defineComponent({
9870
9987
  };
9871
9988
  }
9872
9989
  });
9990
+ //#endregion
9991
+ //#region components/menu/menu.tsx
9873
9992
  var Menu = /* @__PURE__ */ defineComponent({
9874
9993
  name: "Menu",
9875
9994
  props: {
@@ -9979,6 +10098,8 @@ var MenuDivider = /* @__PURE__ */ defineComponent({
9979
10098
  };
9980
10099
  }
9981
10100
  });
10101
+ //#endregion
10102
+ //#region components/menu/menu-group.tsx
9982
10103
  var MenuGroup = /* @__PURE__ */ defineComponent({
9983
10104
  name: "MenuGroup",
9984
10105
  props: { title: {
@@ -10395,7 +10516,7 @@ var Modal = /* @__PURE__ */ defineComponent({
10395
10516
  "tabindex": "0"
10396
10517
  }, [contents]);
10397
10518
  }
10398
- const style = {
10519
+ const style = props.maximized ? null : {
10399
10520
  width: typeof width === "number" ? `${width}px` : width,
10400
10521
  top: `${currentTop.value}px`,
10401
10522
  left: `${left.value}px`
@@ -10617,6 +10738,8 @@ var notice = {
10617
10738
  });
10618
10739
  }
10619
10740
  };
10741
+ //#endregion
10742
+ //#region components/page/index.tsx
10620
10743
  var Page = /* @__PURE__ */ defineComponent({
10621
10744
  name: "Page",
10622
10745
  props: {
@@ -10783,7 +10906,7 @@ var Page = /* @__PURE__ */ defineComponent({
10783
10906
  };
10784
10907
  const renderSize = () => {
10785
10908
  let prop = {
10786
- value: defaultPageSize.value,
10909
+ modelValue: defaultPageSize.value,
10787
10910
  size: props.size,
10788
10911
  clearable: false,
10789
10912
  theme: props.theme,
@@ -10856,6 +10979,8 @@ var Page = /* @__PURE__ */ defineComponent({
10856
10979
  };
10857
10980
  }
10858
10981
  });
10982
+ //#endregion
10983
+ //#region components/poptip/index.tsx
10859
10984
  var Poptip = /* @__PURE__ */ defineComponent({
10860
10985
  name: "Poptip",
10861
10986
  directives: { transfer },
@@ -10932,12 +11057,16 @@ var Poptip = /* @__PURE__ */ defineComponent({
10932
11057
  document.addEventListener("click", outsideClick);
10933
11058
  nextTick(() => {
10934
11059
  updateShow(true);
10935
- updatePosition();
11060
+ nextTick(() => {
11061
+ updatePosition();
11062
+ });
10936
11063
  });
10937
11064
  } else {
10938
11065
  clearTimeout(showTimer.value);
10939
11066
  updateShow(true);
10940
- updatePosition();
11067
+ nextTick(() => {
11068
+ updatePosition();
11069
+ });
10941
11070
  }
10942
11071
  };
10943
11072
  const hide = () => {
@@ -11012,6 +11141,8 @@ var Poptip = /* @__PURE__ */ defineComponent({
11012
11141
  };
11013
11142
  }
11014
11143
  });
11144
+ //#endregion
11145
+ //#region components/popconfirm/index.tsx
11015
11146
  var Popconfirm = /* @__PURE__ */ defineComponent({
11016
11147
  name: "Popconfirm",
11017
11148
  directives: { transfer },
@@ -11089,12 +11220,16 @@ var Popconfirm = /* @__PURE__ */ defineComponent({
11089
11220
  document.addEventListener("click", outsideClick);
11090
11221
  nextTick(() => {
11091
11222
  updateShow(true);
11092
- updatePosition();
11223
+ nextTick(() => {
11224
+ updatePosition();
11225
+ });
11093
11226
  });
11094
11227
  } else {
11095
11228
  clearTimeout(showTimer.value);
11096
11229
  updateShow(true);
11097
- updatePosition();
11230
+ nextTick(() => {
11231
+ updatePosition();
11232
+ });
11098
11233
  }
11099
11234
  };
11100
11235
  const ok = () => {
@@ -11172,6 +11307,8 @@ var Popconfirm = /* @__PURE__ */ defineComponent({
11172
11307
  };
11173
11308
  }
11174
11309
  });
11310
+ //#endregion
11311
+ //#region components/progress/index.tsx
11175
11312
  var Progress = /* @__PURE__ */ defineComponent({
11176
11313
  name: "Progress",
11177
11314
  props: {
@@ -11240,7 +11377,7 @@ var Progress = /* @__PURE__ */ defineComponent({
11240
11377
  const d = `M 50,50
11241
11378
  m ${beginX}, ${beginY}
11242
11379
  a ${radius},${radius} 0 1 1 ${endX}, ${-endY}
11243
- a ${radius},${radius} 0 1 1 ${-endX},${endY}`, len = Math.PI * 2 * radius;
11380
+ a ${radius},${radius} 0 1 1 0,${endY}`, len = Math.PI * 2 * radius;
11244
11381
  const style = {
11245
11382
  strokeDasharray: `${percent / 100 * (len - (dashboard ? gap : 0))}px ${len}px`,
11246
11383
  transition: `stroke-dasharray .3s ease 0s,opacity 0.3s ease 0s`,
@@ -11309,112 +11446,2759 @@ var Progress = /* @__PURE__ */ defineComponent({
11309
11446
  };
11310
11447
  }
11311
11448
  });
11312
- var Radio = /* @__PURE__ */ defineComponent({
11313
- name: "Radio",
11314
- props: {
11315
- modelValue: {
11316
- type: [
11317
- Boolean,
11318
- String,
11319
- Number
11320
- ],
11321
- default: false
11449
+ //#endregion
11450
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js
11451
+ var require_can_promise = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11452
+ module.exports = function() {
11453
+ return typeof Promise === "function" && Promise.prototype && Promise.prototype.then;
11454
+ };
11455
+ }));
11456
+ //#endregion
11457
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js
11458
+ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
11459
+ var toSJISFunction;
11460
+ var CODEWORDS_COUNT = [
11461
+ 0,
11462
+ 26,
11463
+ 44,
11464
+ 70,
11465
+ 100,
11466
+ 134,
11467
+ 172,
11468
+ 196,
11469
+ 242,
11470
+ 292,
11471
+ 346,
11472
+ 404,
11473
+ 466,
11474
+ 532,
11475
+ 581,
11476
+ 655,
11477
+ 733,
11478
+ 815,
11479
+ 901,
11480
+ 991,
11481
+ 1085,
11482
+ 1156,
11483
+ 1258,
11484
+ 1364,
11485
+ 1474,
11486
+ 1588,
11487
+ 1706,
11488
+ 1828,
11489
+ 1921,
11490
+ 2051,
11491
+ 2185,
11492
+ 2323,
11493
+ 2465,
11494
+ 2611,
11495
+ 2761,
11496
+ 2876,
11497
+ 3034,
11498
+ 3196,
11499
+ 3362,
11500
+ 3532,
11501
+ 3706
11502
+ ];
11503
+ /**
11504
+ * Returns the QR Code size for the specified version
11505
+ *
11506
+ * @param {Number} version QR Code version
11507
+ * @return {Number} size of QR code
11508
+ */
11509
+ exports.getSymbolSize = function getSymbolSize(version) {
11510
+ if (!version) throw new Error("\"version\" cannot be null or undefined");
11511
+ if (version < 1 || version > 40) throw new Error("\"version\" should be in range from 1 to 40");
11512
+ return version * 4 + 17;
11513
+ };
11514
+ /**
11515
+ * Returns the total number of codewords used to store data and EC information.
11516
+ *
11517
+ * @param {Number} version QR Code version
11518
+ * @return {Number} Data length in bits
11519
+ */
11520
+ exports.getSymbolTotalCodewords = function getSymbolTotalCodewords(version) {
11521
+ return CODEWORDS_COUNT[version];
11522
+ };
11523
+ /**
11524
+ * Encode data with Bose-Chaudhuri-Hocquenghem
11525
+ *
11526
+ * @param {Number} data Value to encode
11527
+ * @return {Number} Encoded value
11528
+ */
11529
+ exports.getBCHDigit = function(data) {
11530
+ let digit = 0;
11531
+ while (data !== 0) {
11532
+ digit++;
11533
+ data >>>= 1;
11534
+ }
11535
+ return digit;
11536
+ };
11537
+ exports.setToSJISFunction = function setToSJISFunction(f) {
11538
+ if (typeof f !== "function") throw new Error("\"toSJISFunc\" is not a valid function.");
11539
+ toSJISFunction = f;
11540
+ };
11541
+ exports.isKanjiModeEnabled = function() {
11542
+ return typeof toSJISFunction !== "undefined";
11543
+ };
11544
+ exports.toSJIS = function toSJIS(kanji) {
11545
+ return toSJISFunction(kanji);
11546
+ };
11547
+ }));
11548
+ //#endregion
11549
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js
11550
+ var require_error_correction_level = /* @__PURE__ */ __commonJSMin(((exports) => {
11551
+ exports.L = { bit: 1 };
11552
+ exports.M = { bit: 0 };
11553
+ exports.Q = { bit: 3 };
11554
+ exports.H = { bit: 2 };
11555
+ function fromString(string) {
11556
+ if (typeof string !== "string") throw new Error("Param is not a string");
11557
+ switch (string.toLowerCase()) {
11558
+ case "l":
11559
+ case "low": return exports.L;
11560
+ case "m":
11561
+ case "medium": return exports.M;
11562
+ case "q":
11563
+ case "quartile": return exports.Q;
11564
+ case "h":
11565
+ case "high": return exports.H;
11566
+ default: throw new Error("Unknown EC Level: " + string);
11567
+ }
11568
+ }
11569
+ exports.isValid = function isValid(level) {
11570
+ return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4;
11571
+ };
11572
+ exports.from = function from(value, defaultValue) {
11573
+ if (exports.isValid(value)) return value;
11574
+ try {
11575
+ return fromString(value);
11576
+ } catch (e) {
11577
+ return defaultValue;
11578
+ }
11579
+ };
11580
+ }));
11581
+ //#endregion
11582
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js
11583
+ var require_bit_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11584
+ function BitBuffer() {
11585
+ this.buffer = [];
11586
+ this.length = 0;
11587
+ }
11588
+ BitBuffer.prototype = {
11589
+ get: function(index) {
11590
+ const bufIndex = Math.floor(index / 8);
11591
+ return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1;
11322
11592
  },
11323
- value: { type: [
11324
- String,
11325
- Number,
11326
- Boolean
11327
- ] },
11328
- label: { type: String },
11329
- checked: Boolean,
11330
- disabled: Boolean,
11331
- theme: {
11332
- type: String,
11333
- default: "fill"
11593
+ put: function(num, length) {
11594
+ for (let i = 0; i < length; i++) this.putBit((num >>> length - i - 1 & 1) === 1);
11334
11595
  },
11335
- size: { type: String },
11336
- onChange: Function
11337
- },
11338
- setup(props, { slots, emit }) {
11339
- const isChecked = ref(props.modelValue || props.checked);
11340
- watch(() => props.modelValue, (v) => {
11341
- isChecked.value = v;
11342
- });
11343
- watch(() => props.checked, (v) => {
11344
- isChecked.value = v;
11345
- });
11346
- const emitValue = (checked) => {
11347
- isChecked.value = checked;
11348
- emit("change", {
11349
- checked,
11350
- value: props.value,
11351
- label: props.label || slots.default?.()
11352
- });
11353
- emit("update:modelValue", checked);
11354
- emit("update:checked", checked);
11355
- };
11356
- const onChange = (e) => {
11357
- if (props.disabled || isChecked.value) return;
11358
- e.stopPropagation();
11359
- e.preventDefault();
11360
- const checked = e.target.checked;
11361
- emitValue(checked);
11362
- };
11363
- const triggerCheck = (e) => {
11364
- if (e.code == "Space") {
11365
- e.preventDefault();
11366
- e.stopPropagation();
11367
- if (props.disabled || isChecked.value) return;
11368
- emitValue(!isChecked.value);
11369
- }
11370
- };
11371
- return () => {
11372
- const classes = ["k-radio", {
11373
- ["k-radio-fill"]: props.theme == "fill",
11374
- ["k-radio-disabled"]: props.disabled,
11375
- ["k-radio-checked"]: isChecked.value,
11376
- ["k-radio-lg"]: props.size === "large",
11377
- ["k-radio-sm"]: props.size === "small"
11378
- }];
11379
- const labelNode = props.label || slots.default?.();
11380
- return createVNode("label", {
11381
- "class": classes,
11382
- "tabindex": props.disabled ? void 0 : 0,
11383
- "onKeydown": triggerCheck
11384
- }, [createVNode("span", { "class": "k-radio-symbol" }, [createVNode("input", {
11385
- "type": "radio",
11386
- "tabindex": "-1",
11387
- "class": "k-radio-input",
11388
- "disabled": props.disabled,
11389
- "onChange": onChange,
11390
- "checked": isChecked.value
11391
- }, null)]), labelNode ? createVNode("span", { "class": "k-radio-label" }, [labelNode]) : null]);
11392
- };
11596
+ getLengthInBits: function() {
11597
+ return this.length;
11598
+ },
11599
+ putBit: function(bit) {
11600
+ const bufIndex = Math.floor(this.length / 8);
11601
+ if (this.buffer.length <= bufIndex) this.buffer.push(0);
11602
+ if (bit) this.buffer[bufIndex] |= 128 >>> this.length % 8;
11603
+ this.length++;
11604
+ }
11605
+ };
11606
+ module.exports = BitBuffer;
11607
+ }));
11608
+ //#endregion
11609
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js
11610
+ var require_bit_matrix = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11611
+ /**
11612
+ * Helper class to handle QR Code symbol modules
11613
+ *
11614
+ * @param {Number} size Symbol size
11615
+ */
11616
+ function BitMatrix(size) {
11617
+ if (!size || size < 1) throw new Error("BitMatrix size must be defined and greater than 0");
11618
+ this.size = size;
11619
+ this.data = new Uint8Array(size * size);
11620
+ this.reservedBit = new Uint8Array(size * size);
11393
11621
  }
11394
- });
11622
+ /**
11623
+ * Set bit value at specified location
11624
+ * If reserved flag is set, this bit will be ignored during masking process
11625
+ *
11626
+ * @param {Number} row
11627
+ * @param {Number} col
11628
+ * @param {Boolean} value
11629
+ * @param {Boolean} reserved
11630
+ */
11631
+ BitMatrix.prototype.set = function(row, col, value, reserved) {
11632
+ const index = row * this.size + col;
11633
+ this.data[index] = value;
11634
+ if (reserved) this.reservedBit[index] = true;
11635
+ };
11636
+ /**
11637
+ * Returns bit value at specified location
11638
+ *
11639
+ * @param {Number} row
11640
+ * @param {Number} col
11641
+ * @return {Boolean}
11642
+ */
11643
+ BitMatrix.prototype.get = function(row, col) {
11644
+ return this.data[row * this.size + col];
11645
+ };
11646
+ /**
11647
+ * Applies xor operator at specified location
11648
+ * (used during masking process)
11649
+ *
11650
+ * @param {Number} row
11651
+ * @param {Number} col
11652
+ * @param {Boolean} value
11653
+ */
11654
+ BitMatrix.prototype.xor = function(row, col, value) {
11655
+ this.data[row * this.size + col] ^= value;
11656
+ };
11657
+ /**
11658
+ * Check if bit at specified location is reserved
11659
+ *
11660
+ * @param {Number} row
11661
+ * @param {Number} col
11662
+ * @return {Boolean}
11663
+ */
11664
+ BitMatrix.prototype.isReserved = function(row, col) {
11665
+ return this.reservedBit[row * this.size + col];
11666
+ };
11667
+ module.exports = BitMatrix;
11668
+ }));
11395
11669
  //#endregion
11396
- //#region components/radio/radio-button.tsx
11397
- function _isSlot$2(s) {
11398
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
11399
- }
11400
- var RadioButton = /* @__PURE__ */ defineComponent({
11401
- name: "RadioButton",
11402
- props: {
11403
- modelValue: {
11404
- type: [Boolean],
11405
- default: false
11406
- },
11407
- label: { type: String },
11408
- value: { type: [String, Number] },
11409
- theme: String,
11410
- disabled: Boolean,
11411
- checked: Boolean,
11412
- icon: Array,
11413
- size: { type: String },
11414
- shape: { type: String },
11415
- onChange: Function
11416
- },
11417
- setup(props, { slots, emit, attrs }) {
11670
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js
11671
+ var require_alignment_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
11672
+ /**
11673
+ * Alignment pattern are fixed reference pattern in defined positions
11674
+ * in a matrix symbology, which enables the decode software to re-synchronise
11675
+ * the coordinate mapping of the image modules in the event of moderate amounts
11676
+ * of distortion of the image.
11677
+ *
11678
+ * Alignment patterns are present only in QR Code symbols of version 2 or larger
11679
+ * and their number depends on the symbol version.
11680
+ */
11681
+ var getSymbolSize = require_utils$1().getSymbolSize;
11682
+ /**
11683
+ * Calculate the row/column coordinates of the center module of each alignment pattern
11684
+ * for the specified QR Code version.
11685
+ *
11686
+ * The alignment patterns are positioned symmetrically on either side of the diagonal
11687
+ * running from the top left corner of the symbol to the bottom right corner.
11688
+ *
11689
+ * Since positions are simmetrical only half of the coordinates are returned.
11690
+ * Each item of the array will represent in turn the x and y coordinate.
11691
+ * @see {@link getPositions}
11692
+ *
11693
+ * @param {Number} version QR Code version
11694
+ * @return {Array} Array of coordinate
11695
+ */
11696
+ exports.getRowColCoords = function getRowColCoords(version) {
11697
+ if (version === 1) return [];
11698
+ const posCount = Math.floor(version / 7) + 2;
11699
+ const size = getSymbolSize(version);
11700
+ const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2;
11701
+ const positions = [size - 7];
11702
+ for (let i = 1; i < posCount - 1; i++) positions[i] = positions[i - 1] - intervals;
11703
+ positions.push(6);
11704
+ return positions.reverse();
11705
+ };
11706
+ /**
11707
+ * Returns an array containing the positions of each alignment pattern.
11708
+ * Each array's element represent the center point of the pattern as (x, y) coordinates
11709
+ *
11710
+ * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}
11711
+ * and filtering out the items that overlaps with finder pattern
11712
+ *
11713
+ * @example
11714
+ * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.
11715
+ * The alignment patterns, therefore, are to be centered on (row, column)
11716
+ * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).
11717
+ * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns
11718
+ * and are not therefore used for alignment patterns.
11719
+ *
11720
+ * let pos = getPositions(7)
11721
+ * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]
11722
+ *
11723
+ * @param {Number} version QR Code version
11724
+ * @return {Array} Array of coordinates
11725
+ */
11726
+ exports.getPositions = function getPositions(version) {
11727
+ const coords = [];
11728
+ const pos = exports.getRowColCoords(version);
11729
+ const posLength = pos.length;
11730
+ for (let i = 0; i < posLength; i++) for (let j = 0; j < posLength; j++) {
11731
+ if (i === 0 && j === 0 || i === 0 && j === posLength - 1 || i === posLength - 1 && j === 0) continue;
11732
+ coords.push([pos[i], pos[j]]);
11733
+ }
11734
+ return coords;
11735
+ };
11736
+ }));
11737
+ //#endregion
11738
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js
11739
+ var require_finder_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
11740
+ var getSymbolSize = require_utils$1().getSymbolSize;
11741
+ var FINDER_PATTERN_SIZE = 7;
11742
+ /**
11743
+ * Returns an array containing the positions of each finder pattern.
11744
+ * Each array's element represent the top-left point of the pattern as (x, y) coordinates
11745
+ *
11746
+ * @param {Number} version QR Code version
11747
+ * @return {Array} Array of coordinates
11748
+ */
11749
+ exports.getPositions = function getPositions(version) {
11750
+ const size = getSymbolSize(version);
11751
+ return [
11752
+ [0, 0],
11753
+ [size - FINDER_PATTERN_SIZE, 0],
11754
+ [0, size - FINDER_PATTERN_SIZE]
11755
+ ];
11756
+ };
11757
+ }));
11758
+ //#endregion
11759
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js
11760
+ var require_mask_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
11761
+ /**
11762
+ * Data mask pattern reference
11763
+ * @type {Object}
11764
+ */
11765
+ exports.Patterns = {
11766
+ PATTERN000: 0,
11767
+ PATTERN001: 1,
11768
+ PATTERN010: 2,
11769
+ PATTERN011: 3,
11770
+ PATTERN100: 4,
11771
+ PATTERN101: 5,
11772
+ PATTERN110: 6,
11773
+ PATTERN111: 7
11774
+ };
11775
+ /**
11776
+ * Weighted penalty scores for the undesirable features
11777
+ * @type {Object}
11778
+ */
11779
+ var PenaltyScores = {
11780
+ N1: 3,
11781
+ N2: 3,
11782
+ N3: 40,
11783
+ N4: 10
11784
+ };
11785
+ /**
11786
+ * Check if mask pattern value is valid
11787
+ *
11788
+ * @param {Number} mask Mask pattern
11789
+ * @return {Boolean} true if valid, false otherwise
11790
+ */
11791
+ exports.isValid = function isValid(mask) {
11792
+ return mask != null && mask !== "" && !isNaN(mask) && mask >= 0 && mask <= 7;
11793
+ };
11794
+ /**
11795
+ * Returns mask pattern from a value.
11796
+ * If value is not valid, returns undefined
11797
+ *
11798
+ * @param {Number|String} value Mask pattern value
11799
+ * @return {Number} Valid mask pattern or undefined
11800
+ */
11801
+ exports.from = function from(value) {
11802
+ return exports.isValid(value) ? parseInt(value, 10) : void 0;
11803
+ };
11804
+ /**
11805
+ * Find adjacent modules in row/column with the same color
11806
+ * and assign a penalty value.
11807
+ *
11808
+ * Points: N1 + i
11809
+ * i is the amount by which the number of adjacent modules of the same color exceeds 5
11810
+ */
11811
+ exports.getPenaltyN1 = function getPenaltyN1(data) {
11812
+ const size = data.size;
11813
+ let points = 0;
11814
+ let sameCountCol = 0;
11815
+ let sameCountRow = 0;
11816
+ let lastCol = null;
11817
+ let lastRow = null;
11818
+ for (let row = 0; row < size; row++) {
11819
+ sameCountCol = sameCountRow = 0;
11820
+ lastCol = lastRow = null;
11821
+ for (let col = 0; col < size; col++) {
11822
+ let module$1 = data.get(row, col);
11823
+ if (module$1 === lastCol) sameCountCol++;
11824
+ else {
11825
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
11826
+ lastCol = module$1;
11827
+ sameCountCol = 1;
11828
+ }
11829
+ module$1 = data.get(col, row);
11830
+ if (module$1 === lastRow) sameCountRow++;
11831
+ else {
11832
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
11833
+ lastRow = module$1;
11834
+ sameCountRow = 1;
11835
+ }
11836
+ }
11837
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
11838
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
11839
+ }
11840
+ return points;
11841
+ };
11842
+ /**
11843
+ * Find 2x2 blocks with the same color and assign a penalty value
11844
+ *
11845
+ * Points: N2 * (m - 1) * (n - 1)
11846
+ */
11847
+ exports.getPenaltyN2 = function getPenaltyN2(data) {
11848
+ const size = data.size;
11849
+ let points = 0;
11850
+ for (let row = 0; row < size - 1; row++) for (let col = 0; col < size - 1; col++) {
11851
+ const last = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1);
11852
+ if (last === 4 || last === 0) points++;
11853
+ }
11854
+ return points * PenaltyScores.N2;
11855
+ };
11856
+ /**
11857
+ * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,
11858
+ * preceded or followed by light area 4 modules wide
11859
+ *
11860
+ * Points: N3 * number of pattern found
11861
+ */
11862
+ exports.getPenaltyN3 = function getPenaltyN3(data) {
11863
+ const size = data.size;
11864
+ let points = 0;
11865
+ let bitsCol = 0;
11866
+ let bitsRow = 0;
11867
+ for (let row = 0; row < size; row++) {
11868
+ bitsCol = bitsRow = 0;
11869
+ for (let col = 0; col < size; col++) {
11870
+ bitsCol = bitsCol << 1 & 2047 | data.get(row, col);
11871
+ if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++;
11872
+ bitsRow = bitsRow << 1 & 2047 | data.get(col, row);
11873
+ if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) points++;
11874
+ }
11875
+ }
11876
+ return points * PenaltyScores.N3;
11877
+ };
11878
+ /**
11879
+ * Calculate proportion of dark modules in entire symbol
11880
+ *
11881
+ * Points: N4 * k
11882
+ *
11883
+ * k is the rating of the deviation of the proportion of dark modules
11884
+ * in the symbol from 50% in steps of 5%
11885
+ */
11886
+ exports.getPenaltyN4 = function getPenaltyN4(data) {
11887
+ let darkCount = 0;
11888
+ const modulesCount = data.data.length;
11889
+ for (let i = 0; i < modulesCount; i++) darkCount += data.data[i];
11890
+ return Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10) * PenaltyScores.N4;
11891
+ };
11892
+ /**
11893
+ * Return mask value at given position
11894
+ *
11895
+ * @param {Number} maskPattern Pattern reference value
11896
+ * @param {Number} i Row
11897
+ * @param {Number} j Column
11898
+ * @return {Boolean} Mask value
11899
+ */
11900
+ function getMaskAt(maskPattern, i, j) {
11901
+ switch (maskPattern) {
11902
+ case exports.Patterns.PATTERN000: return (i + j) % 2 === 0;
11903
+ case exports.Patterns.PATTERN001: return i % 2 === 0;
11904
+ case exports.Patterns.PATTERN010: return j % 3 === 0;
11905
+ case exports.Patterns.PATTERN011: return (i + j) % 3 === 0;
11906
+ case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0;
11907
+ case exports.Patterns.PATTERN101: return i * j % 2 + i * j % 3 === 0;
11908
+ case exports.Patterns.PATTERN110: return (i * j % 2 + i * j % 3) % 2 === 0;
11909
+ case exports.Patterns.PATTERN111: return (i * j % 3 + (i + j) % 2) % 2 === 0;
11910
+ default: throw new Error("bad maskPattern:" + maskPattern);
11911
+ }
11912
+ }
11913
+ /**
11914
+ * Apply a mask pattern to a BitMatrix
11915
+ *
11916
+ * @param {Number} pattern Pattern reference number
11917
+ * @param {BitMatrix} data BitMatrix data
11918
+ */
11919
+ exports.applyMask = function applyMask(pattern, data) {
11920
+ const size = data.size;
11921
+ for (let col = 0; col < size; col++) for (let row = 0; row < size; row++) {
11922
+ if (data.isReserved(row, col)) continue;
11923
+ data.xor(row, col, getMaskAt(pattern, row, col));
11924
+ }
11925
+ };
11926
+ /**
11927
+ * Returns the best mask pattern for data
11928
+ *
11929
+ * @param {BitMatrix} data
11930
+ * @return {Number} Mask pattern reference number
11931
+ */
11932
+ exports.getBestMask = function getBestMask(data, setupFormatFunc) {
11933
+ const numPatterns = Object.keys(exports.Patterns).length;
11934
+ let bestPattern = 0;
11935
+ let lowerPenalty = Infinity;
11936
+ for (let p = 0; p < numPatterns; p++) {
11937
+ setupFormatFunc(p);
11938
+ exports.applyMask(p, data);
11939
+ const penalty = exports.getPenaltyN1(data) + exports.getPenaltyN2(data) + exports.getPenaltyN3(data) + exports.getPenaltyN4(data);
11940
+ exports.applyMask(p, data);
11941
+ if (penalty < lowerPenalty) {
11942
+ lowerPenalty = penalty;
11943
+ bestPattern = p;
11944
+ }
11945
+ }
11946
+ return bestPattern;
11947
+ };
11948
+ }));
11949
+ //#endregion
11950
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js
11951
+ var require_error_correction_code = /* @__PURE__ */ __commonJSMin(((exports) => {
11952
+ var ECLevel = require_error_correction_level();
11953
+ var EC_BLOCKS_TABLE = [
11954
+ 1,
11955
+ 1,
11956
+ 1,
11957
+ 1,
11958
+ 1,
11959
+ 1,
11960
+ 1,
11961
+ 1,
11962
+ 1,
11963
+ 1,
11964
+ 2,
11965
+ 2,
11966
+ 1,
11967
+ 2,
11968
+ 2,
11969
+ 4,
11970
+ 1,
11971
+ 2,
11972
+ 4,
11973
+ 4,
11974
+ 2,
11975
+ 4,
11976
+ 4,
11977
+ 4,
11978
+ 2,
11979
+ 4,
11980
+ 6,
11981
+ 5,
11982
+ 2,
11983
+ 4,
11984
+ 6,
11985
+ 6,
11986
+ 2,
11987
+ 5,
11988
+ 8,
11989
+ 8,
11990
+ 4,
11991
+ 5,
11992
+ 8,
11993
+ 8,
11994
+ 4,
11995
+ 5,
11996
+ 8,
11997
+ 11,
11998
+ 4,
11999
+ 8,
12000
+ 10,
12001
+ 11,
12002
+ 4,
12003
+ 9,
12004
+ 12,
12005
+ 16,
12006
+ 4,
12007
+ 9,
12008
+ 16,
12009
+ 16,
12010
+ 6,
12011
+ 10,
12012
+ 12,
12013
+ 18,
12014
+ 6,
12015
+ 10,
12016
+ 17,
12017
+ 16,
12018
+ 6,
12019
+ 11,
12020
+ 16,
12021
+ 19,
12022
+ 6,
12023
+ 13,
12024
+ 18,
12025
+ 21,
12026
+ 7,
12027
+ 14,
12028
+ 21,
12029
+ 25,
12030
+ 8,
12031
+ 16,
12032
+ 20,
12033
+ 25,
12034
+ 8,
12035
+ 17,
12036
+ 23,
12037
+ 25,
12038
+ 9,
12039
+ 17,
12040
+ 23,
12041
+ 34,
12042
+ 9,
12043
+ 18,
12044
+ 25,
12045
+ 30,
12046
+ 10,
12047
+ 20,
12048
+ 27,
12049
+ 32,
12050
+ 12,
12051
+ 21,
12052
+ 29,
12053
+ 35,
12054
+ 12,
12055
+ 23,
12056
+ 34,
12057
+ 37,
12058
+ 12,
12059
+ 25,
12060
+ 34,
12061
+ 40,
12062
+ 13,
12063
+ 26,
12064
+ 35,
12065
+ 42,
12066
+ 14,
12067
+ 28,
12068
+ 38,
12069
+ 45,
12070
+ 15,
12071
+ 29,
12072
+ 40,
12073
+ 48,
12074
+ 16,
12075
+ 31,
12076
+ 43,
12077
+ 51,
12078
+ 17,
12079
+ 33,
12080
+ 45,
12081
+ 54,
12082
+ 18,
12083
+ 35,
12084
+ 48,
12085
+ 57,
12086
+ 19,
12087
+ 37,
12088
+ 51,
12089
+ 60,
12090
+ 19,
12091
+ 38,
12092
+ 53,
12093
+ 63,
12094
+ 20,
12095
+ 40,
12096
+ 56,
12097
+ 66,
12098
+ 21,
12099
+ 43,
12100
+ 59,
12101
+ 70,
12102
+ 22,
12103
+ 45,
12104
+ 62,
12105
+ 74,
12106
+ 24,
12107
+ 47,
12108
+ 65,
12109
+ 77,
12110
+ 25,
12111
+ 49,
12112
+ 68,
12113
+ 81
12114
+ ];
12115
+ var EC_CODEWORDS_TABLE = [
12116
+ 7,
12117
+ 10,
12118
+ 13,
12119
+ 17,
12120
+ 10,
12121
+ 16,
12122
+ 22,
12123
+ 28,
12124
+ 15,
12125
+ 26,
12126
+ 36,
12127
+ 44,
12128
+ 20,
12129
+ 36,
12130
+ 52,
12131
+ 64,
12132
+ 26,
12133
+ 48,
12134
+ 72,
12135
+ 88,
12136
+ 36,
12137
+ 64,
12138
+ 96,
12139
+ 112,
12140
+ 40,
12141
+ 72,
12142
+ 108,
12143
+ 130,
12144
+ 48,
12145
+ 88,
12146
+ 132,
12147
+ 156,
12148
+ 60,
12149
+ 110,
12150
+ 160,
12151
+ 192,
12152
+ 72,
12153
+ 130,
12154
+ 192,
12155
+ 224,
12156
+ 80,
12157
+ 150,
12158
+ 224,
12159
+ 264,
12160
+ 96,
12161
+ 176,
12162
+ 260,
12163
+ 308,
12164
+ 104,
12165
+ 198,
12166
+ 288,
12167
+ 352,
12168
+ 120,
12169
+ 216,
12170
+ 320,
12171
+ 384,
12172
+ 132,
12173
+ 240,
12174
+ 360,
12175
+ 432,
12176
+ 144,
12177
+ 280,
12178
+ 408,
12179
+ 480,
12180
+ 168,
12181
+ 308,
12182
+ 448,
12183
+ 532,
12184
+ 180,
12185
+ 338,
12186
+ 504,
12187
+ 588,
12188
+ 196,
12189
+ 364,
12190
+ 546,
12191
+ 650,
12192
+ 224,
12193
+ 416,
12194
+ 600,
12195
+ 700,
12196
+ 224,
12197
+ 442,
12198
+ 644,
12199
+ 750,
12200
+ 252,
12201
+ 476,
12202
+ 690,
12203
+ 816,
12204
+ 270,
12205
+ 504,
12206
+ 750,
12207
+ 900,
12208
+ 300,
12209
+ 560,
12210
+ 810,
12211
+ 960,
12212
+ 312,
12213
+ 588,
12214
+ 870,
12215
+ 1050,
12216
+ 336,
12217
+ 644,
12218
+ 952,
12219
+ 1110,
12220
+ 360,
12221
+ 700,
12222
+ 1020,
12223
+ 1200,
12224
+ 390,
12225
+ 728,
12226
+ 1050,
12227
+ 1260,
12228
+ 420,
12229
+ 784,
12230
+ 1140,
12231
+ 1350,
12232
+ 450,
12233
+ 812,
12234
+ 1200,
12235
+ 1440,
12236
+ 480,
12237
+ 868,
12238
+ 1290,
12239
+ 1530,
12240
+ 510,
12241
+ 924,
12242
+ 1350,
12243
+ 1620,
12244
+ 540,
12245
+ 980,
12246
+ 1440,
12247
+ 1710,
12248
+ 570,
12249
+ 1036,
12250
+ 1530,
12251
+ 1800,
12252
+ 570,
12253
+ 1064,
12254
+ 1590,
12255
+ 1890,
12256
+ 600,
12257
+ 1120,
12258
+ 1680,
12259
+ 1980,
12260
+ 630,
12261
+ 1204,
12262
+ 1770,
12263
+ 2100,
12264
+ 660,
12265
+ 1260,
12266
+ 1860,
12267
+ 2220,
12268
+ 720,
12269
+ 1316,
12270
+ 1950,
12271
+ 2310,
12272
+ 750,
12273
+ 1372,
12274
+ 2040,
12275
+ 2430
12276
+ ];
12277
+ /**
12278
+ * Returns the number of error correction block that the QR Code should contain
12279
+ * for the specified version and error correction level.
12280
+ *
12281
+ * @param {Number} version QR Code version
12282
+ * @param {Number} errorCorrectionLevel Error correction level
12283
+ * @return {Number} Number of error correction blocks
12284
+ */
12285
+ exports.getBlocksCount = function getBlocksCount(version, errorCorrectionLevel) {
12286
+ switch (errorCorrectionLevel) {
12287
+ case ECLevel.L: return EC_BLOCKS_TABLE[(version - 1) * 4 + 0];
12288
+ case ECLevel.M: return EC_BLOCKS_TABLE[(version - 1) * 4 + 1];
12289
+ case ECLevel.Q: return EC_BLOCKS_TABLE[(version - 1) * 4 + 2];
12290
+ case ECLevel.H: return EC_BLOCKS_TABLE[(version - 1) * 4 + 3];
12291
+ default: return;
12292
+ }
12293
+ };
12294
+ /**
12295
+ * Returns the number of error correction codewords to use for the specified
12296
+ * version and error correction level.
12297
+ *
12298
+ * @param {Number} version QR Code version
12299
+ * @param {Number} errorCorrectionLevel Error correction level
12300
+ * @return {Number} Number of error correction codewords
12301
+ */
12302
+ exports.getTotalCodewordsCount = function getTotalCodewordsCount(version, errorCorrectionLevel) {
12303
+ switch (errorCorrectionLevel) {
12304
+ case ECLevel.L: return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0];
12305
+ case ECLevel.M: return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1];
12306
+ case ECLevel.Q: return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2];
12307
+ case ECLevel.H: return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3];
12308
+ default: return;
12309
+ }
12310
+ };
12311
+ }));
12312
+ //#endregion
12313
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js
12314
+ var require_galois_field = /* @__PURE__ */ __commonJSMin(((exports) => {
12315
+ var EXP_TABLE = /* @__PURE__ */ new Uint8Array(512);
12316
+ var LOG_TABLE = /* @__PURE__ */ new Uint8Array(256);
12317
+ (function initTables() {
12318
+ let x = 1;
12319
+ for (let i = 0; i < 255; i++) {
12320
+ EXP_TABLE[i] = x;
12321
+ LOG_TABLE[x] = i;
12322
+ x <<= 1;
12323
+ if (x & 256) x ^= 285;
12324
+ }
12325
+ for (let i = 255; i < 512; i++) EXP_TABLE[i] = EXP_TABLE[i - 255];
12326
+ })();
12327
+ /**
12328
+ * Returns log value of n inside Galois Field
12329
+ *
12330
+ * @param {Number} n
12331
+ * @return {Number}
12332
+ */
12333
+ exports.log = function log(n) {
12334
+ if (n < 1) throw new Error("log(" + n + ")");
12335
+ return LOG_TABLE[n];
12336
+ };
12337
+ /**
12338
+ * Returns anti-log value of n inside Galois Field
12339
+ *
12340
+ * @param {Number} n
12341
+ * @return {Number}
12342
+ */
12343
+ exports.exp = function exp(n) {
12344
+ return EXP_TABLE[n];
12345
+ };
12346
+ /**
12347
+ * Multiplies two number inside Galois Field
12348
+ *
12349
+ * @param {Number} x
12350
+ * @param {Number} y
12351
+ * @return {Number}
12352
+ */
12353
+ exports.mul = function mul(x, y) {
12354
+ if (x === 0 || y === 0) return 0;
12355
+ return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]];
12356
+ };
12357
+ }));
12358
+ //#endregion
12359
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js
12360
+ var require_polynomial = /* @__PURE__ */ __commonJSMin(((exports) => {
12361
+ var GF = require_galois_field();
12362
+ /**
12363
+ * Multiplies two polynomials inside Galois Field
12364
+ *
12365
+ * @param {Uint8Array} p1 Polynomial
12366
+ * @param {Uint8Array} p2 Polynomial
12367
+ * @return {Uint8Array} Product of p1 and p2
12368
+ */
12369
+ exports.mul = function mul(p1, p2) {
12370
+ const coeff = new Uint8Array(p1.length + p2.length - 1);
12371
+ for (let i = 0; i < p1.length; i++) for (let j = 0; j < p2.length; j++) coeff[i + j] ^= GF.mul(p1[i], p2[j]);
12372
+ return coeff;
12373
+ };
12374
+ /**
12375
+ * Calculate the remainder of polynomials division
12376
+ *
12377
+ * @param {Uint8Array} divident Polynomial
12378
+ * @param {Uint8Array} divisor Polynomial
12379
+ * @return {Uint8Array} Remainder
12380
+ */
12381
+ exports.mod = function mod(divident, divisor) {
12382
+ let result = new Uint8Array(divident);
12383
+ while (result.length - divisor.length >= 0) {
12384
+ const coeff = result[0];
12385
+ for (let i = 0; i < divisor.length; i++) result[i] ^= GF.mul(divisor[i], coeff);
12386
+ let offset = 0;
12387
+ while (offset < result.length && result[offset] === 0) offset++;
12388
+ result = result.slice(offset);
12389
+ }
12390
+ return result;
12391
+ };
12392
+ /**
12393
+ * Generate an irreducible generator polynomial of specified degree
12394
+ * (used by Reed-Solomon encoder)
12395
+ *
12396
+ * @param {Number} degree Degree of the generator polynomial
12397
+ * @return {Uint8Array} Buffer containing polynomial coefficients
12398
+ */
12399
+ exports.generateECPolynomial = function generateECPolynomial(degree) {
12400
+ let poly = new Uint8Array([1]);
12401
+ for (let i = 0; i < degree; i++) poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]));
12402
+ return poly;
12403
+ };
12404
+ }));
12405
+ //#endregion
12406
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js
12407
+ var require_reed_solomon_encoder = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12408
+ var Polynomial = require_polynomial();
12409
+ function ReedSolomonEncoder(degree) {
12410
+ this.genPoly = void 0;
12411
+ this.degree = degree;
12412
+ if (this.degree) this.initialize(this.degree);
12413
+ }
12414
+ /**
12415
+ * Initialize the encoder.
12416
+ * The input param should correspond to the number of error correction codewords.
12417
+ *
12418
+ * @param {Number} degree
12419
+ */
12420
+ ReedSolomonEncoder.prototype.initialize = function initialize(degree) {
12421
+ this.degree = degree;
12422
+ this.genPoly = Polynomial.generateECPolynomial(this.degree);
12423
+ };
12424
+ /**
12425
+ * Encodes a chunk of data
12426
+ *
12427
+ * @param {Uint8Array} data Buffer containing input data
12428
+ * @return {Uint8Array} Buffer containing encoded data
12429
+ */
12430
+ ReedSolomonEncoder.prototype.encode = function encode(data) {
12431
+ if (!this.genPoly) throw new Error("Encoder not initialized");
12432
+ const paddedData = new Uint8Array(data.length + this.degree);
12433
+ paddedData.set(data);
12434
+ const remainder = Polynomial.mod(paddedData, this.genPoly);
12435
+ const start = this.degree - remainder.length;
12436
+ if (start > 0) {
12437
+ const buff = new Uint8Array(this.degree);
12438
+ buff.set(remainder, start);
12439
+ return buff;
12440
+ }
12441
+ return remainder;
12442
+ };
12443
+ module.exports = ReedSolomonEncoder;
12444
+ }));
12445
+ //#endregion
12446
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js
12447
+ var require_version_check = /* @__PURE__ */ __commonJSMin(((exports) => {
12448
+ /**
12449
+ * Check if QR Code version is valid
12450
+ *
12451
+ * @param {Number} version QR Code version
12452
+ * @return {Boolean} true if valid version, false otherwise
12453
+ */
12454
+ exports.isValid = function isValid(version) {
12455
+ return !isNaN(version) && version >= 1 && version <= 40;
12456
+ };
12457
+ }));
12458
+ //#endregion
12459
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js
12460
+ var require_regex = /* @__PURE__ */ __commonJSMin(((exports) => {
12461
+ var numeric = "[0-9]+";
12462
+ var alphanumeric = "[A-Z $%*+\\-./:]+";
12463
+ var kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
12464
+ kanji = kanji.replace(/u/g, "\\u");
12465
+ var byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+";
12466
+ exports.KANJI = new RegExp(kanji, "g");
12467
+ exports.BYTE_KANJI = /* @__PURE__ */ new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
12468
+ exports.BYTE = new RegExp(byte, "g");
12469
+ exports.NUMERIC = new RegExp(numeric, "g");
12470
+ exports.ALPHANUMERIC = new RegExp(alphanumeric, "g");
12471
+ var TEST_KANJI = new RegExp("^" + kanji + "$");
12472
+ var TEST_NUMERIC = /* @__PURE__ */ new RegExp("^[0-9]+$");
12473
+ var TEST_ALPHANUMERIC = /* @__PURE__ */ new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
12474
+ exports.testKanji = function testKanji(str) {
12475
+ return TEST_KANJI.test(str);
12476
+ };
12477
+ exports.testNumeric = function testNumeric(str) {
12478
+ return TEST_NUMERIC.test(str);
12479
+ };
12480
+ exports.testAlphanumeric = function testAlphanumeric(str) {
12481
+ return TEST_ALPHANUMERIC.test(str);
12482
+ };
12483
+ }));
12484
+ //#endregion
12485
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js
12486
+ var require_mode = /* @__PURE__ */ __commonJSMin(((exports) => {
12487
+ var VersionCheck = require_version_check();
12488
+ var Regex = require_regex();
12489
+ /**
12490
+ * Numeric mode encodes data from the decimal digit set (0 - 9)
12491
+ * (byte values 30HEX to 39HEX).
12492
+ * Normally, 3 data characters are represented by 10 bits.
12493
+ *
12494
+ * @type {Object}
12495
+ */
12496
+ exports.NUMERIC = {
12497
+ id: "Numeric",
12498
+ bit: 1,
12499
+ ccBits: [
12500
+ 10,
12501
+ 12,
12502
+ 14
12503
+ ]
12504
+ };
12505
+ /**
12506
+ * Alphanumeric mode encodes data from a set of 45 characters,
12507
+ * i.e. 10 numeric digits (0 - 9),
12508
+ * 26 alphabetic characters (A - Z),
12509
+ * and 9 symbols (SP, $, %, *, +, -, ., /, :).
12510
+ * Normally, two input characters are represented by 11 bits.
12511
+ *
12512
+ * @type {Object}
12513
+ */
12514
+ exports.ALPHANUMERIC = {
12515
+ id: "Alphanumeric",
12516
+ bit: 2,
12517
+ ccBits: [
12518
+ 9,
12519
+ 11,
12520
+ 13
12521
+ ]
12522
+ };
12523
+ /**
12524
+ * In byte mode, data is encoded at 8 bits per character.
12525
+ *
12526
+ * @type {Object}
12527
+ */
12528
+ exports.BYTE = {
12529
+ id: "Byte",
12530
+ bit: 4,
12531
+ ccBits: [
12532
+ 8,
12533
+ 16,
12534
+ 16
12535
+ ]
12536
+ };
12537
+ /**
12538
+ * The Kanji mode efficiently encodes Kanji characters in accordance with
12539
+ * the Shift JIS system based on JIS X 0208.
12540
+ * The Shift JIS values are shifted from the JIS X 0208 values.
12541
+ * JIS X 0208 gives details of the shift coded representation.
12542
+ * Each two-byte character value is compacted to a 13-bit binary codeword.
12543
+ *
12544
+ * @type {Object}
12545
+ */
12546
+ exports.KANJI = {
12547
+ id: "Kanji",
12548
+ bit: 8,
12549
+ ccBits: [
12550
+ 8,
12551
+ 10,
12552
+ 12
12553
+ ]
12554
+ };
12555
+ /**
12556
+ * Mixed mode will contain a sequences of data in a combination of any of
12557
+ * the modes described above
12558
+ *
12559
+ * @type {Object}
12560
+ */
12561
+ exports.MIXED = { bit: -1 };
12562
+ /**
12563
+ * Returns the number of bits needed to store the data length
12564
+ * according to QR Code specifications.
12565
+ *
12566
+ * @param {Mode} mode Data mode
12567
+ * @param {Number} version QR Code version
12568
+ * @return {Number} Number of bits
12569
+ */
12570
+ exports.getCharCountIndicator = function getCharCountIndicator(mode, version) {
12571
+ if (!mode.ccBits) throw new Error("Invalid mode: " + mode);
12572
+ if (!VersionCheck.isValid(version)) throw new Error("Invalid version: " + version);
12573
+ if (version >= 1 && version < 10) return mode.ccBits[0];
12574
+ else if (version < 27) return mode.ccBits[1];
12575
+ return mode.ccBits[2];
12576
+ };
12577
+ /**
12578
+ * Returns the most efficient mode to store the specified data
12579
+ *
12580
+ * @param {String} dataStr Input data string
12581
+ * @return {Mode} Best mode
12582
+ */
12583
+ exports.getBestModeForData = function getBestModeForData(dataStr) {
12584
+ if (Regex.testNumeric(dataStr)) return exports.NUMERIC;
12585
+ else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC;
12586
+ else if (Regex.testKanji(dataStr)) return exports.KANJI;
12587
+ else return exports.BYTE;
12588
+ };
12589
+ /**
12590
+ * Return mode name as string
12591
+ *
12592
+ * @param {Mode} mode Mode object
12593
+ * @returns {String} Mode name
12594
+ */
12595
+ exports.toString = function toString(mode) {
12596
+ if (mode && mode.id) return mode.id;
12597
+ throw new Error("Invalid mode");
12598
+ };
12599
+ /**
12600
+ * Check if input param is a valid mode object
12601
+ *
12602
+ * @param {Mode} mode Mode object
12603
+ * @returns {Boolean} True if valid mode, false otherwise
12604
+ */
12605
+ exports.isValid = function isValid(mode) {
12606
+ return mode && mode.bit && mode.ccBits;
12607
+ };
12608
+ /**
12609
+ * Get mode object from its name
12610
+ *
12611
+ * @param {String} string Mode name
12612
+ * @returns {Mode} Mode object
12613
+ */
12614
+ function fromString(string) {
12615
+ if (typeof string !== "string") throw new Error("Param is not a string");
12616
+ switch (string.toLowerCase()) {
12617
+ case "numeric": return exports.NUMERIC;
12618
+ case "alphanumeric": return exports.ALPHANUMERIC;
12619
+ case "kanji": return exports.KANJI;
12620
+ case "byte": return exports.BYTE;
12621
+ default: throw new Error("Unknown mode: " + string);
12622
+ }
12623
+ }
12624
+ /**
12625
+ * Returns mode from a value.
12626
+ * If value is not a valid mode, returns defaultValue
12627
+ *
12628
+ * @param {Mode|String} value Encoding mode
12629
+ * @param {Mode} defaultValue Fallback value
12630
+ * @return {Mode} Encoding mode
12631
+ */
12632
+ exports.from = function from(value, defaultValue) {
12633
+ if (exports.isValid(value)) return value;
12634
+ try {
12635
+ return fromString(value);
12636
+ } catch (e) {
12637
+ return defaultValue;
12638
+ }
12639
+ };
12640
+ }));
12641
+ //#endregion
12642
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js
12643
+ var require_version = /* @__PURE__ */ __commonJSMin(((exports) => {
12644
+ var Utils = require_utils$1();
12645
+ var ECCode = require_error_correction_code();
12646
+ var ECLevel = require_error_correction_level();
12647
+ var Mode = require_mode();
12648
+ var VersionCheck = require_version_check();
12649
+ var G18 = 7973;
12650
+ var G18_BCH = Utils.getBCHDigit(G18);
12651
+ function getBestVersionForDataLength(mode, length, errorCorrectionLevel) {
12652
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) return currentVersion;
12653
+ }
12654
+ function getReservedBitsCount(mode, version) {
12655
+ return Mode.getCharCountIndicator(mode, version) + 4;
12656
+ }
12657
+ function getTotalBitsFromDataArray(segments, version) {
12658
+ let totalBits = 0;
12659
+ segments.forEach(function(data) {
12660
+ const reservedBits = getReservedBitsCount(data.mode, version);
12661
+ totalBits += reservedBits + data.getBitsLength();
12662
+ });
12663
+ return totalBits;
12664
+ }
12665
+ function getBestVersionForMixedData(segments, errorCorrectionLevel) {
12666
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) if (getTotalBitsFromDataArray(segments, currentVersion) <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) return currentVersion;
12667
+ }
12668
+ /**
12669
+ * Returns version number from a value.
12670
+ * If value is not a valid version, returns defaultValue
12671
+ *
12672
+ * @param {Number|String} value QR Code version
12673
+ * @param {Number} defaultValue Fallback value
12674
+ * @return {Number} QR Code version number
12675
+ */
12676
+ exports.from = function from(value, defaultValue) {
12677
+ if (VersionCheck.isValid(value)) return parseInt(value, 10);
12678
+ return defaultValue;
12679
+ };
12680
+ /**
12681
+ * Returns how much data can be stored with the specified QR code version
12682
+ * and error correction level
12683
+ *
12684
+ * @param {Number} version QR Code version (1-40)
12685
+ * @param {Number} errorCorrectionLevel Error correction level
12686
+ * @param {Mode} mode Data mode
12687
+ * @return {Number} Quantity of storable data
12688
+ */
12689
+ exports.getCapacity = function getCapacity(version, errorCorrectionLevel, mode) {
12690
+ if (!VersionCheck.isValid(version)) throw new Error("Invalid QR Code version");
12691
+ if (typeof mode === "undefined") mode = Mode.BYTE;
12692
+ const dataTotalCodewordsBits = (Utils.getSymbolTotalCodewords(version) - ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)) * 8;
12693
+ if (mode === Mode.MIXED) return dataTotalCodewordsBits;
12694
+ const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version);
12695
+ switch (mode) {
12696
+ case Mode.NUMERIC: return Math.floor(usableBits / 10 * 3);
12697
+ case Mode.ALPHANUMERIC: return Math.floor(usableBits / 11 * 2);
12698
+ case Mode.KANJI: return Math.floor(usableBits / 13);
12699
+ case Mode.BYTE:
12700
+ default: return Math.floor(usableBits / 8);
12701
+ }
12702
+ };
12703
+ /**
12704
+ * Returns the minimum version needed to contain the amount of data
12705
+ *
12706
+ * @param {Segment} data Segment of data
12707
+ * @param {Number} [errorCorrectionLevel=H] Error correction level
12708
+ * @param {Mode} mode Data mode
12709
+ * @return {Number} QR Code version
12710
+ */
12711
+ exports.getBestVersionForData = function getBestVersionForData(data, errorCorrectionLevel) {
12712
+ let seg;
12713
+ const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M);
12714
+ if (Array.isArray(data)) {
12715
+ if (data.length > 1) return getBestVersionForMixedData(data, ecl);
12716
+ if (data.length === 0) return 1;
12717
+ seg = data[0];
12718
+ } else seg = data;
12719
+ return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl);
12720
+ };
12721
+ /**
12722
+ * Returns version information with relative error correction bits
12723
+ *
12724
+ * The version information is included in QR Code symbols of version 7 or larger.
12725
+ * It consists of an 18-bit sequence containing 6 data bits,
12726
+ * with 12 error correction bits calculated using the (18, 6) Golay code.
12727
+ *
12728
+ * @param {Number} version QR Code version
12729
+ * @return {Number} Encoded version info bits
12730
+ */
12731
+ exports.getEncodedBits = function getEncodedBits(version) {
12732
+ if (!VersionCheck.isValid(version) || version < 7) throw new Error("Invalid QR Code version");
12733
+ let d = version << 12;
12734
+ while (Utils.getBCHDigit(d) - G18_BCH >= 0) d ^= G18 << Utils.getBCHDigit(d) - G18_BCH;
12735
+ return version << 12 | d;
12736
+ };
12737
+ }));
12738
+ //#endregion
12739
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js
12740
+ var require_format_info = /* @__PURE__ */ __commonJSMin(((exports) => {
12741
+ var Utils = require_utils$1();
12742
+ var G15 = 1335;
12743
+ var G15_MASK = 21522;
12744
+ var G15_BCH = Utils.getBCHDigit(G15);
12745
+ /**
12746
+ * Returns format information with relative error correction bits
12747
+ *
12748
+ * The format information is a 15-bit sequence containing 5 data bits,
12749
+ * with 10 error correction bits calculated using the (15, 5) BCH code.
12750
+ *
12751
+ * @param {Number} errorCorrectionLevel Error correction level
12752
+ * @param {Number} mask Mask pattern
12753
+ * @return {Number} Encoded format information bits
12754
+ */
12755
+ exports.getEncodedBits = function getEncodedBits(errorCorrectionLevel, mask) {
12756
+ const data = errorCorrectionLevel.bit << 3 | mask;
12757
+ let d = data << 10;
12758
+ while (Utils.getBCHDigit(d) - G15_BCH >= 0) d ^= G15 << Utils.getBCHDigit(d) - G15_BCH;
12759
+ return (data << 10 | d) ^ G15_MASK;
12760
+ };
12761
+ }));
12762
+ //#endregion
12763
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js
12764
+ var require_numeric_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12765
+ var Mode = require_mode();
12766
+ function NumericData(data) {
12767
+ this.mode = Mode.NUMERIC;
12768
+ this.data = data.toString();
12769
+ }
12770
+ NumericData.getBitsLength = function getBitsLength(length) {
12771
+ return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0);
12772
+ };
12773
+ NumericData.prototype.getLength = function getLength() {
12774
+ return this.data.length;
12775
+ };
12776
+ NumericData.prototype.getBitsLength = function getBitsLength() {
12777
+ return NumericData.getBitsLength(this.data.length);
12778
+ };
12779
+ NumericData.prototype.write = function write(bitBuffer) {
12780
+ let i, group, value;
12781
+ for (i = 0; i + 3 <= this.data.length; i += 3) {
12782
+ group = this.data.substr(i, 3);
12783
+ value = parseInt(group, 10);
12784
+ bitBuffer.put(value, 10);
12785
+ }
12786
+ const remainingNum = this.data.length - i;
12787
+ if (remainingNum > 0) {
12788
+ group = this.data.substr(i);
12789
+ value = parseInt(group, 10);
12790
+ bitBuffer.put(value, remainingNum * 3 + 1);
12791
+ }
12792
+ };
12793
+ module.exports = NumericData;
12794
+ }));
12795
+ //#endregion
12796
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js
12797
+ var require_alphanumeric_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12798
+ var Mode = require_mode();
12799
+ /**
12800
+ * Array of characters available in alphanumeric mode
12801
+ *
12802
+ * As per QR Code specification, to each character
12803
+ * is assigned a value from 0 to 44 which in this case coincides
12804
+ * with the array index
12805
+ *
12806
+ * @type {Array}
12807
+ */
12808
+ var ALPHA_NUM_CHARS = [
12809
+ "0",
12810
+ "1",
12811
+ "2",
12812
+ "3",
12813
+ "4",
12814
+ "5",
12815
+ "6",
12816
+ "7",
12817
+ "8",
12818
+ "9",
12819
+ "A",
12820
+ "B",
12821
+ "C",
12822
+ "D",
12823
+ "E",
12824
+ "F",
12825
+ "G",
12826
+ "H",
12827
+ "I",
12828
+ "J",
12829
+ "K",
12830
+ "L",
12831
+ "M",
12832
+ "N",
12833
+ "O",
12834
+ "P",
12835
+ "Q",
12836
+ "R",
12837
+ "S",
12838
+ "T",
12839
+ "U",
12840
+ "V",
12841
+ "W",
12842
+ "X",
12843
+ "Y",
12844
+ "Z",
12845
+ " ",
12846
+ "$",
12847
+ "%",
12848
+ "*",
12849
+ "+",
12850
+ "-",
12851
+ ".",
12852
+ "/",
12853
+ ":"
12854
+ ];
12855
+ function AlphanumericData(data) {
12856
+ this.mode = Mode.ALPHANUMERIC;
12857
+ this.data = data;
12858
+ }
12859
+ AlphanumericData.getBitsLength = function getBitsLength(length) {
12860
+ return 11 * Math.floor(length / 2) + 6 * (length % 2);
12861
+ };
12862
+ AlphanumericData.prototype.getLength = function getLength() {
12863
+ return this.data.length;
12864
+ };
12865
+ AlphanumericData.prototype.getBitsLength = function getBitsLength() {
12866
+ return AlphanumericData.getBitsLength(this.data.length);
12867
+ };
12868
+ AlphanumericData.prototype.write = function write(bitBuffer) {
12869
+ let i;
12870
+ for (i = 0; i + 2 <= this.data.length; i += 2) {
12871
+ let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45;
12872
+ value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1]);
12873
+ bitBuffer.put(value, 11);
12874
+ }
12875
+ if (this.data.length % 2) bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6);
12876
+ };
12877
+ module.exports = AlphanumericData;
12878
+ }));
12879
+ //#endregion
12880
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js
12881
+ var require_byte_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12882
+ var Mode = require_mode();
12883
+ function ByteData(data) {
12884
+ this.mode = Mode.BYTE;
12885
+ if (typeof data === "string") this.data = new TextEncoder().encode(data);
12886
+ else this.data = new Uint8Array(data);
12887
+ }
12888
+ ByteData.getBitsLength = function getBitsLength(length) {
12889
+ return length * 8;
12890
+ };
12891
+ ByteData.prototype.getLength = function getLength() {
12892
+ return this.data.length;
12893
+ };
12894
+ ByteData.prototype.getBitsLength = function getBitsLength() {
12895
+ return ByteData.getBitsLength(this.data.length);
12896
+ };
12897
+ ByteData.prototype.write = function(bitBuffer) {
12898
+ for (let i = 0, l = this.data.length; i < l; i++) bitBuffer.put(this.data[i], 8);
12899
+ };
12900
+ module.exports = ByteData;
12901
+ }));
12902
+ //#endregion
12903
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js
12904
+ var require_kanji_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12905
+ var Mode = require_mode();
12906
+ var Utils = require_utils$1();
12907
+ function KanjiData(data) {
12908
+ this.mode = Mode.KANJI;
12909
+ this.data = data;
12910
+ }
12911
+ KanjiData.getBitsLength = function getBitsLength(length) {
12912
+ return length * 13;
12913
+ };
12914
+ KanjiData.prototype.getLength = function getLength() {
12915
+ return this.data.length;
12916
+ };
12917
+ KanjiData.prototype.getBitsLength = function getBitsLength() {
12918
+ return KanjiData.getBitsLength(this.data.length);
12919
+ };
12920
+ KanjiData.prototype.write = function(bitBuffer) {
12921
+ let i;
12922
+ for (i = 0; i < this.data.length; i++) {
12923
+ let value = Utils.toSJIS(this.data[i]);
12924
+ if (value >= 33088 && value <= 40956) value -= 33088;
12925
+ else if (value >= 57408 && value <= 60351) value -= 49472;
12926
+ else throw new Error("Invalid SJIS character: " + this.data[i] + "\nMake sure your charset is UTF-8");
12927
+ value = (value >>> 8 & 255) * 192 + (value & 255);
12928
+ bitBuffer.put(value, 13);
12929
+ }
12930
+ };
12931
+ module.exports = KanjiData;
12932
+ }));
12933
+ //#endregion
12934
+ //#region node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js
12935
+ var require_dijkstra = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12936
+ /******************************************************************************
12937
+ * Created 2008-08-19.
12938
+ *
12939
+ * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.
12940
+ *
12941
+ * Copyright (C) 2008
12942
+ * Wyatt Baldwin <self@wyattbaldwin.com>
12943
+ * All rights reserved
12944
+ *
12945
+ * Licensed under the MIT license.
12946
+ *
12947
+ * http://www.opensource.org/licenses/mit-license.php
12948
+ *
12949
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12950
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12951
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12952
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12953
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12954
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
12955
+ * THE SOFTWARE.
12956
+ *****************************************************************************/
12957
+ var dijkstra = {
12958
+ single_source_shortest_paths: function(graph, s, d) {
12959
+ var predecessors = {};
12960
+ var costs = {};
12961
+ costs[s] = 0;
12962
+ var open = dijkstra.PriorityQueue.make();
12963
+ open.push(s, 0);
12964
+ var closest, u, v, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit;
12965
+ while (!open.empty()) {
12966
+ closest = open.pop();
12967
+ u = closest.value;
12968
+ cost_of_s_to_u = closest.cost;
12969
+ adjacent_nodes = graph[u] || {};
12970
+ for (v in adjacent_nodes) if (adjacent_nodes.hasOwnProperty(v)) {
12971
+ cost_of_e = adjacent_nodes[v];
12972
+ cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;
12973
+ cost_of_s_to_v = costs[v];
12974
+ first_visit = typeof costs[v] === "undefined";
12975
+ if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {
12976
+ costs[v] = cost_of_s_to_u_plus_cost_of_e;
12977
+ open.push(v, cost_of_s_to_u_plus_cost_of_e);
12978
+ predecessors[v] = u;
12979
+ }
12980
+ }
12981
+ }
12982
+ if (typeof d !== "undefined" && typeof costs[d] === "undefined") {
12983
+ var msg = [
12984
+ "Could not find a path from ",
12985
+ s,
12986
+ " to ",
12987
+ d,
12988
+ "."
12989
+ ].join("");
12990
+ throw new Error(msg);
12991
+ }
12992
+ return predecessors;
12993
+ },
12994
+ extract_shortest_path_from_predecessor_list: function(predecessors, d) {
12995
+ var nodes = [];
12996
+ var u = d;
12997
+ while (u) {
12998
+ nodes.push(u);
12999
+ predecessors[u];
13000
+ u = predecessors[u];
13001
+ }
13002
+ nodes.reverse();
13003
+ return nodes;
13004
+ },
13005
+ find_path: function(graph, s, d) {
13006
+ var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);
13007
+ return dijkstra.extract_shortest_path_from_predecessor_list(predecessors, d);
13008
+ },
13009
+ /**
13010
+ * A very naive priority queue implementation.
13011
+ */
13012
+ PriorityQueue: {
13013
+ make: function(opts) {
13014
+ var T = dijkstra.PriorityQueue, t = {}, key;
13015
+ opts = opts || {};
13016
+ for (key in T) if (T.hasOwnProperty(key)) t[key] = T[key];
13017
+ t.queue = [];
13018
+ t.sorter = opts.sorter || T.default_sorter;
13019
+ return t;
13020
+ },
13021
+ default_sorter: function(a, b) {
13022
+ return a.cost - b.cost;
13023
+ },
13024
+ /**
13025
+ * Add a new item to the queue and ensure the highest priority element
13026
+ * is at the front of the queue.
13027
+ */
13028
+ push: function(value, cost) {
13029
+ var item = {
13030
+ value,
13031
+ cost
13032
+ };
13033
+ this.queue.push(item);
13034
+ this.queue.sort(this.sorter);
13035
+ },
13036
+ /**
13037
+ * Return the highest priority element in the queue.
13038
+ */
13039
+ pop: function() {
13040
+ return this.queue.shift();
13041
+ },
13042
+ empty: function() {
13043
+ return this.queue.length === 0;
13044
+ }
13045
+ }
13046
+ };
13047
+ if (typeof module !== "undefined") module.exports = dijkstra;
13048
+ }));
13049
+ //#endregion
13050
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js
13051
+ var require_segments = /* @__PURE__ */ __commonJSMin(((exports) => {
13052
+ var Mode = require_mode();
13053
+ var NumericData = require_numeric_data();
13054
+ var AlphanumericData = require_alphanumeric_data();
13055
+ var ByteData = require_byte_data();
13056
+ var KanjiData = require_kanji_data();
13057
+ var Regex = require_regex();
13058
+ var Utils = require_utils$1();
13059
+ var dijkstra = require_dijkstra();
13060
+ /**
13061
+ * Returns UTF8 byte length
13062
+ *
13063
+ * @param {String} str Input string
13064
+ * @return {Number} Number of byte
13065
+ */
13066
+ function getStringByteLength(str) {
13067
+ return unescape(encodeURIComponent(str)).length;
13068
+ }
13069
+ /**
13070
+ * Get a list of segments of the specified mode
13071
+ * from a string
13072
+ *
13073
+ * @param {Mode} mode Segment mode
13074
+ * @param {String} str String to process
13075
+ * @return {Array} Array of object with segments data
13076
+ */
13077
+ function getSegments(regex, mode, str) {
13078
+ const segments = [];
13079
+ let result;
13080
+ while ((result = regex.exec(str)) !== null) segments.push({
13081
+ data: result[0],
13082
+ index: result.index,
13083
+ mode,
13084
+ length: result[0].length
13085
+ });
13086
+ return segments;
13087
+ }
13088
+ /**
13089
+ * Extracts a series of segments with the appropriate
13090
+ * modes from a string
13091
+ *
13092
+ * @param {String} dataStr Input string
13093
+ * @return {Array} Array of object with segments data
13094
+ */
13095
+ function getSegmentsFromString(dataStr) {
13096
+ const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr);
13097
+ const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr);
13098
+ let byteSegs;
13099
+ let kanjiSegs;
13100
+ if (Utils.isKanjiModeEnabled()) {
13101
+ byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr);
13102
+ kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr);
13103
+ } else {
13104
+ byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr);
13105
+ kanjiSegs = [];
13106
+ }
13107
+ return numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs).sort(function(s1, s2) {
13108
+ return s1.index - s2.index;
13109
+ }).map(function(obj) {
13110
+ return {
13111
+ data: obj.data,
13112
+ mode: obj.mode,
13113
+ length: obj.length
13114
+ };
13115
+ });
13116
+ }
13117
+ /**
13118
+ * Returns how many bits are needed to encode a string of
13119
+ * specified length with the specified mode
13120
+ *
13121
+ * @param {Number} length String length
13122
+ * @param {Mode} mode Segment mode
13123
+ * @return {Number} Bit length
13124
+ */
13125
+ function getSegmentBitsLength(length, mode) {
13126
+ switch (mode) {
13127
+ case Mode.NUMERIC: return NumericData.getBitsLength(length);
13128
+ case Mode.ALPHANUMERIC: return AlphanumericData.getBitsLength(length);
13129
+ case Mode.KANJI: return KanjiData.getBitsLength(length);
13130
+ case Mode.BYTE: return ByteData.getBitsLength(length);
13131
+ }
13132
+ }
13133
+ /**
13134
+ * Merges adjacent segments which have the same mode
13135
+ *
13136
+ * @param {Array} segs Array of object with segments data
13137
+ * @return {Array} Array of object with segments data
13138
+ */
13139
+ function mergeSegments(segs) {
13140
+ return segs.reduce(function(acc, curr) {
13141
+ const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null;
13142
+ if (prevSeg && prevSeg.mode === curr.mode) {
13143
+ acc[acc.length - 1].data += curr.data;
13144
+ return acc;
13145
+ }
13146
+ acc.push(curr);
13147
+ return acc;
13148
+ }, []);
13149
+ }
13150
+ /**
13151
+ * Generates a list of all possible nodes combination which
13152
+ * will be used to build a segments graph.
13153
+ *
13154
+ * Nodes are divided by groups. Each group will contain a list of all the modes
13155
+ * in which is possible to encode the given text.
13156
+ *
13157
+ * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.
13158
+ * The group for '12345' will contain then 3 objects, one for each
13159
+ * possible encoding mode.
13160
+ *
13161
+ * Each node represents a possible segment.
13162
+ *
13163
+ * @param {Array} segs Array of object with segments data
13164
+ * @return {Array} Array of object with segments data
13165
+ */
13166
+ function buildNodes(segs) {
13167
+ const nodes = [];
13168
+ for (let i = 0; i < segs.length; i++) {
13169
+ const seg = segs[i];
13170
+ switch (seg.mode) {
13171
+ case Mode.NUMERIC:
13172
+ nodes.push([
13173
+ seg,
13174
+ {
13175
+ data: seg.data,
13176
+ mode: Mode.ALPHANUMERIC,
13177
+ length: seg.length
13178
+ },
13179
+ {
13180
+ data: seg.data,
13181
+ mode: Mode.BYTE,
13182
+ length: seg.length
13183
+ }
13184
+ ]);
13185
+ break;
13186
+ case Mode.ALPHANUMERIC:
13187
+ nodes.push([seg, {
13188
+ data: seg.data,
13189
+ mode: Mode.BYTE,
13190
+ length: seg.length
13191
+ }]);
13192
+ break;
13193
+ case Mode.KANJI:
13194
+ nodes.push([seg, {
13195
+ data: seg.data,
13196
+ mode: Mode.BYTE,
13197
+ length: getStringByteLength(seg.data)
13198
+ }]);
13199
+ break;
13200
+ case Mode.BYTE: nodes.push([{
13201
+ data: seg.data,
13202
+ mode: Mode.BYTE,
13203
+ length: getStringByteLength(seg.data)
13204
+ }]);
13205
+ }
13206
+ }
13207
+ return nodes;
13208
+ }
13209
+ /**
13210
+ * Builds a graph from a list of nodes.
13211
+ * All segments in each node group will be connected with all the segments of
13212
+ * the next group and so on.
13213
+ *
13214
+ * At each connection will be assigned a weight depending on the
13215
+ * segment's byte length.
13216
+ *
13217
+ * @param {Array} nodes Array of object with segments data
13218
+ * @param {Number} version QR Code version
13219
+ * @return {Object} Graph of all possible segments
13220
+ */
13221
+ function buildGraph(nodes, version) {
13222
+ const table = {};
13223
+ const graph = { start: {} };
13224
+ let prevNodeIds = ["start"];
13225
+ for (let i = 0; i < nodes.length; i++) {
13226
+ const nodeGroup = nodes[i];
13227
+ const currentNodeIds = [];
13228
+ for (let j = 0; j < nodeGroup.length; j++) {
13229
+ const node = nodeGroup[j];
13230
+ const key = "" + i + j;
13231
+ currentNodeIds.push(key);
13232
+ table[key] = {
13233
+ node,
13234
+ lastCount: 0
13235
+ };
13236
+ graph[key] = {};
13237
+ for (let n = 0; n < prevNodeIds.length; n++) {
13238
+ const prevNodeId = prevNodeIds[n];
13239
+ if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {
13240
+ graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node.mode);
13241
+ table[prevNodeId].lastCount += node.length;
13242
+ } else {
13243
+ if (table[prevNodeId]) table[prevNodeId].lastCount = node.length;
13244
+ graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + 4 + Mode.getCharCountIndicator(node.mode, version);
13245
+ }
13246
+ }
13247
+ }
13248
+ prevNodeIds = currentNodeIds;
13249
+ }
13250
+ for (let n = 0; n < prevNodeIds.length; n++) graph[prevNodeIds[n]].end = 0;
13251
+ return {
13252
+ map: graph,
13253
+ table
13254
+ };
13255
+ }
13256
+ /**
13257
+ * Builds a segment from a specified data and mode.
13258
+ * If a mode is not specified, the more suitable will be used.
13259
+ *
13260
+ * @param {String} data Input data
13261
+ * @param {Mode | String} modesHint Data mode
13262
+ * @return {Segment} Segment
13263
+ */
13264
+ function buildSingleSegment(data, modesHint) {
13265
+ let mode;
13266
+ const bestMode = Mode.getBestModeForData(data);
13267
+ mode = Mode.from(modesHint, bestMode);
13268
+ if (mode !== Mode.BYTE && mode.bit < bestMode.bit) throw new Error("\"" + data + "\" cannot be encoded with mode " + Mode.toString(mode) + ".\n Suggested mode is: " + Mode.toString(bestMode));
13269
+ if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) mode = Mode.BYTE;
13270
+ switch (mode) {
13271
+ case Mode.NUMERIC: return new NumericData(data);
13272
+ case Mode.ALPHANUMERIC: return new AlphanumericData(data);
13273
+ case Mode.KANJI: return new KanjiData(data);
13274
+ case Mode.BYTE: return new ByteData(data);
13275
+ }
13276
+ }
13277
+ /**
13278
+ * Builds a list of segments from an array.
13279
+ * Array can contain Strings or Objects with segment's info.
13280
+ *
13281
+ * For each item which is a string, will be generated a segment with the given
13282
+ * string and the more appropriate encoding mode.
13283
+ *
13284
+ * For each item which is an object, will be generated a segment with the given
13285
+ * data and mode.
13286
+ * Objects must contain at least the property "data".
13287
+ * If property "mode" is not present, the more suitable mode will be used.
13288
+ *
13289
+ * @param {Array} array Array of objects with segments data
13290
+ * @return {Array} Array of Segments
13291
+ */
13292
+ exports.fromArray = function fromArray(array) {
13293
+ return array.reduce(function(acc, seg) {
13294
+ if (typeof seg === "string") acc.push(buildSingleSegment(seg, null));
13295
+ else if (seg.data) acc.push(buildSingleSegment(seg.data, seg.mode));
13296
+ return acc;
13297
+ }, []);
13298
+ };
13299
+ /**
13300
+ * Builds an optimized sequence of segments from a string,
13301
+ * which will produce the shortest possible bitstream.
13302
+ *
13303
+ * @param {String} data Input string
13304
+ * @param {Number} version QR Code version
13305
+ * @return {Array} Array of segments
13306
+ */
13307
+ exports.fromString = function fromString(data, version) {
13308
+ const graph = buildGraph(buildNodes(getSegmentsFromString(data, Utils.isKanjiModeEnabled())), version);
13309
+ const path = dijkstra.find_path(graph.map, "start", "end");
13310
+ const optimizedSegs = [];
13311
+ for (let i = 1; i < path.length - 1; i++) optimizedSegs.push(graph.table[path[i]].node);
13312
+ return exports.fromArray(mergeSegments(optimizedSegs));
13313
+ };
13314
+ /**
13315
+ * Splits a string in various segments with the modes which
13316
+ * best represent their content.
13317
+ * The produced segments are far from being optimized.
13318
+ * The output of this function is only used to estimate a QR Code version
13319
+ * which may contain the data.
13320
+ *
13321
+ * @param {string} data Input string
13322
+ * @return {Array} Array of segments
13323
+ */
13324
+ exports.rawSplit = function rawSplit(data) {
13325
+ return exports.fromArray(getSegmentsFromString(data, Utils.isKanjiModeEnabled()));
13326
+ };
13327
+ }));
13328
+ //#endregion
13329
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js
13330
+ var require_qrcode = /* @__PURE__ */ __commonJSMin(((exports) => {
13331
+ var Utils = require_utils$1();
13332
+ var ECLevel = require_error_correction_level();
13333
+ var BitBuffer = require_bit_buffer();
13334
+ var BitMatrix = require_bit_matrix();
13335
+ var AlignmentPattern = require_alignment_pattern();
13336
+ var FinderPattern = require_finder_pattern();
13337
+ var MaskPattern = require_mask_pattern();
13338
+ var ECCode = require_error_correction_code();
13339
+ var ReedSolomonEncoder = require_reed_solomon_encoder();
13340
+ var Version = require_version();
13341
+ var FormatInfo = require_format_info();
13342
+ var Mode = require_mode();
13343
+ var Segments = require_segments();
13344
+ /**
13345
+ * QRCode for JavaScript
13346
+ *
13347
+ * modified by Ryan Day for nodejs support
13348
+ * Copyright (c) 2011 Ryan Day
13349
+ *
13350
+ * Licensed under the MIT license:
13351
+ * http://www.opensource.org/licenses/mit-license.php
13352
+ *
13353
+ //---------------------------------------------------------------------
13354
+ // QRCode for JavaScript
13355
+ //
13356
+ // Copyright (c) 2009 Kazuhiko Arase
13357
+ //
13358
+ // URL: http://www.d-project.com/
13359
+ //
13360
+ // Licensed under the MIT license:
13361
+ // http://www.opensource.org/licenses/mit-license.php
13362
+ //
13363
+ // The word "QR Code" is registered trademark of
13364
+ // DENSO WAVE INCORPORATED
13365
+ // http://www.denso-wave.com/qrcode/faqpatent-e.html
13366
+ //
13367
+ //---------------------------------------------------------------------
13368
+ */
13369
+ /**
13370
+ * Add finder patterns bits to matrix
13371
+ *
13372
+ * @param {BitMatrix} matrix Modules matrix
13373
+ * @param {Number} version QR Code version
13374
+ */
13375
+ function setupFinderPattern(matrix, version) {
13376
+ const size = matrix.size;
13377
+ const pos = FinderPattern.getPositions(version);
13378
+ for (let i = 0; i < pos.length; i++) {
13379
+ const row = pos[i][0];
13380
+ const col = pos[i][1];
13381
+ for (let r = -1; r <= 7; r++) {
13382
+ if (row + r <= -1 || size <= row + r) continue;
13383
+ for (let c = -1; c <= 7; c++) {
13384
+ if (col + c <= -1 || size <= col + c) continue;
13385
+ if (r >= 0 && r <= 6 && (c === 0 || c === 6) || c >= 0 && c <= 6 && (r === 0 || r === 6) || r >= 2 && r <= 4 && c >= 2 && c <= 4) matrix.set(row + r, col + c, true, true);
13386
+ else matrix.set(row + r, col + c, false, true);
13387
+ }
13388
+ }
13389
+ }
13390
+ }
13391
+ /**
13392
+ * Add timing pattern bits to matrix
13393
+ *
13394
+ * Note: this function must be called before {@link setupAlignmentPattern}
13395
+ *
13396
+ * @param {BitMatrix} matrix Modules matrix
13397
+ */
13398
+ function setupTimingPattern(matrix) {
13399
+ const size = matrix.size;
13400
+ for (let r = 8; r < size - 8; r++) {
13401
+ const value = r % 2 === 0;
13402
+ matrix.set(r, 6, value, true);
13403
+ matrix.set(6, r, value, true);
13404
+ }
13405
+ }
13406
+ /**
13407
+ * Add alignment patterns bits to matrix
13408
+ *
13409
+ * Note: this function must be called after {@link setupTimingPattern}
13410
+ *
13411
+ * @param {BitMatrix} matrix Modules matrix
13412
+ * @param {Number} version QR Code version
13413
+ */
13414
+ function setupAlignmentPattern(matrix, version) {
13415
+ const pos = AlignmentPattern.getPositions(version);
13416
+ for (let i = 0; i < pos.length; i++) {
13417
+ const row = pos[i][0];
13418
+ const col = pos[i][1];
13419
+ for (let r = -2; r <= 2; r++) for (let c = -2; c <= 2; c++) if (r === -2 || r === 2 || c === -2 || c === 2 || r === 0 && c === 0) matrix.set(row + r, col + c, true, true);
13420
+ else matrix.set(row + r, col + c, false, true);
13421
+ }
13422
+ }
13423
+ /**
13424
+ * Add version info bits to matrix
13425
+ *
13426
+ * @param {BitMatrix} matrix Modules matrix
13427
+ * @param {Number} version QR Code version
13428
+ */
13429
+ function setupVersionInfo(matrix, version) {
13430
+ const size = matrix.size;
13431
+ const bits = Version.getEncodedBits(version);
13432
+ let row, col, mod;
13433
+ for (let i = 0; i < 18; i++) {
13434
+ row = Math.floor(i / 3);
13435
+ col = i % 3 + size - 8 - 3;
13436
+ mod = (bits >> i & 1) === 1;
13437
+ matrix.set(row, col, mod, true);
13438
+ matrix.set(col, row, mod, true);
13439
+ }
13440
+ }
13441
+ /**
13442
+ * Add format info bits to matrix
13443
+ *
13444
+ * @param {BitMatrix} matrix Modules matrix
13445
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
13446
+ * @param {Number} maskPattern Mask pattern reference value
13447
+ */
13448
+ function setupFormatInfo(matrix, errorCorrectionLevel, maskPattern) {
13449
+ const size = matrix.size;
13450
+ const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern);
13451
+ let i, mod;
13452
+ for (i = 0; i < 15; i++) {
13453
+ mod = (bits >> i & 1) === 1;
13454
+ if (i < 6) matrix.set(i, 8, mod, true);
13455
+ else if (i < 8) matrix.set(i + 1, 8, mod, true);
13456
+ else matrix.set(size - 15 + i, 8, mod, true);
13457
+ if (i < 8) matrix.set(8, size - i - 1, mod, true);
13458
+ else if (i < 9) matrix.set(8, 15 - i - 1 + 1, mod, true);
13459
+ else matrix.set(8, 15 - i - 1, mod, true);
13460
+ }
13461
+ matrix.set(size - 8, 8, 1, true);
13462
+ }
13463
+ /**
13464
+ * Add encoded data bits to matrix
13465
+ *
13466
+ * @param {BitMatrix} matrix Modules matrix
13467
+ * @param {Uint8Array} data Data codewords
13468
+ */
13469
+ function setupData(matrix, data) {
13470
+ const size = matrix.size;
13471
+ let inc = -1;
13472
+ let row = size - 1;
13473
+ let bitIndex = 7;
13474
+ let byteIndex = 0;
13475
+ for (let col = size - 1; col > 0; col -= 2) {
13476
+ if (col === 6) col--;
13477
+ while (true) {
13478
+ for (let c = 0; c < 2; c++) if (!matrix.isReserved(row, col - c)) {
13479
+ let dark = false;
13480
+ if (byteIndex < data.length) dark = (data[byteIndex] >>> bitIndex & 1) === 1;
13481
+ matrix.set(row, col - c, dark);
13482
+ bitIndex--;
13483
+ if (bitIndex === -1) {
13484
+ byteIndex++;
13485
+ bitIndex = 7;
13486
+ }
13487
+ }
13488
+ row += inc;
13489
+ if (row < 0 || size <= row) {
13490
+ row -= inc;
13491
+ inc = -inc;
13492
+ break;
13493
+ }
13494
+ }
13495
+ }
13496
+ }
13497
+ /**
13498
+ * Create encoded codewords from data input
13499
+ *
13500
+ * @param {Number} version QR Code version
13501
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
13502
+ * @param {ByteData} data Data input
13503
+ * @return {Uint8Array} Buffer containing encoded codewords
13504
+ */
13505
+ function createData(version, errorCorrectionLevel, segments) {
13506
+ const buffer = new BitBuffer();
13507
+ segments.forEach(function(data) {
13508
+ buffer.put(data.mode.bit, 4);
13509
+ buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version));
13510
+ data.write(buffer);
13511
+ });
13512
+ const dataTotalCodewordsBits = (Utils.getSymbolTotalCodewords(version) - ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)) * 8;
13513
+ if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) buffer.put(0, 4);
13514
+ while (buffer.getLengthInBits() % 8 !== 0) buffer.putBit(0);
13515
+ const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8;
13516
+ for (let i = 0; i < remainingByte; i++) buffer.put(i % 2 ? 17 : 236, 8);
13517
+ return createCodewords(buffer, version, errorCorrectionLevel);
13518
+ }
13519
+ /**
13520
+ * Encode input data with Reed-Solomon and return codewords with
13521
+ * relative error correction bits
13522
+ *
13523
+ * @param {BitBuffer} bitBuffer Data to encode
13524
+ * @param {Number} version QR Code version
13525
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
13526
+ * @return {Uint8Array} Buffer containing encoded codewords
13527
+ */
13528
+ function createCodewords(bitBuffer, version, errorCorrectionLevel) {
13529
+ const totalCodewords = Utils.getSymbolTotalCodewords(version);
13530
+ const dataTotalCodewords = totalCodewords - ECCode.getTotalCodewordsCount(version, errorCorrectionLevel);
13531
+ const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel);
13532
+ const blocksInGroup1 = ecTotalBlocks - totalCodewords % ecTotalBlocks;
13533
+ const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks);
13534
+ const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks);
13535
+ const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1;
13536
+ const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1;
13537
+ const rs = new ReedSolomonEncoder(ecCount);
13538
+ let offset = 0;
13539
+ const dcData = new Array(ecTotalBlocks);
13540
+ const ecData = new Array(ecTotalBlocks);
13541
+ let maxDataSize = 0;
13542
+ const buffer = new Uint8Array(bitBuffer.buffer);
13543
+ for (let b = 0; b < ecTotalBlocks; b++) {
13544
+ const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2;
13545
+ dcData[b] = buffer.slice(offset, offset + dataSize);
13546
+ ecData[b] = rs.encode(dcData[b]);
13547
+ offset += dataSize;
13548
+ maxDataSize = Math.max(maxDataSize, dataSize);
13549
+ }
13550
+ const data = new Uint8Array(totalCodewords);
13551
+ let index = 0;
13552
+ let i, r;
13553
+ for (i = 0; i < maxDataSize; i++) for (r = 0; r < ecTotalBlocks; r++) if (i < dcData[r].length) data[index++] = dcData[r][i];
13554
+ for (i = 0; i < ecCount; i++) for (r = 0; r < ecTotalBlocks; r++) data[index++] = ecData[r][i];
13555
+ return data;
13556
+ }
13557
+ /**
13558
+ * Build QR Code symbol
13559
+ *
13560
+ * @param {String} data Input string
13561
+ * @param {Number} version QR Code version
13562
+ * @param {ErrorCorretionLevel} errorCorrectionLevel Error level
13563
+ * @param {MaskPattern} maskPattern Mask pattern
13564
+ * @return {Object} Object containing symbol data
13565
+ */
13566
+ function createSymbol(data, version, errorCorrectionLevel, maskPattern) {
13567
+ let segments;
13568
+ if (Array.isArray(data)) segments = Segments.fromArray(data);
13569
+ else if (typeof data === "string") {
13570
+ let estimatedVersion = version;
13571
+ if (!estimatedVersion) {
13572
+ const rawSegments = Segments.rawSplit(data);
13573
+ estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel);
13574
+ }
13575
+ segments = Segments.fromString(data, estimatedVersion || 40);
13576
+ } else throw new Error("Invalid data");
13577
+ const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel);
13578
+ if (!bestVersion) throw new Error("The amount of data is too big to be stored in a QR Code");
13579
+ if (!version) version = bestVersion;
13580
+ else if (version < bestVersion) throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n");
13581
+ const dataBits = createData(version, errorCorrectionLevel, segments);
13582
+ const modules = new BitMatrix(Utils.getSymbolSize(version));
13583
+ setupFinderPattern(modules, version);
13584
+ setupTimingPattern(modules);
13585
+ setupAlignmentPattern(modules, version);
13586
+ setupFormatInfo(modules, errorCorrectionLevel, 0);
13587
+ if (version >= 7) setupVersionInfo(modules, version);
13588
+ setupData(modules, dataBits);
13589
+ if (isNaN(maskPattern)) maskPattern = MaskPattern.getBestMask(modules, setupFormatInfo.bind(null, modules, errorCorrectionLevel));
13590
+ MaskPattern.applyMask(maskPattern, modules);
13591
+ setupFormatInfo(modules, errorCorrectionLevel, maskPattern);
13592
+ return {
13593
+ modules,
13594
+ version,
13595
+ errorCorrectionLevel,
13596
+ maskPattern,
13597
+ segments
13598
+ };
13599
+ }
13600
+ /**
13601
+ * QR Code
13602
+ *
13603
+ * @param {String | Array} data Input data
13604
+ * @param {Object} options Optional configurations
13605
+ * @param {Number} options.version QR Code version
13606
+ * @param {String} options.errorCorrectionLevel Error correction level
13607
+ * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis
13608
+ */
13609
+ exports.create = function create(data, options) {
13610
+ if (typeof data === "undefined" || data === "") throw new Error("No input text");
13611
+ let errorCorrectionLevel = ECLevel.M;
13612
+ let version;
13613
+ let mask;
13614
+ if (typeof options !== "undefined") {
13615
+ errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M);
13616
+ version = Version.from(options.version);
13617
+ mask = MaskPattern.from(options.maskPattern);
13618
+ if (options.toSJISFunc) Utils.setToSJISFunction(options.toSJISFunc);
13619
+ }
13620
+ return createSymbol(data, version, errorCorrectionLevel, mask);
13621
+ };
13622
+ }));
13623
+ //#endregion
13624
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js
13625
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
13626
+ function hex2rgba(hex) {
13627
+ if (typeof hex === "number") hex = hex.toString();
13628
+ if (typeof hex !== "string") throw new Error("Color should be defined as hex string");
13629
+ let hexCode = hex.slice().replace("#", "").split("");
13630
+ if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) throw new Error("Invalid hex color: " + hex);
13631
+ if (hexCode.length === 3 || hexCode.length === 4) hexCode = Array.prototype.concat.apply([], hexCode.map(function(c) {
13632
+ return [c, c];
13633
+ }));
13634
+ if (hexCode.length === 6) hexCode.push("F", "F");
13635
+ const hexValue = parseInt(hexCode.join(""), 16);
13636
+ return {
13637
+ r: hexValue >> 24 & 255,
13638
+ g: hexValue >> 16 & 255,
13639
+ b: hexValue >> 8 & 255,
13640
+ a: hexValue & 255,
13641
+ hex: "#" + hexCode.slice(0, 6).join("")
13642
+ };
13643
+ }
13644
+ exports.getOptions = function getOptions(options) {
13645
+ if (!options) options = {};
13646
+ if (!options.color) options.color = {};
13647
+ const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin;
13648
+ const width = options.width && options.width >= 21 ? options.width : void 0;
13649
+ const scale = options.scale || 4;
13650
+ return {
13651
+ width,
13652
+ scale: width ? 4 : scale,
13653
+ margin,
13654
+ color: {
13655
+ dark: hex2rgba(options.color.dark || "#000000ff"),
13656
+ light: hex2rgba(options.color.light || "#ffffffff")
13657
+ },
13658
+ type: options.type,
13659
+ rendererOpts: options.rendererOpts || {}
13660
+ };
13661
+ };
13662
+ exports.getScale = function getScale(qrSize, opts) {
13663
+ return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale;
13664
+ };
13665
+ exports.getImageWidth = function getImageWidth(qrSize, opts) {
13666
+ const scale = exports.getScale(qrSize, opts);
13667
+ return Math.floor((qrSize + opts.margin * 2) * scale);
13668
+ };
13669
+ exports.qrToImageData = function qrToImageData(imgData, qr, opts) {
13670
+ const size = qr.modules.size;
13671
+ const data = qr.modules.data;
13672
+ const scale = exports.getScale(size, opts);
13673
+ const symbolSize = Math.floor((size + opts.margin * 2) * scale);
13674
+ const scaledMargin = opts.margin * scale;
13675
+ const palette = [opts.color.light, opts.color.dark];
13676
+ for (let i = 0; i < symbolSize; i++) for (let j = 0; j < symbolSize; j++) {
13677
+ let posDst = (i * symbolSize + j) * 4;
13678
+ let pxColor = opts.color.light;
13679
+ if (i >= scaledMargin && j >= scaledMargin && i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {
13680
+ const iSrc = Math.floor((i - scaledMargin) / scale);
13681
+ const jSrc = Math.floor((j - scaledMargin) / scale);
13682
+ pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0];
13683
+ }
13684
+ imgData[posDst++] = pxColor.r;
13685
+ imgData[posDst++] = pxColor.g;
13686
+ imgData[posDst++] = pxColor.b;
13687
+ imgData[posDst] = pxColor.a;
13688
+ }
13689
+ };
13690
+ }));
13691
+ //#endregion
13692
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js
13693
+ var require_canvas = /* @__PURE__ */ __commonJSMin(((exports) => {
13694
+ var Utils = require_utils();
13695
+ function clearCanvas(ctx, canvas, size) {
13696
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
13697
+ if (!canvas.style) canvas.style = {};
13698
+ canvas.height = size;
13699
+ canvas.width = size;
13700
+ canvas.style.height = size + "px";
13701
+ canvas.style.width = size + "px";
13702
+ }
13703
+ function getCanvasElement() {
13704
+ try {
13705
+ return document.createElement("canvas");
13706
+ } catch (e) {
13707
+ throw new Error("You need to specify a canvas element");
13708
+ }
13709
+ }
13710
+ exports.render = function render(qrData, canvas, options) {
13711
+ let opts = options;
13712
+ let canvasEl = canvas;
13713
+ if (typeof opts === "undefined" && (!canvas || !canvas.getContext)) {
13714
+ opts = canvas;
13715
+ canvas = void 0;
13716
+ }
13717
+ if (!canvas) canvasEl = getCanvasElement();
13718
+ opts = Utils.getOptions(opts);
13719
+ const size = Utils.getImageWidth(qrData.modules.size, opts);
13720
+ const ctx = canvasEl.getContext("2d");
13721
+ const image = ctx.createImageData(size, size);
13722
+ Utils.qrToImageData(image.data, qrData, opts);
13723
+ clearCanvas(ctx, canvasEl, size);
13724
+ ctx.putImageData(image, 0, 0);
13725
+ return canvasEl;
13726
+ };
13727
+ exports.renderToDataURL = function renderToDataURL(qrData, canvas, options) {
13728
+ let opts = options;
13729
+ if (typeof opts === "undefined" && (!canvas || !canvas.getContext)) {
13730
+ opts = canvas;
13731
+ canvas = void 0;
13732
+ }
13733
+ if (!opts) opts = {};
13734
+ const canvasEl = exports.render(qrData, canvas, opts);
13735
+ const type = opts.type || "image/png";
13736
+ const rendererOpts = opts.rendererOpts || {};
13737
+ return canvasEl.toDataURL(type, rendererOpts.quality);
13738
+ };
13739
+ }));
13740
+ //#endregion
13741
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js
13742
+ var require_svg_tag = /* @__PURE__ */ __commonJSMin(((exports) => {
13743
+ var Utils = require_utils();
13744
+ function getColorAttrib(color, attrib) {
13745
+ const alpha = color.a / 255;
13746
+ const str = attrib + "=\"" + color.hex + "\"";
13747
+ return alpha < 1 ? str + " " + attrib + "-opacity=\"" + alpha.toFixed(2).slice(1) + "\"" : str;
13748
+ }
13749
+ function svgCmd(cmd, x, y) {
13750
+ let str = cmd + x;
13751
+ if (typeof y !== "undefined") str += " " + y;
13752
+ return str;
13753
+ }
13754
+ function qrToPath(data, size, margin) {
13755
+ let path = "";
13756
+ let moveBy = 0;
13757
+ let newRow = false;
13758
+ let lineLength = 0;
13759
+ for (let i = 0; i < data.length; i++) {
13760
+ const col = Math.floor(i % size);
13761
+ const row = Math.floor(i / size);
13762
+ if (!col && !newRow) newRow = true;
13763
+ if (data[i]) {
13764
+ lineLength++;
13765
+ if (!(i > 0 && col > 0 && data[i - 1])) {
13766
+ path += newRow ? svgCmd("M", col + margin, .5 + row + margin) : svgCmd("m", moveBy, 0);
13767
+ moveBy = 0;
13768
+ newRow = false;
13769
+ }
13770
+ if (!(col + 1 < size && data[i + 1])) {
13771
+ path += svgCmd("h", lineLength);
13772
+ lineLength = 0;
13773
+ }
13774
+ } else moveBy++;
13775
+ }
13776
+ return path;
13777
+ }
13778
+ exports.render = function render(qrData, options, cb) {
13779
+ const opts = Utils.getOptions(options);
13780
+ const size = qrData.modules.size;
13781
+ const data = qrData.modules.data;
13782
+ const qrcodesize = size + opts.margin * 2;
13783
+ const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + " d=\"M0 0h" + qrcodesize + "v" + qrcodesize + "H0z\"/>";
13784
+ const path = "<path " + getColorAttrib(opts.color.dark, "stroke") + " d=\"" + qrToPath(data, size, opts.margin) + "\"/>";
13785
+ const viewBox = "viewBox=\"0 0 " + qrcodesize + " " + qrcodesize + "\"";
13786
+ const svgTag = "<svg xmlns=\"http://www.w3.org/2000/svg\" " + (!opts.width ? "" : "width=\"" + opts.width + "\" height=\"" + opts.width + "\" ") + viewBox + " shape-rendering=\"crispEdges\">" + bg + path + "</svg>\n";
13787
+ if (typeof cb === "function") cb(null, svgTag);
13788
+ return svgTag;
13789
+ };
13790
+ }));
13791
+ //#endregion
13792
+ //#region components/spin/index.tsx
13793
+ var import_browser = (/* @__PURE__ */ __commonJSMin(((exports) => {
13794
+ var canPromise = require_can_promise();
13795
+ var QRCode = require_qrcode();
13796
+ var CanvasRenderer = require_canvas();
13797
+ var SvgRenderer = require_svg_tag();
13798
+ function renderCanvas(renderFunc, canvas, text, opts, cb) {
13799
+ const args = [].slice.call(arguments, 1);
13800
+ const argsNum = args.length;
13801
+ const isLastArgCb = typeof args[argsNum - 1] === "function";
13802
+ if (!isLastArgCb && !canPromise()) throw new Error("Callback required as last argument");
13803
+ if (isLastArgCb) {
13804
+ if (argsNum < 2) throw new Error("Too few arguments provided");
13805
+ if (argsNum === 2) {
13806
+ cb = text;
13807
+ text = canvas;
13808
+ canvas = opts = void 0;
13809
+ } else if (argsNum === 3) if (canvas.getContext && typeof cb === "undefined") {
13810
+ cb = opts;
13811
+ opts = void 0;
13812
+ } else {
13813
+ cb = opts;
13814
+ opts = text;
13815
+ text = canvas;
13816
+ canvas = void 0;
13817
+ }
13818
+ } else {
13819
+ if (argsNum < 1) throw new Error("Too few arguments provided");
13820
+ if (argsNum === 1) {
13821
+ text = canvas;
13822
+ canvas = opts = void 0;
13823
+ } else if (argsNum === 2 && !canvas.getContext) {
13824
+ opts = text;
13825
+ text = canvas;
13826
+ canvas = void 0;
13827
+ }
13828
+ return new Promise(function(resolve, reject) {
13829
+ try {
13830
+ resolve(renderFunc(QRCode.create(text, opts), canvas, opts));
13831
+ } catch (e) {
13832
+ reject(e);
13833
+ }
13834
+ });
13835
+ }
13836
+ try {
13837
+ const data = QRCode.create(text, opts);
13838
+ cb(null, renderFunc(data, canvas, opts));
13839
+ } catch (e) {
13840
+ cb(e);
13841
+ }
13842
+ }
13843
+ exports.create = QRCode.create;
13844
+ exports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render);
13845
+ exports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL);
13846
+ exports.toString = renderCanvas.bind(null, function(data, _, opts) {
13847
+ return SvgRenderer.render(data, opts);
13848
+ });
13849
+ })))();
13850
+ var Spin = /* @__PURE__ */ defineComponent({
13851
+ name: "Spin",
13852
+ props: {
13853
+ modelValue: {
13854
+ type: Boolean,
13855
+ default: true
13856
+ },
13857
+ delay: {
13858
+ type: Number,
13859
+ default: 500
13860
+ },
13861
+ size: { type: String },
13862
+ mode: {
13863
+ type: String,
13864
+ default: "rotate"
13865
+ }
13866
+ },
13867
+ setup(props, { slots }) {
13868
+ const spinning = ref(props.modelValue);
13869
+ let timer;
13870
+ watch(() => props.modelValue, (nv) => {
13871
+ if (nv) spinning.value = nv;
13872
+ else {
13873
+ clearTimeout(timer);
13874
+ timer = setTimeout(() => {
13875
+ spinning.value = nv;
13876
+ }, props.delay);
13877
+ }
13878
+ });
13879
+ return () => {
13880
+ let { mode, size } = props;
13881
+ const classes = [{
13882
+ [`k-spin-loading`]: spinning.value,
13883
+ [`k-spin-${mode}`]: mode && spinning.value
13884
+ }];
13885
+ const children = slots.default?.();
13886
+ const root = ["k-spin", {
13887
+ [`k-spin-lg`]: size == "large",
13888
+ [`k-spin-sm`]: size == "small",
13889
+ [`k-spin-only`]: children == null
13890
+ }];
13891
+ const spin = createVNode("div", { "class": classes }, null);
13892
+ return createVNode("div", { "class": root }, [[spin, children]]);
13893
+ };
13894
+ }
13895
+ });
13896
+ //#endregion
13897
+ //#region components/qrcode/index.tsx
13898
+ var QRCode = /* @__PURE__ */ defineComponent({
13899
+ name: "QRCode",
13900
+ props: {
13901
+ value: {
13902
+ type: String,
13903
+ required: true
13904
+ },
13905
+ size: {
13906
+ type: Number,
13907
+ default: 160
13908
+ },
13909
+ colorDark: {
13910
+ type: String,
13911
+ default: "var(--kui-color-reverse)"
13912
+ },
13913
+ colorLight: {
13914
+ type: String,
13915
+ default: "var(--kui-color-bg)"
13916
+ },
13917
+ bordered: {
13918
+ type: Boolean,
13919
+ default: true
13920
+ },
13921
+ status: {
13922
+ type: String,
13923
+ default: "active"
13924
+ },
13925
+ logo: {
13926
+ type: String,
13927
+ default: ""
13928
+ },
13929
+ logoSize: { type: Number },
13930
+ margin: {
13931
+ type: Number,
13932
+ default: 0
13933
+ },
13934
+ logoRadius: {
13935
+ type: Number,
13936
+ default: 4
13937
+ },
13938
+ logoBorder: {
13939
+ type: Boolean,
13940
+ default: true
13941
+ },
13942
+ errorLevel: {
13943
+ type: String,
13944
+ default: "M"
13945
+ }
13946
+ },
13947
+ emits: ["refresh"],
13948
+ setup(props, { emit, slots, expose }) {
13949
+ const canvasRef = ref(null);
13950
+ let rootObserver = null;
13951
+ const injectedLocale = inject("locale", zh_CN_default);
13952
+ const locale = computed(() => {
13953
+ return injectedLocale instanceof Object && "value" in injectedLocale ? injectedLocale.value : injectedLocale;
13954
+ });
13955
+ const initThemeObserver = () => {
13956
+ const rootEl = document.documentElement;
13957
+ rootObserver = new MutationObserver((mutations) => {
13958
+ for (const mutation of mutations) if (mutation.type === "attributes" && mutation.attributeName === "theme-mode") {
13959
+ drawQRCode();
13960
+ break;
13961
+ }
13962
+ });
13963
+ rootObserver.observe(rootEl, {
13964
+ attributes: true,
13965
+ attributeFilter: ["theme-mode"]
13966
+ });
13967
+ };
13968
+ const parseCssVariable = (colorStr) => {
13969
+ if (colorStr.trim().startsWith("var(")) {
13970
+ const tempDiv = document.createElement("div");
13971
+ tempDiv.style.color = colorStr;
13972
+ document.body.appendChild(tempDiv);
13973
+ let computedColor = window.getComputedStyle(tempDiv).color;
13974
+ computedColor = Color(computedColor).hex();
13975
+ document.body.removeChild(tempDiv);
13976
+ return computedColor || "#000000";
13977
+ }
13978
+ return colorStr;
13979
+ };
13980
+ const drawQRCode = async () => {
13981
+ if (!canvasRef.value) return;
13982
+ const canvas = canvasRef.value;
13983
+ const ctx = canvas.getContext("2d");
13984
+ if (!ctx) return;
13985
+ const { size, value, logo, logoRadius, logoBorder, errorLevel } = props;
13986
+ const ratio = window.devicePixelRatio || 1;
13987
+ canvas.width = size * ratio;
13988
+ canvas.height = size * ratio;
13989
+ ctx.scale(ratio, ratio);
13990
+ try {
13991
+ const realDark = parseCssVariable(props.colorDark);
13992
+ const realLight = parseCssVariable(props.colorLight);
13993
+ const options = {
13994
+ width: size,
13995
+ margin: props.margin,
13996
+ color: {
13997
+ dark: realDark,
13998
+ light: realLight
13999
+ },
14000
+ errorCorrectionLevel: errorLevel
14001
+ };
14002
+ const memCanvas = document.createElement("canvas");
14003
+ await (0, import_browser.toCanvas)(memCanvas, value || " ", options);
14004
+ ctx.drawImage(memCanvas, 0, 0, size, size);
14005
+ if (logo) {
14006
+ const img = new Image();
14007
+ img.crossOrigin = "anonymous";
14008
+ img.src = logo;
14009
+ img.onload = () => {
14010
+ const computedLogoSize = props.logoSize || size * .22;
14011
+ const x = (size - computedLogoSize) / 2;
14012
+ const y = (size - computedLogoSize) / 2;
14013
+ ctx.save();
14014
+ if (logoBorder) {
14015
+ ctx.fillStyle = realLight;
14016
+ const borderSize = computedLogoSize + 6;
14017
+ const bx = (size - borderSize) / 2;
14018
+ const by = (size - borderSize) / 2;
14019
+ ctx.beginPath();
14020
+ ctx.roundRect(bx, by, borderSize, borderSize, logoRadius + 2);
14021
+ ctx.fill();
14022
+ }
14023
+ ctx.beginPath();
14024
+ ctx.roundRect(x, y, computedLogoSize, computedLogoSize, logoRadius);
14025
+ ctx.clip();
14026
+ ctx.drawImage(img, x, y, computedLogoSize, computedLogoSize);
14027
+ ctx.restore();
14028
+ };
14029
+ }
14030
+ } catch (err) {
14031
+ console.error("二维码生成失败: ", err);
14032
+ }
14033
+ };
14034
+ const download = (fileName = "qrcode.png") => {
14035
+ if (!canvasRef.value) return;
14036
+ const url = canvasRef.value.toDataURL("image/png");
14037
+ const a = document.createElement("a");
14038
+ a.download = fileName;
14039
+ a.href = url;
14040
+ a.click();
14041
+ };
14042
+ watch(() => [
14043
+ props.value,
14044
+ props.size,
14045
+ props.colorDark,
14046
+ props.colorLight,
14047
+ props.logo,
14048
+ props.status,
14049
+ props.margin,
14050
+ props.errorLevel
14051
+ ], () => {
14052
+ if (props.status === "active") drawQRCode();
14053
+ }, { deep: true });
14054
+ expose({ download });
14055
+ onMounted(() => {
14056
+ drawQRCode();
14057
+ initThemeObserver();
14058
+ });
14059
+ onBeforeUnmount(() => {
14060
+ if (rootObserver) rootObserver.disconnect();
14061
+ });
14062
+ const renderMask = () => {
14063
+ if (props.status === "active") return null;
14064
+ return createVNode("div", { "class": "k-qrcode-mask" }, [
14065
+ props.status === "loading" && createVNode("div", { "class": "k-qrcode-loading-wrapper" }, [slots.loading ? slots.loading() : [createVNode(Spin, { "size": "small" }, null), createVNode("span", null, [locale.value?.k.qrcode.loading])]]),
14066
+ props.status === "expired" && createVNode("div", {
14067
+ "class": "k-qrcode-expired-wrapper",
14068
+ "onClick": () => emit("refresh")
14069
+ }, [slots.expired ? slots.expired() : createVNode(Fragment, null, [createVNode("div", { "class": "k-qrcode-expired" }, [locale.value?.k.qrcode.expired]), createVNode(Button, {
14070
+ "size": "small",
14071
+ "type": "text"
14072
+ }, { default: () => [locale.value?.k.qrcode.refresh] })])]),
14073
+ props.status === "scanned" && createVNode("div", { "class": "k-qrcode-scanned-wrapper" }, [slots.scanned ? slots.scanned() : createVNode(Fragment, null, [locale.value?.k.qrcode.scanned])])
14074
+ ]);
14075
+ };
14076
+ return () => {
14077
+ return createVNode("div", {
14078
+ "style": {
14079
+ width: `${props.size}px`,
14080
+ height: `${props.size}px`
14081
+ },
14082
+ "class": ["k-qrcode", { "k-qrcode-borderless": props.bordered === false }]
14083
+ }, [createVNode("canvas", {
14084
+ "ref": canvasRef,
14085
+ "style": {
14086
+ width: `${props.size}px`,
14087
+ height: `${props.size}px`,
14088
+ display: "block"
14089
+ }
14090
+ }, null), renderMask()]);
14091
+ };
14092
+ }
14093
+ });
14094
+ //#endregion
14095
+ //#region components/radio/radio.tsx
14096
+ var Radio = /* @__PURE__ */ defineComponent({
14097
+ name: "Radio",
14098
+ props: {
14099
+ modelValue: {
14100
+ type: [
14101
+ Boolean,
14102
+ String,
14103
+ Number
14104
+ ],
14105
+ default: false
14106
+ },
14107
+ value: { type: [
14108
+ String,
14109
+ Number,
14110
+ Boolean
14111
+ ] },
14112
+ label: { type: String },
14113
+ checked: Boolean,
14114
+ disabled: Boolean,
14115
+ theme: {
14116
+ type: String,
14117
+ default: "fill"
14118
+ },
14119
+ size: { type: String },
14120
+ onChange: Function
14121
+ },
14122
+ setup(props, { slots, emit }) {
14123
+ const isChecked = ref(props.modelValue || props.checked);
14124
+ watch(() => props.modelValue, (v) => {
14125
+ isChecked.value = v;
14126
+ });
14127
+ watch(() => props.checked, (v) => {
14128
+ isChecked.value = v;
14129
+ });
14130
+ const emitValue = (checked) => {
14131
+ isChecked.value = checked;
14132
+ emit("change", {
14133
+ checked,
14134
+ value: props.value,
14135
+ label: props.label || slots.default?.()
14136
+ });
14137
+ emit("update:modelValue", checked);
14138
+ emit("update:checked", checked);
14139
+ };
14140
+ const onChange = (e) => {
14141
+ if (props.disabled || isChecked.value) return;
14142
+ e.stopPropagation();
14143
+ e.preventDefault();
14144
+ const checked = e.target.checked;
14145
+ emitValue(checked);
14146
+ };
14147
+ const triggerCheck = (e) => {
14148
+ if (e.code == "Space") {
14149
+ e.preventDefault();
14150
+ e.stopPropagation();
14151
+ if (props.disabled || isChecked.value) return;
14152
+ emitValue(!isChecked.value);
14153
+ }
14154
+ };
14155
+ return () => {
14156
+ const classes = ["k-radio", {
14157
+ ["k-radio-fill"]: props.theme == "fill",
14158
+ ["k-radio-disabled"]: props.disabled,
14159
+ ["k-radio-checked"]: isChecked.value,
14160
+ ["k-radio-lg"]: props.size === "large",
14161
+ ["k-radio-sm"]: props.size === "small"
14162
+ }];
14163
+ const labelNode = props.label || slots.default?.();
14164
+ return createVNode("label", {
14165
+ "class": classes,
14166
+ "tabindex": props.disabled ? void 0 : 0,
14167
+ "onKeydown": triggerCheck
14168
+ }, [createVNode("span", { "class": "k-radio-symbol" }, [createVNode("input", {
14169
+ "type": "radio",
14170
+ "tabindex": "-1",
14171
+ "class": "k-radio-input",
14172
+ "disabled": props.disabled,
14173
+ "onChange": onChange,
14174
+ "checked": isChecked.value
14175
+ }, null)]), labelNode ? createVNode("span", { "class": "k-radio-label" }, [labelNode]) : null]);
14176
+ };
14177
+ }
14178
+ });
14179
+ //#endregion
14180
+ //#region components/radio/radio-button.tsx
14181
+ function _isSlot$2(s) {
14182
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
14183
+ }
14184
+ var RadioButton = /* @__PURE__ */ defineComponent({
14185
+ name: "RadioButton",
14186
+ props: {
14187
+ modelValue: {
14188
+ type: [Boolean],
14189
+ default: false
14190
+ },
14191
+ label: { type: String },
14192
+ value: { type: [String, Number] },
14193
+ theme: String,
14194
+ disabled: Boolean,
14195
+ checked: Boolean,
14196
+ icon: Array,
14197
+ size: { type: String },
14198
+ shape: { type: String },
14199
+ onChange: Function
14200
+ },
14201
+ setup(props, { slots, emit, attrs }) {
11418
14202
  const isChecked = ref(props.modelValue || props.checked);
11419
14203
  watch(() => props.modelValue, (v) => {
11420
14204
  isChecked.value = v;
@@ -11449,6 +14233,8 @@ var RadioButton = /* @__PURE__ */ defineComponent({
11449
14233
  };
11450
14234
  }
11451
14235
  });
14236
+ //#endregion
14237
+ //#region components/radio/radio-group.tsx
11452
14238
  var RadioGroup = /* @__PURE__ */ defineComponent({
11453
14239
  name: "RadioGroup",
11454
14240
  props: {
@@ -11645,6 +14431,8 @@ var star_default = /* @__PURE__ */ defineComponent({
11645
14431
  };
11646
14432
  }
11647
14433
  });
14434
+ //#endregion
14435
+ //#region components/rate/index.tsx
11648
14436
  var Rate = /* @__PURE__ */ defineComponent({
11649
14437
  name: "Rate",
11650
14438
  props: {
@@ -11685,8 +14473,10 @@ var Rate = /* @__PURE__ */ defineComponent({
11685
14473
  const update = (t, index, percent) => {
11686
14474
  if (t === "M") {
11687
14475
  if (cleared.value) return;
11688
- if (props.allowHalf) tempValue.value = index - (percent < .5 ? .5 : 0);
11689
- else tempValue.value = index;
14476
+ if (props.allowHalf) {
14477
+ const value = index - (percent < .5 ? .5 : 0);
14478
+ tempValue.value = value;
14479
+ } else tempValue.value = index;
11690
14480
  } else {
11691
14481
  let value = index - (props.allowHalf ? percent < .5 ? .5 : 0 : 0);
11692
14482
  value = parseFloat(value.toFixed(2));
@@ -12438,6 +15228,8 @@ var CountUpNumber = /* @__PURE__ */ defineComponent({
12438
15228
  }, null);
12439
15229
  }
12440
15230
  });
15231
+ //#endregion
15232
+ //#region components/stat-card/stat-number.tsx
12441
15233
  var StatNumber = /* @__PURE__ */ defineComponent({
12442
15234
  name: "StatNumber",
12443
15235
  props: {
@@ -12491,6 +15283,8 @@ var StatNumber = /* @__PURE__ */ defineComponent({
12491
15283
  };
12492
15284
  }
12493
15285
  });
15286
+ //#endregion
15287
+ //#region components/stat-card/stat-card.tsx
12494
15288
  var StatCard = /* @__PURE__ */ defineComponent({
12495
15289
  name: "StatCard",
12496
15290
  props: {
@@ -12532,6 +15326,8 @@ var StatCard = /* @__PURE__ */ defineComponent({
12532
15326
  };
12533
15327
  }
12534
15328
  });
15329
+ //#endregion
15330
+ //#region components/space/index.tsx
12535
15331
  var Space = /* @__PURE__ */ defineComponent({
12536
15332
  name: "Space",
12537
15333
  props: {
@@ -12597,117 +15393,197 @@ var Space = /* @__PURE__ */ defineComponent({
12597
15393
  };
12598
15394
  }
12599
15395
  });
12600
- var Spin = /* @__PURE__ */ defineComponent({
12601
- name: "Spin",
15396
+ //#endregion
15397
+ //#region components/switch/index.tsx
15398
+ var Switch = /* @__PURE__ */ defineComponent({
15399
+ name: "KSwitch",
12602
15400
  props: {
12603
- modelValue: {
15401
+ checked: {
12604
15402
  type: Boolean,
12605
- default: true
15403
+ default: false
12606
15404
  },
12607
- delay: {
12608
- type: Number,
12609
- default: 500
15405
+ valueType: {
15406
+ type: String,
15407
+ default: "boolean"
12610
15408
  },
15409
+ modelValue: { type: [
15410
+ String,
15411
+ Number,
15412
+ Boolean
15413
+ ] },
15414
+ type: String,
15415
+ disabled: Boolean,
15416
+ loading: Boolean,
12611
15417
  size: { type: String },
12612
- mode: {
12613
- type: String,
12614
- default: "rotate"
12615
- }
15418
+ trueText: String,
15419
+ falseText: String,
15420
+ onChange: Function
12616
15421
  },
12617
- setup(props, { slots }) {
12618
- const spinning = ref(props.modelValue);
12619
- let timer;
15422
+ setup(props, { slots, emit }) {
15423
+ const isChecked = ref(props.modelValue || props.checked);
12620
15424
  watch(() => props.modelValue, (nv) => {
12621
- if (nv) spinning.value = nv;
12622
- else {
12623
- clearTimeout(timer);
12624
- timer = setTimeout(() => {
12625
- spinning.value = nv;
12626
- }, props.delay);
12627
- }
15425
+ isChecked.value = nv == 1;
15426
+ });
15427
+ watch(() => props.checked, (nv) => {
15428
+ isChecked.value = nv;
12628
15429
  });
15430
+ const change = () => {
15431
+ if (props.disabled) return false;
15432
+ const checked = !isChecked.value;
15433
+ isChecked.value = checked;
15434
+ const value = getValueWithType(checked, props.valueType);
15435
+ emit("update:modelValue", value);
15436
+ emit("update:checked", checked);
15437
+ emit("change", value);
15438
+ };
12629
15439
  return () => {
12630
- let { mode, size } = props;
12631
- const classes = [{
12632
- [`k-spin-loading`]: spinning.value,
12633
- [`k-spin-${mode}`]: mode && spinning.value
12634
- }];
12635
- const children = slots.default?.();
12636
- const root = ["k-spin", {
12637
- [`k-spin-lg`]: size == "large",
12638
- [`k-spin-sm`]: size == "small",
12639
- [`k-spin-only`]: children == null
15440
+ const { type, trueText, falseText, disabled, loading, size } = props;
15441
+ const classes = ["k-switch", {
15442
+ ["k-switch-checked"]: isChecked.value,
15443
+ ["k-switch-disabled"]: disabled || loading,
15444
+ [`k-switch-${type}`]: !!type,
15445
+ ["k-switch-sm"]: props.size == "small"
12640
15446
  }];
12641
- const spin = createVNode("div", { "class": classes }, null);
12642
- return createVNode("div", { "class": root }, [[spin, children]]);
15447
+ const children = slots.checked?.() || trueText || slots.unchecked?.() || falseText;
15448
+ const loadNode = loading ? createVNode(Icon, {
15449
+ "spin": true,
15450
+ "type": Loading,
15451
+ "class": "k-switch-loading"
15452
+ }, null) : null;
15453
+ const textNode = size != "small" && children ? createVNode("span", { "class": "k-switch-inner" }, [isChecked.value ? slots.checked?.() || trueText : slots.unchecked?.() || falseText]) : null;
15454
+ return createVNode("button", {
15455
+ "class": classes,
15456
+ "onClick": change,
15457
+ "disabled": disabled || loading,
15458
+ "type": "button"
15459
+ }, [textNode, loadNode]);
15460
+ };
15461
+ }
15462
+ });
15463
+ var Splitter = /* @__PURE__ */ defineComponent({
15464
+ name: "Splitter",
15465
+ props: {
15466
+ direction: {
15467
+ type: String,
15468
+ default: "horizontal"
15469
+ },
15470
+ onResize: Function,
15471
+ onResizeEnd: Function,
15472
+ onResizeStart: Function
15473
+ },
15474
+ setup(props, { slots, emit }) {
15475
+ const containerRef = ref(null);
15476
+ const isDragging = ref(false);
15477
+ const activeResizerIndex = ref(null);
15478
+ const panelSizes = ref([]);
15479
+ const minSizes = ref([]);
15480
+ const maxSizes = ref([]);
15481
+ const parseToPx = (val, total) => {
15482
+ if (val === void 0 || val === null || val === "") return null;
15483
+ const s = String(val).trim();
15484
+ if (s.endsWith("%")) return parseFloat(s) / 100 * total;
15485
+ if (s.endsWith("px")) return parseFloat(s);
15486
+ if (!isNaN(Number(s))) return parseFloat(s) / 100 * total;
15487
+ return null;
15488
+ };
15489
+ const initSizes = () => {
15490
+ if (!containerRef.value) return;
15491
+ const rect = containerRef.value.getBoundingClientRect();
15492
+ const children = slots.default?.() || [];
15493
+ const totalSize = (props.direction === "horizontal" ? rect.width : rect.height) - (children.length - 1) * 4;
15494
+ minSizes.value = children.map((c) => parseToPx(c.props?.min, totalSize) ?? 0);
15495
+ maxSizes.value = children.map((c) => parseToPx(c.props?.max, totalSize) ?? totalSize);
15496
+ const rawSizes = children.map((c) => parseToPx(c.props?.size, totalSize));
15497
+ const definedSum = rawSizes.reduce((acc, s) => (acc ?? 0) + (s ?? 0), 0) || 0;
15498
+ const undefinedCount = rawSizes.filter((s) => s === null).length;
15499
+ const spare = Math.max(0, totalSize - definedSum);
15500
+ const autoSize = undefinedCount > 0 ? spare / undefinedCount : 0;
15501
+ panelSizes.value = rawSizes.map((s) => s ?? autoSize);
15502
+ };
15503
+ const onMouseDown = (index) => {
15504
+ isDragging.value = true;
15505
+ activeResizerIndex.value = index;
15506
+ document.addEventListener("mousemove", onMouseMove);
15507
+ document.addEventListener("mouseup", onMouseUp);
15508
+ document.body.style.cursor = props.direction === "horizontal" ? "col-resize" : "row-resize";
15509
+ document.body.classList.add("k-splitter-dragging");
15510
+ emitSize("resizeStart");
15511
+ };
15512
+ const emitSize = (type) => {
15513
+ emit(type, panelSizes.value.map((x) => parseFloat(x.toFixed(3))));
15514
+ };
15515
+ const onMouseMove = (e) => {
15516
+ if (!isDragging.value || activeResizerIndex.value === null || !containerRef.value) return;
15517
+ const rect = containerRef.value.getBoundingClientRect();
15518
+ const idx = activeResizerIndex.value;
15519
+ const children = slots.default?.() || [];
15520
+ const resizerWidth = 4;
15521
+ const totalResizersWidth = (children.length - 1) * resizerWidth;
15522
+ const totalAvailableSize = (props.direction === "horizontal" ? rect.width : rect.height) - totalResizersWidth;
15523
+ const resizersBefore = idx * resizerWidth;
15524
+ let currentPos = (props.direction === "horizontal" ? e.clientX - rect.left : e.clientY - rect.top) - resizersBefore;
15525
+ currentPos = Math.max(0, Math.min(totalAvailableSize, currentPos));
15526
+ const pairTotal = panelSizes.value[idx] + panelSizes.value[idx + 1];
15527
+ const offset = panelSizes.value.slice(0, idx).reduce((a, b) => a + b, 0);
15528
+ let newSizeIdx = currentPos - offset;
15529
+ newSizeIdx = Math.max(minSizes.value[idx], Math.min(maxSizes.value[idx], newSizeIdx));
15530
+ const maxAllowed = pairTotal - minSizes.value[idx + 1];
15531
+ newSizeIdx = Math.min(newSizeIdx, maxAllowed);
15532
+ panelSizes.value[idx] = newSizeIdx;
15533
+ panelSizes.value[idx + 1] = pairTotal - newSizeIdx;
15534
+ emitSize("resize");
15535
+ };
15536
+ const onMouseUp = () => {
15537
+ isDragging.value = false;
15538
+ activeResizerIndex.value = null;
15539
+ document.removeEventListener("mousemove", onMouseMove);
15540
+ document.removeEventListener("mouseup", onMouseUp);
15541
+ document.body.style.cursor = "";
15542
+ document.body.classList.remove("k-splitter-dragging");
15543
+ emitSize("resizeEnd");
15544
+ };
15545
+ let ob = null;
15546
+ onMounted(() => {
15547
+ initSizes();
15548
+ ob = new ResizeObserver(() => initSizes());
15549
+ if (containerRef.value) ob.observe(containerRef.value);
15550
+ });
15551
+ onUnmounted(() => ob?.disconnect());
15552
+ return () => {
15553
+ const children = slots.default?.() || [];
15554
+ return createVNode("div", {
15555
+ "ref": containerRef,
15556
+ "class": ["k-splitter", `is-${props.direction}`]
15557
+ }, [children.map((child, index) => {
15558
+ const isLast = index === children.length - 1;
15559
+ return createVNode(Fragment, null, [createVNode("div", {
15560
+ "class": "k-splitter-item",
15561
+ "style": {
15562
+ flexBasis: `${panelSizes.value[index]}px`,
15563
+ flexGrow: 0,
15564
+ flexShrink: 0
15565
+ }
15566
+ }, [child]), !isLast && createVNode("div", {
15567
+ "class": "k-splitter-resizer",
15568
+ "onMousedown": () => onMouseDown(index)
15569
+ }, null)]);
15570
+ })]);
12643
15571
  };
12644
15572
  }
12645
15573
  });
12646
- var Switch = /* @__PURE__ */ defineComponent({
12647
- name: "KSwitch",
15574
+ var SplitterPanel = /* @__PURE__ */ defineComponent({
15575
+ name: "SplitterPanel",
12648
15576
  props: {
12649
- checked: {
12650
- type: Boolean,
12651
- default: false
12652
- },
12653
- valueType: {
12654
- type: String,
12655
- default: "boolean"
12656
- },
12657
- modelValue: { type: [
12658
- String,
12659
- Number,
12660
- Boolean
12661
- ] },
12662
- type: String,
12663
- disabled: Boolean,
12664
- loading: Boolean,
12665
- size: { type: String },
12666
- trueText: String,
12667
- falseText: String,
12668
- onChange: Function
15577
+ size: { type: [Number, String] },
15578
+ min: { type: [Number, String] },
15579
+ max: { type: [Number, String] }
12669
15580
  },
12670
- setup(props, { slots, emit }) {
12671
- const isChecked = ref(props.modelValue || props.checked);
12672
- watch(() => props.modelValue, (nv) => {
12673
- isChecked.value = nv == 1;
12674
- });
12675
- watch(() => props.checked, (nv) => {
12676
- isChecked.value = nv;
12677
- });
12678
- const change = () => {
12679
- if (props.disabled) return false;
12680
- const checked = !isChecked.value;
12681
- isChecked.value = checked;
12682
- const value = getValueWithType(checked, props.valueType);
12683
- emit("update:modelValue", value);
12684
- emit("update:checked", checked);
12685
- emit("change", value);
12686
- };
12687
- return () => {
12688
- const { type, trueText, falseText, disabled, loading, size } = props;
12689
- const classes = ["k-switch", {
12690
- ["k-switch-checked"]: isChecked.value,
12691
- ["k-switch-disabled"]: disabled || loading,
12692
- [`k-switch-${type}`]: !!type,
12693
- ["k-switch-sm"]: props.size == "small"
12694
- }];
12695
- const children = slots.checked?.() || trueText || slots.unchecked?.() || falseText;
12696
- const loadNode = loading ? createVNode(Icon, {
12697
- "spin": true,
12698
- "type": Loading,
12699
- "class": "k-switch-loading"
12700
- }, null) : null;
12701
- const textNode = size != "small" && children ? createVNode("span", { "class": "k-switch-inner" }, [isChecked.value ? slots.checked?.() || trueText : slots.unchecked?.() || falseText]) : null;
12702
- return createVNode("button", {
12703
- "class": classes,
12704
- "onClick": change,
12705
- "disabled": disabled || loading,
12706
- "type": "button"
12707
- }, [textNode, loadNode]);
12708
- };
15581
+ setup(_, { slots }) {
15582
+ return () => createVNode("div", { "class": "k-splitter-panel" }, [slots.default?.()]);
12709
15583
  }
12710
15584
  });
15585
+ //#endregion
15586
+ //#region components/table/index.tsx
12711
15587
  var Table = /* @__PURE__ */ defineComponent({
12712
15588
  name: "Table",
12713
15589
  props: {
@@ -13114,6 +15990,8 @@ var Table = /* @__PURE__ */ defineComponent({
13114
15990
  };
13115
15991
  }
13116
15992
  });
15993
+ //#endregion
15994
+ //#region components/tabs/tab-panel.tsx
13117
15995
  var TabPanel = /* @__PURE__ */ defineComponent({
13118
15996
  name: "TabPanel",
13119
15997
  props: {
@@ -13133,6 +16011,8 @@ var TabPanel = /* @__PURE__ */ defineComponent({
13133
16011
  };
13134
16012
  }
13135
16013
  });
16014
+ //#endregion
16015
+ //#region components/tabs/tabs.tsx
13136
16016
  var Tabs = /* @__PURE__ */ defineComponent({
13137
16017
  name: "Tabs",
13138
16018
  props: {
@@ -13238,7 +16118,8 @@ var Tabs = /* @__PURE__ */ defineComponent({
13238
16118
  };
13239
16119
  const updateIndex = () => {
13240
16120
  nextTick(() => {
13241
- currentIndex.value = getChildren(slots.default?.())?.map((p) => p.key).indexOf(defaultActiveKey.value);
16121
+ const nodes = getChildren(slots.default?.());
16122
+ currentIndex.value = nodes?.map((p) => p.key).indexOf(defaultActiveKey.value);
13242
16123
  resetActivePosition();
13243
16124
  updateInkBarPosition();
13244
16125
  });
@@ -13329,6 +16210,8 @@ var Tabs = /* @__PURE__ */ defineComponent({
13329
16210
  };
13330
16211
  }
13331
16212
  });
16213
+ //#endregion
16214
+ //#region components/time-line/timeline.tsx
13332
16215
  var TimeLine = /* @__PURE__ */ defineComponent({
13333
16216
  name: "TimeLine",
13334
16217
  props: { mode: {
@@ -13349,6 +16232,8 @@ var TimeLine = /* @__PURE__ */ defineComponent({
13349
16232
  };
13350
16233
  }
13351
16234
  });
16235
+ //#endregion
16236
+ //#region components/time-line/timeline-item.tsx
13352
16237
  var TimeLineItem = /* @__PURE__ */ defineComponent({
13353
16238
  name: "TimeLineItem",
13354
16239
  props: {
@@ -13916,6 +16801,8 @@ var Tree = /* @__PURE__ */ defineComponent({
13916
16801
  };
13917
16802
  }
13918
16803
  });
16804
+ //#endregion
16805
+ //#region components/tree-select/index.tsx
13919
16806
  var TreeSelect = /* @__PURE__ */ defineComponent({
13920
16807
  name: "TreeSelect",
13921
16808
  directives: {
@@ -14128,13 +17015,17 @@ var TreeSelect = /* @__PURE__ */ defineComponent({
14128
17015
  document.addEventListener("click", outsideClick);
14129
17016
  nextTick(() => {
14130
17017
  openChange(true);
14131
- updatePosition();
14132
- showQuery();
17018
+ nextTick(() => {
17019
+ updatePosition();
17020
+ showQuery();
17021
+ });
14133
17022
  });
14134
17023
  } else {
14135
17024
  openChange(show || !visible.value);
14136
17025
  if (visible.value) {
14137
- updatePosition();
17026
+ nextTick(() => {
17027
+ updatePosition();
17028
+ });
14138
17029
  showQuery();
14139
17030
  } else clearQuery();
14140
17031
  }
@@ -14356,6 +17247,8 @@ var TreeSelect = /* @__PURE__ */ defineComponent({
14356
17247
  };
14357
17248
  }
14358
17249
  });
17250
+ //#endregion
17251
+ //#region components/tag/index.tsx
14359
17252
  var Tag = /* @__PURE__ */ defineComponent({
14360
17253
  name: "Tag",
14361
17254
  props: {
@@ -14421,20 +17314,20 @@ var Tag = /* @__PURE__ */ defineComponent({
14421
17314
  }
14422
17315
  });
14423
17316
  //#endregion
14424
- //#region node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/stringify.js
17317
+ //#region node_modules/.pnpm/uuid@14.0.1/node_modules/uuid/dist/stringify.js
14425
17318
  var byteToHex = [];
14426
17319
  for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
14427
17320
  function unsafeStringify(arr, offset = 0) {
14428
17321
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
14429
17322
  }
14430
17323
  //#endregion
14431
- //#region node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/rng.js
14432
- var rnds8 = new Uint8Array(16);
17324
+ //#region node_modules/.pnpm/uuid@14.0.1/node_modules/uuid/dist/rng.js
17325
+ var rnds8 = /* @__PURE__ */ new Uint8Array(16);
14433
17326
  function rng() {
14434
17327
  return crypto.getRandomValues(rnds8);
14435
17328
  }
14436
17329
  //#endregion
14437
- //#region node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/v4.js
17330
+ //#region node_modules/.pnpm/uuid@14.0.1/node_modules/uuid/dist/v4.js
14438
17331
  function v4(options, buf, offset) {
14439
17332
  if (!buf && !options && crypto.randomUUID) return crypto.randomUUID();
14440
17333
  return _v4(options, buf, offset);
@@ -14619,6 +17512,8 @@ var selector_default = /* @__PURE__ */ defineComponent({
14619
17512
  };
14620
17513
  }
14621
17514
  });
17515
+ //#endregion
17516
+ //#region components/upload/index.tsx
14622
17517
  var Upload = /* @__PURE__ */ defineComponent({
14623
17518
  name: "Upload",
14624
17519
  props: {
@@ -14846,128 +17741,253 @@ var Upload = /* @__PURE__ */ defineComponent({
14846
17741
  };
14847
17742
  }
14848
17743
  });
14849
- var Splitter = /* @__PURE__ */ defineComponent({
14850
- name: "Splitter",
17744
+ //#endregion
17745
+ //#region components/watermark/index.tsx
17746
+ var Watermark = /* @__PURE__ */ defineComponent({
17747
+ name: "Watermark",
14851
17748
  props: {
14852
- direction: {
17749
+ content: {
17750
+ type: [String, Array],
17751
+ default: ""
17752
+ },
17753
+ image: {
14853
17754
  type: String,
14854
- default: "horizontal"
17755
+ default: ""
14855
17756
  },
14856
- onResize: Function,
14857
- onResizeEnd: Function,
14858
- onResizeStart: Function
17757
+ width: {
17758
+ type: Number,
17759
+ default: 240
17760
+ },
17761
+ height: {
17762
+ type: Number,
17763
+ default: 189
17764
+ },
17765
+ rotate: {
17766
+ type: Number,
17767
+ default: -22
17768
+ },
17769
+ zIndex: {
17770
+ type: Number,
17771
+ default: 999
17772
+ },
17773
+ fullscreen: {
17774
+ type: Boolean,
17775
+ default: false
17776
+ },
17777
+ antiTamper: {
17778
+ type: Boolean,
17779
+ default: true
17780
+ },
17781
+ font: {
17782
+ type: Object,
17783
+ default: () => ({
17784
+ color: "rgba(128, 128, 128, 0.15)",
17785
+ fontSize: 15,
17786
+ fontWeight: "normal",
17787
+ fontFamily: "sans-serif",
17788
+ fontStyle: "normal"
17789
+ })
17790
+ },
17791
+ gap: {
17792
+ type: Array,
17793
+ default: () => [40, 40]
17794
+ },
17795
+ offset: {
17796
+ type: Array,
17797
+ default: () => [20, 20]
17798
+ },
17799
+ layout: {
17800
+ type: String,
17801
+ default: "stagger"
17802
+ }
14859
17803
  },
14860
- setup(props, { slots, emit }) {
17804
+ setup(props, { slots }) {
14861
17805
  const containerRef = ref(null);
14862
- const isDragging = ref(false);
14863
- const activeResizerIndex = ref(null);
14864
- const panelSizes = ref([]);
14865
- const minSizes = ref([]);
14866
- const maxSizes = ref([]);
14867
- const parseToPx = (val, total) => {
14868
- if (val === void 0 || val === null || val === "") return null;
14869
- const s = String(val).trim();
14870
- if (s.endsWith("%")) return parseFloat(s) / 100 * total;
14871
- if (s.endsWith("px")) return parseFloat(s);
14872
- if (!isNaN(Number(s))) return parseFloat(s) / 100 * total;
14873
- return null;
14874
- };
14875
- const initSizes = () => {
14876
- if (!containerRef.value) return;
14877
- const rect = containerRef.value.getBoundingClientRect();
14878
- const children = slots.default?.() || [];
14879
- const totalSize = (props.direction === "horizontal" ? rect.width : rect.height) - (children.length - 1) * 4;
14880
- minSizes.value = children.map((c) => parseToPx(c.props?.min, totalSize) ?? 0);
14881
- maxSizes.value = children.map((c) => parseToPx(c.props?.max, totalSize) ?? totalSize);
14882
- const rawSizes = children.map((c) => parseToPx(c.props?.size, totalSize));
14883
- const definedSum = rawSizes.reduce((acc, s) => (acc ?? 0) + (s ?? 0), 0) || 0;
14884
- const undefinedCount = rawSizes.filter((s) => s === null).length;
14885
- const spare = Math.max(0, totalSize - definedSum);
14886
- const autoSize = undefinedCount > 0 ? spare / undefinedCount : 0;
14887
- panelSizes.value = rawSizes.map((s) => s ?? autoSize);
17806
+ const watermarkRef = ref(null);
17807
+ let parentObserver = null;
17808
+ let selfObserver = null;
17809
+ let base64Url = ref("");
17810
+ const createWatermarkBase64 = () => {
17811
+ return new Promise((resolve) => {
17812
+ const canvas = document.createElement("canvas");
17813
+ const ratio = window.devicePixelRatio || 1;
17814
+ const cellW = props.width + props.gap[0];
17815
+ const cellH = props.height + props.gap[1];
17816
+ const offsetX = props.offset?.[0] ?? 0;
17817
+ const offsetY = props.offset?.[1] ?? 0;
17818
+ const isStagger = props.layout === "stagger";
17819
+ const canvasWidth = isStagger ? cellW * 2 : cellW;
17820
+ const canvasHeight = isStagger ? cellH * 2 : cellH;
17821
+ canvas.width = canvasWidth * ratio;
17822
+ canvas.height = canvasHeight * ratio;
17823
+ const ctx = canvas.getContext("2d");
17824
+ if (!ctx) return resolve("");
17825
+ ctx.scale(ratio, ratio);
17826
+ const drawSingleCell = (ctx, centerX, centerY, imgObj) => {
17827
+ ctx.save();
17828
+ ctx.translate(centerX, centerY);
17829
+ ctx.rotate(props.rotate * Math.PI / 180);
17830
+ if (imgObj) ctx.drawImage(imgObj, -props.width / 2, -props.height / 2, props.width, props.height);
17831
+ else drawTextWatermark(ctx);
17832
+ ctx.restore();
17833
+ };
17834
+ const renderAllCells = (imgObj) => {
17835
+ if (isStagger) {
17836
+ drawSingleCell(ctx, cellW / 2 + offsetX, cellH / 2 + offsetY, imgObj);
17837
+ drawSingleCell(ctx, cellW + cellW / 2 + offsetX, cellH / 2 + offsetY, imgObj);
17838
+ drawSingleCell(ctx, 0 + offsetX, cellH + cellH / 2 + offsetY, imgObj);
17839
+ drawSingleCell(ctx, cellW + offsetX, cellH + cellH / 2 + offsetY, imgObj);
17840
+ drawSingleCell(ctx, cellW * 2 + offsetX, cellH + cellH / 2 + offsetY, imgObj);
17841
+ } else drawSingleCell(ctx, cellW / 2 + offsetX, cellH / 2 + offsetY, imgObj);
17842
+ resolve(canvas.toDataURL());
17843
+ };
17844
+ if (props.image) {
17845
+ const img = new Image();
17846
+ img.crossOrigin = "anonymous";
17847
+ img.src = props.image;
17848
+ img.onload = () => {
17849
+ renderAllCells(img);
17850
+ };
17851
+ img.onerror = () => {
17852
+ renderAllCells();
17853
+ };
17854
+ } else renderAllCells();
17855
+ });
14888
17856
  };
14889
- const onMouseDown = (index) => {
14890
- isDragging.value = true;
14891
- activeResizerIndex.value = index;
14892
- document.addEventListener("mousemove", onMouseMove);
14893
- document.addEventListener("mouseup", onMouseUp);
14894
- document.body.style.cursor = props.direction === "horizontal" ? "col-resize" : "row-resize";
14895
- document.body.classList.add("k-splitter-dragging");
14896
- emitSize("resizeStart");
17857
+ const drawTextWatermark = (ctx) => {
17858
+ const globalFont = {
17859
+ color: "rgba(128, 128, 128, 0.15)",
17860
+ fontSize: 15,
17861
+ fontWeight: "normal",
17862
+ fontStyle: "normal",
17863
+ fontFamily: "sans-serif",
17864
+ ...props.font
17865
+ };
17866
+ const contents = (Array.isArray(props.content) ? props.content : [props.content || ""]).map((item) => {
17867
+ if (typeof item === "string") return { text: item };
17868
+ return item;
17869
+ });
17870
+ ctx.textAlign = "center";
17871
+ ctx.textBaseline = "middle";
17872
+ let totalHeight = 0;
17873
+ const lineHeights = contents.map((item) => {
17874
+ return (item.fontSize || globalFont.fontSize) + 8;
17875
+ });
17876
+ totalHeight = lineHeights.reduce((a, b) => a + b, 0);
17877
+ let currentY = -totalHeight / 2;
17878
+ contents.forEach((item, index) => {
17879
+ const fSize = item.fontSize || globalFont.fontSize;
17880
+ const fWeight = item.fontWeight || globalFont.fontWeight;
17881
+ const fStyle = item.fontStyle || globalFont.fontStyle;
17882
+ const fColor = item.color || globalFont.color;
17883
+ ctx.font = `${fStyle} ${fWeight} ${fSize}px ${globalFont.fontFamily}`;
17884
+ ctx.fillStyle = fColor;
17885
+ const yOffset = currentY + lineHeights[index] / 2;
17886
+ ctx.fillText(item.text, 0, yOffset);
17887
+ currentY += lineHeights[index];
17888
+ });
14897
17889
  };
14898
- const emitSize = (type) => {
14899
- emit(type, panelSizes.value.map((x) => parseFloat(x.toFixed(3))));
17890
+ const renderWatermark = async () => {
17891
+ base64Url.value = await createWatermarkBase64();
17892
+ const targetContainer = props.fullscreen ? document.body : containerRef.value;
17893
+ if (!targetContainer) return;
17894
+ disconnectObservers();
17895
+ if (watermarkRef.value && watermarkRef.value.parentNode) watermarkRef.value.parentNode.removeChild(watermarkRef.value);
17896
+ const wmWrapper = document.createElement("div");
17897
+ const wmStyle = {
17898
+ position: props.fullscreen ? "fixed" : "absolute",
17899
+ left: "0",
17900
+ top: "0",
17901
+ width: "100%",
17902
+ height: "100%",
17903
+ pointerEvents: "none",
17904
+ zIndex: props.zIndex.toString(),
17905
+ margin: "0",
17906
+ padding: "0"
17907
+ };
17908
+ Object.assign(wmWrapper.style, wmStyle);
17909
+ wmWrapper.setAttribute("data-wm-root", "true");
17910
+ const shadowRoot = wmWrapper.attachShadow({ mode: "closed" });
17911
+ const wmInner = document.createElement("div");
17912
+ const cellW = props.width + props.gap[0];
17913
+ const cellH = props.height + props.gap[1];
17914
+ const isStagger = props.layout === "stagger";
17915
+ const innerStyle = {
17916
+ width: "100%",
17917
+ height: "100%",
17918
+ backgroundSize: `${isStagger ? cellW * 2 : cellW}px ${isStagger ? cellH * 2 : cellH}px`,
17919
+ backgroundImage: `url(${base64Url.value})`,
17920
+ backgroundRepeat: "repeat",
17921
+ pointerEvents: "none"
17922
+ };
17923
+ Object.assign(wmInner.style, innerStyle);
17924
+ shadowRoot.appendChild(wmInner);
17925
+ targetContainer.appendChild(wmWrapper);
17926
+ watermarkRef.value = wmWrapper;
17927
+ if (props.antiTamper) nextTick(() => {
17928
+ initAntiTamper(targetContainer, wmWrapper);
17929
+ });
14900
17930
  };
14901
- const onMouseMove = (e) => {
14902
- if (!isDragging.value || activeResizerIndex.value === null || !containerRef.value) return;
14903
- const rect = containerRef.value.getBoundingClientRect();
14904
- const idx = activeResizerIndex.value;
14905
- const children = slots.default?.() || [];
14906
- const resizerWidth = 4;
14907
- const totalResizersWidth = (children.length - 1) * resizerWidth;
14908
- const totalAvailableSize = (props.direction === "horizontal" ? rect.width : rect.height) - totalResizersWidth;
14909
- const resizersBefore = idx * resizerWidth;
14910
- let currentPos = (props.direction === "horizontal" ? e.clientX - rect.left : e.clientY - rect.top) - resizersBefore;
14911
- currentPos = Math.max(0, Math.min(totalAvailableSize, currentPos));
14912
- const pairTotal = panelSizes.value[idx] + panelSizes.value[idx + 1];
14913
- const offset = panelSizes.value.slice(0, idx).reduce((a, b) => a + b, 0);
14914
- let newSizeIdx = currentPos - offset;
14915
- newSizeIdx = Math.max(minSizes.value[idx], Math.min(maxSizes.value[idx], newSizeIdx));
14916
- const maxAllowed = pairTotal - minSizes.value[idx + 1];
14917
- newSizeIdx = Math.min(newSizeIdx, maxAllowed);
14918
- panelSizes.value[idx] = newSizeIdx;
14919
- panelSizes.value[idx + 1] = pairTotal - newSizeIdx;
14920
- emitSize("resize");
17931
+ const initAntiTamper = (parent, self) => {
17932
+ parentObserver = new MutationObserver((mutations) => {
17933
+ for (const mutation of mutations) if (Array.from(mutation.removedNodes).includes(self)) {
17934
+ renderWatermark();
17935
+ break;
17936
+ }
17937
+ });
17938
+ parentObserver.observe(parent, { childList: true });
17939
+ selfObserver = new MutationObserver((mutations) => {
17940
+ for (const mutation of mutations) if (mutation.type === "attributes") {
17941
+ renderWatermark();
17942
+ break;
17943
+ }
17944
+ });
17945
+ selfObserver.observe(self, {
17946
+ attributes: true,
17947
+ attributeFilter: [
17948
+ "style",
17949
+ "class",
17950
+ "id",
17951
+ "hidden"
17952
+ ]
17953
+ });
14921
17954
  };
14922
- const onMouseUp = () => {
14923
- isDragging.value = false;
14924
- activeResizerIndex.value = null;
14925
- document.removeEventListener("mousemove", onMouseMove);
14926
- document.removeEventListener("mouseup", onMouseUp);
14927
- document.body.style.cursor = "";
14928
- document.body.classList.remove("k-splitter-dragging");
14929
- emitSize("resizeEnd");
17955
+ const disconnectObservers = () => {
17956
+ if (parentObserver) parentObserver.disconnect();
17957
+ if (selfObserver) selfObserver.disconnect();
14930
17958
  };
14931
- let ob = null;
14932
- onMounted(() => {
14933
- initSizes();
14934
- ob = new ResizeObserver(() => initSizes());
14935
- if (containerRef.value) ob.observe(containerRef.value);
17959
+ watch(() => [
17960
+ props.content,
17961
+ props.image,
17962
+ props.width,
17963
+ props.height,
17964
+ props.rotate,
17965
+ props.gap,
17966
+ props.offset,
17967
+ props.font,
17968
+ props.layout
17969
+ ], () => {
17970
+ renderWatermark();
17971
+ }, { deep: true });
17972
+ onMounted(() => renderWatermark());
17973
+ onBeforeUnmount(() => {
17974
+ disconnectObservers();
17975
+ if (watermarkRef.value && watermarkRef.value.parentNode) watermarkRef.value.parentNode.removeChild(watermarkRef.value);
14936
17976
  });
14937
- onUnmounted(() => ob?.disconnect());
14938
17977
  return () => {
14939
- const children = slots.default?.() || [];
17978
+ if (props.fullscreen) return slots.default ? slots.default() : null;
14940
17979
  return createVNode("div", {
14941
17980
  "ref": containerRef,
14942
- "class": ["k-splitter", `is-${props.direction}`]
14943
- }, [children.map((child, index) => {
14944
- const isLast = index === children.length - 1;
14945
- return createVNode(Fragment, null, [createVNode("div", {
14946
- "class": "k-splitter-item",
14947
- "style": {
14948
- flexBasis: `${panelSizes.value[index]}px`,
14949
- flexGrow: 0,
14950
- flexShrink: 0
14951
- }
14952
- }, [child]), !isLast && createVNode("div", {
14953
- "class": "k-splitter-resizer",
14954
- "onMousedown": () => onMouseDown(index)
14955
- }, null)]);
14956
- })]);
17981
+ "style": {
17982
+ position: "relative",
17983
+ width: "100%",
17984
+ height: "100%"
17985
+ },
17986
+ "class": "k-watermark-container"
17987
+ }, [slots.default?.()]);
14957
17988
  };
14958
17989
  }
14959
17990
  });
14960
- var SplitterPanel = /* @__PURE__ */ defineComponent({
14961
- name: "SplitterPanel",
14962
- props: {
14963
- size: { type: [Number, String] },
14964
- min: { type: [Number, String] },
14965
- max: { type: [Number, String] }
14966
- },
14967
- setup(_, { slots }) {
14968
- return () => createVNode("div", { "class": "k-splitter-panel" }, [slots.default?.()]);
14969
- }
14970
- });
14971
17991
  //#endregion
14972
17992
  //#region components/utils/theme.ts
14973
17993
  var THEME_KEY = "theme-mode";
@@ -15071,6 +18091,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
15071
18091
  Popconfirm: () => Popconfirm,
15072
18092
  Poptip: () => Poptip,
15073
18093
  Progress: () => Progress,
18094
+ QRCode: () => QRCode,
15074
18095
  Radio: () => Radio,
15075
18096
  RadioButton: () => RadioButton,
15076
18097
  RadioGroup: () => RadioGroup,
@@ -15102,6 +18123,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
15102
18123
  Tree: () => Tree,
15103
18124
  TreeSelect: () => TreeSelect,
15104
18125
  Upload: () => Upload,
18126
+ Watermark: () => Watermark,
15105
18127
  loading: () => loading,
15106
18128
  message: () => message,
15107
18129
  modal: () => modal,
@@ -15140,4 +18162,4 @@ var UI = {
15140
18162
  var install = UI.install;
15141
18163
  var version = UI.version;
15142
18164
  //#endregion
15143
- export { Affix, Alert, Anchor, AnchorLink, Avatar, AvatarGroup, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Card, Carousel, CarouselItem, Checkbox, CheckboxGroup, Col, Collapse, CollapsePanel, ColorPicker, ConfigProvider, Content, DatePicker, Descriptions, DescriptionsItem, Divider, Drawer, Dropdown, DropdownButton, Empty, Flex, Footer, Form, FormItem, Grid, GridItem, Header, Icon, ImageGroup, Input, InputGroup, InputNumber, KImage, Switch as KSwitch, Layout, Menu, MenuDivider, MenuGroup, MenuItem, modal_default as Modal, Option, Page, Popconfirm, Poptip, Progress, Radio, RadioButton, RadioGroup, Rate, Row, Select, Sider, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonImage, SkeletonText, Slider, Space, Spin, Splitter, SplitterPanel, StatCard, StatNumber, SubMenu, TabPanel, Table, Tabs, Tag, TextArea, TimeLine, TimeLineItem, Tooltip, Tree, TreeSelect, Upload, UI as default, install, loading, message, modal, notice, Theme as theme, version };
18165
+ export { Affix, Alert, Anchor, AnchorLink, Avatar, AvatarGroup, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Card, Carousel, CarouselItem, Checkbox, CheckboxGroup, Col, Collapse, CollapsePanel, ColorPicker, ConfigProvider, Content, DatePicker, Descriptions, DescriptionsItem, Divider, Drawer, Dropdown, DropdownButton, Empty, Flex, Footer, Form, FormItem, Grid, GridItem, Header, Icon, ImageGroup, Input, InputGroup, InputNumber, KImage, Switch as KSwitch, Layout, Menu, MenuDivider, MenuGroup, MenuItem, modal_default as Modal, Option, Page, Popconfirm, Poptip, Progress, QRCode, Radio, RadioButton, RadioGroup, Rate, Row, Select, Sider, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonImage, SkeletonText, Slider, Space, Spin, Splitter, SplitterPanel, StatCard, StatNumber, SubMenu, TabPanel, Table, Tabs, Tag, TextArea, TimeLine, TimeLineItem, Tooltip, Tree, TreeSelect, Upload, Watermark, UI as default, install, loading, message, modal, notice, Theme as theme, version };