@inpageedit/core 0.1.1 → 0.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 (67) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +55 -55
  3. package/dist/ActionButton-ByMKIthQ.js +24 -0
  4. package/dist/ActionButton-ByMKIthQ.js.map +1 -0
  5. package/dist/InPageEdit.d.ts +7 -2
  6. package/dist/{CheckBox-ROZZIK-t.js → InputBox-FIzJ-rPN.js} +11 -11
  7. package/dist/InputBox-FIzJ-rPN.js.map +1 -0
  8. package/dist/Preferences-Bg3J5Ur9.js.map +1 -1
  9. package/dist/{RadioBox-Bt5tAniV.js → RadioBox-BZFhTEo5.js} +2 -2
  10. package/dist/RadioBox-BZFhTEo5.js.map +1 -0
  11. package/dist/components/ActionButton.d.ts +6 -9
  12. package/dist/components/SchemaForm/index.d.ts +142 -0
  13. package/dist/components/index.d.ts +8 -0
  14. package/dist/components/index.js +79 -0
  15. package/dist/components/index.js.map +1 -0
  16. package/dist/{index-M4USLRId.js → index-BByzm2Fz.js} +169 -167
  17. package/dist/index-BByzm2Fz.js.map +1 -0
  18. package/dist/{index-BI0z4WfP.js → index-BPsDFq9U.js} +2 -2
  19. package/dist/index-BPsDFq9U.js.map +1 -0
  20. package/dist/{index-Bz9ciRCe.js → index-BsYzf3Yw.js} +9 -8
  21. package/dist/index-BsYzf3Yw.js.map +1 -0
  22. package/dist/{index-DIovbA02.js → index-CMqk2ovP.js} +14 -14
  23. package/dist/index-CMqk2ovP.js.map +1 -0
  24. package/dist/{index-DPXRKwGM.js → index-Ch5DJDZZ.js} +20 -19
  25. package/dist/index-Ch5DJDZZ.js.map +1 -0
  26. package/dist/index-Cq1Q9Xau.js +4635 -0
  27. package/dist/index-Cq1Q9Xau.js.map +1 -0
  28. package/dist/{index-01GVXg9H.js → index-Cq9xxVsu.js} +20 -30
  29. package/dist/index-Cq9xxVsu.js.map +1 -0
  30. package/dist/index-CvhkVj_L.js +361 -0
  31. package/dist/index-CvhkVj_L.js.map +1 -0
  32. package/dist/{index-jJ3Ut97G.js → index-HyxA2rYz.js} +20 -19
  33. package/dist/index-HyxA2rYz.js.map +1 -0
  34. package/dist/{index-BY3hO6sZ.js → index-X1X416tZ.js} +36 -34
  35. package/dist/index-X1X416tZ.js.map +1 -0
  36. package/dist/index.d.ts +16 -1
  37. package/dist/index.js +5187 -5
  38. package/dist/index.js.map +1 -1
  39. package/dist/plugins/BasePlugin.d.ts +2 -2
  40. package/dist/plugins/preferences/{PluginPreferencesUI.d.ts → ui/index.d.ts} +3 -2
  41. package/dist/sleep-DpyIipK-.js.map +1 -1
  42. package/dist/style.css +1 -1
  43. package/dist/{plugins/preferences/components/hooks.d.ts → utils/vueHooks.d.ts} +1 -1
  44. package/lib/index.umd.js +57 -2620
  45. package/lib/index.umd.js.map +1 -0
  46. package/lib/style.css +1 -1
  47. package/package.json +42 -4
  48. package/dist/ActionButton-B9JniHy6.js +0 -33
  49. package/dist/ActionButton-B9JniHy6.js.map +0 -1
  50. package/dist/CheckBox-ROZZIK-t.js.map +0 -1
  51. package/dist/PluginPreferencesUI-7u9JClgy.js +0 -33921
  52. package/dist/PluginPreferencesUI-7u9JClgy.js.map +0 -1
  53. package/dist/RadioBox-Bt5tAniV.js.map +0 -1
  54. package/dist/i18n/languages.json +0 -1527
  55. package/dist/index-01GVXg9H.js.map +0 -1
  56. package/dist/index-BI0z4WfP.js.map +0 -1
  57. package/dist/index-BY3hO6sZ.js.map +0 -1
  58. package/dist/index-Bz9ciRCe.js.map +0 -1
  59. package/dist/index-CGg-JS5d.js +0 -5466
  60. package/dist/index-CGg-JS5d.js.map +0 -1
  61. package/dist/index-DIovbA02.js.map +0 -1
  62. package/dist/index-DPXRKwGM.js.map +0 -1
  63. package/dist/index-M4USLRId.js.map +0 -1
  64. package/dist/index-jJ3Ut97G.js.map +0 -1
  65. package/dist/utils/schemaValidator.d.ts +0 -12
  66. package/lib/i18n/languages.json +0 -1527
  67. /package/dist/components/TabView/{TabView.d.ts → index.d.ts} +0 -0
