@knime/jsonforms 1.14.2 → 1.15.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 (165) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/{AnyOfTwinlist-Cwxtyt0Q.js → AnyOfTwinlist-Co_sJAsc.js} +3 -3
  3. package/dist/{Button-BxuGKyL5.js → Button-Cqwayw73.js} +4 -4
  4. package/dist/CheckboxControl-C10_DX1N.js +40 -0
  5. package/dist/{Checkboxes-DIPjJhPO.js → Checkboxes-DWOxHiUX.js} +2 -2
  6. package/dist/{CheckboxesControl-5QlPmjwv.js → CheckboxesControl-BMRFgmO_.js} +7 -10
  7. package/dist/{ComboBoxControl-Dk02x7sN.js → ComboBoxControl-R0DlbAdT.js} +26 -29
  8. package/dist/{DateControl-CddCObVg.js → DateControl-DAGAM92B.js} +3 -3
  9. package/dist/DateTimeControl-DJhIb_U4.js +45 -0
  10. package/dist/{DateTimeFormatInput-bO1zHUyp.js → DateTimeFormatInput-BhLQzC-P.js} +74 -82
  11. package/dist/{DateTimeFormatPickerControl-Dq25_JV2.js → DateTimeFormatPickerControl-V7pxRYaW.js} +5 -8
  12. package/dist/{DateTimeFormatPickerWithTypeControl-DZib_x-B.js → DateTimeFormatPickerWithTypeControl-3fa75rGw.js} +6 -9
  13. package/dist/{DateTimeInput-CEYEV8dt.js → DateTimeInput-Cs0KqlOS.js} +4629 -4556
  14. package/dist/Dropdown-BEx-cvXH.js +608 -0
  15. package/dist/{DropdownControl-BNQKWzTT.js → DropdownControl-DEIA5VD4.js} +4 -4
  16. package/dist/{HorizontalLayout-6GwurgkR.js → HorizontalLayout-DCfhMNq4.js} +2 -2
  17. package/dist/{InputField-BYxW_-G3.js → InputField-OkFB9VHZ.js} +11 -11
  18. package/dist/{IntegerControl-DZIY-wb_.js → IntegerControl-Om8J7hch.js} +3 -3
  19. package/dist/{IntervalControl-Yts36_MI.js → IntervalControl-B7UbyyD-.js} +99 -100
  20. package/dist/{LoadingDropdown-Dw-0WQ8x.js → LoadingDropdown-CINkq_Sw.js} +6 -6
  21. package/dist/{ManualTwinlistControl-C3NnAug1.js → ManualTwinlistControl-BLTfr2gT.js} +24 -30
  22. package/dist/MultiSelectListBoxControl-j1TaFtQj.js +31 -0
  23. package/dist/{MultimodeTwinlistControl-B2Jven29.js → MultimodeTwinlistControl-BsFqHRFM.js} +97 -108
  24. package/dist/{MultimodeTwinlistControl.vue_vue_type_style_index_0_scoped_37fe7036_lang-DGKMWtLi.js → MultimodeTwinlistControl.vue_vue_type_style_index_0_scoped_37fe7036_lang-2fVBipAl.js} +1 -1
  25. package/dist/{MultiselectListBox-CHvGxAhY.js → MultiselectListBox-CMTJnAWr.js} +18 -23
  26. package/dist/{NameFilter-D0hKO5Fr.js → NameFilter-d5k6rDVY.js} +3 -3
  27. package/dist/{NumberControl-DkeQT1iR.js → NumberControl-Kc3hvVef.js} +3 -3
  28. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-BOCR1qXG.js +50 -0
  29. package/dist/{NumberInput-DJ38AGiR.js → NumberInput-BepS3tAK.js} +5 -5
  30. package/dist/{OneOfDropdown-NAgE-mPP.js → OneOfDropdown-CLwVXrbC.js} +10 -11
  31. package/dist/{RadioControl-DjrysNQ_.js → RadioControl-DpziR8nA.js} +4 -4
  32. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-DVIeg5W1.js +104 -0
  33. package/dist/{RichTextControl-CXY1ULxR.js → RichTextControl-CE6whfV5.js} +4524 -4079
  34. package/dist/SectionHeading-D7znCZXu.js +19 -0
  35. package/dist/SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-DR31vaIu.js +15431 -0
  36. package/dist/{SectionLayout-CJP4sYyB.js → SectionLayout-BhXDOzqB.js} +4 -4
  37. package/dist/SettingsSubPanel-x9uWGoiu.js +5 -0
  38. package/dist/{SettingsSubPanelLayout-YBNVPQOD.js → SettingsSubPanelLayout-BPHBM5n5.js} +12 -11
  39. package/dist/{SimpleButtonControl-ejyUwJdL.js → SimpleButtonControl-DfCSlgZS.js} +9 -9
  40. package/dist/SimpleTwinlistControl-CBalniCf.js +25 -0
  41. package/dist/{SingleSelectControl-B0JgDv7j.js → SingleSelectControl-DC4w0ata.js} +4 -4
  42. package/dist/{SingleSelectListBoxControl-ClQOxnxW.js → SingleSelectListBoxControl-CKj-p8jZ.js} +33 -36
  43. package/dist/{SortListControl-mvJofiWn.js → SortListControl-BIUyPjCi.js} +122 -120
  44. package/dist/{StyledListItem-BXz08pEQ.js → StyledListItem-D-HJWfo5.js} +3 -3
  45. package/dist/{TextAreaControl-S4aoqAv1.js → TextAreaControl-D28TQZEY.js} +23 -26
  46. package/dist/{TextControl-rJrjrBw8.js → TextControl-DUDBWcHy.js} +1 -1
  47. package/dist/{TextControl.vue_vue_type_script_setup_true_lang-Bf6GB1zX.js → TextControl.vue_vue_type_script_setup_true_lang-DpAd3yOu.js} +16 -19
  48. package/dist/TimeControl-HRooO_z3.js +36 -0
  49. package/dist/{TwinlistControlBase-D1l9t7Up.js → TwinlistControlBase-Brfh5pqZ.js} +5 -5
  50. package/dist/{TwinlistLoadingInfo-CQRx9cEu.js → TwinlistLoadingInfo-C4Tta00d.js} +150 -167
  51. package/dist/TypedStringFilter-CdvgPKhD.js +26 -0
  52. package/dist/{ValueSwitch-CUYV7v67.js → ValueSwitch-W4y1YvNM.js} +8 -8
  53. package/dist/{ValueSwitchControl-IP9SxrUs.js → ValueSwitchControl-BaXH8Cjx.js} +3 -3
  54. package/dist/{VerticalLayout-D2eQSYgv.js → VerticalLayout-ChAmRKNj.js} +5 -5
  55. package/dist/VerticalLayoutBase-DAk4vfH5.js +20 -0
  56. package/dist/ZonedDateTimeControl-Qb57KmMT.js +69 -0
  57. package/dist/{_baseEach-cjHvi5iT.js → _baseEach-DdH9cM67.js} +4 -4
  58. package/dist/{_baseIteratee-CIxt0KWU.js → _baseIteratee-BGt-t7Os.js} +27 -27
  59. package/dist/{_getTag-sLUyzSDj.js → _getTag-DAFySze4.js} +10 -10
  60. package/dist/{arrow-dropdown-DdgjzLAO.js → arrow-dropdown-BAFsD8Su.js} +2 -2
  61. package/dist/{arrow-next-CIOU5o42.js → arrow-next-BQVCxGb8.js} +2 -2
  62. package/dist/{close-BuY4mhXV.js → close-DGt8x-x_.js} +2 -2
  63. package/dist/floating-ui.vue-CDo9Kas1.js +1055 -0
  64. package/dist/{hotkeys-kwHHtFKz.js → hotkeys-rxnt4egK.js} +1 -1
  65. package/dist/index-CpKfM262.js +376 -0
  66. package/dist/knime-jsonforms.css +1 -1
  67. package/dist/knime-jsonforms.js +64 -67
  68. package/dist/{localTimeUtils-Dv-1R88J.js → localTimeUtils-NIKgHnIr.js} +179 -181
  69. package/dist/magic-string.es-BQ9KnLz-.js +659 -0
  70. package/dist/navigator-e30QQMkl.js +4 -0
  71. package/dist/popper-LGjf7Wza.js +905 -0
  72. package/dist/{reload-BVbCGubF.js → reload-DCdbNLa2.js} +2 -2
  73. package/dist/src/higherOrderComponents/control/LabeledControl.vue.d.ts +26 -22
  74. package/dist/src/higherOrderComponents/control/errorMessage/ErrorLine.vue.d.ts +3 -4
  75. package/dist/src/higherOrderComponents/control/errorMessage/ErrorMessages.vue.d.ts +16 -10
  76. package/dist/src/higherOrderComponents/control/errorMessage/withErrorMessage.d.ts +1 -1
  77. package/dist/src/higherOrderComponents/control/util.d.ts +7 -33
  78. package/dist/src/higherOrderComponents/layout/util.d.ts +1 -17
  79. package/dist/src/layoutComponents/Form.vue.d.ts +12 -4
  80. package/dist/src/layoutComponents/HorizontalLayout.vue.d.ts +1 -1
  81. package/dist/src/layoutComponents/SectionLayout.vue.d.ts +13 -5
  82. package/dist/src/layoutComponents/VerticalLayout.vue.d.ts +1 -1
  83. package/dist/src/layoutComponents/VerticalLayoutBase.vue.d.ts +16 -9
  84. package/dist/src/layoutComponents/section/SectionHeading.vue.d.ts +13 -6
  85. package/dist/src/layoutComponents/settingsSubPanel/SettingsSubPanel.vue.d.ts +2 -2
  86. package/dist/src/layoutComponents/settingsSubPanel/SettingsSubPanelBackArrow.vue.d.ts +1 -1
  87. package/dist/src/renderers/dateTimeFormatPickerRenderer.d.ts +2 -2
  88. package/dist/src/renderers/defaultRenderers.d.ts +966 -151
  89. package/dist/src/renderers/dropdownRenderer.d.ts +1 -1
  90. package/dist/src/renderers/fallbackRenderers.d.ts +8 -8
  91. package/dist/src/renderers/horizontalLayoutRenderer.d.ts +1 -1
  92. package/dist/src/renderers/sectionLayoutRenderer.d.ts +4 -4
  93. package/dist/src/renderers/simpleButtonRenderer.d.ts +7 -89
  94. package/dist/src/renderers/sortListRenderer.d.ts +853 -20
  95. package/dist/src/renderers/textMessageRenderer.d.ts +65 -1
  96. package/dist/src/renderers/textRenderer.d.ts +1 -1
  97. package/dist/src/renderers/verticalLayoutRenderer.d.ts +2 -2
  98. package/dist/src/renderers/zonedDateTimeRenderer.d.ts +1 -1
  99. package/dist/src/uiComponents/CheckboxControl.vue.d.ts +15 -6
  100. package/dist/src/uiComponents/CheckboxesControl.vue.d.ts +2 -1
  101. package/dist/src/uiComponents/ComboBoxControl.vue.d.ts +2 -1
  102. package/dist/src/uiComponents/DateControl.vue.d.ts +2 -1
  103. package/dist/src/uiComponents/DateTimeControl.vue.d.ts +2 -1
  104. package/dist/src/uiComponents/DateTimeFormatPickerControl.vue.d.ts +2 -1
  105. package/dist/src/uiComponents/DateTimeFormatPickerWithTypeControl.vue.d.ts +2 -1
  106. package/dist/src/uiComponents/DropdownControl.vue.d.ts +2 -1
  107. package/dist/src/uiComponents/IntegerControl.vue.d.ts +2 -1
  108. package/dist/src/uiComponents/IntervalControl.vue.d.ts +2 -1
  109. package/dist/src/uiComponents/MultiSelectListBoxControl.vue.d.ts +2 -1
  110. package/dist/src/uiComponents/NumberControl.vue.d.ts +2 -1
  111. package/dist/src/uiComponents/NumberControlBase.vue.d.ts +5 -9
  112. package/dist/src/uiComponents/OneOfDropdown.vue.d.ts +2 -1
  113. package/dist/src/uiComponents/RadioControl.vue.d.ts +2 -1
  114. package/dist/src/uiComponents/RadioControlBase.vue.d.ts +4 -8
  115. package/dist/src/uiComponents/SimpleButtonControl.vue.d.ts +5 -129
  116. package/dist/src/uiComponents/SingleSelectControl.vue.d.ts +2 -1
  117. package/dist/src/uiComponents/SingleSelectListBoxControl.vue.d.ts +2 -1
  118. package/dist/src/uiComponents/SortListControl.vue.d.ts +845 -12
  119. package/dist/src/uiComponents/TextAreaControl.vue.d.ts +2 -1
  120. package/dist/src/uiComponents/TextControl.vue.d.ts +203 -3
  121. package/dist/src/uiComponents/TextMessageControl.vue.d.ts +2 -1
  122. package/dist/src/uiComponents/TimeControl.vue.d.ts +2 -1
  123. package/dist/src/uiComponents/ValueSwitchControl.vue.d.ts +2 -1
  124. package/dist/src/uiComponents/ZonedDateTimeControl.vue.d.ts +2 -1
  125. package/dist/src/uiComponents/composables/useProvidedState.d.ts +1 -1
  126. package/dist/src/uiComponents/loading/TwinlistLoadingInfo.vue.d.ts +1 -1
  127. package/dist/src/uiComponents/richTextControl/DialogLinkModal.vue.d.ts +3 -1
  128. package/dist/src/uiComponents/richTextControl/RichTextControl.vue.d.ts +230 -1
  129. package/dist/src/uiComponents/twinlist/AnyOfTwinlist.vue.d.ts +2 -1
  130. package/dist/src/uiComponents/twinlist/ManualTwinlistControl.vue.d.ts +2 -1
  131. package/dist/src/uiComponents/twinlist/MultimodeTwinlistControl.vue.d.ts +8 -15
  132. package/dist/src/uiComponents/twinlist/NameFilter.vue.d.ts +2 -1
  133. package/dist/src/uiComponents/twinlist/SimpleTwinlistControl.vue.d.ts +2 -1
  134. package/dist/src/uiComponents/twinlist/TwinlistControlBase.vue.d.ts +5 -10
  135. package/dist/src/uiComponents/twinlist/TypedStringFilter.vue.d.ts +2 -1
  136. package/dist/{svgWithTitle-Cr3Pu3wr.js → svgWithTitle-CnTmPYAB.js} +4 -4
  137. package/dist/testUtils/component.d.ts +18 -18
  138. package/dist/testing.js +8688 -8655
  139. package/dist/{toString-C_MqBj3_.js → toString-BhubvA3m.js} +1 -1
  140. package/dist/{useBuiltinValidations-DP7OS71z.js → useBuiltinValidations-Boxrm71q.js} +1 -1
  141. package/dist/useDropdownNavigation-BfCXUheD.js +817 -0
  142. package/dist/usePossibleValues-DXuWWBh_.js +16 -0
  143. package/package.json +14 -14
  144. package/dist/CheckboxControl-Oe97HhY3.js +0 -40
  145. package/dist/DateTimeControl-DyXUJBHE.js +0 -54
  146. package/dist/Dropdown-CJj0CUA8.js +0 -604
  147. package/dist/MultiSelectListBoxControl-3Q41S4aA.js +0 -34
  148. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-B9K5qEs3.js +0 -53
  149. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-WaVJMdQq.js +0 -114
  150. package/dist/SectionHeading-BU1W5lDr.js +0 -19
  151. package/dist/SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-CsYyUtDa.js +0 -14015
  152. package/dist/SettingsSubPanel-KxEyzlB6.js +0 -5
  153. package/dist/SimpleTwinlistControl-qXQxRI7h.js +0 -28
  154. package/dist/TimeControl-DfhE8yu9.js +0 -42
  155. package/dist/TypedStringFilter-C6JhWCCC.js +0 -29
  156. package/dist/VerticalLayoutBase-DRfHwc4t.js +0 -20
  157. package/dist/ZonedDateTimeControl-Bi8cV34A.js +0 -75
  158. package/dist/floating-ui.vue-B-MrqKCT.js +0 -1019
  159. package/dist/index-CoRworrE.js +0 -322
  160. package/dist/magic-string.es-D-aKzDFf.js +0 -858
  161. package/dist/navigator-D_R-txCf.js +0 -7
  162. package/dist/popper-CRR--9mA.js +0 -907
  163. package/dist/src/JsonFormsDialog.vue.d.ts +0 -46
  164. package/dist/useDropdownNavigation-7o7SRJSo.js +0 -781
  165. package/dist/usePossibleValues-lz0Rcu_N.js +0 -20
