@signosoft/signpad-js 0.2.0 → 0.2.2

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.
@@ -1,7 +1,7 @@
1
- const ZA = globalThis, KI = ZA.ShadowRoot && (ZA.ShadyCSS === void 0 || ZA.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, tg = /* @__PURE__ */ Symbol(), Ag = /* @__PURE__ */ new WeakMap();
1
+ const ZA = globalThis, KI = ZA.ShadowRoot && (ZA.ShadyCSS === void 0 || ZA.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, kg = /* @__PURE__ */ Symbol(), Ag = /* @__PURE__ */ new WeakMap();
2
2
  let oC = class {
3
3
  constructor(A, I, g) {
4
- if (this._$cssResult$ = !0, g !== tg) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
4
+ if (this._$cssResult$ = !0, g !== kg) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
5
  this.cssText = A, this.t = I;
6
6
  }
7
7
  get styleSheet() {
@@ -17,7 +17,7 @@ let oC = class {
17
17
  return this.cssText;
18
18
  }
19
19
  };
20
- const kg = (Q) => new oC(typeof Q == "string" ? Q : Q + "", void 0, tg), DC = (Q, A) => {
20
+ const tg = (Q) => new oC(typeof Q == "string" ? Q : Q + "", void 0, kg), DC = (Q, A) => {
21
21
  if (KI) Q.adoptedStyleSheets = A.map((I) => I instanceof CSSStyleSheet ? I : I.styleSheet);
22
22
  else for (const I of A) {
23
23
  const g = document.createElement("style"), E = ZA.litNonce;
@@ -26,9 +26,9 @@ const kg = (Q) => new oC(typeof Q == "string" ? Q : Q + "", void 0, tg), DC = (Q
26
26
  }, Ig = KI ? (Q) => Q : (Q) => Q instanceof CSSStyleSheet ? ((A) => {
27
27
  let I = "";
28
28
  for (const g of A.cssRules) I += g.cssText;
29
- return kg(I);
29
+ return tg(I);
30
30
  })(Q) : Q;
31
- const { is: wC, defineProperty: SC, getOwnPropertyDescriptor: sC, getOwnPropertyNames: aC, getOwnPropertySymbols: yC, getPrototypeOf: KC } = Object, $A = globalThis, gg = $A.trustedTypes, hC = gg ? gg.emptyScript : "", MC = $A.reactiveElementPolyfillSupport, tA = (Q, A) => Q, zA = { toAttribute(Q, A) {
31
+ const { is: wC, defineProperty: SC, getOwnPropertyDescriptor: sC, getOwnPropertyNames: aC, getOwnPropertySymbols: yC, getPrototypeOf: KC } = Object, $A = globalThis, gg = $A.trustedTypes, hC = gg ? gg.emptyScript : "", MC = $A.reactiveElementPolyfillSupport, kA = (Q, A) => Q, zA = { toAttribute(Q, A) {
32
32
  switch (A) {
33
33
  case Boolean:
34
34
  Q = Q ? hC : null;
@@ -86,13 +86,13 @@ let DA = class extends HTMLElement {
86
86
  return this.elementProperties.get(A) ?? Cg;
87
87
  }
88
88
  static _$Ei() {
89
- if (this.hasOwnProperty(tA("elementProperties"))) return;
89
+ if (this.hasOwnProperty(kA("elementProperties"))) return;
90
90
  const A = KC(this);
91
91
  A.finalize(), A.l !== void 0 && (this.l = [...A.l]), this.elementProperties = new Map(A.elementProperties);
92
92
  }
93
93
  static finalize() {
94
- if (this.hasOwnProperty(tA("finalized"))) return;
95
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(tA("properties"))) {
94
+ if (this.hasOwnProperty(kA("finalized"))) return;
95
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(kA("properties"))) {
96
96
  const I = this.properties, g = [...aC(I), ...yC(I)];
97
97
  for (const E of g) this.createProperty(E, I[E]);
98
98
  }
@@ -239,7 +239,7 @@ let DA = class extends HTMLElement {
239
239
  firstUpdated(A) {
240
240
  }
241
241
  };
242
- DA.elementStyles = [], DA.shadowRootOptions = { mode: "open" }, DA[tA("elementProperties")] = /* @__PURE__ */ new Map(), DA[tA("finalized")] = /* @__PURE__ */ new Map(), MC?.({ ReactiveElement: DA }), ($A.reactiveElementVersions ??= []).push("2.1.2");
242
+ DA.elementStyles = [], DA.shadowRootOptions = { mode: "open" }, DA[kA("elementProperties")] = /* @__PURE__ */ new Map(), DA[kA("finalized")] = /* @__PURE__ */ new Map(), MC?.({ ReactiveElement: DA }), ($A.reactiveElementVersions ??= []).push("2.1.2");
243
243
  const MI = globalThis, Bg = (Q) => Q, vA = MI.trustedTypes, Qg = vA ? vA.createPolicy("lit-html", { createHTML: (Q) => Q }) : void 0, Fg = "$lit$", P = `lit$${Math.random().toFixed(9).slice(2)}$`, Jg = "?" + P, GC = `<${Jg}>`, BA = document, FA = () => BA.createComment(""), JA = (Q) => Q === null || typeof Q != "object" && typeof Q != "function", GI = Array.isArray, RC = (Q) => GI(Q) || typeof Q?.[Symbol.iterator] == "function", aI = `[
244
244
  \f\r]`, NA = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Eg = /-->/g, ig = />/g, gA = RegExp(`>|${aI}(?:([^\\s"'>=/]+)(${aI}*=${aI}*(?:[^
245
245
  \f\r"'\`<>=]|("|')|))|$)`, "g"), og = /'/g, Dg = /"/g, Ug = /^(?:script|style|textarea|title)$/i, NC = (Q) => (A, ...I) => ({ _$litType$: Q, strings: A, values: I }), p = NC(1), wA = /* @__PURE__ */ Symbol.for("lit-noChange"), r = /* @__PURE__ */ Symbol.for("lit-nothing"), wg = /* @__PURE__ */ new WeakMap(), CA = BA.createTreeWalker(BA, 129);
@@ -247,15 +247,15 @@ function cg(Q, A) {
247
247
  if (!GI(Q) || !Q.hasOwnProperty("raw")) throw Error("invalid template strings array");
248
248
  return Qg !== void 0 ? Qg.createHTML(A) : A;
249
249
  }
250
- const tC = (Q, A) => {
250
+ const kC = (Q, A) => {
251
251
  const I = Q.length - 1, g = [];
252
252
  let E, i = A === 2 ? "<svg>" : A === 3 ? "<math>" : "", w = NA;
253
253
  for (let s = 0; s < I; s++) {
254
254
  const y = Q[s];
255
- let t, F, k = -1, c = 0;
256
- for (; c < y.length && (w.lastIndex = c, F = w.exec(y), F !== null); ) c = w.lastIndex, w === NA ? F[1] === "!--" ? w = Eg : F[1] !== void 0 ? w = ig : F[2] !== void 0 ? (Ug.test(F[2]) && (E = RegExp("</" + F[2], "g")), w = gA) : F[3] !== void 0 && (w = gA) : w === gA ? F[0] === ">" ? (w = E ?? NA, k = -1) : F[1] === void 0 ? k = -2 : (k = w.lastIndex - F[2].length, t = F[1], w = F[3] === void 0 ? gA : F[3] === '"' ? Dg : og) : w === Dg || w === og ? w = gA : w === Eg || w === ig ? w = NA : (w = gA, E = void 0);
255
+ let k, F, t = -1, c = 0;
256
+ for (; c < y.length && (w.lastIndex = c, F = w.exec(y), F !== null); ) c = w.lastIndex, w === NA ? F[1] === "!--" ? w = Eg : F[1] !== void 0 ? w = ig : F[2] !== void 0 ? (Ug.test(F[2]) && (E = RegExp("</" + F[2], "g")), w = gA) : F[3] !== void 0 && (w = gA) : w === gA ? F[0] === ">" ? (w = E ?? NA, t = -1) : F[1] === void 0 ? t = -2 : (t = w.lastIndex - F[2].length, k = F[1], w = F[3] === void 0 ? gA : F[3] === '"' ? Dg : og) : w === Dg || w === og ? w = gA : w === Eg || w === ig ? w = NA : (w = gA, E = void 0);
257
257
  const l = w === gA && Q[s + 1].startsWith("/>") ? " " : "";
258
- i += w === NA ? y + GC : k >= 0 ? (g.push(t), y.slice(0, k) + Fg + y.slice(k) + P + l) : y + P + (k === -2 ? s : l);
258
+ i += w === NA ? y + GC : t >= 0 ? (g.push(k), y.slice(0, t) + Fg + y.slice(t) + P + l) : y + P + (t === -2 ? s : l);
259
259
  }
260
260
  return [cg(Q, i + (Q[I] || "<?>") + (A === 2 ? "</svg>" : A === 3 ? "</math>" : "")), g];
261
261
  };
@@ -264,29 +264,29 @@ class UA {
264
264
  let E;
265
265
  this.parts = [];
266
266
  let i = 0, w = 0;
267
- const s = A.length - 1, y = this.parts, [t, F] = tC(A, I);
268
- if (this.el = UA.createElement(t, g), CA.currentNode = this.el.content, I === 2 || I === 3) {
269
- const k = this.el.content.firstChild;
270
- k.replaceWith(...k.childNodes);
267
+ const s = A.length - 1, y = this.parts, [k, F] = kC(A, I);
268
+ if (this.el = UA.createElement(k, g), CA.currentNode = this.el.content, I === 2 || I === 3) {
269
+ const t = this.el.content.firstChild;
270
+ t.replaceWith(...t.childNodes);
271
271
  }
272
272
  for (; (E = CA.nextNode()) !== null && y.length < s; ) {
273
273
  if (E.nodeType === 1) {
274
- if (E.hasAttributes()) for (const k of E.getAttributeNames()) if (k.endsWith(Fg)) {
275
- const c = F[w++], l = E.getAttribute(k).split(P), f = /([.?@])?(.*)/.exec(c);
276
- y.push({ type: 1, index: i, name: f[2], strings: l, ctor: f[1] === "." ? FC : f[1] === "?" ? JC : f[1] === "@" ? UC : AI }), E.removeAttribute(k);
277
- } else k.startsWith(P) && (y.push({ type: 6, index: i }), E.removeAttribute(k));
274
+ if (E.hasAttributes()) for (const t of E.getAttributeNames()) if (t.endsWith(Fg)) {
275
+ const c = F[w++], l = E.getAttribute(t).split(P), f = /([.?@])?(.*)/.exec(c);
276
+ y.push({ type: 1, index: i, name: f[2], strings: l, ctor: f[1] === "." ? FC : f[1] === "?" ? JC : f[1] === "@" ? UC : AI }), E.removeAttribute(t);
277
+ } else t.startsWith(P) && (y.push({ type: 6, index: i }), E.removeAttribute(t));
278
278
  if (Ug.test(E.tagName)) {
279
- const k = E.textContent.split(P), c = k.length - 1;
279
+ const t = E.textContent.split(P), c = t.length - 1;
280
280
  if (c > 0) {
281
281
  E.textContent = vA ? vA.emptyScript : "";
282
- for (let l = 0; l < c; l++) E.append(k[l], FA()), CA.nextNode(), y.push({ type: 2, index: ++i });
283
- E.append(k[c], FA());
282
+ for (let l = 0; l < c; l++) E.append(t[l], FA()), CA.nextNode(), y.push({ type: 2, index: ++i });
283
+ E.append(t[c], FA());
284
284
  }
285
285
  }
286
286
  } else if (E.nodeType === 8) if (E.data === Jg) y.push({ type: 2, index: i });
287
287
  else {
288
- let k = -1;
289
- for (; (k = E.data.indexOf(P, k + 1)) !== -1; ) y.push({ type: 7, index: i }), k += P.length - 1;
288
+ let t = -1;
289
+ for (; (t = E.data.indexOf(P, t + 1)) !== -1; ) y.push({ type: 7, index: i }), t += P.length - 1;
290
290
  }
291
291
  i++;
292
292
  }
@@ -302,7 +302,7 @@ function SA(Q, A, I = Q, g) {
302
302
  const i = JA(A) ? void 0 : A._$litDirective$;
303
303
  return E?.constructor !== i && (E?._$AO?.(!1), i === void 0 ? E = void 0 : (E = new i(Q), E._$AT(Q, I, g)), g !== void 0 ? (I._$Co ??= [])[g] = E : I._$Cl = E), E !== void 0 && (A = SA(Q, E._$AS(Q, A.values), E, g)), A;
304
304
  }
305
- class kC {
305
+ class tC {
306
306
  constructor(A, I) {
307
307
  this._$AV = [], this._$AN = void 0, this._$AD = A, this._$AM = I;
308
308
  }
@@ -318,8 +318,8 @@ class kC {
318
318
  let i = CA.nextNode(), w = 0, s = 0, y = g[0];
319
319
  for (; y !== void 0; ) {
320
320
  if (w === y.index) {
321
- let t;
322
- y.type === 2 ? t = new LA(i, i.nextSibling, this, A) : y.type === 1 ? t = new y.ctor(i, y.name, y.strings, this, A) : y.type === 6 && (t = new cC(i, this, A)), this._$AV.push(t), y = g[++s];
321
+ let k;
322
+ y.type === 2 ? k = new LA(i, i.nextSibling, this, A) : y.type === 1 ? k = new y.ctor(i, y.name, y.strings, this, A) : y.type === 6 && (k = new cC(i, this, A)), this._$AV.push(k), y = g[++s];
323
323
  }
324
324
  w !== y?.index && (i = CA.nextNode(), w++);
325
325
  }
@@ -364,7 +364,7 @@ class LA {
364
364
  const { values: I, _$litType$: g } = A, E = typeof g == "number" ? this._$AC(A) : (g.el === void 0 && (g.el = UA.createElement(cg(g.h, g.h[0]), this.options)), g);
365
365
  if (this._$AH?._$AD === E) this._$AH.p(I);
366
366
  else {
367
- const i = new kC(E, this), w = i.u(this.options);
367
+ const i = new tC(E, this), w = i.u(this.options);
368
368
  i.p(I), this.T(w), this._$AH = i;
369
369
  }
370
370
  }
@@ -405,8 +405,8 @@ class AI {
405
405
  if (i === void 0) A = SA(this, A, I, 0), w = !JA(A) || A !== this._$AH && A !== wA, w && (this._$AH = A);
406
406
  else {
407
407
  const s = A;
408
- let y, t;
409
- for (A = i[0], y = 0; y < i.length - 1; y++) t = SA(this, s[g + y], I, y), t === wA && (t = this._$AH[y]), w ||= !JA(t) || t !== this._$AH[y], t === r ? A = r : A !== r && (A += (t ?? "") + i[y + 1]), this._$AH[y] = t;
408
+ let y, k;
409
+ for (A = i[0], y = 0; y < i.length - 1; y++) k = SA(this, s[g + y], I, y), k === wA && (k = this._$AH[y]), w ||= !JA(k) || k !== this._$AH[y], k === r ? A = r : A !== r && (A += (k ?? "") + i[y + 1]), this._$AH[y] = k;
410
410
  }
411
411
  w && !E && this.j(A);
412
412
  }
@@ -456,7 +456,7 @@ class cC {
456
456
  }
457
457
  const LC = MI.litHtmlPolyfillSupport;
458
458
  LC?.(UA, LA), (MI.litHtmlVersions ??= []).push("3.3.2");
459
- const eC = (Q, A, I) => {
459
+ const YC = (Q, A, I) => {
460
460
  const g = I?.renderBefore ?? A;
461
461
  let E = g._$litPart$;
462
462
  if (E === void 0) {
@@ -466,7 +466,7 @@ const eC = (Q, A, I) => {
466
466
  return E._$AI(Q), E;
467
467
  };
468
468
  const RI = globalThis;
469
- class kA extends DA {
469
+ class tA extends DA {
470
470
  constructor() {
471
471
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
472
472
  }
@@ -476,7 +476,7 @@ class kA extends DA {
476
476
  }
477
477
  update(A) {
478
478
  const I = this.render();
479
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(A), this._$Do = eC(I, this.renderRoot, this.renderOptions);
479
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(A), this._$Do = YC(I, this.renderRoot, this.renderOptions);
480
480
  }
481
481
  connectedCallback() {
482
482
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -488,9 +488,9 @@ class kA extends DA {
488
488
  return wA;
489
489
  }
490
490
  }
491
- kA._$litElement$ = !0, kA.finalized = !0, RI.litElementHydrateSupport?.({ LitElement: kA });
492
- const YC = RI.litElementPolyfillSupport;
493
- YC?.({ LitElement: kA });
491
+ tA._$litElement$ = !0, tA.finalized = !0, RI.litElementHydrateSupport?.({ LitElement: tA });
492
+ const eC = RI.litElementPolyfillSupport;
493
+ eC?.({ LitElement: tA });
494
494
  (RI.litElementVersions ??= []).push("4.2.2");
495
495
  const nC = (Q) => (A, I) => {
496
496
  I !== void 0 ? I.addInitializer(() => {
@@ -693,8 +693,8 @@ class xC {
693
693
  * @param penData - Data containing coordinates (0-1), pressure, and contact status.
694
694
  */
695
695
  drawSegment(A) {
696
- const I = this.ctx, g = this.canvas, E = this.currentDrawingOptions, i = A.relativeX ?? 0, w = A.relativeY ?? 0, s = i * g.width, y = w * g.height, t = this.drawingOptions.minWidth + (this.drawingOptions.maxWidth - this.drawingOptions.minWidth) * (A.pressure ?? 0);
697
- I.strokeStyle = E.color ?? "#000000", I.lineWidth = t, A.inContact ? this.lastDrawPoint ? (I.beginPath(), I.moveTo(this.lastDrawPoint.x, this.lastDrawPoint.y), I.lineTo(s, y), I.stroke(), this.lastDrawPoint = { x: s, y }) : this.lastDrawPoint = { x: s, y } : this.lastDrawPoint = null;
696
+ const I = this.ctx, g = this.canvas, E = this.currentDrawingOptions, i = A.relativeX ?? 0, w = A.relativeY ?? 0, s = i * g.width, y = w * g.height, k = this.drawingOptions.minWidth + (this.drawingOptions.maxWidth - this.drawingOptions.minWidth) * (A.pressure ?? 0);
697
+ I.strokeStyle = E.color ?? "#000000", I.lineWidth = k, A.inContact ? this.lastDrawPoint ? (I.beginPath(), I.moveTo(this.lastDrawPoint.x, this.lastDrawPoint.y), I.lineTo(s, y), I.stroke(), this.lastDrawPoint = { x: s, y }) : this.lastDrawPoint = { x: s, y } : this.lastDrawPoint = null;
698
698
  }
699
699
  /**
700
700
  * Wipes the canvas clean and resets the drawing state.
@@ -726,7 +726,7 @@ class OC {
726
726
  * @param component - The host SignosoftSignpad instance.
727
727
  */
728
728
  constructor(A) {
729
- this.sigLayer = null, this.debugCallbackRegistrationCount = 0, this.offscreenDrawingCanvas = null, this.cachedDeviceInfo = null, this.sigLayerInitialized = !1, this.licenseServerUrl = "https://test.signosoft.com/api/v1/driver/leases", this.lastPenDispatchTime = 0, this.penDataToDispatch = null, this.throttleDelayMs = 16, this.fetchShimInstalled = !1, this.component = A;
729
+ this.sigLayer = null, this.debugCallbackRegistrationCount = 0, this.offscreenDrawingCanvas = null, this.cachedDeviceInfo = null, this.sigLayerInitialized = !1, this.licenseServerUrl = "https://test.signosoft.com/api/v1/driver/leases", this.lastPenDispatchTime = 0, this.penDataToDispatch = null, this.throttleDelayMs = 16, this.component = A;
730
730
  }
731
731
  // --- PUBLIC METHODS ---
732
732
  /**
@@ -737,7 +737,7 @@ class OC {
737
737
  * @returns A promise resolving to true if connection (or fallback) was successful.
738
738
  */
739
739
  async connect(A = !1, I = !1) {
740
- this.installLibAsset(), this.component.stateManager.transitionTo(
740
+ this.component.stateManager.transitionTo(
741
741
  R.CONNECTING,
742
742
  A ? L.AUTO_CONNECTING : L.CONNECTING_TO_DEVICE
743
743
  );
@@ -746,25 +746,25 @@ class OC {
746
746
  const g = await this.sigLayer?.connect(A), E = this.sigLayer?.isConnected() ?? !1, i = !!(g && E), w = i ? this.normalizeDeviceInfo(await this.sigLayer?.getDeviceInfo()) : null;
747
747
  this.cachedDeviceInfo = w ?? null;
748
748
  const s = i && (w?.deviceName ?? w?.name ?? null) === "Pointer Input (Fallback Mode)";
749
- let y = null, t, F;
749
+ let y = null, k, F;
750
750
  if (i && !s) {
751
751
  this.offscreenDrawingCanvas || (this.offscreenDrawingCanvas = document.createElement("canvas"), this.offscreenDrawingCanvas.width = 10, this.offscreenDrawingCanvas.height = 10), y = this.offscreenDrawingCanvas;
752
- const k = w?.deviceName ?? w?.name ?? u.CONNECTED_UNKNOWN;
753
- this.component.setDeviceStatusText(k), t = R.CONNECTED_PHYSICAL, F = L.TEXT_SIGN_WITH_PHYSICAL, this.component.mouseManager?.areListenersAttached() && this.component.mouseManager?.removeListeners();
752
+ const t = w?.deviceName ?? w?.name ?? u.CONNECTED_UNKNOWN;
753
+ this.component.setDeviceStatusText(t), k = R.CONNECTED_PHYSICAL, F = L.TEXT_SIGN_WITH_PHYSICAL, this.component.mouseManager?.areListenersAttached() && this.component.mouseManager?.removeListeners();
754
754
  } else if (i && s)
755
- y = this.component.canvasRef, this.component.setDeviceStatusText(u.MOUSE), t = R.CONNECTED_MOUSE_FALLBACK, F = L.TEXT_SIGN_WITH_MOUSE;
755
+ y = this.component.canvasRef, this.component.setDeviceStatusText(u.MOUSE), k = R.CONNECTED_MOUSE_FALLBACK, F = L.TEXT_SIGN_WITH_MOUSE;
756
756
  else if (!i && I)
757
- y = this.component.canvasRef, this.component.setDeviceStatusText(u.MOUSE), t = R.CONNECTED_MOUSE_FALLBACK, F = L.TEXT_SIGN_WITH_MOUSE;
757
+ y = this.component.canvasRef, this.component.setDeviceStatusText(u.MOUSE), k = R.CONNECTED_MOUSE_FALLBACK, F = L.TEXT_SIGN_WITH_MOUSE;
758
758
  else
759
759
  return this.component.stateManager.transitionTo(
760
760
  R.DISCONNECTED,
761
761
  L.NO_DEVICE_FOUND
762
762
  ), !1;
763
763
  if (y) {
764
- const k = this.component.configManager.getDrawingOptions();
765
- this.sigLayer?.isInSigningMode?.() && await this.sigLayer.stopSigning(), await this.sigLayer?.startSigning(y, !0, k);
764
+ const t = this.component.configManager.getDrawingOptions();
765
+ this.sigLayer?.isInSigningMode?.() && await this.sigLayer.stopSigning(), await this.sigLayer?.startSigning(y, !0, t);
766
766
  }
767
- return this.component.stateManager.transitionTo(t, F), this.component.dispatch(q.SIGN_CONNECT, { deviceInfo: w }), !0;
767
+ return this.component.stateManager.transitionTo(k, F), this.component.dispatch(q.SIGN_CONNECT, { deviceInfo: w }), !0;
768
768
  } catch (g) {
769
769
  return console.error("Signosoft Signpad: Error in connect method:", g), this.component.stateManager.transitionTo(
770
770
  R.ERROR,
@@ -937,29 +937,6 @@ class OC {
937
937
  throw console.error("Signosoft Signpad: License initialization failed", A), A;
938
938
  }
939
939
  }
940
- /**
941
- * Installs a fetch shim to resolve lib assets when bundled.
942
- */
943
- installLibAsset() {
944
- if (this.fetchShimInstalled || typeof fetch != "function") return;
945
- const A = fetch.bind(globalThis), I = (g) => g.endsWith("/lib/deviceConfigs.json") || g === "/lib/deviceConfigs.json" ? new URL("../lib/deviceConfigs.json", import.meta.url).toString() : g.endsWith("/lib/images.json") || g === "/lib/images.json" ? new URL("../lib/images.json", import.meta.url).toString() : null;
946
- globalThis.fetch = (g, E) => {
947
- try {
948
- if (typeof g == "string") {
949
- const i = I(g);
950
- if (i) return A(i, E);
951
- } else if (g instanceof URL) {
952
- const i = I(g.toString());
953
- if (i) return A(i, E);
954
- } else if (g instanceof Request) {
955
- const i = I(g.url);
956
- if (i) return A(new Request(i, g));
957
- }
958
- } catch {
959
- }
960
- return A(g, E);
961
- }, this.fetchShimInstalled = !0;
962
- }
963
940
  // --- PRIVATE HELPERS ---
964
941
  isFallback(A, I, g) {
965
942
  const i = (A?.deviceName ?? A?.name ?? null) === "Pointer Input (Fallback Mode)", w = this.component.currentState === R.CONNECTED_MOUSE_FALLBACK, s = this.component.deviceStatusText === u.MOUSE;
@@ -1211,7 +1188,7 @@ class jC {
1211
1188
  return Number(I.toFixed(3));
1212
1189
  }
1213
1190
  }
1214
- const WC = "OK", bC = "Clear", mC = "Cancel", ZC = "Clear signature", uC = "Disconnect", XC = "Connect Signpad", PC = "Not Connected", VC = "Connected", zC = "Connecting...", vC = "Mouse", _C = "Connected (Unknown Device)", $C = "Auto-connecting to device...", AB = "Connecting to your device...", IB = "Disconnecting device...", gB = "Component initialized.", CB = "Connect your device.", BB = "Please sign using the device pen.", QB = "Please sign using your mouse.", EB = "Sign in the area above using mouse or pen.", iB = "Signing with {device}", oB = "No device found.", DB = "Connection error.", wB = "Error during disconnection.", SB = "Error instantiating driver.", sB = "Signpad disconnected.", aB = "Device unexpectedly disconnected.", yB = "Signature saved successfully.", KB = "Signing cancelled.", hB = "Signature cleared.", MB = "No license key provided. Please provide a license key to connect.", GB = "Ready to connect.", RB = "Signpad detected. Click 'Connect Signpad' to begin.", NB = "Device connected, but no license key provided.", tB = {
1191
+ const WC = "OK", bC = "Clear", mC = "Cancel", ZC = "Clear signature", uC = "Disconnect", XC = "Connect Signpad", PC = "Not Connected", VC = "Connected", zC = "Connecting...", vC = "Mouse", _C = "Connected (Unknown Device)", $C = "Auto-connecting to device...", AB = "Connecting to your device...", IB = "Disconnecting device...", gB = "Component initialized.", CB = "Connect your device.", BB = "Please sign using the device pen.", QB = "Please sign using your mouse.", EB = "Sign in the area above using mouse or pen.", iB = "Signing with {device}", oB = "No device found.", DB = "Connection error.", wB = "Error during disconnection.", SB = "Error instantiating driver.", sB = "Signpad disconnected.", aB = "Device unexpectedly disconnected.", yB = "Signature saved successfully.", KB = "Signing cancelled.", hB = "Signature cleared.", MB = "No license key provided. Please provide a license key to connect.", GB = "Ready to connect.", RB = "Signpad detected. Click 'Connect Signpad' to begin.", NB = "Device connected, but no license key provided.", kB = {
1215
1192
  OK: WC,
1216
1193
  CLEAR: bC,
1217
1194
  CANCEL: mC,
@@ -1245,15 +1222,15 @@ const WC = "OK", bC = "Clear", mC = "Cancel", ZC = "Clear signature", uC = "Disc
1245
1222
  READY_TO_CONNECT: GB,
1246
1223
  SIGNPAD_DETECTED: RB,
1247
1224
  NO_LICENSE_KEY: NB
1248
- }, kB = "OK", FB = "Smazat", JB = "Zrušit", UB = "Smazat podpis", cB = "Odpojit", LB = "Připojit Signpad", eB = "Nepřipojeno", YB = "Připojeno", nB = "Připojování...", HB = "Myš", rB = "Připojeno (neznámé zařízení)", qB = "Automatické připojování k zařízení...", lB = "Připojování k vašemu zařízení...", dB = "Odpojování zařízení...", fB = "Komponenta byla inicializována.", pB = "Připojte své zařízení.", xB = "Podepište se perem zařízení.", OB = "Podepište se pomocí myši.", TB = "Podepište se v oblasti výše pomocí myši nebo pera.", jB = "Podepisování pomocí: {device}", WB = "Zařízení nebylo nalezeno.", bB = "Chyba připojení.", mB = "Chyba při odpojování.", ZB = "Chyba při inicializaci ovladače.", uB = "Signpad byl odpojen.", XB = "Zařízení bylo neočekávaně odpojeno.", PB = "Podpis byl úspěšně uložen.", VB = "Podepisování bylo zrušeno.", zB = "Podpis byl vymazán.", vB = "Nebyl poskytnut licenční klíč. Pro připojení prosím zadejte licenční klíč.", _B = "Připraveno k připojení.", $B = "Signpad byl nalezen. Klikněte na 'Připojit Signpad' pro spuštění.", AQ = "Zařízení je připojeno, ale nebyl poskytnut licenční klíč.", IQ = {
1249
- OK: kB,
1225
+ }, tB = "OK", FB = "Smazat", JB = "Zrušit", UB = "Smazat podpis", cB = "Odpojit", LB = "Připojit Signpad", YB = "Nepřipojeno", eB = "Připojeno", nB = "Připojování...", HB = "Myš", rB = "Připojeno (neznámé zařízení)", qB = "Automatické připojování k zařízení...", lB = "Připojování k vašemu zařízení...", dB = "Odpojování zařízení...", fB = "Komponenta byla inicializována.", pB = "Připojte své zařízení.", xB = "Podepište se perem zařízení.", OB = "Podepište se pomocí myši.", TB = "Podepište se v oblasti výše pomocí myši nebo pera.", jB = "Podepisování pomocí: {device}", WB = "Zařízení nebylo nalezeno.", bB = "Chyba připojení.", mB = "Chyba při odpojování.", ZB = "Chyba při inicializaci ovladače.", uB = "Signpad byl odpojen.", XB = "Zařízení bylo neočekávaně odpojeno.", PB = "Podpis byl úspěšně uložen.", VB = "Podepisování bylo zrušeno.", zB = "Podpis byl vymazán.", vB = "Nebyl poskytnut licenční klíč. Pro připojení prosím zadejte licenční klíč.", _B = "Připraveno k připojení.", $B = "Signpad byl nalezen. Klikněte na 'Připojit Signpad' pro spuštění.", AQ = "Zařízení je připojeno, ale nebyl poskytnut licenční klíč.", IQ = {
1226
+ OK: tB,
1250
1227
  CLEAR: FB,
1251
1228
  CANCEL: JB,
1252
1229
  CLEAR_SIGNATURE: UB,
1253
1230
  DISCONNECT: cB,
1254
1231
  CONNECT_SIGNPAD: LB,
1255
- NOT_CONNECTED: eB,
1256
- CONNECTED: YB,
1232
+ NOT_CONNECTED: YB,
1233
+ CONNECTED: eB,
1257
1234
  CONNECTING: nB,
1258
1235
  MOUSE: HB,
1259
1236
  CONNECTED_UNKNOWN_DEVICE: rB,
@@ -1280,7 +1257,7 @@ const WC = "OK", bC = "Clear", mC = "Cancel", ZC = "Clear signature", uC = "Disc
1280
1257
  SIGNPAD_DETECTED: $B,
1281
1258
  NO_LICENSE_KEY: AQ
1282
1259
  }, jA = {
1283
- en: tB,
1260
+ en: kB,
1284
1261
  cs: IQ
1285
1262
  };
1286
1263
  class gQ {
@@ -1343,10 +1320,10 @@ class gQ {
1343
1320
  try {
1344
1321
  const y = await fetch(s);
1345
1322
  if (y.ok) {
1346
- const t = await y.json();
1323
+ const k = await y.json();
1347
1324
  i = {
1348
1325
  ...i,
1349
- ...t
1326
+ ...k
1350
1327
  }, console.log(
1351
1328
  `signosoft-signpad: External translations loaded from ${s}`
1352
1329
  );
@@ -1542,12 +1519,12 @@ var sg = (() => {
1542
1519
  return (async function(A = {}) {
1543
1520
  var I, g = A, E, i, w = new Promise((C, B) => {
1544
1521
  E = C, i = B;
1545
- }), s = typeof window == "object", y = typeof WorkerGlobalScope < "u", t = typeof process == "object" && process.versions?.node && process.type != "renderer";
1522
+ }), s = typeof window == "object", y = typeof WorkerGlobalScope < "u", k = typeof process == "object" && process.versions?.node && process.type != "renderer";
1546
1523
  typeof __filename < "u" ? Q = __filename : y && (Q = self.location.href);
1547
- var F = "", k, c;
1548
- if (t) {
1524
+ var F = "", t, c;
1525
+ if (k) {
1549
1526
  var l = require("fs");
1550
- require("path"), F = __dirname + "/", c = (C) => (C = YA(C) ? new URL(C) : C, l.readFileSync(C)), k = async (C) => (C = YA(C) ? new URL(C) : C, l.readFileSync(C, void 0)), process.argv.slice(2);
1527
+ require("path"), F = __dirname + "/", c = (C) => (C = eA(C) ? new URL(C) : C, l.readFileSync(C)), t = async (C) => (C = eA(C) ? new URL(C) : C, l.readFileSync(C, void 0)), process.argv.slice(2);
1551
1528
  } else if (s || y) {
1552
1529
  try {
1553
1530
  F = new URL(".", Q).href;
@@ -1556,8 +1533,8 @@ var sg = (() => {
1556
1533
  y && (c = (C) => {
1557
1534
  var B = new XMLHttpRequest();
1558
1535
  return B.open("GET", C, !1), B.responseType = "arraybuffer", B.send(null), new Uint8Array(B.response);
1559
- }), k = async (C) => {
1560
- if (YA(C)) return new Promise((o, D) => {
1536
+ }), t = async (C) => {
1537
+ if (eA(C)) return new Promise((o, D) => {
1561
1538
  var S = new XMLHttpRequest();
1562
1539
  S.open("GET", C, !0), S.responseType = "arraybuffer", S.onload = () => {
1563
1540
  S.status == 200 || S.status == 0 && S.response ? o(S.response) : D(S.status);
@@ -1569,19 +1546,19 @@ var sg = (() => {
1569
1546
  };
1570
1547
  }
1571
1548
  console.log.bind(console);
1572
- var f = console.error.bind(console), V, QA, eA = !1, EA, W, sA, z, v, n, tI, II, kI, FI, YA = (C) => C.startsWith("file://");
1549
+ var f = console.error.bind(console), V, QA, YA = !1, EA, W, sA, z, v, n, kI, II, tI, FI, eA = (C) => C.startsWith("file://");
1573
1550
  function JI() {
1574
1551
  var C = QA.buffer;
1575
- EA = new Int8Array(C), sA = new Int16Array(C), g.HEAPU8 = W = new Uint8Array(C), z = new Uint16Array(C), v = new Int32Array(C), n = new Uint32Array(C), tI = new Float32Array(C), FI = new Float64Array(C), II = new BigInt64Array(C), kI = new BigUint64Array(C);
1552
+ EA = new Int8Array(C), sA = new Int16Array(C), g.HEAPU8 = W = new Uint8Array(C), z = new Uint16Array(C), v = new Int32Array(C), n = new Uint32Array(C), kI = new Float32Array(C), FI = new Float64Array(C), II = new BigInt64Array(C), tI = new BigUint64Array(C);
1576
1553
  }
1577
1554
  var _ = 0, aA = null;
1578
1555
  function UI(C) {
1579
- throw g.onAbort?.(C), C = "Aborted(" + C + ")", f(C), eA = !0, C = new WebAssembly.RuntimeError(C + ". Build with -sASSERTIONS for more info."), i(C), C;
1556
+ throw g.onAbort?.(C), C = "Aborted(" + C + ")", f(C), YA = !0, C = new WebAssembly.RuntimeError(C + ". Build with -sASSERTIONS for more info."), i(C), C;
1580
1557
  }
1581
1558
  var gI;
1582
1559
  async function Hg(C) {
1583
1560
  if (!V) try {
1584
- var B = await k(C);
1561
+ var B = await t(C);
1585
1562
  return new Uint8Array(B);
1586
1563
  } catch {
1587
1564
  }
@@ -1600,7 +1577,7 @@ var sg = (() => {
1600
1577
  }
1601
1578
  async function qg(C) {
1602
1579
  var B = gI;
1603
- if (!V && typeof WebAssembly.instantiateStreaming == "function" && !YA(B) && !t) try {
1580
+ if (!V && typeof WebAssembly.instantiateStreaming == "function" && !eA(B) && !k) try {
1604
1581
  var o = fetch(B, { credentials: "same-origin" });
1605
1582
  return await WebAssembly.instantiateStreaming(o, C);
1606
1583
  } catch (D) {
@@ -1610,16 +1587,16 @@ var sg = (() => {
1610
1587
  }
1611
1588
  var cI = (C) => {
1612
1589
  for (; 0 < C.length; ) C.shift()(g);
1613
- }, LI = [], eI = [], lg = () => {
1590
+ }, LI = [], YI = [], lg = () => {
1614
1591
  var C = g.preRun.shift();
1615
- eI.push(C);
1592
+ YI.push(C);
1616
1593
  };
1617
1594
  class dg {
1618
1595
  constructor(B) {
1619
1596
  this.Z = B - 24;
1620
1597
  }
1621
1598
  }
1622
- var YI = 0, nA = {}, CI = (C) => {
1599
+ var eI = 0, nA = {}, CI = (C) => {
1623
1600
  for (; C.length; ) {
1624
1601
  var B = C.pop();
1625
1602
  C.pop()(B);
@@ -1675,7 +1652,7 @@ var sg = (() => {
1675
1652
  case 4:
1676
1653
  return o ? (D) => v[D >> 2] : (D) => n[D >> 2];
1677
1654
  case 8:
1678
- return o ? (D) => II[D >> 3] : (D) => kI[D >> 3];
1655
+ return o ? (D) => II[D >> 3] : (D) => tI[D >> 3];
1679
1656
  default:
1680
1657
  throw new TypeError(`invalid integer width (${B}): ${C}`);
1681
1658
  }
@@ -1833,21 +1810,21 @@ var sg = (() => {
1833
1810
  M = M.join(","), G = G.join(","), M = `return function (${M}) {
1834
1811
  `, N && (M += `var destructors = [];
1835
1812
  `);
1836
- var U = N ? "destructors" : "null", Y = "humanName throwBindingError invoker fn runDestructors retType classParam".split(" ");
1813
+ var U = N ? "destructors" : "null", e = "humanName throwBindingError invoker fn runDestructors retType classParam".split(" ");
1837
1814
  for (h && (M += `var thisWired = classParam['toWireType'](${U}, this);
1838
1815
  `), K = 0; K < S; ++K) M += `var arg${K}Wired = argType${K}['toWireType'](${U}, arg${K});
1839
- `, Y.push(`argType${K}`);
1816
+ `, e.push(`argType${K}`);
1840
1817
  if (M += (o || a ? "var rv = " : "") + `invoker(${G});
1841
1818
  `, N) M += `runDestructors(destructors);
1842
1819
  `;
1843
1820
  else for (K = h ? 1 : 2; K < B.length; ++K) a = K === 1 ? "thisWired" : "arg" + (K - 2) + "Wired", B[K].fa !== null && (M += `${a}_dtor(${a});
1844
- `, Y.push(`${a}_dtor`));
1821
+ `, e.push(`${a}_dtor`));
1845
1822
  o && (M += `var ret = retType['fromWireType'](rv);
1846
1823
  return ret;
1847
1824
  `);
1848
- let [d, e] = [Y, M + `}
1825
+ let [d, Y] = [e, M + `}
1849
1826
  `];
1850
- return B = new Function(...d, e)(...D), lA(C, B);
1827
+ return B = new Function(...d, Y)(...D), lA(C, B);
1851
1828
  }
1852
1829
  for (var WI = (C, B) => {
1853
1830
  for (var o = [], D = 0; D < C; D++) o.push(n[B + 4 * D >> 2]);
@@ -1909,7 +1886,7 @@ return ret;
1909
1886
  switch (B) {
1910
1887
  case 4:
1911
1888
  return function(o) {
1912
- return this.fromWireType(tI[o >> 2]);
1889
+ return this.fromWireType(kI[o >> 2]);
1913
1890
  };
1914
1891
  case 8:
1915
1892
  return function(o) {
@@ -2108,7 +2085,7 @@ return ret;
2108
2085
  var BC = {
2109
2086
  k: (C, B, o) => {
2110
2087
  var D = new dg(C);
2111
- throw n[D.Z + 16 >> 2] = 0, n[D.Z + 4 >> 2] = B, n[D.Z + 8 >> 2] = o, YI = C, YI;
2088
+ throw n[D.Z + 16 >> 2] = 0, n[D.Z + 4 >> 2] = B, n[D.Z + 8 >> 2] = o, eI = C, eI;
2112
2089
  },
2113
2090
  F: () => UI(""),
2114
2091
  t: (C) => {
@@ -2118,10 +2095,10 @@ return ret;
2118
2095
  KA([C], a, (K) => {
2119
2096
  var h = {};
2120
2097
  return S.forEach((N, M) => {
2121
- var G = K[M], U = N.Da, Y = N.Ea, d = K[M + S.length], e = N.La, j = N.Na;
2122
- h[N.Aa] = { read: (X) => G.fromWireType(U(Y, X)), write: (X, GA) => {
2098
+ var G = K[M], U = N.Da, e = N.Ea, d = K[M + S.length], Y = N.La, j = N.Na;
2099
+ h[N.Aa] = { read: (X) => G.fromWireType(U(e, X)), write: (X, GA) => {
2123
2100
  var x = [];
2124
- e(j, X, d.toWireType(x, GA)), CI(x);
2101
+ Y(j, X, d.toWireType(x, GA)), CI(x);
2125
2102
  }, optional: K[M].optional };
2126
2103
  }), [{ name: B.name, fromWireType: (N) => {
2127
2104
  var M = {}, G;
@@ -2160,43 +2137,43 @@ return ret;
2160
2137
  fa: null
2161
2138
  });
2162
2139
  },
2163
- M: (C, B, o, D, S, a, K, h, N, M, G, U, Y) => {
2164
- G = H(G), a = Z(S, a), h &&= Z(K, h), M &&= Z(N, M), Y = Z(U, Y);
2140
+ M: (C, B, o, D, S, a, K, h, N, M, G, U, e) => {
2141
+ G = H(G), a = Z(S, a), h &&= Z(K, h), M &&= Z(N, M), e = Z(U, e);
2165
2142
  var d = xg(G);
2166
2143
  EI(d, function() {
2167
2144
  DI(`Cannot construct ${G} due to unbound types`, [D]);
2168
- }), KA([C, B, o], D ? [D] : [], (e) => {
2169
- if (e = e[0], D)
2170
- var j = e.$, X = j.ka;
2145
+ }), KA([C, B, o], D ? [D] : [], (Y) => {
2146
+ if (Y = Y[0], D)
2147
+ var j = Y.$, X = j.ka;
2171
2148
  else X = qA.prototype;
2172
- e = lA(G, function(...sI) {
2149
+ Y = lA(G, function(...sI) {
2173
2150
  if (Object.getPrototypeOf(this) !== GA) throw new J(`Use 'new' to construct ${G}`);
2174
2151
  if (x.ja === void 0) throw new J(`${G} has no accessible constructor`);
2175
2152
  var $I = x.ja[sI.length];
2176
2153
  if ($I === void 0) throw new J(`Tried to invoke ctor of ${G} with invalid number of parameters (${sI.length}) - expected (${Object.keys(x.ja).toString()}) parameters instead!`);
2177
2154
  return $I.apply(this, sI);
2178
2155
  });
2179
- var GA = Object.create(X, { constructor: { value: e } });
2180
- e.prototype = GA;
2181
- var x = new Og(G, e, GA, Y, j, a, h, M);
2156
+ var GA = Object.create(X, { constructor: { value: Y } });
2157
+ Y.prototype = GA;
2158
+ var x = new Og(G, Y, GA, e, j, a, h, M);
2182
2159
  if (x.ea) {
2183
2160
  var RA;
2184
2161
  (RA = x.ea).ua ?? (RA.ua = []), x.ea.ua.push(x);
2185
2162
  }
2186
- return j = new fA(G, x, !0, !1, !1), RA = new fA(G + "*", x, !1, !1, !1), X = new fA(G + " const*", x, !1, !0, !1), qI[C] = { pointerType: RA, ya: X }, fI(d, e), [j, RA, X];
2163
+ return j = new fA(G, x, !0, !1, !1), RA = new fA(G + "*", x, !1, !1, !1), X = new fA(G + " const*", x, !1, !0, !1), qI[C] = { pointerType: RA, ya: X }, fI(d, Y), [j, RA, X];
2187
2164
  });
2188
2165
  },
2189
2166
  y: (C, B, o, D, S, a, K, h, N) => {
2190
2167
  var M = WI(o, D);
2191
2168
  B = H(B), B = bI(B), a = Z(S, a), KA([], [C], (G) => {
2192
2169
  function U() {
2193
- DI(`Cannot call ${Y} due to unbound types`, M);
2170
+ DI(`Cannot call ${e} due to unbound types`, M);
2194
2171
  }
2195
2172
  G = G[0];
2196
- var Y = `${G.name}.${B}`;
2173
+ var e = `${G.name}.${B}`;
2197
2174
  B.startsWith("@@") && (B = Symbol[B.substring(2)]), h && G.$.Ja.push(B);
2198
- var d = G.$.ka, e = d[B];
2199
- return e === void 0 || e.ba === void 0 && e.className !== G.name && e.la === o - 2 ? (U.la = o - 2, U.className = G.name, d[B] = U) : (lI(d, B, Y), d[B].ba[o - 2] = U), KA([], M, (j) => (j = jI(Y, j, G, a, K, N), d[B].ba === void 0 ? (j.la = o - 2, d[B] = j) : d[B].ba[o - 2] = j, [])), [];
2175
+ var d = G.$.ka, Y = d[B];
2176
+ return Y === void 0 || Y.ba === void 0 && Y.className !== G.name && Y.la === o - 2 ? (U.la = o - 2, U.className = G.name, d[B] = U) : (lI(d, B, e), d[B].ba[o - 2] = U), KA([], M, (j) => (j = jI(e, j, G, a, K, N), d[B].ba === void 0 ? (j.la = o - 2, d[B] = j) : d[B].ba[o - 2] = j, [])), [];
2200
2177
  });
2201
2178
  },
2202
2179
  I: (C) => b(C, ug),
@@ -2271,8 +2248,8 @@ return ret;
2271
2248
  else B === 4 && (D = _g, S = $g, a = AC, K = (h) => n[h >> 2]);
2272
2249
  b(C, { name: o, fromWireType: (h) => {
2273
2250
  for (var N = n[h >> 2], M, G = h + 4, U = 0; U <= N; ++U) {
2274
- var Y = h + 4 + U * B;
2275
- (U == N || K(Y) == 0) && (G = D(G, Y - G), M === void 0 ? M = G : (M += "\0", M += G), G = Y + B);
2251
+ var e = h + 4 + U * B;
2252
+ (U == N || K(e) == 0) && (G = D(G, e - G), M === void 0 ? M = G : (M += "\0", M += G), G = e + B);
2276
2253
  }
2277
2254
  return IA(h), M;
2278
2255
  }, toWireType: (h, N) => {
@@ -2370,12 +2347,12 @@ return ret;
2370
2347
  if (!N.ok) throw Error(`HTTP ${N.status}: ${N.statusText}`);
2371
2348
  const M = await N.text(), G = globalThis.ta(M), U = await crypto.subtle.importKey("spki", G, { name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, !1, ["verify"]);
2372
2349
  globalThis.ja("Public key imported successfully");
2373
- const Y = new TextEncoder().encode(S), d = globalThis.ta(a), e = await crypto.subtle.verify("RSASSA-PKCS1-v1_5", U, d, Y);
2374
- globalThis.ja("RSA verification result: " + e), g.ccall(
2350
+ const e = new TextEncoder().encode(S), d = globalThis.ta(a), Y = await crypto.subtle.verify("RSASSA-PKCS1-v1_5", U, d, e);
2351
+ globalThis.ja("RSA verification result: " + Y), g.ccall(
2375
2352
  "on_rsa_verification_complete",
2376
2353
  "void",
2377
2354
  ["number", "boolean"],
2378
- [C, e]
2355
+ [C, Y]
2379
2356
  );
2380
2357
  } catch (h) {
2381
2358
  console.error("RSA verification with server key fetch failed:", h), g.ccall("on_rsa_verification_complete", "void", ["number", "boolean"], [C, !1]);
@@ -2418,7 +2395,7 @@ return ret;
2418
2395
  var EC = T.V, _I = T.W, iC = T.X;
2419
2396
  function SI() {
2420
2397
  function C() {
2421
- if (g.calledRun = !0, !eA) {
2398
+ if (g.calledRun = !0, !YA) {
2422
2399
  if (T.P(), E(g), g.onRuntimeInitialized?.(), g.postRun) for (typeof g.postRun == "function" && (g.postRun = [g.postRun]); g.postRun.length; ) {
2423
2400
  var B = g.postRun.shift();
2424
2401
  LI.push(B);
@@ -2429,7 +2406,7 @@ return ret;
2429
2406
  if (0 < _) aA = SI;
2430
2407
  else {
2431
2408
  if (g.preRun) for (typeof g.preRun == "function" && (g.preRun = [g.preRun]); g.preRun.length; ) lg();
2432
- cI(eI), 0 < _ ? aA = SI : g.setStatus ? (g.setStatus("Running..."), setTimeout(() => {
2409
+ cI(YI), 0 < _ ? aA = SI : g.setStatus ? (g.setStatus("Running..."), setTimeout(() => {
2433
2410
  setTimeout(() => g.setStatus(""), 1), C();
2434
2411
  }, 1)) : C();
2435
2412
  }
@@ -3024,7 +3001,7 @@ let yI = class Lg {
3024
3001
  };
3025
3002
  typeof window < "u" && (window.AspectRatioCorrector = yI);
3026
3003
  typeof yI < "u" && (window.AspectRatioCorrector = yI);
3027
- let ag = class eg {
3004
+ let ag = class Yg {
3028
3005
  constructor() {
3029
3006
  this._args = {};
3030
3007
  }
@@ -3080,7 +3057,7 @@ let ag = class eg {
3080
3057
  }
3081
3058
  // Clone builder with same arguments
3082
3059
  clone() {
3083
- const A = new eg();
3060
+ const A = new Yg();
3084
3061
  return A._args = { ...this._args }, A;
3085
3062
  }
3086
3063
  // =====================================================
@@ -3232,8 +3209,8 @@ let yg = class {
3232
3209
  }
3233
3210
  // Calculate page bounds in tablet coordinate space (0-1)
3234
3211
  _calculatePageBounds() {
3235
- const A = window.outerHeight - window.innerHeight, I = window.screenX - window.screen.availLeft, g = window.screenY - window.screen.availTop + A, E = window.innerWidth, i = window.innerHeight, w = I / window.screen.width, s = g / window.screen.height, y = E / window.screen.width, t = i / window.screen.height;
3236
- return { x: w, y: s, width: y, height: t };
3212
+ const A = window.outerHeight - window.innerHeight, I = window.screenX - window.screen.availLeft, g = window.screenY - window.screen.availTop + A, E = window.innerWidth, i = window.innerHeight, w = I / window.screen.width, s = g / window.screen.height, y = E / window.screen.width, k = i / window.screen.height;
3213
+ return { x: w, y: s, width: y, height: k };
3237
3214
  }
3238
3215
  _getElementAtPenPoint(A) {
3239
3216
  if (typeof window > "u" || !window.document || typeof document.elementFromPoint != "function")
@@ -3421,16 +3398,16 @@ let Kg = class {
3421
3398
  g.width = i.width, g.height = i.height, E.fillStyle = i.backgroundColor, E.fillRect(0, 0, g.width, g.height), E.fillStyle = i.textColor, E.font = `${i.fontSize}px ${i.fontFamily}`, E.textAlign = i.textAlign === "center" ? "center" : i.textAlign === "right" ? "end" : "start";
3422
3399
  const w = A.split(" "), s = [];
3423
3400
  let y = "";
3424
- for (const k of w) {
3425
- const c = y + (y ? " " : "") + k;
3426
- E.measureText(c).width > g.width - 2 * i.padding && y ? (s.push(y), y = k) : y = c;
3401
+ for (const t of w) {
3402
+ const c = y + (y ? " " : "") + t;
3403
+ E.measureText(c).width > g.width - 2 * i.padding && y ? (s.push(y), y = t) : y = c;
3427
3404
  }
3428
3405
  y && s.push(y);
3429
- const t = s.length * i.fontSize * i.lineHeight;
3406
+ const k = s.length * i.fontSize * i.lineHeight;
3430
3407
  let F;
3431
- return i.verticalAlign === "top" ? F = i.padding + i.fontSize : i.verticalAlign === "bottom" ? F = g.height - i.padding - t + i.fontSize : F = (g.height - t) / 2 + i.fontSize, s.forEach((k, c) => {
3408
+ return i.verticalAlign === "top" ? F = i.padding + i.fontSize : i.verticalAlign === "bottom" ? F = g.height - i.padding - k + i.fontSize : F = (g.height - k) / 2 + i.fontSize, s.forEach((t, c) => {
3432
3409
  const l = i.textAlign === "center" ? g.width / 2 : i.textAlign === "right" ? g.width - i.padding : i.padding, f = F + c * i.fontSize * i.lineHeight;
3433
- E.fillText(k, l, f);
3410
+ E.fillText(t, l, f);
3434
3411
  }), g;
3435
3412
  }
3436
3413
  };
@@ -3617,8 +3594,8 @@ let hg = class {
3617
3594
  this._state.lastTime = i;
3618
3595
  const s = this._state.velocityX * w, y = this._state.velocityY * w;
3619
3596
  this._scrollTarget(this._state.target, s, y);
3620
- const t = Math.pow(this._friction, w / 16);
3621
- if (this._state.velocityX *= t, this._state.velocityY *= t, Math.max(Math.abs(this._state.velocityX), Math.abs(this._state.velocityY)) < this._minInertia) {
3597
+ const k = Math.pow(this._friction, w / 16);
3598
+ if (this._state.velocityX *= k, this._state.velocityY *= k, Math.max(Math.abs(this._state.velocityX), Math.abs(this._state.velocityY)) < this._minInertia) {
3622
3599
  this._cancelInertiaScroll();
3623
3600
  return;
3624
3601
  }
@@ -3776,13 +3753,13 @@ let Mg = class {
3776
3753
  try {
3777
3754
  if (E)
3778
3755
  if (i) {
3779
- const s = this._deviceInfo.supportedCommands || [], y = s.includes("DisplayImage"), t = s.includes("WipeScreen"), F = s.includes("EnableDrawing"), k = s.includes("PenStyle");
3756
+ const s = this._deviceInfo.supportedCommands || [], y = s.includes("DisplayImage"), k = s.includes("WipeScreen"), F = s.includes("EnableDrawing"), t = s.includes("PenStyle");
3780
3757
  if (y)
3781
3758
  if (this._currentDeviceConfig.images?.signing ?? !1) {
3782
3759
  const c = new CommandArgsBuilder().addImage(this._currentDeviceConfig.images.signing);
3783
3760
  await this._tablet.sendCommand("DisplayImage", c), console.log("[SignatureLayer] Signing image displayed");
3784
- } else t && (await this._tablet.wipeScreen(), console.log("[SignatureLayer] Screen wiped before signing"));
3785
- k && (await this._tablet.setPenStyle(
3761
+ } else k && (await this._tablet.wipeScreen(), console.log("[SignatureLayer] Screen wiped before signing"));
3762
+ t && (await this._tablet.setPenStyle(
3786
3763
  w.color,
3787
3764
  this._calculatePenStyleWidth(w.maxWidth)
3788
3765
  ), console.log("[SignatureLayer] PenStyle applied")), F && (await this._tablet.enableDrawing(), console.log("[SignatureLayer] Drawing enabled")), this._hotspotManager && this._hotspotManager.enableAllHotspots();
@@ -4646,14 +4623,14 @@ window.SignatureDeviceImagesData = {
4646
4623
  }
4647
4624
  }
4648
4625
  };
4649
- var QQ = Object.defineProperty, EQ = Object.getOwnPropertyDescriptor, Yg = (Q) => {
4626
+ var QQ = Object.defineProperty, EQ = Object.getOwnPropertyDescriptor, eg = (Q) => {
4650
4627
  throw TypeError(Q);
4651
4628
  }, NI = (Q, A, I, g) => {
4652
4629
  for (var E = g > 1 ? void 0 : g ? EQ(A, I) : A, i = Q.length - 1, w; i >= 0; i--)
4653
4630
  (w = Q[i]) && (E = (g ? w(A, I, E) : w(E)) || E);
4654
4631
  return g && E && QQ(A, I, E), E;
4655
- }, ng = (Q, A, I) => A.has(Q) || Yg("Cannot " + I), WA = (Q, A, I) => (ng(Q, A, "read from private field"), I ? I.call(Q) : A.get(Q)), bA = (Q, A, I) => A.has(Q) ? Yg("Cannot add the same private member more than once") : A instanceof WeakSet ? A.add(Q) : A.set(Q, I), mA = (Q, A, I, g) => (ng(Q, A, "write to private field"), A.set(Q, I), I), uA, XA, PA, VA;
4656
- let cA = class extends kA {
4632
+ }, ng = (Q, A, I) => A.has(Q) || eg("Cannot " + I), WA = (Q, A, I) => (ng(Q, A, "read from private field"), I ? I.call(Q) : A.get(Q)), bA = (Q, A, I) => A.has(Q) ? eg("Cannot add the same private member more than once") : A instanceof WeakSet ? A.add(Q) : A.set(Q, I), mA = (Q, A, I, g) => (ng(Q, A, "write to private field"), A.set(Q, I), I), uA, XA, PA, VA;
4633
+ let cA = class extends tA {
4657
4634
  /**
4658
4635
  * Component constructor.
4659
4636
  * Initializes all sub-managers.
@@ -4880,19 +4857,19 @@ let cA = class extends kA {
4880
4857
  */
4881
4858
  render() {
4882
4859
  const Q = this.localizationManager, A = this.stateManager, I = A.isConnected, g = A.isBusy, E = A.isError, i = A.actionButtonsDisabled, w = A.connectButtonDisabled, s = A.disconnectButtonDisabled, y = I || this.currentState === R.CONNECTING ? "connected" : "", {
4883
- topBarVisible: t,
4860
+ topBarVisible: k,
4884
4861
  topBarClearButtonVisible: F,
4885
- bottomBarVisible: k,
4862
+ bottomBarVisible: t,
4886
4863
  okButtonVisible: c,
4887
4864
  clearButtonVisible: l,
4888
4865
  cancelButtonVisible: f,
4889
4866
  canvasLineVisible: V,
4890
4867
  deviceStatusTextVisible: QA,
4891
- additionalTextVisible: eA
4868
+ additionalTextVisible: YA
4892
4869
  } = this.configManager.getUiVisibilityOptions();
4893
4870
  return p`
4894
4871
  <div class="signpad-canvas-container">
4895
- ${t ? p`
4872
+ ${k ? p`
4896
4873
  <div class="signpad-top-bar">
4897
4874
  <div class="signpad-top-left-actions">
4898
4875
  ${I && F ? p`
@@ -4947,7 +4924,7 @@ let cA = class extends kA {
4947
4924
  ` : ""}
4948
4925
  </div>
4949
4926
  <div class="signpad-canvas-line-right">
4950
- ${eA ? p`
4927
+ ${YA ? p`
4951
4928
  <p class="signpad-canvas-line-additional-text">
4952
4929
  ${Q.t(A.additionalTextKey, {
4953
4930
  device: Q.t(A.deviceStatusKey)
@@ -4967,7 +4944,7 @@ let cA = class extends kA {
4967
4944
  ` : ""}
4968
4945
  </div>
4969
4946
 
4970
- ${k ? p`
4947
+ ${t ? p`
4971
4948
  <div class="signpad-bottom-bar">
4972
4949
  ${c && I ? p` <button
4973
4950
  class="btn ok-button btn-primary"
@@ -5000,7 +4977,7 @@ uA = /* @__PURE__ */ new WeakMap();
5000
4977
  XA = /* @__PURE__ */ new WeakMap();
5001
4978
  PA = /* @__PURE__ */ new WeakMap();
5002
4979
  VA = /* @__PURE__ */ new WeakMap();
5003
- cA.styles = [kg(BQ)];
4980
+ cA.styles = [tg(BQ)];
5004
4981
  NI([
5005
4982
  qC({ type: Object })
5006
4983
  ], cA.prototype, "config", 2);