@@ -1,7 +1,8 @@
1
- import { j as m, F as Ne, B as ee, P as Pe, a as Ee, S as E } from "./index-CGg-JS5d.js";
2
- import { R as We } from "./Preferences-Bg3J5Ur9.js";
3
- import { R as _e, M as Oe } from "./RadioBox-Bt5tAniV.js";
4
- class D {
1
+ import { j as m, F as Pe, P as be } from "./index-CvhkVj_L.js";
2
+ import { BasePlugin as G, Inject as Se, Schema as E } from "./index.js";
3
+ import { R as Ne } from "./Preferences-Bg3J5Ur9.js";
4
+ import { R as Ee, M as We } from "./RadioBox-BZFhTEo5.js";
5
+ class b {
5
6
  diff(e, n, i = {}) {
6
7
  let s;
7
8
  typeof i == "function" ? (s = i, i = {}) : "callback" in i && (s = i.callback);
@@ -31,17 +32,17 @@ class D {
31
32
  let c;
32
33
  const w = v[u - 1], k = v[u + 1];
33
34
  w && (v[u - 1] = void 0);
34
- let b = !1;
35
+ let P = !1;
35
36
  if (k) {
36
- const N = k.oldPos - u;
37
- b = k && 0 <= N && N < o;
37
+ const S = k.oldPos - u;
38
+ P = k && 0 <= S && S < o;
38
39
  }
39
- const S = w && w.oldPos + 1 < f;
40
- if (!b && !S) {
40
+ const D = w && w.oldPos + 1 < f;
41
+ if (!P && !D) {
41
42
  v[u] = void 0;
42
43
  continue;
43
44
  }
44
- if (!S || b && w.oldPos < k.oldPos ? c = this.addToPath(k, !0, !1, 0, i) : c = this.addToPath(w, !1, !0, 1, i), d = this.extractCommon(c, n, e, u, i), c.oldPos + 1 >= f && d + 1 >= o)
45
+ if (!D || P && w.oldPos < k.oldPos ? c = this.addToPath(k, !0, !1, 0, i) : c = this.addToPath(w, !1, !0, 1, i), d = this.extractCommon(c, n, e, u, i), c.oldPos + 1 >= f && d + 1 >= o)
45
46
  return l(this.buildValues(c.lastComponent, n, e)) || !0;
46
47
  v[u] = c, c.oldPos + 1 >= f && (x = Math.min(x, u - 1)), d + 1 >= o && (p = Math.max(p, u + 1));
47
48
  }
@@ -132,20 +133,20 @@ class D {
132
133
  return s;
133
134
  }
134
135
  }
135
- class Te extends D {
136
+ class _e extends b {
136
137
  }
137
- const te = new Te();
138
- function ne(t, e, n) {
139
- return te.diff(t, e, n);
138
+ const K = new _e();
139
+ function ee(t, e, n) {
140
+ return K.diff(t, e, n);
140
141
  }
141
- function V(t, e) {
142
+ function U(t, e) {
142
143
  let n;
143
144
  for (n = 0; n < t.length && n < e.length; n++)
144
145
  if (t[n] != e[n])
145
146
  return t.slice(0, n);
146
147
  return t.slice(0, n);
147
148
  }
148
- function Y(t, e) {
149
+ function V(t, e) {
149
150
  let n;
150
151
  if (!t || !e || t[t.length - 1] != e[e.length - 1])
151
152
  return "";
@@ -172,10 +173,10 @@ function W(t, e) {
172
173
  function O(t, e) {
173
174
  return H(t, e, "");
174
175
  }
175
- function X(t, e) {
176
- return e.slice(0, Fe(t, e));
176
+ function Y(t, e) {
177
+ return e.slice(0, Oe(t, e));
177
178
  }
178
- function Fe(t, e) {
179
+ function Oe(t, e) {
179
180
  let n = 0;
180
181
  t.length > e.length && (n = t.length - e.length);
181
182
  let i = e.length;
@@ -196,12 +197,12 @@ function Fe(t, e) {
196
197
  }
197
198
  return r;
198
199
  }
199
- function Ae(t) {
200
+ function Te(t) {
200
201
  return t.includes(`\r
201
202
  `) && !t.startsWith(`
202
203
  `) && !t.match(/[^\r]\n/);
203
204
  }
204
- function Le(t) {
205
+ function Fe(t) {
205
206
  return !t.includes(`\r
206
207
  `) && t.includes(`
207
208
  `);
@@ -212,12 +213,12 @@ function _(t) {
212
213
  ;
213
214
  return t.substring(e + 1);
214
215
  }
215
- function P(t) {
216
+ function N(t) {
216
217
  const e = t.match(/^\s*/);
217
218
  return e ? e[0] : "";
218
219
  }
219
- const T = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", je = new RegExp(`[${T}]+|\\s+|[^${T}]`, "ug");
220
- class ze extends D {
220
+ const T = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", Ae = new RegExp(`[${T}]+|\\s+|[^${T}]`, "ug");
221
+ class Le extends b {
221
222
  equals(e, n, i) {
222
223
  return i.ignoreCase && (e = e.toLowerCase(), n = n.toLowerCase()), e.trim() === n.trim();
223
224
  }
@@ -229,7 +230,7 @@ class ze extends D {
229
230
  throw new Error('The segmenter passed must have a granularity of "word"');
230
231
  i = Array.from(l.segment(e), (o) => o.segment);
231
232
  } else
232
- i = e.match(je) || [];
233
+ i = e.match(Ae) || [];
233
234
  const s = [];
234
235
  let r = null;
235
236
  return i.forEach((l) => {
@@ -244,58 +245,58 @@ class ze extends D {
244
245
  return e;
245
246
  let i = null, s = null, r = null;
246
247
  return e.forEach((l) => {
247
- l.added ? s = l : l.removed ? r = l : ((s || r) && Z(i, r, s, l), i = l, s = null, r = null);
248
- }), (s || r) && Z(i, r, s, null), e;
248
+ l.added ? s = l : l.removed ? r = l : ((s || r) && X(i, r, s, l), i = l, s = null, r = null);
249
+ }), (s || r) && X(i, r, s, null), e;
249
250
  }
250
251
  }
251
- const ie = new ze();
252
- function re(t, e, n) {
253
- return n?.ignoreWhitespace != null && !n.ignoreWhitespace ? q(t, e, n) : ie.diff(t, e, n);
252
+ const te = new Le();
253
+ function ne(t, e, n) {
254
+ return n?.ignoreWhitespace != null && !n.ignoreWhitespace ? q(t, e, n) : te.diff(t, e, n);
254
255
  }
255
- function Z(t, e, n, i) {
256
+ function X(t, e, n, i) {
256
257
  if (e && n) {
257
- const s = P(e.value), r = _(e.value), l = P(n.value), o = _(n.value);
258
+ const s = N(e.value), r = _(e.value), l = N(n.value), o = _(n.value);
258
259
  if (t) {
259
- const f = V(s, l);
260
+ const f = U(s, l);
260
261
  t.value = H(t.value, l, f), e.value = W(e.value, f), n.value = W(n.value, f);
261
262
  }
262
263
  if (i) {
263
- const f = Y(r, o);
264
+ const f = V(r, o);
264
265
  i.value = I(i.value, o, f), e.value = O(e.value, f), n.value = O(n.value, f);
265
266
  }
266
267
  } else if (n) {
267
268
  if (t) {
268
- const s = P(n.value);
269
+ const s = N(n.value);
269
270
  n.value = n.value.substring(s.length);
270
271
  }
271
272
  if (i) {
272
- const s = P(i.value);
273
+ const s = N(i.value);
273
274
  i.value = i.value.substring(s.length);
274
275
  }
275
276
  } else if (t && i) {
276
- const s = P(i.value), r = P(e.value), l = _(e.value), o = V(s, r);
277
+ const s = N(i.value), r = N(e.value), l = _(e.value), o = U(s, r);
277
278
  e.value = W(e.value, o);
278
- const f = Y(W(s, o), l);
279
+ const f = V(W(s, o), l);
279
280
  e.value = O(e.value, f), i.value = I(i.value, s, f), t.value = H(t.value, s, s.slice(0, s.length - f.length));
280
281
  } else if (i) {
281
- const s = P(i.value), r = _(e.value), l = X(r, s);
282
+ const s = N(i.value), r = _(e.value), l = Y(r, s);
282
283
  e.value = O(e.value, l);
283
284
  } else if (t) {
284
- const s = _(t.value), r = P(e.value), l = X(s, r);
285
+ const s = _(t.value), r = N(e.value), l = Y(s, r);
285
286
  e.value = W(e.value, l);
286
287
  }
287
288
  }
288
- class Ie extends D {
289
+ class je extends b {
289
290
  tokenize(e) {
290
291
  const n = new RegExp(`(\\r?\\n)|[${T}]+|[^\\S\\n\\r]+|[^${T}]`, "ug");
291
292
  return e.match(n) || [];
292
293
  }
293
294
  }
294
- const se = new Ie();
295
+ const ie = new je();
295
296
  function q(t, e, n) {
296
- return se.diff(t, e, n);
297
+ return ie.diff(t, e, n);
297
298
  }
298
- function He(t, e) {
299
+ function ze(t, e) {
299
300
  if (typeof t == "function")
300
301
  e.callback = t;
301
302
  else if (t)
@@ -303,9 +304,9 @@ function He(t, e) {
303
304
  Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
304
305
  return e;
305
306
  }
306
- class $e extends D {
307
+ class Ie extends b {
307
308
  constructor() {
308
- super(...arguments), this.tokenize = oe;
309
+ super(...arguments), this.tokenize = se;
309
310
  }
310
311
  equals(e, n, i) {
311
312
  return i.ignoreWhitespace ? ((!i.newlineIsToken || !e.includes(`
@@ -315,14 +316,14 @@ class $e extends D {
315
316
  `) && (n = n.slice(0, -1))), super.equals(e, n, i);
316
317
  }
317
318
  }
318
- const M = new $e();
319
+ const M = new Ie();
319
320
  function F(t, e, n) {
320
321
  return M.diff(t, e, n);
321
322
  }
322
- function le(t, e, n) {
323
- return n = He(n, { ignoreWhitespace: !0 }), M.diff(t, e, n);
323
+ function re(t, e, n) {
324
+ return n = ze(n, { ignoreWhitespace: !0 }), M.diff(t, e, n);
324
325
  }
325
- function oe(t, e) {
326
+ function se(t, e) {
326
327
  e.stripTrailingCr && (t = t.replace(/\r\n/g, `
327
328
  `));
328
329
  const n = [], i = t.split(/(\n|\r\n)/);
@@ -333,10 +334,10 @@ function oe(t, e) {
333
334
  }
334
335
  return n;
335
336
  }
336
- function qe(t) {
337
+ function He(t) {
337
338
  return t == "." || t == "!" || t == "?";
338
339
  }
339
- class Me extends D {
340
+ class $e extends b {
340
341
  tokenize(e) {
341
342
  var n;
342
343
  const i = [];
@@ -346,7 +347,7 @@ class Me extends D {
346
347
  i.push(e.slice(s));
347
348
  break;
348
349
  }
349
- if (qe(e[r]) && e[r + 1].match(/\s/)) {
350
+ if (He(e[r]) && e[r + 1].match(/\s/)) {
350
351
  for (i.push(e.slice(s, r + 1)), r = s = r + 1; !((n = e[r + 1]) === null || n === void 0) && n.match(/\s/); )
351
352
  r++;
352
353
  i.push(e.slice(s, r + 1)), s = r + 1;
@@ -355,22 +356,22 @@ class Me extends D {
355
356
  return i;
356
357
  }
357
358
  }
358
- const fe = new Me();
359
- function ae(t, e, n) {
360
- return fe.diff(t, e, n);
359
+ const le = new $e();
360
+ function oe(t, e, n) {
361
+ return le.diff(t, e, n);
361
362
  }
362
- class Re extends D {
363
+ class qe extends b {
363
364
  tokenize(e) {
364
365
  return e.split(/([{}:;,]|\s+)/);
365
366
  }
366
367
  }
367
- const ce = new Re();
368
- function ue(t, e, n) {
369
- return ce.diff(t, e, n);
368
+ const fe = new qe();
369
+ function ae(t, e, n) {
370
+ return fe.diff(t, e, n);
370
371
  }
371
- class Je extends D {
372
+ class Me extends b {
372
373
  constructor() {
373
- super(...arguments), this.tokenize = oe;
374
+ super(...arguments), this.tokenize = se;
374
375
  }
375
376
  get useLongestToken() {
376
377
  return !0;
@@ -383,9 +384,9 @@ class Je extends D {
383
384
  return super.equals(e.replace(/,([\r\n])/g, "$1"), n.replace(/,([\r\n])/g, "$1"), i);
384
385
  }
385
386
  }
386
- const de = new Je();
387
- function me(t, e, n) {
388
- return de.diff(t, e, n);
387
+ const ce = new Me();
388
+ function ue(t, e, n) {
389
+ return ce.diff(t, e, n);
389
390
  }
390
391
  function A(t, e, n, i, s) {
391
392
  e = e || [], n = n || [], i && (t = i(s === void 0 ? "" : s, t));
@@ -412,7 +413,7 @@ function A(t, e, n, i, s) {
412
413
  l = t;
413
414
  return l;
414
415
  }
415
- class Be extends D {
416
+ class Re extends b {
416
417
  tokenize(e) {
417
418
  return e.slice();
418
419
  }
@@ -423,20 +424,20 @@ class Be extends D {
423
424
  return e;
424
425
  }
425
426
  }
426
- const he = new Be();
427
- function ge(t, e, n) {
428
- return he.diff(t, e, n);
427
+ const de = new Re();
428
+ function me(t, e, n) {
429
+ return de.diff(t, e, n);
429
430
  }
430
- function pe(t) {
431
- return Array.isArray(t) ? t.map((e) => pe(e)) : Object.assign(Object.assign({}, t), { hunks: t.hunks.map((e) => Object.assign(Object.assign({}, e), { lines: e.lines.map((n, i) => {
431
+ function he(t) {
432
+ return Array.isArray(t) ? t.map((e) => he(e)) : Object.assign(Object.assign({}, t), { hunks: t.hunks.map((e) => Object.assign(Object.assign({}, e), { lines: e.lines.map((n, i) => {
432
433
  var s;
433
434
  return n.startsWith("\\") || n.endsWith("\r") || !((s = e.lines[i + 1]) === null || s === void 0) && s.startsWith("\\") ? n : n + "\r";
434
435
  }) })) });
435
436
  }
436
- function we(t) {
437
- return Array.isArray(t) ? t.map((e) => we(e)) : Object.assign(Object.assign({}, t), { hunks: t.hunks.map((e) => Object.assign(Object.assign({}, e), { lines: e.lines.map((n) => n.endsWith("\r") ? n.substring(0, n.length - 1) : n) })) });
437
+ function ge(t) {
438
+ return Array.isArray(t) ? t.map((e) => ge(e)) : Object.assign(Object.assign({}, t), { hunks: t.hunks.map((e) => Object.assign(Object.assign({}, e), { lines: e.lines.map((n) => n.endsWith("\r") ? n.substring(0, n.length - 1) : n) })) });
438
439
  }
439
- function Ue(t) {
440
+ function Je(t) {
440
441
  return Array.isArray(t) || (t = [t]), !t.some((e) => e.hunks.some((n) => n.lines.some((i) => !i.startsWith("\\") && i.endsWith("\r"))));
441
442
  }
442
443
  function Qe(t) {
@@ -506,7 +507,7 @@ function R(t) {
506
507
  s();
507
508
  return n;
508
509
  }
509
- function Ve(t, e, n) {
510
+ function Be(t, e, n) {
510
511
  let i = !0, s = !1, r = !1, l = 1;
511
512
  return function o() {
512
513
  if (i && !r) {
@@ -518,14 +519,14 @@ function Ve(t, e, n) {
518
519
  return r || (i = !0), e <= t - l ? t - l++ : (s = !0, o());
519
520
  };
520
521
  }
521
- function ve(t, e, n = {}) {
522
+ function pe(t, e, n = {}) {
522
523
  let i;
523
524
  if (typeof e == "string" ? i = R(e) : Array.isArray(e) ? i = e : i = [e], i.length > 1)
524
525
  throw new Error("applyPatch only works with a single input.");
525
- return Ye(t, i[0], n);
526
+ return Ue(t, i[0], n);
526
527
  }
527
- function Ye(t, e, n = {}) {
528
- (n.autoConvertLineEndings || n.autoConvertLineEndings == null) && (Ae(t) && Ue(e) ? e = pe(e) : Le(t) && Qe(e) && (e = we(e)));
528
+ function Ue(t, e, n = {}) {
529
+ (n.autoConvertLineEndings || n.autoConvertLineEndings == null) && (Te(t) && Je(e) ? e = he(e) : Fe(t) && Qe(e) && (e = ge(e)));
529
530
  const i = t.split(`
530
531
  `), s = e.hunks, r = n.compareLine || ((d, p, x, C) => p === C), l = n.fuzzFactor || 0;
531
532
  let o = 0;
@@ -553,24 +554,24 @@ function Ye(t, e, n = {}) {
553
554
  return !1;
554
555
  }
555
556
  function h(d, p, x, C = 0, u = !0, c = [], w = 0) {
556
- let k = 0, b = !1;
557
+ let k = 0, P = !1;
557
558
  for (; C < d.length; C++) {
558
- const S = d[C], N = S.length > 0 ? S[0] : " ", z = S.length > 0 ? S.substr(1) : S;
559
- if (N === "-")
560
- if (r(p + 1, i[p], N, z))
559
+ const D = d[C], S = D.length > 0 ? D[0] : " ", z = D.length > 0 ? D.substr(1) : D;
560
+ if (S === "-")
561
+ if (r(p + 1, i[p], S, z))
561
562
  p++, k = 0;
562
563
  else
563
564
  return !x || i[p] == null ? null : (c[w] = i[p], h(d, p + 1, x - 1, C, !1, c, w + 1));
564
- if (N === "+") {
565
+ if (S === "+") {
565
566
  if (!u)
566
567
  return null;
567
- c[w] = z, w++, k = 0, b = !0;
568
+ c[w] = z, w++, k = 0, P = !0;
568
569
  }
569
- if (N === " ")
570
- if (k++, c[w] = i[p], r(p + 1, i[p], N, z))
571
- w++, u = !0, b = !1, p++;
570
+ if (S === " ")
571
+ if (k++, c[w] = i[p], r(p + 1, i[p], S, z))
572
+ w++, u = !0, P = !1, p++;
572
573
  else
573
- return b || !x ? null : i[p] && (h(d, p + 1, x - 1, C + 1, !1, c, w + 1) || h(d, p + 1, x - 1, C, !1, c, w + 1)) || h(d, p, x - 1, C + 1, !1, c, w);
574
+ return P || !x ? null : i[p] && (h(d, p + 1, x - 1, C + 1, !1, c, w + 1) || h(d, p + 1, x - 1, C, !1, c, w + 1)) || h(d, p, x - 1, C + 1, !1, c, w);
574
575
  }
575
576
  return w -= k, p -= k, c.length = w, {
576
577
  patchedLines: c,
@@ -586,7 +587,7 @@ function Ye(t, e, n = {}) {
586
587
  let u;
587
588
  for (let c = 0; c <= l; c++) {
588
589
  u = p.oldStart + v - 1;
589
- const w = Ve(u, o, C);
590
+ const w = Be(u, o, C);
590
591
  for (; u !== void 0 && (x = h(p.lines, u, c), !x); u = w())
591
592
  ;
592
593
  if (x)
@@ -607,7 +608,7 @@ function Ye(t, e, n = {}) {
607
608
  return y.join(`
608
609
  `);
609
610
  }
610
- function Xe(t, e) {
611
+ function Ve(t, e) {
611
612
  const n = typeof t == "string" ? R(t) : t;
612
613
  let i = 0;
613
614
  function s() {
@@ -617,7 +618,7 @@ function Xe(t, e) {
617
618
  e.loadFile(r, function(l, o) {
618
619
  if (l)
619
620
  return e.complete(l);
620
- const f = ve(o, r, e);
621
+ const f = pe(o, r, e);
621
622
  e.patched(r, f, function(g) {
622
623
  if (g)
623
624
  return e.complete(g);
@@ -627,8 +628,8 @@ function Xe(t, e) {
627
628
  }
628
629
  s();
629
630
  }
630
- function ye(t) {
631
- return Array.isArray(t) ? t.map((e) => ye(e)).reverse() : Object.assign(Object.assign({}, t), { oldFileName: t.newFileName, oldHeader: t.newHeader, newFileName: t.oldFileName, newHeader: t.oldHeader, hunks: t.hunks.map((e) => ({
631
+ function we(t) {
632
+ return Array.isArray(t) ? t.map((e) => we(e)).reverse() : Object.assign(Object.assign({}, t), { oldFileName: t.newFileName, oldHeader: t.newHeader, newFileName: t.oldFileName, newHeader: t.oldHeader, hunks: t.hunks.map((e) => ({
632
633
  oldLines: e.newLines,
633
634
  oldStart: e.newStart,
634
635
  newLines: e.oldLines,
@@ -662,7 +663,7 @@ function $(t, e, n, i, s, r, l) {
662
663
  const y = [];
663
664
  let v = 0, d = 0, p = [], x = 1, C = 1;
664
665
  for (let u = 0; u < a.length; u++) {
665
- const c = a[u], w = c.lines || Ge(c.value);
666
+ const c = a[u], w = c.lines || Xe(c.value);
666
667
  if (c.lines = w, c.added || c.removed) {
667
668
  if (!v) {
668
669
  const k = a[u - 1];
@@ -678,16 +679,16 @@ function $(t, e, n, i, s, r, l) {
678
679
  p.push(k);
679
680
  else {
680
681
  const k = Math.min(w.length, f);
681
- for (const S of h(w.slice(0, k)))
682
- p.push(S);
683
- const b = {
682
+ for (const D of h(w.slice(0, k)))
683
+ p.push(D);
684
+ const P = {
684
685
  oldStart: v,
685
686
  oldLines: x - v + k,
686
687
  newStart: d,
687
688
  newLines: C - d + k,
688
689
  lines: p
689
690
  };
690
- y.push(b), v = 0, d = 0, p = [];
691
+ y.push(P), v = 0, d = 0, p = [];
691
692
  }
692
693
  x += w.length, C += w.length;
693
694
  }
@@ -732,75 +733,75 @@ function J(t, e, n, i, s, r, l) {
732
733
  return o ? L(o) : void 0;
733
734
  }
734
735
  }
735
- function Ze(t, e, n, i, s, r) {
736
+ function Ye(t, e, n, i, s, r) {
736
737
  return J(t, t, e, n, i, s, r);
737
738
  }
738
- function Ge(t) {
739
+ function Xe(t) {
739
740
  const e = t.endsWith(`
740
741
  `), n = t.split(`
741
742
  `).map((i) => i + `
742
743
  `);
743
744
  return e ? n.pop() : n.push(n.pop().slice(0, -1)), n;
744
745
  }
745
- function Ke(t) {
746
+ function Ze(t) {
746
747
  const e = [];
747
748
  let n, i;
748
749
  for (let s = 0; s < t.length; s++)
749
750
  n = t[s], n.added ? i = 1 : n.removed ? i = -1 : i = 0, e.push([i, n.value]);
750
751
  return e;
751
752
  }
752
- function et(t) {
753
+ function Ge(t) {
753
754
  const e = [];
754
755
  for (let n = 0; n < t.length; n++) {
755
756
  const i = t[n];
756
- i.added ? e.push("<ins>") : i.removed && e.push("<del>"), e.push(tt(i.value)), i.added ? e.push("</ins>") : i.removed && e.push("</del>");
757
+ i.added ? e.push("<ins>") : i.removed && e.push("<del>"), e.push(Ke(i.value)), i.added ? e.push("</ins>") : i.removed && e.push("</del>");
757
758
  }
758
759
  return e.join("");
759
760
  }
760
- function tt(t) {
761
+ function Ke(t) {
761
762
  let e = t;
762
763
  return e = e.replace(/&/g, "&amp;"), e = e.replace(/</g, "&lt;"), e = e.replace(/>/g, "&gt;"), e = e.replace(/"/g, "&quot;"), e;
763
764
  }
764
- const nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
765
+ const et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
765
766
  __proto__: null,
766
- Diff: D,
767
- applyPatch: ve,
768
- applyPatches: Xe,
769
- arrayDiff: he,
767
+ Diff: b,
768
+ applyPatch: pe,
769
+ applyPatches: Ve,
770
+ arrayDiff: de,
770
771
  canonicalize: A,
771
- characterDiff: te,
772
- convertChangesToDMP: Ke,
773
- convertChangesToXML: et,
774
- createPatch: Ze,
772
+ characterDiff: K,
773
+ convertChangesToDMP: Ze,
774
+ convertChangesToXML: Ge,
775
+ createPatch: Ye,
775
776
  createTwoFilesPatch: J,
776
- cssDiff: ce,
777
- diffArrays: ge,
778
- diffChars: ne,
779
- diffCss: ue,
780
- diffJson: me,
777
+ cssDiff: fe,
778
+ diffArrays: me,
779
+ diffChars: ee,
780
+ diffCss: ae,
781
+ diffJson: ue,
781
782
  diffLines: F,
782
- diffSentences: ae,
783
- diffTrimmedLines: le,
784
- diffWords: re,
783
+ diffSentences: oe,
784
+ diffTrimmedLines: re,
785
+ diffWords: ne,
785
786
  diffWordsWithSpace: q,
786
787
  formatPatch: L,
787
- jsonDiff: de,
788
+ jsonDiff: ce,
788
789
  lineDiff: M,
789
790
  parsePatch: R,
790
- reversePatch: ye,
791
- sentenceDiff: fe,
791
+ reversePatch: we,
792
+ sentenceDiff: le,
792
793
  structuredPatch: $,
793
- wordDiff: ie,
794
- wordsWithSpaceDiff: se
794
+ wordDiff: te,
795
+ wordsWithSpaceDiff: ie
795
796
  }, Symbol.toStringTag, { value: "Module" }));
796
- class it {
797
+ class tt {
797
798
  constructor(e) {
798
- this.ctx = e, this.JsDiff = nt, this.diffChars = ne, this.diffWords = re, this.diffWordsWithSpace = q, this.diffLines = F, this.diffTrimmedLines = le, this.diffSentences = ae, this.diffCss = ue, this.diffJson = me, this.diffArrays = ge, this.createTwoFilesPatch = J, this.ctx.set("jsdiff", this);
799
+ this.ctx = e, this.JsDiff = et, this.diffChars = ee, this.diffWords = ne, this.diffWordsWithSpace = q, this.diffLines = F, this.diffTrimmedLines = re, this.diffSentences = oe, this.diffCss = ae, this.diffJson = ue, this.diffArrays = me, this.createTwoFilesPatch = J, this.ctx.set("jsdiff", this);
799
800
  }
800
801
  }
801
- const rt = {
802
+ const nt = {
802
803
  "diff-container": "_diff-container_lq0si_2"
803
- }, st = (t) => {
804
+ }, it = (t) => {
804
805
  let { user: e, target: n } = t;
805
806
  const i = window.mw?.config?.get("wgArticlePath") || "/$1", s = (r) => i.replace("$1", r);
806
807
  return /* @__PURE__ */ m("span", { className: "mw-userlinks", children: [
@@ -832,23 +833,23 @@ const rt = {
832
833
  ")"
833
834
  ] })
834
835
  ] });
835
- }, lt = new Intl.DateTimeFormat(void 0, {
836
+ }, rt = new Intl.DateTimeFormat(void 0, {
836
837
  dateStyle: "medium",
837
838
  timeStyle: "medium"
838
- }).format, G = (t) => {
839
+ }).format, Z = (t) => {
839
840
  let e = ["diff-title"];
840
841
  return t.type === "from" ? e.push("diff-otitle") : t.type === "to" && e.push("diff-ntitle"), !t.pageid || !t.userid ? /* @__PURE__ */ m("td", { colSpan: 2, className: e, children: /* @__PURE__ */ m("div", { className: "mw-diff-title--title", children: t.type === "from" ? "Original content" : t.type === "to" ? "Your content" : "" }) }) : /* @__PURE__ */ m("td", { colSpan: 2, className: e, children: [
841
842
  /* @__PURE__ */ m("div", { className: "mw-diff-title--title", children: t.pagetitle || t.timestamp }),
842
- /* @__PURE__ */ m("div", { className: "mw-diff-title--user", children: t.username && /* @__PURE__ */ m(st, { user: t.username, target: "_blank" }) }),
843
- /* @__PURE__ */ m("div", { className: "mw-diff-title--timestamp", children: t.timestamp && lt(new Date(t.timestamp)) }),
844
- /* @__PURE__ */ m("div", { className: "mw-diff-title--comment", children: t.parsedcomment && /* @__PURE__ */ m(Ne, { children: [
843
+ /* @__PURE__ */ m("div", { className: "mw-diff-title--user", children: t.username && /* @__PURE__ */ m(it, { user: t.username, target: "_blank" }) }),
844
+ /* @__PURE__ */ m("div", { className: "mw-diff-title--timestamp", children: t.timestamp && rt(new Date(t.timestamp)) }),
845
+ /* @__PURE__ */ m("div", { className: "mw-diff-title--comment", children: t.parsedcomment && /* @__PURE__ */ m(Pe, { children: [
845
846
  "(",
846
847
  /* @__PURE__ */ m("i", { innerHTML: t.parsedcomment }),
847
848
  ")"
848
849
  ] }) }),
849
850
  /* @__PURE__ */ m("div", { className: "mw-diff-title--navigation" })
850
851
  ] });
851
- }, ot = (t) => {
852
+ }, st = (t) => {
852
853
  const { data: e, ...n } = t, i = /* @__PURE__ */ m("table", { className: "theme-ipe diff diff-type-table", "data-mw": "interface", ...n, children: [
853
854
  /* @__PURE__ */ m("colgroup", { children: [
854
855
  /* @__PURE__ */ m("col", { className: "diff-marker" }),
@@ -859,7 +860,7 @@ const rt = {
859
860
  /* @__PURE__ */ m("tbody", { children: [
860
861
  /* @__PURE__ */ m("tr", { children: [
861
862
  /* @__PURE__ */ m(
862
- G,
863
+ Z,
863
864
  {
864
865
  type: "from",
865
866
  pageid: e.fromid,
@@ -874,7 +875,7 @@ const rt = {
874
875
  }
875
876
  ),
876
877
  /* @__PURE__ */ m(
877
- G,
878
+ Z,
878
879
  {
879
880
  type: "to",
880
881
  pageid: e.toid,
@@ -908,19 +909,19 @@ const rt = {
908
909
  children: /* @__PURE__ */ m("i", { children: "No changes" })
909
910
  }
910
911
  ) }) })).outerHTML, i;
911
- }, ft = (t, e = document) => e.querySelector(t), at = (t, e = document) => e.querySelectorAll(t);
912
- var ct = Object.create, B = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, xe = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), ke = (t) => {
912
+ }, lt = (t, e = document) => e.querySelector(t), ot = (t, e = document) => e.querySelectorAll(t);
913
+ var ft = Object.create, Q = Object.defineProperty, at = Object.getOwnPropertyDescriptor, ve = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), ye = (t) => {
913
914
  throw TypeError(t);
914
- }, dt = (t, e, n) => e in t ? B(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, mt = (t, e) => B(t, "name", { value: e, configurable: !0 }), ht = (t) => [, , , ct(t?.[xe("metadata")] ?? null)], gt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ce = (t) => t !== void 0 && typeof t != "function" ? ke("Function expected") : t, pt = (t, e, n, i, s) => ({ kind: gt[t], name: e, metadata: i, addInitializer: (r) => n._ ? ke("Already initialized") : s.push(Ce(r || null)) }), wt = (t, e) => dt(e, xe("metadata"), t[3]), vt = (t, e, n, i) => {
915
+ }, ct = (t, e, n) => e in t ? Q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ut = (t, e) => Q(t, "name", { value: e, configurable: !0 }), dt = (t) => [, , , ft(t?.[ve("metadata")] ?? null)], mt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], xe = (t) => t !== void 0 && typeof t != "function" ? ye("Function expected") : t, ht = (t, e, n, i, s) => ({ kind: mt[t], name: e, metadata: i, addInitializer: (r) => n._ ? ye("Already initialized") : s.push(xe(r || null)) }), gt = (t, e) => ct(e, ve("metadata"), t[3]), pt = (t, e, n, i) => {
915
916
  for (var s = 0, r = t[e >> 1], l = r && r.length; s < l; s++) r[s].call(n);
916
917
  return i;
917
- }, yt = (t, e, n, i, s, r) => {
918
- var l, o, f, g = e & 7, a = !1, h = 0, y = t[h] || (t[h] = []), v = g && (s = s.prototype, g < 5 && (g > 3 || !a) && ut(s, n));
919
- mt(s, n);
918
+ }, wt = (t, e, n, i, s, r) => {
919
+ var l, o, f, g = e & 7, a = !1, h = 0, y = t[h] || (t[h] = []), v = g && (s = s.prototype, g < 5 && (g > 3 || !a) && at(s, n));
920
+ ut(s, n);
920
921
  for (var d = i.length - 1; d >= 0; d--)
921
- f = pt(g, n, o = {}, t[3], y), l = (0, i[d])(s, f), o._ = 1, Ce(l) && (s = l);
922
- return wt(t, s), v && B(s, n, v), a ? g ^ 4 ? r : v : s;
923
- }, Se, U, be;
922
+ f = ht(g, n, o = {}, t[3], y), l = (0, i[d])(s, f), o._ = 1, xe(l) && (s = l);
923
+ return gt(t, s), v && Q(s, n, v), a ? g ^ 4 ? r : v : s;
924
+ }, ke, B, Ce;
924
925
  const De = [
925
926
  "diffChars",
926
927
  "diffWords",
@@ -928,7 +929,7 @@ const De = [
928
929
  "diffLines",
929
930
  "createTwoFilesPatch"
930
931
  ];
931
- Se = [Ee(["jsdiff"]), We(
932
+ ke = [Se(["jsdiff"]), Ne(
932
933
  E.object({
933
934
  "quickDiff.preferredCompareMode": E.union([E.const("jsDiff"), E.const("mwApi")]).description("The preferred comparison mode for quick diff").default("mwApi"),
934
935
  "quickDiff.jsDiff.defaultType": E.union(De.map((t) => E.const(t))).description("The default diff type for JsDiff").default("diffSentences")
@@ -938,7 +939,7 @@ Se = [Ee(["jsdiff"]), We(
938
939
  "quickDiff.jsDiff.defaultType": "diffSentences"
939
940
  }
940
941
  )];
941
- class j extends (be = ee) {
942
+ class j extends (Ce = G) {
942
943
  constructor(e) {
943
944
  super(e, {}, "quick-diff"), this.ctx = e, this.VALID_DIFF_TYPES = De, this.COMPARE_API_DEFAULT_OPTIONS = {
944
945
  prop: [
@@ -962,10 +963,10 @@ class j extends (be = ee) {
962
963
  this.ctx.off("quickEdit/wikiPage", this.injectQuickEdit.bind(this));
963
964
  }
964
965
  injectHistoryPage() {
965
- const e = ft("#mw-history-compare");
966
+ const e = lt("#mw-history-compare");
966
967
  if (!e)
967
968
  return;
968
- at(".mw-history-compareselectedversions-button", e).forEach((i) => {
969
+ ot(".mw-history-compareselectedversions-button", e).forEach((i) => {
969
970
  i.after(
970
971
  /* @__PURE__ */ m(
971
972
  "button",
@@ -1011,7 +1012,7 @@ class j extends (be = ee) {
1011
1012
  className: "in-page-edit ipe-quickDiff"
1012
1013
  });
1013
1014
  i.show();
1014
- const s = /* @__PURE__ */ m("pre", { className: rt["diff-container"] }), r = /* @__PURE__ */ m(
1015
+ const s = /* @__PURE__ */ m("pre", { className: nt["diff-container"] }), r = /* @__PURE__ */ m(
1015
1016
  "div",
1016
1017
  {
1017
1018
  style: {
@@ -1019,7 +1020,7 @@ class j extends (be = ee) {
1019
1020
  gap: "1em"
1020
1021
  },
1021
1022
  children: this.VALID_DIFF_TYPES.map((l, o) => /* @__PURE__ */ m(
1022
- _e,
1023
+ Ee,
1023
1024
  {
1024
1025
  name: "diffType",
1025
1026
  value: l,
@@ -1080,7 +1081,7 @@ class j extends (be = ee) {
1080
1081
  comparePages(e) {
1081
1082
  const n = this.ctx.modal.createObject({
1082
1083
  title: "Loading diff...",
1083
- content: /* @__PURE__ */ m(Pe, {}),
1084
+ content: /* @__PURE__ */ m(be, {}),
1084
1085
  className: "quick-diff"
1085
1086
  }).init();
1086
1087
  return window.mw && mw.loader.getState("mediawiki.diff.styles") !== "ready" && mw.loader.load(["mediawiki.diff.styles"]), this.ctx.api.post({
@@ -1105,26 +1106,27 @@ class j extends (be = ee) {
1105
1106
  n.setTitle(
1106
1107
  s.fromtitle && s.totitle ? `${s.fromtitle} ⇔ ${s.totitle}` : "Differences"
1107
1108
  ), n.setContent(
1108
- /* @__PURE__ */ m("section", { children: /* @__PURE__ */ m(ot, { data: s }) })
1109
+ /* @__PURE__ */ m("section", { children: /* @__PURE__ */ m(st, { data: s }) })
1109
1110
  );
1110
1111
  }).catch((i) => {
1111
1112
  n.setContent(
1112
- /* @__PURE__ */ m(Oe, { title: "Failed to load diff", type: "error", children: /* @__PURE__ */ m("pre", { children: i instanceof Error ? i.message : String(i) }) })
1113
+ /* @__PURE__ */ m(We, { title: "Failed to load diff", type: "error", children: /* @__PURE__ */ m("pre", { children: i instanceof Error ? i.message : String(i) }) })
1113
1114
  );
1114
1115
  }), n.show();
1115
1116
  }
1116
1117
  }
1117
- U = ht(be);
1118
- j = yt(U, 0, "PluginQuickDiffCore", Se, j);
1119
- vt(U, 1, j);
1120
- const Q = class Q extends ee {
1118
+ B = dt(Ce);
1119
+ j = wt(B, 0, "PluginQuickDiffCore", ke, j);
1120
+ pt(B, 1, j);
1121
+ class Ct extends G {
1121
1122
  constructor(e) {
1122
- super(e, {}, "quick-diff-loader"), this.ctx = e, e.plugin(it), e.plugin(j);
1123
+ super(e, {}, "quick-diff-loader"), this.ctx = e, e.plugin(tt), e.plugin(j);
1123
1124
  }
1124
- };
1125
- Q.inject = ["api", "wikiPage", "modal"];
1126
- let K = Q;
1125
+ static {
1126
+ this.inject = ["api", "wikiPage", "modal"];
1127
+ }
1128
+ }
1127
1129
  export {
1128
- K as PluginQuickDiff
1130
+ Ct as PluginQuickDiff
1129
1131
  };
1130
- //# sourceMappingURL=index-M4USLRId.js.map
1132
+ //# sourceMappingURL=index-BByzm2Fz.js.map