@knime/jsonforms 3.0.0 → 3.1.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 (205) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/AnyOfTwinlist-iPxS5C9Y.js +24 -0
  3. package/dist/CheckboxControl-C99OdmDL.js +41 -0
  4. package/dist/CheckboxesControl-BZhMhT9x.js +47 -0
  5. package/dist/ColorControl-D1dNnNbO.js +38 -0
  6. package/dist/ColorPreviewControl-B4zix2kb.js +67 -0
  7. package/dist/ComboBoxControl-BGWAD9IW.js +47 -0
  8. package/dist/DateControl-D0HfVrtz.js +49 -0
  9. package/dist/DateTimeControl-kTQZI9JC.js +103 -0
  10. package/dist/DateTimeFormatPickerControl-BiYcsKSn.js +44 -0
  11. package/dist/DropdownControl-jsayV3N5.js +42 -0
  12. package/dist/ExecutorCoresControl-DNo2SaC6.js +26 -0
  13. package/dist/ExecutorMemoryControl-C8RLYQdd.js +26 -0
  14. package/dist/FileUploadControl-Cv3xWTAS.js +58 -0
  15. package/dist/GridSelectionControl-BqtaGQYg.js +86 -0
  16. package/dist/HorizontalLayout-B_lETfCu.js +29 -0
  17. package/dist/IntegerControl-Cr8SO0xH.js +22 -0
  18. package/dist/IntervalControl-BdjKEwLy.js +53 -0
  19. package/dist/LinkControl-QMwkCJlj.js +37 -0
  20. package/dist/LoadingDropdown-BpU4Uiin.js +61 -0
  21. package/dist/ManualTwinlistControl-CPILp7H_.js +75 -0
  22. package/dist/NameFilter-CYYPRj-2.js +29 -0
  23. package/dist/NumberControl-ODy5GAlR.js +22 -0
  24. package/dist/NumberControlBase-Cl3QcvzB.js +56 -0
  25. package/dist/OneOfDropdown-CMPRAraI.js +44 -0
  26. package/dist/ProgressButtonControl-BimHrSZd.js +51 -0
  27. package/dist/RadioButtonsWithDescriptionControl-DJu3ODo7.js +58 -0
  28. package/dist/RadioControl-D_NE5s4n.js +22 -0
  29. package/dist/RadioControlBase-knF86px0.js +69 -0
  30. package/dist/ResourceControlBase-BVMVVYns.js +64 -0
  31. package/dist/RichTextControl-JIM904_P.js +72 -0
  32. package/dist/SectionLayout-BDYjoUXM.js +41 -0
  33. package/dist/SettingsSubPanelLayout-DVw_AsU6.js +53 -0
  34. package/dist/SimpleTwinlistControl-BNnOmbN-.js +24 -0
  35. package/dist/SingleSelectControl-CJV9VMZm.js +58 -0
  36. package/dist/SortListControl-D-ifoRva.js +71 -0
  37. package/dist/TeamAndSpacesControl-D1FvyeCV.js +56 -0
  38. package/dist/TeamResourceControl-DyCO6-Nk.js +26 -0
  39. package/dist/TextAreaControl-7QziyTgn.js +40 -0
  40. package/dist/TimeControl-B29iTlhP.js +71 -0
  41. package/dist/TimeframesControl-Wvu--J0V.js +46 -0
  42. package/dist/TwinlistControlBase-300a_qUR.js +55 -0
  43. package/dist/TypedStringFilter-Ek7bQ-7j.js +35 -0
  44. package/dist/ValueSwitchControl-H2t2Wgo6.js +22 -0
  45. package/dist/VerticalLayout-zV890HYr.js +32 -0
  46. package/dist/ZonedDateTimeControl-DoE2T9iz.js +88 -0
  47. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  48. package/dist/inject-DEsHVs5q.js +5 -0
  49. package/dist/knime-jsonforms.css +2 -1
  50. package/dist/knime-jsonforms.d.ts +1 -1
  51. package/dist/knime-jsonforms.js +3 -219
  52. package/dist/magic-string.es-DrXXtutX.js +659 -0
  53. package/dist/plainDateTimeUtils-5uOCJ4N5.js +58 -0
  54. package/dist/rolldown-runtime-Dy4uBu1J.js +11 -0
  55. package/dist/src/JsonFormsDialog.vue.d.ts +53 -435
  56. package/dist/src/higherOrderComponents/control/DescriptionPopover.vue.d.ts +2 -1
  57. package/dist/src/higherOrderComponents/control/LabeledControl.vue.d.ts +21 -21
  58. package/dist/src/layoutComponents/Form.vue.d.ts +9 -12
  59. package/dist/src/layoutComponents/HorizontalLayout.vue.d.ts +2 -1
  60. package/dist/src/layoutComponents/SectionLayout.vue.d.ts +9 -13
  61. package/dist/src/layoutComponents/SettingsSubPanelLayout.vue.d.ts +9 -13
  62. package/dist/src/layoutComponents/VerticalLayout.vue.d.ts +2 -1
  63. package/dist/src/layoutComponents/VerticalLayoutBase.vue.d.ts +10 -14
  64. package/dist/src/layoutComponents/section/SectionHeading.vue.d.ts +7 -15
  65. package/dist/src/layoutComponents/settingsSubPanel/SettingsSubPanel.vue.d.ts +11 -10
  66. package/dist/src/layoutComponents/simpleArrayLayout/SimpleArrayLayout.vue.d.ts +2 -1
  67. package/dist/src/layoutComponents/simpleArrayLayout/SimpleArrayLayoutItemControls.vue.d.ts +3 -2
  68. package/dist/src/loading/LoadingDialog.vue.d.ts +2 -1
  69. package/dist/src/renderers/checkboxRenderer.d.ts +5 -4
  70. package/dist/src/renderers/colorPreviewRenderer.d.ts +1 -1
  71. package/dist/src/renderers/defaultRenderers.d.ts +22 -21
  72. package/dist/src/renderers/fallbackRenderers.d.ts +6 -5
  73. package/dist/src/renderers/horizontalLayoutRenderer.d.ts +1 -1
  74. package/dist/src/renderers/linkRenderer.d.ts +1 -1
  75. package/dist/src/renderers/progressButtonRenderer.d.ts +3 -3
  76. package/dist/src/renderers/sectionLayoutRenderer.d.ts +3 -3
  77. package/dist/src/renderers/sectionSubPanelLayoutRenderer.d.ts +3 -3
  78. package/dist/src/renderers/simpleButtonRenderer.d.ts +3 -3
  79. package/dist/src/renderers/verticalLayoutRenderer.d.ts +2 -2
  80. package/dist/src/uiComponents/CheckboxControl.vue.d.ts +11 -14
  81. package/dist/src/uiComponents/CheckboxesControl.vue.d.ts +2 -1
  82. package/dist/src/uiComponents/ColorControl.vue.d.ts +2 -1
  83. package/dist/src/uiComponents/ColorPreviewControl.vue.d.ts +2 -1
  84. package/dist/src/uiComponents/ComboBoxControl.vue.d.ts +2 -1
  85. package/dist/src/uiComponents/DateControl.vue.d.ts +2 -1
  86. package/dist/src/uiComponents/DateTimeControl.vue.d.ts +2 -1
  87. package/dist/src/uiComponents/DateTimeFormatPickerControl.vue.d.ts +2 -1
  88. package/dist/src/uiComponents/DropdownControl.vue.d.ts +2 -1
  89. package/dist/src/uiComponents/FieldControl.vue.d.ts +12 -7
  90. package/dist/src/uiComponents/FieldRenderer.vue.d.ts +12 -7
  91. package/dist/src/uiComponents/FileUploadControl.vue.d.ts +2 -3
  92. package/dist/src/uiComponents/GridSelectionControl.vue.d.ts +2 -1
  93. package/dist/src/uiComponents/IntegerControl.vue.d.ts +2 -1
  94. package/dist/src/uiComponents/IntervalControl.vue.d.ts +2 -1
  95. package/dist/src/uiComponents/LinkControl.vue.d.ts +2 -1
  96. package/dist/src/uiComponents/NumberControl.vue.d.ts +2 -1
  97. package/dist/src/uiComponents/NumberControlBase.vue.d.ts +2 -1
  98. package/dist/src/uiComponents/OneOfDropdown.vue.d.ts +2 -1
  99. package/dist/src/uiComponents/PasswordControl.vue.d.ts +2 -1
  100. package/dist/src/uiComponents/ProgressButtonControl.vue.d.ts +9 -13
  101. package/dist/src/uiComponents/QuantityControl.vue.d.ts +2 -1
  102. package/dist/src/uiComponents/RadioButtonsWithDescriptionControl.vue.d.ts +2 -1
  103. package/dist/src/uiComponents/RadioControl.vue.d.ts +2 -1
  104. package/dist/src/uiComponents/RadioControlBase.vue.d.ts +2 -1
  105. package/dist/src/uiComponents/SimpleButtonControl.vue.d.ts +9 -13
  106. package/dist/src/uiComponents/SingleSelectControl.vue.d.ts +2 -1
  107. package/dist/src/uiComponents/SortListControl.vue.d.ts +2 -1
  108. package/dist/src/uiComponents/TeamAndSpacesControl.vue.d.ts +2 -1
  109. package/dist/src/uiComponents/TextAreaControl.vue.d.ts +2 -1
  110. package/dist/src/uiComponents/TextControl.vue.d.ts +3 -454
  111. package/dist/src/uiComponents/TextMessageControl.vue.d.ts +2 -1
  112. package/dist/src/uiComponents/TimeControl.vue.d.ts +2 -1
  113. package/dist/src/uiComponents/TimeframesControl.vue.d.ts +2 -1
  114. package/dist/src/uiComponents/UsernameControl.vue.d.ts +2 -1
  115. package/dist/src/uiComponents/ValueSwitchControl.vue.d.ts +2 -1
  116. package/dist/src/uiComponents/ZonedDateTimeControl.vue.d.ts +2 -1
  117. package/dist/src/uiComponents/colorPreview/ColorPreviewEmptyState.vue.d.ts +2 -1
  118. package/dist/src/uiComponents/colorPreview/GradientPreview.vue.d.ts +2 -1
  119. package/dist/src/uiComponents/colorPreview/PalettePreview.vue.d.ts +2 -1
  120. package/dist/src/uiComponents/loading/LoadingDropdown.vue.d.ts +3 -2
  121. package/dist/src/uiComponents/resourceControls/ExecutorCoresControl.vue.d.ts +2 -1
  122. package/dist/src/uiComponents/resourceControls/ExecutorMemoryControl.vue.d.ts +2 -1
  123. package/dist/src/uiComponents/resourceControls/ResourceControlBase.vue.d.ts +2 -1
  124. package/dist/src/uiComponents/resourceControls/TeamResourceControl.vue.d.ts +2 -1
  125. package/dist/src/uiComponents/richTextControl/RichTextControl.vue.d.ts +2 -141
  126. package/dist/src/uiComponents/twinlist/AnyOfTwinlist.vue.d.ts +2 -1
  127. package/dist/src/uiComponents/twinlist/ManualTwinlistControl.vue.d.ts +2 -1
  128. package/dist/src/uiComponents/twinlist/MultimodeTwinlistControl.vue.d.ts +3 -2
  129. package/dist/src/uiComponents/twinlist/NameFilter.vue.d.ts +2 -1
  130. package/dist/src/uiComponents/twinlist/SimpleTwinlistControl.vue.d.ts +2 -1
  131. package/dist/src/uiComponents/twinlist/TwinlistControlBase.vue.d.ts +2 -1
  132. package/dist/src/uiComponents/twinlist/TypedStringFilter.vue.d.ts +2 -1
  133. package/dist/src-DwqijroM.js +1269 -0
  134. package/dist/temporal-polyfill-D4u1I_Z-.js +3114 -0
  135. package/dist/testing.d.ts +1 -1
  136. package/dist/testing.js +15278 -19038
  137. package/dist/toKdsPossibleValues-Dd_qzlUI.js +14 -0
  138. package/dist/useBuiltinValidations-B_Drc2y-.js +43 -0
  139. package/dist/usePossibleValues-Cx6iSt_X.js +15 -0
  140. package/dist/useProvidedState-478_KXOe.js +26 -0
  141. package/dist/useUnknownValuesInTwinlist-BvCTc3hC.js +205 -0
  142. package/dist/utils-DmZLgn8X.js +12 -0
  143. package/package.json +7 -7
  144. package/dist/AnyOfTwinlist-CcodfEXw.js +0 -23
  145. package/dist/CheckboxControl-B_MAR82s.js +0 -41
  146. package/dist/CheckboxesControl--bG4aF6O.js +0 -39
  147. package/dist/ColorControl-CEp2Ei7R.js +0 -29
  148. package/dist/ColorPreviewControl-j0uQH95J.js +0 -90
  149. package/dist/ComboBoxControl-BpJzwiv6.js +0 -39
  150. package/dist/DateControl-83Fi6P5y.js +0 -44
  151. package/dist/DateTimeControl-C-D8bFm3.js +0 -103
  152. package/dist/DateTimeFormatPickerControl-B9gl_66T.js +0 -35
  153. package/dist/DropdownControl-CtveoldX.js +0 -32
  154. package/dist/ExecutorCoresControl-CErHidL7.js +0 -39
  155. package/dist/ExecutorMemoryControl-DgSM86Yg.js +0 -35
  156. package/dist/FileUploadControl-BBfnxURy.js +0 -56
  157. package/dist/GridSelectionControl-BaI4j0Jj.js +0 -117
  158. package/dist/HorizontalLayout-D1SRCyhL.js +0 -26
  159. package/dist/IntegerControl-v93Xw4DJ.js +0 -21
  160. package/dist/IntervalControl-CVlO_mFO.js +0 -52
  161. package/dist/LinkControl-j8GrcZZG.js +0 -36
  162. package/dist/LoadingDropdown.vue_vue_type_script_setup_true_lang-DFSHuMQ6.js +0 -57
  163. package/dist/ManualTwinlistControl-BzJehuHs.js +0 -74
  164. package/dist/MultimodeTwinlistControl-Br0DrpsZ.js +0 -4
  165. package/dist/MultimodeTwinlistControl.vue_vue_type_script_setup_true_lang-CHcU__0y.js +0 -159
  166. package/dist/NameFilter-BjuVseuX.js +0 -25
  167. package/dist/NumberControl-BF76FEhD.js +0 -21
  168. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-DMTsK83k.js +0 -52
  169. package/dist/OneOfDropdown-DpXmZauV.js +0 -35
  170. package/dist/ProgressButtonControl-t8QMA22a.js +0 -52
  171. package/dist/RadioButtonsWithDescriptionControl-CeZ4qYCr.js +0 -58
  172. package/dist/RadioControl-DOn1Kre5.js +0 -21
  173. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-CExBvDXt.js +0 -57
  174. package/dist/ResourceControlBase-CX97xRiy.js +0 -70
  175. package/dist/RichTextControl-BrVmkMgh.js +0 -60
  176. package/dist/SectionHeading-YAJTwOE4.js +0 -61
  177. package/dist/SectionLayout-BYOxuxY2.js +0 -47
  178. package/dist/SettingsSubPanel-DgISjowU.js +0 -5
  179. package/dist/SettingsSubPanelLayout-BQJCnTqx.js +0 -69
  180. package/dist/SimpleButtonControl-GTX19t2_.js +0 -50
  181. package/dist/SimpleButtonControl.vue_vue_type_style_index_0_scoped_c79c6b71_lang-Ccuf283K.js +0 -1284
  182. package/dist/SimpleTwinlistControl-DOH1_L25.js +0 -23
  183. package/dist/SingleSelectControl-mY_yYOyk.js +0 -58
  184. package/dist/SortListControl-D-Um5gEW.js +0 -81
  185. package/dist/TeamAndSpacesControl-fGumynvr.js +0 -66
  186. package/dist/TeamResourceControl--1Sj3-Ks.js +0 -35
  187. package/dist/TextAreaControl-Cwq-lNBk.js +0 -30
  188. package/dist/TextControl-MvbrNTGW.js +0 -4
  189. package/dist/TextControl.vue_vue_type_script_setup_true_lang-Cbv0bM2X.js +0 -53
  190. package/dist/TimeControl-WG0SC4_b.js +0 -71
  191. package/dist/TimeframesControl-CX5eKOGZ.js +0 -53
  192. package/dist/TwinlistControlBase.vue_vue_type_script_setup_true_lang-BKCvZF3X.js +0 -45
  193. package/dist/TypedStringFilter-BnWygKQJ.js +0 -27
  194. package/dist/ValueSwitchControl-BByKe7NK.js +0 -21
  195. package/dist/VerticalLayout-DIBkvSZ9.js +0 -30
  196. package/dist/VerticalLayoutBase-BEDnWcoh.js +0 -20
  197. package/dist/ZonedDateTimeControl-B45OygrC.js +0 -97
  198. package/dist/index-Blg1O3Fz.js +0 -15
  199. package/dist/index-_VUHzju5.js +0 -3210
  200. package/dist/magic-string.es-uPKorP4O.js +0 -663
  201. package/dist/plainDateTimeUtils-BZSKqp9i.js +0 -52
  202. package/dist/toKdsPossibleValues-BklBg3gG.js +0 -14
  203. package/dist/useBuiltinValidations-_4IBMopQ.js +0 -74
  204. package/dist/usePossibleValues-CXVLf00v.js +0 -16
  205. package/dist/useUnknownValuesInTwinlist-uXOCQkVS.js +0 -65