@@ -1,858 +0,0 @@
1
- import { O as ht } from "./SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-CsYyUtDa.js";
2
- var q = { exports: {} };
3
- (function(E, t) {
4
- (function(e, n) {
5
- n(t);
6
- })(ht, function(e) {
7
- const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", u = new Uint8Array(64), f = new Uint8Array(128);
8
- for (let a = 0; a < r.length; a++) {
9
- const h = r.charCodeAt(a);
10
- u[a] = h, f[h] = a;
11
- }
12
- function o(a, h) {
13
- let i = 0, l = 0, d = 0;
14
- do {
15
- const b = a.next();
16
- d = f[b], i |= (d & 31) << l, l += 5;
17
- } while (d & 32);
18
- const g = i & 1;
19
- return i >>>= 1, g && (i = -2147483648 | -i), h + i;
20
- }
21
- function c(a, h, i) {
22
- let l = h - i;
23
- l = l < 0 ? -l << 1 | 1 : l << 1;
24
- do {
25
- let d = l & 31;
26
- l >>>= 5, l > 0 && (d |= 32), a.write(u[d]);
27
- } while (l > 0);
28
- return h;
29
- }
30
- function k(a, h) {
31
- return a.pos >= h ? !1 : a.peek() !== 44;
32
- }
33
- const O = 1024 * 16, z = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
34
- decode(a) {
35
- return Buffer.from(a.buffer, a.byteOffset, a.byteLength).toString();
36
- }
37
- } : {
38
- decode(a) {
39
- let h = "";
40
- for (let i = 0; i < a.length; i++)
41
- h += String.fromCharCode(a[i]);
42
- return h;
43
- }
44
- };
45
- class P {
46
- constructor() {
47
- this.pos = 0, this.out = "", this.buffer = new Uint8Array(O);
48
- }
49
- write(h) {
50
- const { buffer: i } = this;
51
- i[this.pos++] = h, this.pos === O && (this.out += z.decode(i), this.pos = 0);
52
- }
53
- flush() {
54
- const { buffer: h, out: i, pos: l } = this;
55
- return l > 0 ? i + z.decode(h.subarray(0, l)) : i;
56
- }
57
- }
58
- class G {
59
- constructor(h) {
60
- this.pos = 0, this.buffer = h;
61
- }
62
- next() {
63
- return this.buffer.charCodeAt(this.pos++);
64
- }
65
- peek() {
66
- return this.buffer.charCodeAt(this.pos);
67
- }
68
- indexOf(h) {
69
- const { buffer: i, pos: l } = this, d = i.indexOf(h, l);
70
- return d === -1 ? i.length : d;
71
- }
72
- }
73
- const F = [];
74
- function X(a) {
75
- const { length: h } = a, i = new G(a), l = [], d = [];
76
- let g = 0;
77
- for (; i.pos < h; i.pos++) {
78
- g = o(i, g);
79
- const b = o(i, 0);
80
- if (!k(i, h)) {
81
- const v = d.pop();
82
- v[2] = g, v[3] = b;
83
- continue;
84
- }
85
- const m = o(i, 0), w = o(i, 0) & 1 ? [g, b, 0, 0, m, o(i, 0)] : [g, b, 0, 0, m];
86
- let y = F;
87
- if (k(i, h)) {
88
- y = [];
89
- do {
90
- const v = o(i, 0);
91
- y.push(v);
92
- } while (k(i, h));
93
- }
94
- w.vars = y, l.push(w), d.push(w);
95
- }
96
- return l;
97
- }
98
- function Z(a) {
99
- const h = new P();
100
- for (let i = 0; i < a.length; )
101
- i = H(a, i, h, [0]);
102
- return h.flush();
103
- }
104
- function H(a, h, i, l) {
105
- const d = a[h], { 0: g, 1: b, 2: m, 3: S, 4: C, vars: w } = d;
106
- h > 0 && i.write(44), l[0] = c(i, g, l[0]), c(i, b, 0), c(i, C, 0);
107
- const y = d.length === 6 ? 1 : 0;
108
- c(i, y, 0), d.length === 6 && c(i, d[5], 0);
109
- for (const v of w)
110
- c(i, v, 0);
111
- for (h++; h < a.length; ) {
112
- const v = a[h], { 0: p, 1: x } = v;
113
- if (p > m || p === m && x >= S)
114
- break;
115
- h = H(a, h, i, l);
116
- }
117
- return i.write(44), l[0] = c(i, m, l[0]), c(i, S, 0), h;
118
- }
119
- function V(a) {
120
- const { length: h } = a, i = new G(a), l = [], d = [];
121
- let g = 0, b = 0, m = 0, S = 0, C = 0, w = 0, y = 0, v = 0;
122
- do {
123
- const p = i.indexOf(";");
124
- let x = 0;
125
- for (; i.pos < p; i.pos++) {
126
- if (x = o(i, x), !k(i, p)) {
127
- const L = d.pop();
128
- L[2] = g, L[3] = x;
129
- continue;
130
- }
131
- const R = o(i, 0), U = R & 1, A = R & 2, T = R & 4;
132
- let Y = null, D = F, _;
133
- if (U) {
134
- const L = o(i, b);
135
- m = o(i, b === L ? m : 0), b = L, _ = [g, x, 0, 0, L, m];
136
- } else
137
- _ = [g, x, 0, 0];
138
- if (_.isScope = !!T, A) {
139
- const L = S, I = C;
140
- S = o(i, S);
141
- const j = L === S;
142
- C = o(i, j ? C : 0), w = o(i, j && I === C ? w : 0), Y = [S, C, w];
143
- }
144
- if (_.callsite = Y, k(i, p)) {
145
- D = [];
146
- do {
147
- y = g, v = x;
148
- const L = o(i, 0);
149
- let I;
150
- if (L < -1) {
151
- I = [[o(i, 0)]];
152
- for (let j = -1; j > L; j--) {
153
- const rt = y;
154
- y = o(i, y), v = o(i, y === rt ? v : 0);
155
- const ot = o(i, 0);
156
- I.push([ot, y, v]);
157
- }
158
- } else
159
- I = [[L]];
160
- D.push(I);
161
- } while (k(i, p));
162
- }
163
- _.bindings = D, l.push(_), d.push(_);
164
- }
165
- g++, i.pos = p + 1;
166
- } while (i.pos < h);
167
- return l;
168
- }
169
- function tt(a) {
170
- if (a.length === 0)
171
- return "";
172
- const h = new P();
173
- for (let i = 0; i < a.length; )
174
- i = J(a, i, h, [0, 0, 0, 0, 0, 0, 0]);
175
- return h.flush();
176
- }
177
- function J(a, h, i, l) {
178
- const d = a[h], { 0: g, 1: b, 2: m, 3: S, isScope: C, callsite: w, bindings: y } = d;
179
- l[0] < g ? (W(i, l[0], g), l[0] = g, l[1] = 0) : h > 0 && i.write(44), l[1] = c(i, d[1], l[1]);
180
- const v = (d.length === 6 ? 1 : 0) | (w ? 2 : 0) | (C ? 4 : 0);
181
- if (c(i, v, 0), d.length === 6) {
182
- const { 4: p, 5: x } = d;
183
- p !== l[2] && (l[3] = 0), l[2] = c(i, p, l[2]), l[3] = c(i, x, l[3]);
184
- }
185
- if (w) {
186
- const { 0: p, 1: x, 2: R } = d.callsite;
187
- p !== l[4] ? (l[5] = 0, l[6] = 0) : x !== l[5] && (l[6] = 0), l[4] = c(i, p, l[4]), l[5] = c(i, x, l[5]), l[6] = c(i, R, l[6]);
188
- }
189
- if (y)
190
- for (const p of y) {
191
- p.length > 1 && c(i, -p.length, 0);
192
- const x = p[0][0];
193
- c(i, x, 0);
194
- let R = g, U = b;
195
- for (let A = 1; A < p.length; A++) {
196
- const T = p[A];
197
- R = c(i, T[1], R), U = c(i, T[2], U), c(i, T[0], 0);
198
- }
199
- }
200
- for (h++; h < a.length; ) {
201
- const p = a[h], { 0: x, 1: R } = p;
202
- if (x > m || x === m && R >= S)
203
- break;
204
- h = J(a, h, i, l);
205
- }
206
- return l[0] < m ? (W(i, l[0], m), l[0] = m, l[1] = 0) : i.write(44), l[1] = c(i, S, l[1]), h;
207
- }
208
- function W(a, h, i) {
209
- do
210
- a.write(59);
211
- while (++h < i);
212
- }
213
- function et(a) {
214
- const { length: h } = a, i = new G(a), l = [];
215
- let d = 0, g = 0, b = 0, m = 0, S = 0;
216
- do {
217
- const C = i.indexOf(";"), w = [];
218
- let y = !0, v = 0;
219
- for (d = 0; i.pos < C; ) {
220
- let p;
221
- d = o(i, d), d < v && (y = !1), v = d, k(i, C) ? (g = o(i, g), b = o(i, b), m = o(i, m), k(i, C) ? (S = o(i, S), p = [d, g, b, m, S]) : p = [d, g, b, m]) : p = [d], w.push(p), i.pos++;
222
- }
223
- y || nt(w), l.push(w), i.pos = C + 1;
224
- } while (i.pos <= h);
225
- return l;
226
- }
227
- function nt(a) {
228
- a.sort(it);
229
- }
230
- function it(a, h) {
231
- return a[0] - h[0];
232
- }
233
- function st(a) {
234
- const h = new P();
235
- let i = 0, l = 0, d = 0, g = 0;
236
- for (let b = 0; b < a.length; b++) {
237
- const m = a[b];
238
- if (b > 0 && h.write(59), m.length === 0)
239
- continue;
240
- let S = 0;
241
- for (let C = 0; C < m.length; C++) {
242
- const w = m[C];
243
- C > 0 && h.write(44), S = c(h, w[0], S), w.length !== 1 && (i = c(h, w[1], i), l = c(h, w[2], l), d = c(h, w[3], d), w.length !== 4 && (g = c(h, w[4], g)));
244
- }
245
- }
246
- return h.flush();
247
- }
248
- e.decode = et, e.decodeGeneratedRanges = V, e.decodeOriginalScopes = X, e.encode = st, e.encodeGeneratedRanges = tt, e.encodeOriginalScopes = Z, Object.defineProperty(e, "__esModule", { value: !0 });
249
- });
250
- })(q, q.exports);
251
- var lt = q.exports;
252
- class B {
253
- constructor(t) {
254
- this.bits = t instanceof B ? t.bits.slice() : [];
255
- }
256
- add(t) {
257
- this.bits[t >> 5] |= 1 << (t & 31);
258
- }
259
- has(t) {
260
- return !!(this.bits[t >> 5] & 1 << (t & 31));
261
- }
262
- }
263
- class M {
264
- constructor(t, e, n) {
265
- this.start = t, this.end = e, this.original = n, this.intro = "", this.outro = "", this.content = n, this.storeName = !1, this.edited = !1, this.previous = null, this.next = null;
266
- }
267
- appendLeft(t) {
268
- this.outro += t;
269
- }
270
- appendRight(t) {
271
- this.intro = this.intro + t;
272
- }
273
- clone() {
274
- const t = new M(this.start, this.end, this.original);
275
- return t.intro = this.intro, t.outro = this.outro, t.content = this.content, t.storeName = this.storeName, t.edited = this.edited, t;
276
- }
277
- contains(t) {
278
- return this.start < t && t < this.end;
279
- }
280
- eachNext(t) {
281
- let e = this;
282
- for (; e; )
283
- t(e), e = e.next;
284
- }
285
- eachPrevious(t) {
286
- let e = this;
287
- for (; e; )
288
- t(e), e = e.previous;
289
- }
290
- edit(t, e, n) {
291
- return this.content = t, n || (this.intro = "", this.outro = ""), this.storeName = e, this.edited = !0, this;
292
- }
293
- prependLeft(t) {
294
- this.outro = t + this.outro;
295
- }
296
- prependRight(t) {
297
- this.intro = t + this.intro;
298
- }
299
- reset() {
300
- this.intro = "", this.outro = "", this.edited && (this.content = this.original, this.storeName = !1, this.edited = !1);
301
- }
302
- split(t) {
303
- const e = t - this.start, n = this.original.slice(0, e), s = this.original.slice(e);
304
- this.original = n;
305
- const r = new M(t, this.end, s);
306
- return r.outro = this.outro, this.outro = "", this.end = t, this.edited ? (r.edit("", !1), this.content = "") : this.content = n, r.next = this.next, r.next && (r.next.previous = r), r.previous = this, this.next = r, r;
307
- }
308
- toString() {
309
- return this.intro + this.content + this.outro;
310
- }
311
- trimEnd(t) {
312
- if (this.outro = this.outro.replace(t, ""), this.outro.length) return !0;
313
- const e = this.content.replace(t, "");
314
- if (e.length)
315
- return e !== this.content && (this.split(this.start + e.length).edit("", void 0, !0), this.edited && this.edit(e, this.storeName, !0)), !0;
316
- if (this.edit("", void 0, !0), this.intro = this.intro.replace(t, ""), this.intro.length) return !0;
317
- }
318
- trimStart(t) {
319
- if (this.intro = this.intro.replace(t, ""), this.intro.length) return !0;
320
- const e = this.content.replace(t, "");
321
- if (e.length) {
322
- if (e !== this.content) {
323
- const n = this.split(this.end - e.length);
324
- this.edited && n.edit(e, this.storeName, !0), this.edit("", void 0, !0);
325
- }
326
- return !0;
327
- } else if (this.edit("", void 0, !0), this.outro = this.outro.replace(t, ""), this.outro.length) return !0;
328
- }
329
- }
330
- function ut() {
331
- return typeof globalThis < "u" && typeof globalThis.btoa == "function" ? (E) => globalThis.btoa(unescape(encodeURIComponent(E))) : typeof Buffer == "function" ? (E) => Buffer.from(E, "utf-8").toString("base64") : () => {
332
- throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
333
- };
334
- }
335
- const ct = /* @__PURE__ */ ut();
336
- class at {
337
- constructor(t) {
338
- this.version = 3, this.file = t.file, this.sources = t.sources, this.sourcesContent = t.sourcesContent, this.names = t.names, this.mappings = lt.encode(t.mappings), typeof t.x_google_ignoreList < "u" && (this.x_google_ignoreList = t.x_google_ignoreList), typeof t.debugId < "u" && (this.debugId = t.debugId);
339
- }
340
- toString() {
341
- return JSON.stringify(this);
342
- }
343
- toUrl() {
344
- return "data:application/json;charset=utf-8;base64," + ct(this.toString());
345
- }
346
- }
347
- function ft(E) {
348
- const t = E.split(`
349
- `), e = t.filter((r) => /^\t+/.test(r)), n = t.filter((r) => /^ {2,}/.test(r));
350
- if (e.length === 0 && n.length === 0)
351
- return null;
352
- if (e.length >= n.length)
353
- return " ";
354
- const s = n.reduce((r, u) => {
355
- const f = /^ +/.exec(u)[0].length;
356
- return Math.min(f, r);
357
- }, 1 / 0);
358
- return new Array(s + 1).join(" ");
359
- }
360
- function dt(E, t) {
361
- const e = E.split(/[/\\]/), n = t.split(/[/\\]/);
362
- for (e.pop(); e[0] === n[0]; )
363
- e.shift(), n.shift();
364
- if (e.length) {
365
- let s = e.length;
366
- for (; s--; ) e[s] = "..";
367
- }
368
- return e.concat(n).join("/");
369
- }
370
- const gt = Object.prototype.toString;
371
- function pt(E) {
372
- return gt.call(E) === "[object Object]";
373
- }
374
- function K(E) {
375
- const t = E.split(`
376
- `), e = [];
377
- for (let n = 0, s = 0; n < t.length; n++)
378
- e.push(s), s += t[n].length + 1;
379
- return function(s) {
380
- let r = 0, u = e.length;
381
- for (; r < u; ) {
382
- const c = r + u >> 1;
383
- s < e[c] ? u = c : r = c + 1;
384
- }
385
- const f = r - 1, o = s - e[f];
386
- return { line: f, column: o };
387
- };
388
- }
389
- const mt = /\w/;
390
- class wt {
391
- constructor(t) {
392
- this.hires = t, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] = [], this.pending = null;
393
- }
394
- addEdit(t, e, n, s) {
395
- if (e.length) {
396
- const r = e.length - 1;
397
- let u = e.indexOf(`
398
- `, 0), f = -1;
399
- for (; u >= 0 && r > u; ) {
400
- const c = [this.generatedCodeColumn, t, n.line, n.column];
401
- s >= 0 && c.push(s), this.rawSegments.push(c), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, f = u, u = e.indexOf(`
402
- `, u + 1);
403
- }
404
- const o = [this.generatedCodeColumn, t, n.line, n.column];
405
- s >= 0 && o.push(s), this.rawSegments.push(o), this.advance(e.slice(f + 1));
406
- } else this.pending && (this.rawSegments.push(this.pending), this.advance(e));
407
- this.pending = null;
408
- }
409
- addUneditedChunk(t, e, n, s, r) {
410
- let u = e.start, f = !0, o = !1;
411
- for (; u < e.end; ) {
412
- if (n[u] === `
413
- `)
414
- s.line += 1, s.column = 0, this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, f = !0, o = !1;
415
- else {
416
- if (this.hires || f || r.has(u)) {
417
- const c = [this.generatedCodeColumn, t, s.line, s.column];
418
- this.hires === "boundary" ? mt.test(n[u]) ? o || (this.rawSegments.push(c), o = !0) : (this.rawSegments.push(c), o = !1) : this.rawSegments.push(c);
419
- }
420
- s.column += 1, this.generatedCodeColumn += 1, f = !1;
421
- }
422
- u += 1;
423
- }
424
- this.pending = null;
425
- }
426
- advance(t) {
427
- if (!t) return;
428
- const e = t.split(`
429
- `);
430
- if (e.length > 1) {
431
- for (let n = 0; n < e.length - 1; n++)
432
- this.generatedCodeLine++, this.raw[this.generatedCodeLine] = this.rawSegments = [];
433
- this.generatedCodeColumn = 0;
434
- }
435
- this.generatedCodeColumn += e[e.length - 1].length;
436
- }
437
- }
438
- const $ = `
439
- `, N = {
440
- insertLeft: !1,
441
- insertRight: !1,
442
- storeName: !1
443
- };
444
- class Q {
445
- constructor(t, e = {}) {
446
- const n = new M(0, t.length, t);
447
- Object.defineProperties(this, {
448
- original: { writable: !0, value: t },
449
- outro: { writable: !0, value: "" },
450
- intro: { writable: !0, value: "" },
451
- firstChunk: { writable: !0, value: n },
452
- lastChunk: { writable: !0, value: n },
453
- lastSearchedChunk: { writable: !0, value: n },
454
- byStart: { writable: !0, value: {} },
455
- byEnd: { writable: !0, value: {} },
456
- filename: { writable: !0, value: e.filename },
457
- indentExclusionRanges: { writable: !0, value: e.indentExclusionRanges },
458
- sourcemapLocations: { writable: !0, value: new B() },
459
- storedNames: { writable: !0, value: {} },
460
- indentStr: { writable: !0, value: void 0 },
461
- ignoreList: { writable: !0, value: e.ignoreList },
462
- offset: { writable: !0, value: e.offset || 0 }
463
- }), this.byStart[0] = n, this.byEnd[t.length] = n;
464
- }
465
- addSourcemapLocation(t) {
466
- this.sourcemapLocations.add(t);
467
- }
468
- append(t) {
469
- if (typeof t != "string") throw new TypeError("outro content must be a string");
470
- return this.outro += t, this;
471
- }
472
- appendLeft(t, e) {
473
- if (t = t + this.offset, typeof e != "string") throw new TypeError("inserted content must be a string");
474
- this._split(t);
475
- const n = this.byEnd[t];
476
- return n ? n.appendLeft(e) : this.intro += e, this;
477
- }
478
- appendRight(t, e) {
479
- if (t = t + this.offset, typeof e != "string") throw new TypeError("inserted content must be a string");
480
- this._split(t);
481
- const n = this.byStart[t];
482
- return n ? n.appendRight(e) : this.outro += e, this;
483
- }
484
- clone() {
485
- const t = new Q(this.original, { filename: this.filename, offset: this.offset });
486
- let e = this.firstChunk, n = t.firstChunk = t.lastSearchedChunk = e.clone();
487
- for (; e; ) {
488
- t.byStart[n.start] = n, t.byEnd[n.end] = n;
489
- const s = e.next, r = s && s.clone();
490
- r && (n.next = r, r.previous = n, n = r), e = s;
491
- }
492
- return t.lastChunk = n, this.indentExclusionRanges && (t.indentExclusionRanges = this.indentExclusionRanges.slice()), t.sourcemapLocations = new B(this.sourcemapLocations), t.intro = this.intro, t.outro = this.outro, t;
493
- }
494
- generateDecodedMap(t) {
495
- t = t || {};
496
- const e = 0, n = Object.keys(this.storedNames), s = new wt(t.hires), r = K(this.original);
497
- return this.intro && s.advance(this.intro), this.firstChunk.eachNext((u) => {
498
- const f = r(u.start);
499
- u.intro.length && s.advance(u.intro), u.edited ? s.addEdit(
500
- e,
501
- u.content,
502
- f,
503
- u.storeName ? n.indexOf(u.original) : -1
504
- ) : s.addUneditedChunk(e, u, this.original, f, this.sourcemapLocations), u.outro.length && s.advance(u.outro);
505
- }), {
506
- file: t.file ? t.file.split(/[/\\]/).pop() : void 0,
507
- sources: [
508
- t.source ? dt(t.file || "", t.source) : t.file || ""
509
- ],
510
- sourcesContent: t.includeContent ? [this.original] : void 0,
511
- names: n,
512
- mappings: s.raw,
513
- x_google_ignoreList: this.ignoreList ? [e] : void 0
514
- };
515
- }
516
- generateMap(t) {
517
- return new at(this.generateDecodedMap(t));
518
- }
519
- _ensureindentStr() {
520
- this.indentStr === void 0 && (this.indentStr = ft(this.original));
521
- }
522
- _getRawIndentString() {
523
- return this._ensureindentStr(), this.indentStr;
524
- }
525
- getIndentString() {
526
- return this._ensureindentStr(), this.indentStr === null ? " " : this.indentStr;
527
- }
528
- indent(t, e) {
529
- const n = /^[^\r\n]/gm;
530
- if (pt(t) && (e = t, t = void 0), t === void 0 && (this._ensureindentStr(), t = this.indentStr || " "), t === "") return this;
531
- e = e || {};
532
- const s = {};
533
- e.exclude && (typeof e.exclude[0] == "number" ? [e.exclude] : e.exclude).forEach((k) => {
534
- for (let O = k[0]; O < k[1]; O += 1)
535
- s[O] = !0;
536
- });
537
- let r = e.indentStart !== !1;
538
- const u = (c) => r ? `${t}${c}` : (r = !0, c);
539
- this.intro = this.intro.replace(n, u);
540
- let f = 0, o = this.firstChunk;
541
- for (; o; ) {
542
- const c = o.end;
543
- if (o.edited)
544
- s[f] || (o.content = o.content.replace(n, u), o.content.length && (r = o.content[o.content.length - 1] === `
545
- `));
546
- else
547
- for (f = o.start; f < c; ) {
548
- if (!s[f]) {
549
- const k = this.original[f];
550
- k === `
551
- ` ? r = !0 : k !== "\r" && r && (r = !1, f === o.start || (this._splitChunk(o, f), o = o.next), o.prependRight(t));
552
- }
553
- f += 1;
554
- }
555
- f = o.end, o = o.next;
556
- }
557
- return this.outro = this.outro.replace(n, u), this;
558
- }
559
- insert() {
560
- throw new Error(
561
- "magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"
562
- );
563
- }
564
- insertLeft(t, e) {
565
- return N.insertLeft || (console.warn(
566
- "magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
567
- ), N.insertLeft = !0), this.appendLeft(t, e);
568
- }
569
- insertRight(t, e) {
570
- return N.insertRight || (console.warn(
571
- "magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
572
- ), N.insertRight = !0), this.prependRight(t, e);
573
- }
574
- move(t, e, n) {
575
- if (t = t + this.offset, e = e + this.offset, n = n + this.offset, n >= t && n <= e) throw new Error("Cannot move a selection inside itself");
576
- this._split(t), this._split(e), this._split(n);
577
- const s = this.byStart[t], r = this.byEnd[e], u = s.previous, f = r.next, o = this.byStart[n];
578
- if (!o && r === this.lastChunk) return this;
579
- const c = o ? o.previous : this.lastChunk;
580
- return u && (u.next = f), f && (f.previous = u), c && (c.next = s), o && (o.previous = r), s.previous || (this.firstChunk = r.next), r.next || (this.lastChunk = s.previous, this.lastChunk.next = null), s.previous = c, r.next = o || null, c || (this.firstChunk = s), o || (this.lastChunk = r), this;
581
- }
582
- overwrite(t, e, n, s) {
583
- return s = s || {}, this.update(t, e, n, { ...s, overwrite: !s.contentOnly });
584
- }
585
- update(t, e, n, s) {
586
- if (t = t + this.offset, e = e + this.offset, typeof n != "string") throw new TypeError("replacement content must be a string");
587
- if (this.original.length !== 0) {
588
- for (; t < 0; ) t += this.original.length;
589
- for (; e < 0; ) e += this.original.length;
590
- }
591
- if (e > this.original.length) throw new Error("end is out of bounds");
592
- if (t === e)
593
- throw new Error(
594
- "Cannot overwrite a zero-length range – use appendLeft or prependRight instead"
595
- );
596
- this._split(t), this._split(e), s === !0 && (N.storeName || (console.warn(
597
- "The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
598
- ), N.storeName = !0), s = { storeName: !0 });
599
- const r = s !== void 0 ? s.storeName : !1, u = s !== void 0 ? s.overwrite : !1;
600
- if (r) {
601
- const c = this.original.slice(t, e);
602
- Object.defineProperty(this.storedNames, c, {
603
- writable: !0,
604
- value: !0,
605
- enumerable: !0
606
- });
607
- }
608
- const f = this.byStart[t], o = this.byEnd[e];
609
- if (f) {
610
- let c = f;
611
- for (; c !== o; ) {
612
- if (c.next !== this.byStart[c.end])
613
- throw new Error("Cannot overwrite across a split point");
614
- c = c.next, c.edit("", !1);
615
- }
616
- f.edit(n, r, !u);
617
- } else {
618
- const c = new M(t, e, "").edit(n, r);
619
- o.next = c, c.previous = o;
620
- }
621
- return this;
622
- }
623
- prepend(t) {
624
- if (typeof t != "string") throw new TypeError("outro content must be a string");
625
- return this.intro = t + this.intro, this;
626
- }
627
- prependLeft(t, e) {
628
- if (t = t + this.offset, typeof e != "string") throw new TypeError("inserted content must be a string");
629
- this._split(t);
630
- const n = this.byEnd[t];
631
- return n ? n.prependLeft(e) : this.intro = e + this.intro, this;
632
- }
633
- prependRight(t, e) {
634
- if (t = t + this.offset, typeof e != "string") throw new TypeError("inserted content must be a string");
635
- this._split(t);
636
- const n = this.byStart[t];
637
- return n ? n.prependRight(e) : this.outro = e + this.outro, this;
638
- }
639
- remove(t, e) {
640
- if (t = t + this.offset, e = e + this.offset, this.original.length !== 0) {
641
- for (; t < 0; ) t += this.original.length;
642
- for (; e < 0; ) e += this.original.length;
643
- }
644
- if (t === e) return this;
645
- if (t < 0 || e > this.original.length) throw new Error("Character is out of bounds");
646
- if (t > e) throw new Error("end must be greater than start");
647
- this._split(t), this._split(e);
648
- let n = this.byStart[t];
649
- for (; n; )
650
- n.intro = "", n.outro = "", n.edit(""), n = e > n.end ? this.byStart[n.end] : null;
651
- return this;
652
- }
653
- reset(t, e) {
654
- if (t = t + this.offset, e = e + this.offset, this.original.length !== 0) {
655
- for (; t < 0; ) t += this.original.length;
656
- for (; e < 0; ) e += this.original.length;
657
- }
658
- if (t === e) return this;
659
- if (t < 0 || e > this.original.length) throw new Error("Character is out of bounds");
660
- if (t > e) throw new Error("end must be greater than start");
661
- this._split(t), this._split(e);
662
- let n = this.byStart[t];
663
- for (; n; )
664
- n.reset(), n = e > n.end ? this.byStart[n.end] : null;
665
- return this;
666
- }
667
- lastChar() {
668
- if (this.outro.length) return this.outro[this.outro.length - 1];
669
- let t = this.lastChunk;
670
- do {
671
- if (t.outro.length) return t.outro[t.outro.length - 1];
672
- if (t.content.length) return t.content[t.content.length - 1];
673
- if (t.intro.length) return t.intro[t.intro.length - 1];
674
- } while (t = t.previous);
675
- return this.intro.length ? this.intro[this.intro.length - 1] : "";
676
- }
677
- lastLine() {
678
- let t = this.outro.lastIndexOf($);
679
- if (t !== -1) return this.outro.substr(t + 1);
680
- let e = this.outro, n = this.lastChunk;
681
- do {
682
- if (n.outro.length > 0) {
683
- if (t = n.outro.lastIndexOf($), t !== -1) return n.outro.substr(t + 1) + e;
684
- e = n.outro + e;
685
- }
686
- if (n.content.length > 0) {
687
- if (t = n.content.lastIndexOf($), t !== -1) return n.content.substr(t + 1) + e;
688
- e = n.content + e;
689
- }
690
- if (n.intro.length > 0) {
691
- if (t = n.intro.lastIndexOf($), t !== -1) return n.intro.substr(t + 1) + e;
692
- e = n.intro + e;
693
- }
694
- } while (n = n.previous);
695
- return t = this.intro.lastIndexOf($), t !== -1 ? this.intro.substr(t + 1) + e : this.intro + e;
696
- }
697
- slice(t = 0, e = this.original.length - this.offset) {
698
- if (t = t + this.offset, e = e + this.offset, this.original.length !== 0) {
699
- for (; t < 0; ) t += this.original.length;
700
- for (; e < 0; ) e += this.original.length;
701
- }
702
- let n = "", s = this.firstChunk;
703
- for (; s && (s.start > t || s.end <= t); ) {
704
- if (s.start < e && s.end >= e)
705
- return n;
706
- s = s.next;
707
- }
708
- if (s && s.edited && s.start !== t)
709
- throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);
710
- const r = s;
711
- for (; s; ) {
712
- s.intro && (r !== s || s.start === t) && (n += s.intro);
713
- const u = s.start < e && s.end >= e;
714
- if (u && s.edited && s.end !== e)
715
- throw new Error(`Cannot use replaced character ${e} as slice end anchor.`);
716
- const f = r === s ? t - s.start : 0, o = u ? s.content.length + e - s.end : s.content.length;
717
- if (n += s.content.slice(f, o), s.outro && (!u || s.end === e) && (n += s.outro), u)
718
- break;
719
- s = s.next;
720
- }
721
- return n;
722
- }
723
- // TODO deprecate this? not really very useful
724
- snip(t, e) {
725
- const n = this.clone();
726
- return n.remove(0, t), n.remove(e, n.original.length), n;
727
- }
728
- _split(t) {
729
- if (this.byStart[t] || this.byEnd[t]) return;
730
- let e = this.lastSearchedChunk;
731
- const n = t > e.end;
732
- for (; e; ) {
733
- if (e.contains(t)) return this._splitChunk(e, t);
734
- e = n ? this.byStart[e.end] : this.byEnd[e.start];
735
- }
736
- }
737
- _splitChunk(t, e) {
738
- if (t.edited && t.content.length) {
739
- const s = K(this.original)(e);
740
- throw new Error(
741
- `Cannot split a chunk that has already been edited (${s.line}:${s.column} – "${t.original}")`
742
- );
743
- }
744
- const n = t.split(e);
745
- return this.byEnd[e] = t, this.byStart[e] = n, this.byEnd[n.end] = n, t === this.lastChunk && (this.lastChunk = n), this.lastSearchedChunk = t, !0;
746
- }
747
- toString() {
748
- let t = this.intro, e = this.firstChunk;
749
- for (; e; )
750
- t += e.toString(), e = e.next;
751
- return t + this.outro;
752
- }
753
- isEmpty() {
754
- let t = this.firstChunk;
755
- do
756
- if (t.intro.length && t.intro.trim() || t.content.length && t.content.trim() || t.outro.length && t.outro.trim())
757
- return !1;
758
- while (t = t.next);
759
- return !0;
760
- }
761
- length() {
762
- let t = this.firstChunk, e = 0;
763
- do
764
- e += t.intro.length + t.content.length + t.outro.length;
765
- while (t = t.next);
766
- return e;
767
- }
768
- trimLines() {
769
- return this.trim("[\\r\\n]");
770
- }
771
- trim(t) {
772
- return this.trimStart(t).trimEnd(t);
773
- }
774
- trimEndAborted(t) {
775
- const e = new RegExp((t || "\\s") + "+$");
776
- if (this.outro = this.outro.replace(e, ""), this.outro.length) return !0;
777
- let n = this.lastChunk;
778
- do {
779
- const s = n.end, r = n.trimEnd(e);
780
- if (n.end !== s && (this.lastChunk === n && (this.lastChunk = n.next), this.byEnd[n.end] = n, this.byStart[n.next.start] = n.next, this.byEnd[n.next.end] = n.next), r) return !0;
781
- n = n.previous;
782
- } while (n);
783
- return !1;
784
- }
785
- trimEnd(t) {
786
- return this.trimEndAborted(t), this;
787
- }
788
- trimStartAborted(t) {
789
- const e = new RegExp("^" + (t || "\\s") + "+");
790
- if (this.intro = this.intro.replace(e, ""), this.intro.length) return !0;
791
- let n = this.firstChunk;
792
- do {
793
- const s = n.end, r = n.trimStart(e);
794
- if (n.end !== s && (n === this.lastChunk && (this.lastChunk = n.next), this.byEnd[n.end] = n, this.byStart[n.next.start] = n.next, this.byEnd[n.next.end] = n.next), r) return !0;
795
- n = n.next;
796
- } while (n);
797
- return !1;
798
- }
799
- trimStart(t) {
800
- return this.trimStartAborted(t), this;
801
- }
802
- hasChanged() {
803
- return this.original !== this.toString();
804
- }
805
- _replaceRegexp(t, e) {
806
- function n(r, u) {
807
- return typeof e == "string" ? e.replace(/\$(\$|&|\d+)/g, (f, o) => o === "$" ? "$" : o === "&" ? r[0] : +o < r.length ? r[+o] : `$${o}`) : e(...r, r.index, u, r.groups);
808
- }
809
- function s(r, u) {
810
- let f;
811
- const o = [];
812
- for (; f = r.exec(u); )
813
- o.push(f);
814
- return o;
815
- }
816
- if (t.global)
817
- s(t, this.original).forEach((u) => {
818
- if (u.index != null) {
819
- const f = n(u, this.original);
820
- f !== u[0] && this.overwrite(u.index, u.index + u[0].length, f);
821
- }
822
- });
823
- else {
824
- const r = this.original.match(t);
825
- if (r && r.index != null) {
826
- const u = n(r, this.original);
827
- u !== r[0] && this.overwrite(r.index, r.index + r[0].length, u);
828
- }
829
- }
830
- return this;
831
- }
832
- _replaceString(t, e) {
833
- const { original: n } = this, s = n.indexOf(t);
834
- return s !== -1 && this.overwrite(s, s + t.length, e), this;
835
- }
836
- replace(t, e) {
837
- return typeof t == "string" ? this._replaceString(t, e) : this._replaceRegexp(t, e);
838
- }
839
- _replaceAllString(t, e) {
840
- const { original: n } = this, s = t.length;
841
- for (let r = n.indexOf(t); r !== -1; r = n.indexOf(t, r + s))
842
- n.slice(r, r + s) !== e && this.overwrite(r, r + s, e);
843
- return this;
844
- }
845
- replaceAll(t, e) {
846
- if (typeof t == "string")
847
- return this._replaceAllString(t, e);
848
- if (!t.global)
849
- throw new TypeError(
850
- "MagicString.prototype.replaceAll called with a non-global RegExp argument"
851
- );
852
- return this._replaceRegexp(t, e);
853
- }
854
- }
855
- export {
856
- at as SourceMap,
857
- Q as default
858
- };