@@ -1,663 +0,0 @@
1
- var x = 44, E = 59, m = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", S = new Uint8Array(64), k = new Uint8Array(128);
2
- for (let u = 0; u < m.length; u++) {
3
- const t = m.charCodeAt(u);
4
- S[u] = t, k[t] = u;
5
- }
6
- function c(u, t, e) {
7
- let i = t - e;
8
- i = i < 0 ? -i << 1 | 1 : i << 1;
9
- do {
10
- let n = i & 31;
11
- i >>>= 5, i > 0 && (n |= 32), u.write(S[n]);
12
- } while (i > 0);
13
- return t;
14
- }
15
- var b = 1024 * 16, C = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
16
- decode(u) {
17
- return Buffer.from(u.buffer, u.byteOffset, u.byteLength).toString();
18
- }
19
- } : {
20
- decode(u) {
21
- let t = "";
22
- for (let e = 0; e < u.length; e++)
23
- t += String.fromCharCode(u[e]);
24
- return t;
25
- }
26
- }, L = class {
27
- constructor() {
28
- this.pos = 0, this.out = "", this.buffer = new Uint8Array(b);
29
- }
30
- write(u) {
31
- const { buffer: t } = this;
32
- t[this.pos++] = u, this.pos === b && (this.out += C.decode(t), this.pos = 0);
33
- }
34
- flush() {
35
- const { buffer: u, out: t, pos: e } = this;
36
- return e > 0 ? t + C.decode(u.subarray(0, e)) : t;
37
- }
38
- };
39
- function R(u) {
40
- const t = new L();
41
- let e = 0, i = 0, n = 0, r = 0;
42
- for (let s = 0; s < u.length; s++) {
43
- const h = u[s];
44
- if (s > 0 && t.write(E), h.length === 0) continue;
45
- let o = 0;
46
- for (let l = 0; l < h.length; l++) {
47
- const a = h[l];
48
- l > 0 && t.write(x), o = c(t, a[0], o), a.length !== 1 && (e = c(t, a[1], e), i = c(t, a[2], i), n = c(t, a[3], n), a.length !== 4 && (r = c(t, a[4], r)));
49
- }
50
- }
51
- return t.flush();
52
- }
53
- class p {
54
- constructor(t) {
55
- this.bits = t instanceof p ? t.bits.slice() : [];
56
- }
57
- add(t) {
58
- this.bits[t >> 5] |= 1 << (t & 31);
59
- }
60
- has(t) {
61
- return !!(this.bits[t >> 5] & 1 << (t & 31));
62
- }
63
- }
64
- class g {
65
- constructor(t, e, i) {
66
- this.start = t, this.end = e, this.original = i, this.intro = "", this.outro = "", this.content = i, this.storeName = !1, this.edited = !1, this.previous = null, this.next = null;
67
- }
68
- appendLeft(t) {
69
- this.outro += t;
70
- }
71
- appendRight(t) {
72
- this.intro = this.intro + t;
73
- }
74
- clone() {
75
- const t = new g(this.start, this.end, this.original);
76
- return t.intro = this.intro, t.outro = this.outro, t.content = this.content, t.storeName = this.storeName, t.edited = this.edited, t;
77
- }
78
- contains(t) {
79
- return this.start < t && t < this.end;
80
- }
81
- eachNext(t) {
82
- let e = this;
83
- for (; e; )
84
- t(e), e = e.next;
85
- }
86
- eachPrevious(t) {
87
- let e = this;
88
- for (; e; )
89
- t(e), e = e.previous;
90
- }
91
- edit(t, e, i) {
92
- return this.content = t, i || (this.intro = "", this.outro = ""), this.storeName = e, this.edited = !0, this;
93
- }
94
- prependLeft(t) {
95
- this.outro = t + this.outro;
96
- }
97
- prependRight(t) {
98
- this.intro = t + this.intro;
99
- }
100
- reset() {
101
- this.intro = "", this.outro = "", this.edited && (this.content = this.original, this.storeName = !1, this.edited = !1);
102
- }
103
- split(t) {
104
- const e = t - this.start, i = this.original.slice(0, e), n = this.original.slice(e);
105
- this.original = i;
106
- const r = new g(t, this.end, n);
107
- return r.outro = this.outro, this.outro = "", this.end = t, this.edited ? (r.edit("", !1), this.content = "") : this.content = i, r.next = this.next, r.next && (r.next.previous = r), r.previous = this, this.next = r, r;
108
- }
109
- toString() {
110
- return this.intro + this.content + this.outro;
111
- }
112
- trimEnd(t) {
113
- if (this.outro = this.outro.replace(t, ""), this.outro.length) return !0;
114
- const e = this.content.replace(t, "");
115
- if (e.length)
116
- return e !== this.content && (this.split(this.start + e.length).edit("", void 0, !0), this.edited && this.edit(e, this.storeName, !0)), !0;
117
- if (this.edit("", void 0, !0), this.intro = this.intro.replace(t, ""), this.intro.length) return !0;
118
- }
119
- trimStart(t) {
120
- if (this.intro = this.intro.replace(t, ""), this.intro.length) return !0;
121
- const e = this.content.replace(t, "");
122
- if (e.length) {
123
- if (e !== this.content) {
124
- const i = this.split(this.end - e.length);
125
- this.edited && i.edit(e, this.storeName, !0), this.edit("", void 0, !0);
126
- }
127
- return !0;
128
- } else if (this.edit("", void 0, !0), this.outro = this.outro.replace(t, ""), this.outro.length) return !0;
129
- }
130
- }
131
- function _() {
132
- return typeof globalThis < "u" && typeof globalThis.btoa == "function" ? (u) => globalThis.btoa(unescape(encodeURIComponent(u))) : typeof Buffer == "function" ? (u) => Buffer.from(u, "utf-8").toString("base64") : () => {
133
- throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
134
- };
135
- }
136
- const O = /* @__PURE__ */ _();
137
- class N {
138
- constructor(t) {
139
- this.version = 3, this.file = t.file, this.sources = t.sources, this.sourcesContent = t.sourcesContent, this.names = t.names, this.mappings = R(t.mappings), typeof t.x_google_ignoreList < "u" && (this.x_google_ignoreList = t.x_google_ignoreList), typeof t.debugId < "u" && (this.debugId = t.debugId);
140
- }
141
- toString() {
142
- return JSON.stringify(this);
143
- }
144
- toUrl() {
145
- return "data:application/json;charset=utf-8;base64," + O(this.toString());
146
- }
147
- }
148
- function I(u) {
149
- const t = u.split(`
150
- `), e = t.filter((r) => /^\t+/.test(r)), i = t.filter((r) => /^ {2,}/.test(r));
151
- if (e.length === 0 && i.length === 0)
152
- return null;
153
- if (e.length >= i.length)
154
- return " ";
155
- const n = i.reduce((r, s) => {
156
- const h = /^ +/.exec(s)[0].length;
157
- return Math.min(h, r);
158
- }, 1 / 0);
159
- return new Array(n + 1).join(" ");
160
- }
161
- function A(u, t) {
162
- const e = u.split(/[/\\]/), i = t.split(/[/\\]/);
163
- for (e.pop(); e[0] === i[0]; )
164
- e.shift(), i.shift();
165
- if (e.length) {
166
- let n = e.length;
167
- for (; n--; ) e[n] = "..";
168
- }
169
- return e.concat(i).join("/");
170
- }
171
- const T = Object.prototype.toString;
172
- function j(u) {
173
- return T.call(u) === "[object Object]";
174
- }
175
- function y(u) {
176
- const t = u.split(`
177
- `), e = [];
178
- for (let i = 0, n = 0; i < t.length; i++)
179
- e.push(n), n += t[i].length + 1;
180
- return function(n) {
181
- let r = 0, s = e.length;
182
- for (; r < s; ) {
183
- const l = r + s >> 1;
184
- n < e[l] ? s = l : r = l + 1;
185
- }
186
- const h = r - 1, o = n - e[h];
187
- return { line: h, column: o };
188
- };
189
- }
190
- const $ = /\w/;
191
- class U {
192
- constructor(t) {
193
- this.hires = t, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] = [], this.pending = null;
194
- }
195
- addEdit(t, e, i, n) {
196
- if (e.length) {
197
- const r = e.length - 1;
198
- let s = e.indexOf(`
199
- `, 0), h = -1;
200
- for (; s >= 0 && r > s; ) {
201
- const l = [this.generatedCodeColumn, t, i.line, i.column];
202
- n >= 0 && l.push(n), this.rawSegments.push(l), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, h = s, s = e.indexOf(`
203
- `, s + 1);
204
- }
205
- const o = [this.generatedCodeColumn, t, i.line, i.column];
206
- n >= 0 && o.push(n), this.rawSegments.push(o), this.advance(e.slice(h + 1));
207
- } else this.pending && (this.rawSegments.push(this.pending), this.advance(e));
208
- this.pending = null;
209
- }
210
- addUneditedChunk(t, e, i, n, r) {
211
- let s = e.start, h = !0, o = !1;
212
- for (; s < e.end; ) {
213
- if (i[s] === `
214
- `)
215
- n.line += 1, n.column = 0, this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, h = !0, o = !1;
216
- else {
217
- if (this.hires || h || r.has(s)) {
218
- const l = [this.generatedCodeColumn, t, n.line, n.column];
219
- this.hires === "boundary" ? $.test(i[s]) ? o || (this.rawSegments.push(l), o = !0) : (this.rawSegments.push(l), o = !1) : this.rawSegments.push(l);
220
- }
221
- n.column += 1, this.generatedCodeColumn += 1, h = !1;
222
- }
223
- s += 1;
224
- }
225
- this.pending = null;
226
- }
227
- advance(t) {
228
- if (!t) return;
229
- const e = t.split(`
230
- `);
231
- if (e.length > 1) {
232
- for (let i = 0; i < e.length - 1; i++)
233
- this.generatedCodeLine++, this.raw[this.generatedCodeLine] = this.rawSegments = [];
234
- this.generatedCodeColumn = 0;
235
- }
236
- this.generatedCodeColumn += e[e.length - 1].length;
237
- }
238
- }
239
- const d = `
240
- `, f = {
241
- insertLeft: !1,
242
- insertRight: !1,
243
- storeName: !1
244
- };
245
- class v {
246
- constructor(t, e = {}) {
247
- const i = new g(0, t.length, t);
248
- Object.defineProperties(this, {
249
- original: { writable: !0, value: t },
250
- outro: { writable: !0, value: "" },
251
- intro: { writable: !0, value: "" },
252
- firstChunk: { writable: !0, value: i },
253
- lastChunk: { writable: !0, value: i },
254
- lastSearchedChunk: { writable: !0, value: i },
255
- byStart: { writable: !0, value: {} },
256
- byEnd: { writable: !0, value: {} },
257
- filename: { writable: !0, value: e.filename },
258
- indentExclusionRanges: { writable: !0, value: e.indentExclusionRanges },
259
- sourcemapLocations: { writable: !0, value: new p() },
260
- storedNames: { writable: !0, value: {} },
261
- indentStr: { writable: !0, value: void 0 },
262
- ignoreList: { writable: !0, value: e.ignoreList },
263
- offset: { writable: !0, value: e.offset || 0 }
264
- }), this.byStart[0] = i, this.byEnd[t.length] = i;
265
- }
266
- addSourcemapLocation(t) {
267
- this.sourcemapLocations.add(t);
268
- }
269
- append(t) {
270
- if (typeof t != "string") throw new TypeError("outro content must be a string");
271
- return this.outro += t, this;
272
- }
273
- appendLeft(t, e) {
274
- if (t = t + this.offset, typeof e != "string") throw new TypeError("inserted content must be a string");
275
- this._split(t);
276
- const i = this.byEnd[t];
277
- return i ? i.appendLeft(e) : this.intro += e, this;
278
- }
279
- appendRight(t, e) {
280
- if (t = t + this.offset, typeof e != "string") throw new TypeError("inserted content must be a string");
281
- this._split(t);
282
- const i = this.byStart[t];
283
- return i ? i.appendRight(e) : this.outro += e, this;
284
- }
285
- clone() {
286
- const t = new v(this.original, { filename: this.filename, offset: this.offset });
287
- let e = this.firstChunk, i = t.firstChunk = t.lastSearchedChunk = e.clone();
288
- for (; e; ) {
289
- t.byStart[i.start] = i, t.byEnd[i.end] = i;
290
- const n = e.next, r = n && n.clone();
291
- r && (i.next = r, r.previous = i, i = r), e = n;
292
- }
293
- return t.lastChunk = i, this.indentExclusionRanges && (t.indentExclusionRanges = this.indentExclusionRanges.slice()), t.sourcemapLocations = new p(this.sourcemapLocations), t.intro = this.intro, t.outro = this.outro, t;
294
- }
295
- generateDecodedMap(t) {
296
- t = t || {};
297
- const e = 0, i = Object.keys(this.storedNames), n = new U(t.hires), r = y(this.original);
298
- return this.intro && n.advance(this.intro), this.firstChunk.eachNext((s) => {
299
- const h = r(s.start);
300
- s.intro.length && n.advance(s.intro), s.edited ? n.addEdit(
301
- e,
302
- s.content,
303
- h,
304
- s.storeName ? i.indexOf(s.original) : -1
305
- ) : n.addUneditedChunk(e, s, this.original, h, this.sourcemapLocations), s.outro.length && n.advance(s.outro);
306
- }), this.outro && n.advance(this.outro), {
307
- file: t.file ? t.file.split(/[/\\]/).pop() : void 0,
308
- sources: [
309
- t.source ? A(t.file || "", t.source) : t.file || ""
310
- ],
311
- sourcesContent: t.includeContent ? [this.original] : void 0,
312
- names: i,
313
- mappings: n.raw,
314
- x_google_ignoreList: this.ignoreList ? [e] : void 0
315
- };
316
- }
317
- generateMap(t) {
318
- return new N(this.generateDecodedMap(t));
319
- }
320
- _ensureindentStr() {
321
- this.indentStr === void 0 && (this.indentStr = I(this.original));
322
- }
323
- _getRawIndentString() {
324
- return this._ensureindentStr(), this.indentStr;
325
- }
326
- getIndentString() {
327
- return this._ensureindentStr(), this.indentStr === null ? " " : this.indentStr;
328
- }
329
- indent(t, e) {
330
- const i = /^[^\r\n]/gm;
331
- if (j(t) && (e = t, t = void 0), t === void 0 && (this._ensureindentStr(), t = this.indentStr || " "), t === "") return this;
332
- e = e || {};
333
- const n = {};
334
- e.exclude && (typeof e.exclude[0] == "number" ? [e.exclude] : e.exclude).forEach((a) => {
335
- for (let w = a[0]; w < a[1]; w += 1)
336
- n[w] = !0;
337
- });
338
- let r = e.indentStart !== !1;
339
- const s = (l) => r ? `${t}${l}` : (r = !0, l);
340
- this.intro = this.intro.replace(i, s);
341
- let h = 0, o = this.firstChunk;
342
- for (; o; ) {
343
- const l = o.end;
344
- if (o.edited)
345
- n[h] || (o.content = o.content.replace(i, s), o.content.length && (r = o.content[o.content.length - 1] === `
346
- `));
347
- else
348
- for (h = o.start; h < l; ) {
349
- if (!n[h]) {
350
- const a = this.original[h];
351
- a === `
352
- ` ? r = !0 : a !== "\r" && r && (r = !1, h === o.start || (this._splitChunk(o, h), o = o.next), o.prependRight(t));
353
- }
354
- h += 1;
355
- }
356
- h = o.end, o = o.next;
357
- }
358
- return this.outro = this.outro.replace(i, s), this;
359
- }
360
- insert() {
361
- throw new Error(
362
- "magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"
363
- );
364
- }
365
- insertLeft(t, e) {
366
- return f.insertLeft || (console.warn(
367
- "magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
368
- ), f.insertLeft = !0), this.appendLeft(t, e);
369
- }
370
- insertRight(t, e) {
371
- return f.insertRight || (console.warn(
372
- "magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
373
- ), f.insertRight = !0), this.prependRight(t, e);
374
- }
375
- move(t, e, i) {
376
- if (t = t + this.offset, e = e + this.offset, i = i + this.offset, i >= t && i <= e) throw new Error("Cannot move a selection inside itself");
377
- this._split(t), this._split(e), this._split(i);
378
- const n = this.byStart[t], r = this.byEnd[e], s = n.previous, h = r.next, o = this.byStart[i];
379
- if (!o && r === this.lastChunk) return this;
380
- const l = o ? o.previous : this.lastChunk;
381
- return s && (s.next = h), h && (h.previous = s), l && (l.next = n), o && (o.previous = r), n.previous || (this.firstChunk = r.next), r.next || (this.lastChunk = n.previous, this.lastChunk.next = null), n.previous = l, r.next = o || null, l || (this.firstChunk = n), o || (this.lastChunk = r), this;
382
- }
383
- overwrite(t, e, i, n) {
384
- return n = n || {}, this.update(t, e, i, { ...n, overwrite: !n.contentOnly });
385
- }
386
- update(t, e, i, n) {
387
- if (t = t + this.offset, e = e + this.offset, typeof i != "string") throw new TypeError("replacement content must be a string");
388
- if (this.original.length !== 0) {
389
- for (; t < 0; ) t += this.original.length;
390
- for (; e < 0; ) e += this.original.length;
391
- }
392
- if (e > this.original.length) throw new Error("end is out of bounds");
393
- if (t === e)
394
- throw new Error(
395
- "Cannot overwrite a zero-length range – use appendLeft or prependRight instead"
396
- );
397
- this._split(t), this._split(e), n === !0 && (f.storeName || (console.warn(
398
- "The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
399
- ), f.storeName = !0), n = { storeName: !0 });
400
- const r = n !== void 0 ? n.storeName : !1, s = n !== void 0 ? n.overwrite : !1;
401
- if (r) {
402
- const l = this.original.slice(t, e);
403
- Object.defineProperty(this.storedNames, l, {
404
- writable: !0,
405
- value: !0,
406
- enumerable: !0
407
- });
408
- }
409
- const h = this.byStart[t], o = this.byEnd[e];
410
- if (h) {
411
- let l = h;
412
- for (; l !== o; ) {
413
- if (l.next !== this.byStart[l.end])
414
- throw new Error("Cannot overwrite across a split point");
415
- l = l.next, l.edit("", !1);
416
- }
417
- h.edit(i, r, !s);
418
- } else {
419
- const l = new g(t, e, "").edit(i, r);
420
- o.next = l, l.previous = o;
421
- }
422
- return this;
423
- }
424
- prepend(t) {
425
- if (typeof t != "string") throw new TypeError("outro content must be a string");
426
- return this.intro = t + this.intro, this;
427
- }
428
- prependLeft(t, e) {
429
- if (t = t + this.offset, typeof e != "string") throw new TypeError("inserted content must be a string");
430
- this._split(t);
431
- const i = this.byEnd[t];
432
- return i ? i.prependLeft(e) : this.intro = e + this.intro, this;
433
- }
434
- prependRight(t, e) {
435
- if (t = t + this.offset, typeof e != "string") throw new TypeError("inserted content must be a string");
436
- this._split(t);
437
- const i = this.byStart[t];
438
- return i ? i.prependRight(e) : this.outro = e + this.outro, this;
439
- }
440
- remove(t, e) {
441
- if (t = t + this.offset, e = e + this.offset, this.original.length !== 0) {
442
- for (; t < 0; ) t += this.original.length;
443
- for (; e < 0; ) e += this.original.length;
444
- }
445
- if (t === e) return this;
446
- if (t < 0 || e > this.original.length) throw new Error("Character is out of bounds");
447
- if (t > e) throw new Error("end must be greater than start");
448
- this._split(t), this._split(e);
449
- let i = this.byStart[t];
450
- for (; i; )
451
- i.intro = "", i.outro = "", i.edit(""), i = e > i.end ? this.byStart[i.end] : null;
452
- return this;
453
- }
454
- reset(t, e) {
455
- if (t = t + this.offset, e = e + this.offset, this.original.length !== 0) {
456
- for (; t < 0; ) t += this.original.length;
457
- for (; e < 0; ) e += this.original.length;
458
- }
459
- if (t === e) return this;
460
- if (t < 0 || e > this.original.length) throw new Error("Character is out of bounds");
461
- if (t > e) throw new Error("end must be greater than start");
462
- this._split(t), this._split(e);
463
- let i = this.byStart[t];
464
- for (; i; )
465
- i.reset(), i = e > i.end ? this.byStart[i.end] : null;
466
- return this;
467
- }
468
- lastChar() {
469
- if (this.outro.length) return this.outro[this.outro.length - 1];
470
- let t = this.lastChunk;
471
- do {
472
- if (t.outro.length) return t.outro[t.outro.length - 1];
473
- if (t.content.length) return t.content[t.content.length - 1];
474
- if (t.intro.length) return t.intro[t.intro.length - 1];
475
- } while (t = t.previous);
476
- return this.intro.length ? this.intro[this.intro.length - 1] : "";
477
- }
478
- lastLine() {
479
- let t = this.outro.lastIndexOf(d);
480
- if (t !== -1) return this.outro.substr(t + 1);
481
- let e = this.outro, i = this.lastChunk;
482
- do {
483
- if (i.outro.length > 0) {
484
- if (t = i.outro.lastIndexOf(d), t !== -1) return i.outro.substr(t + 1) + e;
485
- e = i.outro + e;
486
- }
487
- if (i.content.length > 0) {
488
- if (t = i.content.lastIndexOf(d), t !== -1) return i.content.substr(t + 1) + e;
489
- e = i.content + e;
490
- }
491
- if (i.intro.length > 0) {
492
- if (t = i.intro.lastIndexOf(d), t !== -1) return i.intro.substr(t + 1) + e;
493
- e = i.intro + e;
494
- }
495
- } while (i = i.previous);
496
- return t = this.intro.lastIndexOf(d), t !== -1 ? this.intro.substr(t + 1) + e : this.intro + e;
497
- }
498
- slice(t = 0, e = this.original.length - this.offset) {
499
- if (t = t + this.offset, e = e + this.offset, this.original.length !== 0) {
500
- for (; t < 0; ) t += this.original.length;
501
- for (; e < 0; ) e += this.original.length;
502
- }
503
- let i = "", n = this.firstChunk;
504
- for (; n && (n.start > t || n.end <= t); ) {
505
- if (n.start < e && n.end >= e)
506
- return i;
507
- n = n.next;
508
- }
509
- if (n && n.edited && n.start !== t)
510
- throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);
511
- const r = n;
512
- for (; n; ) {
513
- n.intro && (r !== n || n.start === t) && (i += n.intro);
514
- const s = n.start < e && n.end >= e;
515
- if (s && n.edited && n.end !== e)
516
- throw new Error(`Cannot use replaced character ${e} as slice end anchor.`);
517
- const h = r === n ? t - n.start : 0, o = s ? n.content.length + e - n.end : n.content.length;
518
- if (i += n.content.slice(h, o), n.outro && (!s || n.end === e) && (i += n.outro), s)
519
- break;
520
- n = n.next;
521
- }
522
- return i;
523
- }
524
- // TODO deprecate this? not really very useful
525
- snip(t, e) {
526
- const i = this.clone();
527
- return i.remove(0, t), i.remove(e, i.original.length), i;
528
- }
529
- _split(t) {
530
- if (this.byStart[t] || this.byEnd[t]) return;
531
- let e = this.lastSearchedChunk, i = e;
532
- const n = t > e.end;
533
- for (; e; ) {
534
- if (e.contains(t)) return this._splitChunk(e, t);
535
- if (e = n ? this.byStart[e.end] : this.byEnd[e.start], e === i) return;
536
- i = e;
537
- }
538
- }
539
- _splitChunk(t, e) {
540
- if (t.edited && t.content.length) {
541
- const n = y(this.original)(e);
542
- throw new Error(
543
- `Cannot split a chunk that has already been edited (${n.line}:${n.column} – "${t.original}")`
544
- );
545
- }
546
- const i = t.split(e);
547
- return this.byEnd[e] = t, this.byStart[e] = i, this.byEnd[i.end] = i, t === this.lastChunk && (this.lastChunk = i), this.lastSearchedChunk = t, !0;
548
- }
549
- toString() {
550
- let t = this.intro, e = this.firstChunk;
551
- for (; e; )
552
- t += e.toString(), e = e.next;
553
- return t + this.outro;
554
- }
555
- isEmpty() {
556
- let t = this.firstChunk;
557
- do
558
- if (t.intro.length && t.intro.trim() || t.content.length && t.content.trim() || t.outro.length && t.outro.trim())
559
- return !1;
560
- while (t = t.next);
561
- return !0;
562
- }
563
- length() {
564
- let t = this.firstChunk, e = 0;
565
- do
566
- e += t.intro.length + t.content.length + t.outro.length;
567
- while (t = t.next);
568
- return e;
569
- }
570
- trimLines() {
571
- return this.trim("[\\r\\n]");
572
- }
573
- trim(t) {
574
- return this.trimStart(t).trimEnd(t);
575
- }
576
- trimEndAborted(t) {
577
- const e = new RegExp((t || "\\s") + "+$");
578
- if (this.outro = this.outro.replace(e, ""), this.outro.length) return !0;
579
- let i = this.lastChunk;
580
- do {
581
- const n = i.end, r = i.trimEnd(e);
582
- if (i.end !== n && (this.lastChunk === i && (this.lastChunk = i.next), this.byEnd[i.end] = i, this.byStart[i.next.start] = i.next, this.byEnd[i.next.end] = i.next), r) return !0;
583
- i = i.previous;
584
- } while (i);
585
- return !1;
586
- }
587
- trimEnd(t) {
588
- return this.trimEndAborted(t), this;
589
- }
590
- trimStartAborted(t) {
591
- const e = new RegExp("^" + (t || "\\s") + "+");
592
- if (this.intro = this.intro.replace(e, ""), this.intro.length) return !0;
593
- let i = this.firstChunk;
594
- do {
595
- const n = i.end, r = i.trimStart(e);
596
- if (i.end !== n && (i === this.lastChunk && (this.lastChunk = i.next), this.byEnd[i.end] = i, this.byStart[i.next.start] = i.next, this.byEnd[i.next.end] = i.next), r) return !0;
597
- i = i.next;
598
- } while (i);
599
- return !1;
600
- }
601
- trimStart(t) {
602
- return this.trimStartAborted(t), this;
603
- }
604
- hasChanged() {
605
- return this.original !== this.toString();
606
- }
607
- _replaceRegexp(t, e) {
608
- function i(r, s) {
609
- return typeof e == "string" ? e.replace(/\$(\$|&|\d+)/g, (h, o) => o === "$" ? "$" : o === "&" ? r[0] : +o < r.length ? r[+o] : `$${o}`) : e(...r, r.index, s, r.groups);
610
- }
611
- function n(r, s) {
612
- let h;
613
- const o = [];
614
- for (; h = r.exec(s); )
615
- o.push(h);
616
- return o;
617
- }
618
- if (t.global)
619
- n(t, this.original).forEach((s) => {
620
- if (s.index != null) {
621
- const h = i(s, this.original);
622
- h !== s[0] && this.overwrite(s.index, s.index + s[0].length, h);
623
- }
624
- });
625
- else {
626
- const r = this.original.match(t);
627
- if (r && r.index != null) {
628
- const s = i(r, this.original);
629
- s !== r[0] && this.overwrite(r.index, r.index + r[0].length, s);
630
- }
631
- }
632
- return this;
633
- }
634
- _replaceString(t, e) {
635
- const { original: i } = this, n = i.indexOf(t);
636
- return n !== -1 && (typeof e == "function" && (e = e(t, n, i)), t !== e && this.overwrite(n, n + t.length, e)), this;
637
- }
638
- replace(t, e) {
639
- return typeof t == "string" ? this._replaceString(t, e) : this._replaceRegexp(t, e);
640
- }
641
- _replaceAllString(t, e) {
642
- const { original: i } = this, n = t.length;
643
- for (let r = i.indexOf(t); r !== -1; r = i.indexOf(t, r + n)) {
644
- const s = i.slice(r, r + n);
645
- let h = e;
646
- typeof e == "function" && (h = e(s, r, i)), s !== h && this.overwrite(r, r + n, h);
647
- }
648
- return this;
649
- }
650
- replaceAll(t, e) {
651
- if (typeof t == "string")
652
- return this._replaceAllString(t, e);
653
- if (!t.global)
654
- throw new TypeError(
655
- "MagicString.prototype.replaceAll called with a non-global RegExp argument"
656
- );
657
- return this._replaceRegexp(t, e);
658
- }
659
- }
660
- export {
661
- N as SourceMap,
662
- v as default
663
- };