drill-widgets 2.7.6 → 2.7.10
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.
- package/README.md +0 -2
- package/dist/drill-widgets.es.js +417 -365
- package/dist/drill-widgets.umd.js +200 -170
- package/dist/lib.d.ts +5 -4
- package/package.json +1 -1
package/dist/drill-widgets.es.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
6
|
+
const K = globalThis, he = K.ShadowRoot && (K.ShadyCSS === void 0 || K.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ge = Symbol(), ve = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
let Te = class {
|
|
8
8
|
constructor(e, t, n) {
|
|
9
9
|
if (this._$cssResult$ = !0, n !== ge) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -22,7 +22,7 @@ let Te = class {
|
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const Oe = (i) => new Te(typeof i == "string" ? i : i + "", void 0, ge),
|
|
25
|
+
const Oe = (i) => new Te(typeof i == "string" ? i : i + "", void 0, ge), O = (i, ...e) => {
|
|
26
26
|
const t = i.length === 1 ? i[0] : e.reduce((n, s, r) => n + ((o) => {
|
|
27
27
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
28
28
|
if (typeof o == "number") return o;
|
|
@@ -32,7 +32,7 @@ const Oe = (i) => new Te(typeof i == "string" ? i : i + "", void 0, ge), N = (i,
|
|
|
32
32
|
}, Re = (i, e) => {
|
|
33
33
|
if (he) i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
34
34
|
else for (const t of e) {
|
|
35
|
-
const n = document.createElement("style"), s =
|
|
35
|
+
const n = document.createElement("style"), s = K.litNonce;
|
|
36
36
|
s !== void 0 && n.setAttribute("nonce", s), n.textContent = t.cssText, i.appendChild(n);
|
|
37
37
|
}
|
|
38
38
|
}, xe = he ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
|
|
@@ -45,7 +45,7 @@ const Oe = (i) => new Te(typeof i == "string" ? i : i + "", void 0, ge), N = (i,
|
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is: We, defineProperty: He, getOwnPropertyDescriptor: Ve, getOwnPropertyNames: je, getOwnPropertySymbols: Qe, getPrototypeOf: Be } = Object, A = globalThis, _e = A.trustedTypes, Ge = _e ? _e.emptyScript : "",
|
|
48
|
+
const { is: We, defineProperty: He, getOwnPropertyDescriptor: Ve, getOwnPropertyNames: je, getOwnPropertySymbols: Qe, getPrototypeOf: Be } = Object, A = globalThis, _e = A.trustedTypes, Ge = _e ? _e.emptyScript : "", se = A.reactiveElementPolyfillSupport, H = (i, e) => i, J = { toAttribute(i, e) {
|
|
49
49
|
switch (e) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
i = i ? Ge : null;
|
|
@@ -73,9 +73,9 @@ const { is: We, defineProperty: He, getOwnPropertyDescriptor: Ve, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return t;
|
|
76
|
-
} }, fe = (i, e) => !We(i, e), Se = { attribute: !0, type: String, converter:
|
|
76
|
+
} }, fe = (i, e) => !We(i, e), Se = { attribute: !0, type: String, converter: J, reflect: !1, useDefault: !1, hasChanged: fe };
|
|
77
77
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), A.litPropertyMetadata ?? (A.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
-
let
|
|
78
|
+
let P = class extends HTMLElement {
|
|
79
79
|
static addInitializer(e) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(e);
|
|
81
81
|
}
|
|
@@ -103,13 +103,13 @@ let I = class extends HTMLElement {
|
|
|
103
103
|
return this.elementProperties.get(e) ?? Se;
|
|
104
104
|
}
|
|
105
105
|
static _$Ei() {
|
|
106
|
-
if (this.hasOwnProperty(
|
|
106
|
+
if (this.hasOwnProperty(H("elementProperties"))) return;
|
|
107
107
|
const e = Be(this);
|
|
108
108
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
109
109
|
}
|
|
110
110
|
static finalize() {
|
|
111
|
-
if (this.hasOwnProperty(
|
|
112
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
111
|
+
if (this.hasOwnProperty(H("finalized"))) return;
|
|
112
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(H("properties"))) {
|
|
113
113
|
const t = this.properties, n = [...je(t), ...Qe(t)];
|
|
114
114
|
for (const s of n) this.createProperty(s, t[s]);
|
|
115
115
|
}
|
|
@@ -184,7 +184,7 @@ let I = class extends HTMLElement {
|
|
|
184
184
|
var r;
|
|
185
185
|
const n = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, n);
|
|
186
186
|
if (s !== void 0 && n.reflect === !0) {
|
|
187
|
-
const o = (((r = n.converter) == null ? void 0 : r.toAttribute) !== void 0 ? n.converter :
|
|
187
|
+
const o = (((r = n.converter) == null ? void 0 : r.toAttribute) !== void 0 ? n.converter : J).toAttribute(t, n.type);
|
|
188
188
|
this._$Em = e, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -192,8 +192,8 @@ let I = class extends HTMLElement {
|
|
|
192
192
|
var r, o;
|
|
193
193
|
const n = this.constructor, s = n._$Eh.get(e);
|
|
194
194
|
if (s !== void 0 && this._$Em !== s) {
|
|
195
|
-
const a = n.getPropertyOptions(s),
|
|
196
|
-
this._$Em = s, this[s] =
|
|
195
|
+
const a = n.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((r = a.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? a.converter : J;
|
|
196
|
+
this._$Em = s, this[s] = l.fromAttribute(t, a.type) ?? ((o = this._$Ej) == null ? void 0 : o.get(s)) ?? null, this._$Em = null;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
requestUpdate(e, t, n) {
|
|
@@ -231,8 +231,8 @@ let I = class extends HTMLElement {
|
|
|
231
231
|
}
|
|
232
232
|
const s = this.constructor.elementProperties;
|
|
233
233
|
if (s.size > 0) for (const [r, o] of s) {
|
|
234
|
-
const { wrapped: a } = o,
|
|
235
|
-
a !== !0 || this._$AL.has(r) ||
|
|
234
|
+
const { wrapped: a } = o, l = this[r];
|
|
235
|
+
a !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, o, l);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
let e = !1;
|
|
@@ -276,74 +276,74 @@ let I = class extends HTMLElement {
|
|
|
276
276
|
firstUpdated(e) {
|
|
277
277
|
}
|
|
278
278
|
};
|
|
279
|
-
|
|
279
|
+
P.elementStyles = [], P.shadowRootOptions = { mode: "open" }, P[H("elementProperties")] = /* @__PURE__ */ new Map(), P[H("finalized")] = /* @__PURE__ */ new Map(), se == null || se({ ReactiveElement: P }), (A.reactiveElementVersions ?? (A.reactiveElementVersions = [])).push("2.1.0");
|
|
280
280
|
/**
|
|
281
281
|
* @license
|
|
282
282
|
* Copyright 2017 Google LLC
|
|
283
283
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
284
284
|
*/
|
|
285
|
-
const
|
|
286
|
-
\f\r]`,
|
|
287
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), $e = /'/g, De = /"/g,
|
|
285
|
+
const V = globalThis, X = V.trustedTypes, ye = X ? X.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ze = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`, Ie = "?" + E, Ye = `<${Ie}>`, I = document, j = () => I.createComment(""), Q = (i) => i === null || typeof i != "object" && typeof i != "function", me = Array.isArray, qe = (i) => me(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", re = `[
|
|
286
|
+
\f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, we = /-->/g, ke = />/g, M = RegExp(`>|${re}(?:([^\\s"'>=/]+)(${re}*=${re}*(?:[^
|
|
287
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), $e = /'/g, De = /"/g, Ue = /^(?:script|style|textarea|title)$/i, Ke = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), d = Ke(1), U = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Ce = /* @__PURE__ */ new WeakMap(), T = I.createTreeWalker(I, 129);
|
|
288
288
|
function Pe(i, e) {
|
|
289
289
|
if (!me(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
290
290
|
return ye !== void 0 ? ye.createHTML(e) : e;
|
|
291
291
|
}
|
|
292
292
|
const Je = (i, e) => {
|
|
293
293
|
const t = i.length - 1, n = [];
|
|
294
|
-
let s, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o =
|
|
294
|
+
let s, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = R;
|
|
295
295
|
for (let a = 0; a < t; a++) {
|
|
296
|
-
const
|
|
296
|
+
const l = i[a];
|
|
297
297
|
let p, c, u = -1, h = 0;
|
|
298
|
-
for (; h <
|
|
298
|
+
for (; h < l.length && (o.lastIndex = h, c = o.exec(l), c !== null); ) h = o.lastIndex, o === R ? c[1] === "!--" ? o = we : c[1] !== void 0 ? o = ke : c[2] !== void 0 ? (Ue.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = M) : c[3] !== void 0 && (o = M) : o === M ? c[0] === ">" ? (o = s ?? R, u = -1) : c[1] === void 0 ? u = -2 : (u = o.lastIndex - c[2].length, p = c[1], o = c[3] === void 0 ? M : c[3] === '"' ? De : $e) : o === De || o === $e ? o = M : o === we || o === ke ? o = R : (o = M, s = void 0);
|
|
299
299
|
const g = o === M && i[a + 1].startsWith("/>") ? " " : "";
|
|
300
|
-
r += o ===
|
|
300
|
+
r += o === R ? l + Ye : u >= 0 ? (n.push(p), l.slice(0, u) + ze + l.slice(u) + E + g) : l + E + (u === -2 ? a : g);
|
|
301
301
|
}
|
|
302
302
|
return [Pe(i, r + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), n];
|
|
303
303
|
};
|
|
304
|
-
class
|
|
304
|
+
class B {
|
|
305
305
|
constructor({ strings: e, _$litType$: t }, n) {
|
|
306
306
|
let s;
|
|
307
307
|
this.parts = [];
|
|
308
308
|
let r = 0, o = 0;
|
|
309
|
-
const a = e.length - 1,
|
|
310
|
-
if (this.el =
|
|
309
|
+
const a = e.length - 1, l = this.parts, [p, c] = Je(e, t);
|
|
310
|
+
if (this.el = B.createElement(p, n), T.currentNode = this.el.content, t === 2 || t === 3) {
|
|
311
311
|
const u = this.el.content.firstChild;
|
|
312
312
|
u.replaceWith(...u.childNodes);
|
|
313
313
|
}
|
|
314
|
-
for (; (s =
|
|
314
|
+
for (; (s = T.nextNode()) !== null && l.length < a; ) {
|
|
315
315
|
if (s.nodeType === 1) {
|
|
316
316
|
if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(ze)) {
|
|
317
317
|
const h = c[o++], g = s.getAttribute(u).split(E), b = /([.?@])?(.*)/.exec(h);
|
|
318
|
-
|
|
319
|
-
} else u.startsWith(E) && (
|
|
320
|
-
if (
|
|
318
|
+
l.push({ type: 1, index: r, name: b[2], strings: g, ctor: b[1] === "." ? Ze : b[1] === "?" ? et : b[1] === "@" ? tt : ne }), s.removeAttribute(u);
|
|
319
|
+
} else u.startsWith(E) && (l.push({ type: 6, index: r }), s.removeAttribute(u));
|
|
320
|
+
if (Ue.test(s.tagName)) {
|
|
321
321
|
const u = s.textContent.split(E), h = u.length - 1;
|
|
322
322
|
if (h > 0) {
|
|
323
|
-
s.textContent =
|
|
324
|
-
for (let g = 0; g < h; g++) s.append(u[g],
|
|
325
|
-
s.append(u[h],
|
|
323
|
+
s.textContent = X ? X.emptyScript : "";
|
|
324
|
+
for (let g = 0; g < h; g++) s.append(u[g], j()), T.nextNode(), l.push({ type: 2, index: ++r });
|
|
325
|
+
s.append(u[h], j());
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
328
|
+
} else if (s.nodeType === 8) if (s.data === Ie) l.push({ type: 2, index: r });
|
|
329
329
|
else {
|
|
330
330
|
let u = -1;
|
|
331
|
-
for (; (u = s.data.indexOf(E, u + 1)) !== -1; )
|
|
331
|
+
for (; (u = s.data.indexOf(E, u + 1)) !== -1; ) l.push({ type: 7, index: r }), u += E.length - 1;
|
|
332
332
|
}
|
|
333
333
|
r++;
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
static createElement(e, t) {
|
|
337
|
-
const n =
|
|
337
|
+
const n = I.createElement("template");
|
|
338
338
|
return n.innerHTML = e, n;
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function N(i, e, t = i, n) {
|
|
342
342
|
var o, a;
|
|
343
343
|
if (e === U) return e;
|
|
344
344
|
let s = n !== void 0 ? (o = t._$Co) == null ? void 0 : o[n] : t._$Cl;
|
|
345
|
-
const r =
|
|
346
|
-
return (s == null ? void 0 : s.constructor) !== r && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), r === void 0 ? s = void 0 : (s = new r(i), s._$AT(i, t, n)), n !== void 0 ? (t._$Co ?? (t._$Co = []))[n] = s : t._$Cl = s), s !== void 0 && (e =
|
|
345
|
+
const r = Q(e) ? void 0 : e._$litDirective$;
|
|
346
|
+
return (s == null ? void 0 : s.constructor) !== r && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), r === void 0 ? s = void 0 : (s = new r(i), s._$AT(i, t, n)), n !== void 0 ? (t._$Co ?? (t._$Co = []))[n] = s : t._$Cl = s), s !== void 0 && (e = N(i, s._$AS(i, e.values), s, n)), e;
|
|
347
347
|
}
|
|
348
348
|
class Xe {
|
|
349
349
|
constructor(e, t) {
|
|
@@ -356,24 +356,24 @@ class Xe {
|
|
|
356
356
|
return this._$AM._$AU;
|
|
357
357
|
}
|
|
358
358
|
u(e) {
|
|
359
|
-
const { el: { content: t }, parts: n } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ??
|
|
360
|
-
|
|
361
|
-
let r =
|
|
362
|
-
for (;
|
|
363
|
-
if (o ===
|
|
359
|
+
const { el: { content: t }, parts: n } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? I).importNode(t, !0);
|
|
360
|
+
T.currentNode = s;
|
|
361
|
+
let r = T.nextNode(), o = 0, a = 0, l = n[0];
|
|
362
|
+
for (; l !== void 0; ) {
|
|
363
|
+
if (o === l.index) {
|
|
364
364
|
let p;
|
|
365
|
-
|
|
365
|
+
l.type === 2 ? p = new G(r, r.nextSibling, this, e) : l.type === 1 ? p = new l.ctor(r, l.name, l.strings, this, e) : l.type === 6 && (p = new it(r, this, e)), this._$AV.push(p), l = n[++a];
|
|
366
366
|
}
|
|
367
|
-
o !== (
|
|
367
|
+
o !== (l == null ? void 0 : l.index) && (r = T.nextNode(), o++);
|
|
368
368
|
}
|
|
369
|
-
return
|
|
369
|
+
return T.currentNode = I, s;
|
|
370
370
|
}
|
|
371
371
|
p(e) {
|
|
372
372
|
let t = 0;
|
|
373
373
|
for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(e, n, t), t += n.strings.length - 2) : n._$AI(e[t])), t++;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
class
|
|
376
|
+
class G {
|
|
377
377
|
get _$AU() {
|
|
378
378
|
var e;
|
|
379
379
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
@@ -393,7 +393,7 @@ class B {
|
|
|
393
393
|
return this._$AB;
|
|
394
394
|
}
|
|
395
395
|
_$AI(e, t = this) {
|
|
396
|
-
e =
|
|
396
|
+
e = N(this, e, t), Q(e) ? e === v || e == null || e === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : e !== this._$AH && e !== U && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : qe(e) ? this.k(e) : this._(e);
|
|
397
397
|
}
|
|
398
398
|
O(e) {
|
|
399
399
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -402,11 +402,11 @@ class B {
|
|
|
402
402
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
403
403
|
}
|
|
404
404
|
_(e) {
|
|
405
|
-
this._$AH !== v &&
|
|
405
|
+
this._$AH !== v && Q(this._$AH) ? this._$AA.nextSibling.data = e : this.T(I.createTextNode(e)), this._$AH = e;
|
|
406
406
|
}
|
|
407
407
|
$(e) {
|
|
408
408
|
var r;
|
|
409
|
-
const { values: t, _$litType$: n } = e, s = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el =
|
|
409
|
+
const { values: t, _$litType$: n } = e, s = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = B.createElement(Pe(n.h, n.h[0]), this.options)), n);
|
|
410
410
|
if (((r = this._$AH) == null ? void 0 : r._$AD) === s) this._$AH.p(t);
|
|
411
411
|
else {
|
|
412
412
|
const o = new Xe(s, this), a = o.u(this.options);
|
|
@@ -415,13 +415,13 @@ class B {
|
|
|
415
415
|
}
|
|
416
416
|
_$AC(e) {
|
|
417
417
|
let t = Ce.get(e.strings);
|
|
418
|
-
return t === void 0 && Ce.set(e.strings, t = new
|
|
418
|
+
return t === void 0 && Ce.set(e.strings, t = new B(e)), t;
|
|
419
419
|
}
|
|
420
420
|
k(e) {
|
|
421
421
|
me(this._$AH) || (this._$AH = [], this._$AR());
|
|
422
422
|
const t = this._$AH;
|
|
423
423
|
let n, s = 0;
|
|
424
|
-
for (const r of e) s === t.length ? t.push(n = new
|
|
424
|
+
for (const r of e) s === t.length ? t.push(n = new G(this.O(j()), this.O(j()), this, this.options)) : n = t[s], n._$AI(r), s++;
|
|
425
425
|
s < t.length && (this._$AR(n && n._$AB.nextSibling, s), t.length = s);
|
|
426
426
|
}
|
|
427
427
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
@@ -436,7 +436,7 @@ class B {
|
|
|
436
436
|
this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
class
|
|
439
|
+
class ne {
|
|
440
440
|
get tagName() {
|
|
441
441
|
return this.element.tagName;
|
|
442
442
|
}
|
|
@@ -449,11 +449,11 @@ class ie {
|
|
|
449
449
|
_$AI(e, t = this, n, s) {
|
|
450
450
|
const r = this.strings;
|
|
451
451
|
let o = !1;
|
|
452
|
-
if (r === void 0) e =
|
|
452
|
+
if (r === void 0) e = N(this, e, t, 0), o = !Q(e) || e !== this._$AH && e !== U, o && (this._$AH = e);
|
|
453
453
|
else {
|
|
454
454
|
const a = e;
|
|
455
|
-
let
|
|
456
|
-
for (e = r[0],
|
|
455
|
+
let l, p;
|
|
456
|
+
for (e = r[0], l = 0; l < r.length - 1; l++) p = N(this, a[n + l], t, l), p === U && (p = this._$AH[l]), o || (o = !Q(p) || p !== this._$AH[l]), p === v ? e = v : e !== v && (e += (p ?? "") + r[l + 1]), this._$AH[l] = p;
|
|
457
457
|
}
|
|
458
458
|
o && !s && this.j(e);
|
|
459
459
|
}
|
|
@@ -461,7 +461,7 @@ class ie {
|
|
|
461
461
|
e === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
class Ze extends
|
|
464
|
+
class Ze extends ne {
|
|
465
465
|
constructor() {
|
|
466
466
|
super(...arguments), this.type = 3;
|
|
467
467
|
}
|
|
@@ -469,7 +469,7 @@ class Ze extends ie {
|
|
|
469
469
|
this.element[this.name] = e === v ? void 0 : e;
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
class et extends
|
|
472
|
+
class et extends ne {
|
|
473
473
|
constructor() {
|
|
474
474
|
super(...arguments), this.type = 4;
|
|
475
475
|
}
|
|
@@ -477,12 +477,12 @@ class et extends ie {
|
|
|
477
477
|
this.element.toggleAttribute(this.name, !!e && e !== v);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
class tt extends
|
|
480
|
+
class tt extends ne {
|
|
481
481
|
constructor(e, t, n, s, r) {
|
|
482
482
|
super(e, t, n, s, r), this.type = 5;
|
|
483
483
|
}
|
|
484
484
|
_$AI(e, t = this) {
|
|
485
|
-
if ((e =
|
|
485
|
+
if ((e = N(this, e, t, 0) ?? v) === U) return;
|
|
486
486
|
const n = this._$AH, s = e === v && n !== v || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, r = e !== v && (n === v || s);
|
|
487
487
|
s && this.element.removeEventListener(this.name, this, n), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
488
488
|
}
|
|
@@ -499,17 +499,17 @@ class it {
|
|
|
499
499
|
return this._$AM._$AU;
|
|
500
500
|
}
|
|
501
501
|
_$AI(e) {
|
|
502
|
-
|
|
502
|
+
N(this, e);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
const
|
|
506
|
-
|
|
505
|
+
const oe = V.litHtmlPolyfillSupport;
|
|
506
|
+
oe == null || oe(B, G), (V.litHtmlVersions ?? (V.litHtmlVersions = [])).push("3.3.0");
|
|
507
507
|
const nt = (i, e, t) => {
|
|
508
508
|
const n = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
509
509
|
let s = n._$litPart$;
|
|
510
510
|
if (s === void 0) {
|
|
511
511
|
const r = (t == null ? void 0 : t.renderBefore) ?? null;
|
|
512
|
-
n._$litPart$ = s = new
|
|
512
|
+
n._$litPart$ = s = new G(e.insertBefore(j(), r), r, void 0, t ?? {});
|
|
513
513
|
}
|
|
514
514
|
return s._$AI(i), s;
|
|
515
515
|
};
|
|
@@ -518,8 +518,8 @@ const nt = (i, e, t) => {
|
|
|
518
518
|
* Copyright 2017 Google LLC
|
|
519
519
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
520
520
|
*/
|
|
521
|
-
const
|
|
522
|
-
let
|
|
521
|
+
const z = globalThis;
|
|
522
|
+
let L = class extends P {
|
|
523
523
|
constructor() {
|
|
524
524
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
525
525
|
}
|
|
@@ -545,10 +545,10 @@ let P = class extends I {
|
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
547
|
var Fe;
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
(
|
|
548
|
+
L._$litElement$ = !0, L.finalized = !0, (Fe = z.litElementHydrateSupport) == null || Fe.call(z, { LitElement: L });
|
|
549
|
+
const ae = z.litElementPolyfillSupport;
|
|
550
|
+
ae == null || ae({ LitElement: L });
|
|
551
|
+
(z.litElementVersions ?? (z.litElementVersions = [])).push("4.2.0");
|
|
552
552
|
/**
|
|
553
553
|
* @license
|
|
554
554
|
* Copyright 2017 Google LLC
|
|
@@ -564,14 +564,14 @@ const Le = (i) => (e, t) => {
|
|
|
564
564
|
* Copyright 2017 Google LLC
|
|
565
565
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
566
566
|
*/
|
|
567
|
-
const st = { attribute: !0, type: String, converter:
|
|
567
|
+
const st = { attribute: !0, type: String, converter: J, reflect: !1, hasChanged: fe }, rt = (i = st, e, t) => {
|
|
568
568
|
const { kind: n, metadata: s } = t;
|
|
569
569
|
let r = globalThis.litPropertyMetadata.get(s);
|
|
570
570
|
if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), n === "setter" && ((i = Object.create(i)).wrapped = !0), r.set(t.name, i), n === "accessor") {
|
|
571
571
|
const { name: o } = t;
|
|
572
572
|
return { set(a) {
|
|
573
|
-
const
|
|
574
|
-
e.set.call(this, a), this.requestUpdate(o,
|
|
573
|
+
const l = e.get.call(this);
|
|
574
|
+
e.set.call(this, a), this.requestUpdate(o, l, i);
|
|
575
575
|
}, init(a) {
|
|
576
576
|
return a !== void 0 && this.C(o, void 0, i, a), a;
|
|
577
577
|
} };
|
|
@@ -579,8 +579,8 @@ const st = { attribute: !0, type: String, converter: K, reflect: !1, hasChanged:
|
|
|
579
579
|
if (n === "setter") {
|
|
580
580
|
const { name: o } = t;
|
|
581
581
|
return function(a) {
|
|
582
|
-
const
|
|
583
|
-
e.call(this, a), this.requestUpdate(o,
|
|
582
|
+
const l = this[o];
|
|
583
|
+
e.call(this, a), this.requestUpdate(o, l, i);
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
586
|
throw Error("Unsupported decorator location: " + n);
|
|
@@ -605,28 +605,28 @@ for (let i = 0; i < 256; ++i)
|
|
|
605
605
|
function ot(i, e = 0) {
|
|
606
606
|
return (S[i[e + 0]] + S[i[e + 1]] + S[i[e + 2]] + S[i[e + 3]] + "-" + S[i[e + 4]] + S[i[e + 5]] + "-" + S[i[e + 6]] + S[i[e + 7]] + "-" + S[i[e + 8]] + S[i[e + 9]] + "-" + S[i[e + 10]] + S[i[e + 11]] + S[i[e + 12]] + S[i[e + 13]] + S[i[e + 14]] + S[i[e + 15]]).toLowerCase();
|
|
607
607
|
}
|
|
608
|
-
let
|
|
608
|
+
let le;
|
|
609
609
|
const at = new Uint8Array(16);
|
|
610
|
-
function
|
|
611
|
-
if (!
|
|
610
|
+
function lt() {
|
|
611
|
+
if (!le) {
|
|
612
612
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
613
613
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
614
|
-
|
|
614
|
+
le = crypto.getRandomValues.bind(crypto);
|
|
615
615
|
}
|
|
616
|
-
return
|
|
616
|
+
return le(at);
|
|
617
617
|
}
|
|
618
|
-
const
|
|
619
|
-
function
|
|
618
|
+
const dt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ee = { randomUUID: dt };
|
|
619
|
+
function F(i, e, t) {
|
|
620
620
|
var s;
|
|
621
621
|
if (Ee.randomUUID && !i)
|
|
622
622
|
return Ee.randomUUID();
|
|
623
623
|
i = i || {};
|
|
624
|
-
const n = i.random ?? ((s = i.rng) == null ? void 0 : s.call(i)) ??
|
|
624
|
+
const n = i.random ?? ((s = i.rng) == null ? void 0 : s.call(i)) ?? lt();
|
|
625
625
|
if (n.length < 16)
|
|
626
626
|
throw new Error("Random bytes length must be >= 16");
|
|
627
627
|
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, ot(n);
|
|
628
628
|
}
|
|
629
|
-
const pt =
|
|
629
|
+
const pt = O`
|
|
630
630
|
:host {
|
|
631
631
|
display: block;
|
|
632
632
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
@@ -698,7 +698,7 @@ const pt = N`
|
|
|
698
698
|
padding: 0;
|
|
699
699
|
background-color: #f9fafb; /* Lighter gray background continues */
|
|
700
700
|
}
|
|
701
|
-
`, ct =
|
|
701
|
+
`, ct = O`
|
|
702
702
|
.form-group {
|
|
703
703
|
display: flex;
|
|
704
704
|
flex-direction: column;
|
|
@@ -893,7 +893,7 @@ const pt = N`
|
|
|
893
893
|
border-color: #3b82f6;
|
|
894
894
|
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
895
895
|
}
|
|
896
|
-
`, ut =
|
|
896
|
+
`, ut = O`
|
|
897
897
|
/* Steps and Questions Sections */
|
|
898
898
|
.section {
|
|
899
899
|
padding: 16px;
|
|
@@ -1250,7 +1250,7 @@ const pt = N`
|
|
|
1250
1250
|
border-radius: 4px;
|
|
1251
1251
|
border-left: 3px solid #e5e7eb;
|
|
1252
1252
|
}
|
|
1253
|
-
`, Ne =
|
|
1253
|
+
`, Ne = O`
|
|
1254
1254
|
/* Builder Step Styles */
|
|
1255
1255
|
.steps-list {
|
|
1256
1256
|
display: flex;
|
|
@@ -2952,7 +2952,7 @@ const pt = N`
|
|
|
2952
2952
|
margin: 2px 0;
|
|
2953
2953
|
line-height: 1.4;
|
|
2954
2954
|
}
|
|
2955
|
-
`, ht =
|
|
2955
|
+
`, ht = O`
|
|
2956
2956
|
/* Modal Styles */
|
|
2957
2957
|
.modal-overlay {
|
|
2958
2958
|
position: fixed;
|
|
@@ -3095,7 +3095,7 @@ var gt = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, C = (i, e,
|
|
|
3095
3095
|
(o = i[r]) && (s = (n ? o(e, t, s) : o(s)) || s);
|
|
3096
3096
|
return n && s && gt(e, t, s), s;
|
|
3097
3097
|
};
|
|
3098
|
-
let w = class extends
|
|
3098
|
+
let w = class extends L {
|
|
3099
3099
|
constructor() {
|
|
3100
3100
|
super(...arguments), this._templateData = {
|
|
3101
3101
|
name: "",
|
|
@@ -3107,11 +3107,15 @@ let w = class extends P {
|
|
|
3107
3107
|
}, this._draggedStepId = null, this._dragOverStepId = null, this._selectedStepId = null, this._questions = [];
|
|
3108
3108
|
}
|
|
3109
3109
|
connectedCallback() {
|
|
3110
|
-
super.connectedCallback(), this._templateData = this._getDefaultWorkflowData();
|
|
3110
|
+
super.connectedCallback(), this.workflow ? (this._templateData = { ...this.workflow }, this.workflow.steps && this.workflow.steps.length > 0 && (this._selectedStepId = this.workflow.steps[0].id), console.log("Builder loaded with existing workflow:", this.workflow.name)) : this._templateData = this._getDefaultWorkflowData();
|
|
3111
|
+
}
|
|
3112
|
+
// Detect changes to the workflow property
|
|
3113
|
+
updated(i) {
|
|
3114
|
+
i.has("workflow") && this.workflow && (this._templateData = { ...this.workflow }, this.workflow.steps && this.workflow.steps.length > 0 && (this._selectedStepId = this.workflow.steps[0].id), console.log("Workflow property changed, reloading template data"));
|
|
3111
3115
|
}
|
|
3112
3116
|
_getDefaultWorkflowData() {
|
|
3113
3117
|
const i = {
|
|
3114
|
-
id:
|
|
3118
|
+
id: F(),
|
|
3115
3119
|
title: "Step 1",
|
|
3116
3120
|
description: "",
|
|
3117
3121
|
order: 1,
|
|
@@ -3123,7 +3127,7 @@ let w = class extends P {
|
|
|
3123
3127
|
status: "pending"
|
|
3124
3128
|
};
|
|
3125
3129
|
return {
|
|
3126
|
-
id:
|
|
3130
|
+
id: F(),
|
|
3127
3131
|
name: "",
|
|
3128
3132
|
description: "",
|
|
3129
3133
|
steps: [i]
|
|
@@ -3148,15 +3152,15 @@ let w = class extends P {
|
|
|
3148
3152
|
console.log("🚫 Builder Widget: Cancel button clicked"), (i = this.onCancel) == null || i.call(this);
|
|
3149
3153
|
}
|
|
3150
3154
|
_handleSave() {
|
|
3151
|
-
var i, e;
|
|
3155
|
+
var i, e, t;
|
|
3152
3156
|
if ((i = this._templateData.name) != null && i.trim()) {
|
|
3153
|
-
const
|
|
3154
|
-
id: this._templateData.id ||
|
|
3157
|
+
const n = {
|
|
3158
|
+
id: this._templateData.id || F(),
|
|
3155
3159
|
name: this._templateData.name,
|
|
3156
3160
|
description: this._templateData.description || "",
|
|
3157
3161
|
steps: this._templateData.steps || []
|
|
3158
3162
|
};
|
|
3159
|
-
console.log("💾 Builder Widget: Save button clicked"), console.log("📄 Workflow Template:", JSON.stringify(
|
|
3163
|
+
console.log("💾 Builder Widget: Save button clicked"), console.log("📄 Workflow Template:", JSON.stringify(n, null, 2)), this.workflow ? (console.log("Calling onWorkflowUpdated callback"), (e = this.onWorkflowUpdated) == null || e.call(this, n)) : (console.log("Calling onWorkflowCreated callback"), (t = this.onWorkflowCreated) == null || t.call(this, n));
|
|
3160
3164
|
} else
|
|
3161
3165
|
console.log("⚠️ Builder Widget: Save attempted but no title provided");
|
|
3162
3166
|
}
|
|
@@ -3186,7 +3190,7 @@ let w = class extends P {
|
|
|
3186
3190
|
return;
|
|
3187
3191
|
}
|
|
3188
3192
|
const i = this._templateData.steps || [], e = {
|
|
3189
|
-
id:
|
|
3193
|
+
id: F(),
|
|
3190
3194
|
title: this._stepFormData.title.trim(),
|
|
3191
3195
|
description: ((n = this._stepFormData.description) == null ? void 0 : n.trim()) || "",
|
|
3192
3196
|
order: i.length + 1,
|
|
@@ -3236,14 +3240,14 @@ let w = class extends P {
|
|
|
3236
3240
|
}
|
|
3237
3241
|
console.log(
|
|
3238
3242
|
"🔄 Before reorder:",
|
|
3239
|
-
t.map((a,
|
|
3243
|
+
t.map((a, l) => `${l + 1}: ${a.title}`)
|
|
3240
3244
|
);
|
|
3241
3245
|
const r = [...t], [o] = r.splice(n, 1);
|
|
3242
|
-
r.splice(s, 0, o), r.forEach((a,
|
|
3243
|
-
a.order =
|
|
3246
|
+
r.splice(s, 0, o), r.forEach((a, l) => {
|
|
3247
|
+
a.order = l + 1;
|
|
3244
3248
|
}), console.log(
|
|
3245
3249
|
"🔄 After reorder:",
|
|
3246
|
-
r.map((a,
|
|
3250
|
+
r.map((a, l) => `${l + 1}: ${a.title}`)
|
|
3247
3251
|
), this._templateData = {
|
|
3248
3252
|
...this._templateData,
|
|
3249
3253
|
steps: r
|
|
@@ -3262,7 +3266,7 @@ let w = class extends P {
|
|
|
3262
3266
|
}
|
|
3263
3267
|
if (["text", "html", "divider", "markdown"].includes(i)) {
|
|
3264
3268
|
let r = {
|
|
3265
|
-
id:
|
|
3269
|
+
id: F(),
|
|
3266
3270
|
type: i,
|
|
3267
3271
|
order: (((n = e.elements) == null ? void 0 : n.length) || 0) + 1
|
|
3268
3272
|
};
|
|
@@ -3292,7 +3296,7 @@ Use **bold** and *italic* text.`;
|
|
|
3292
3296
|
}, console.log("✅ Content element added to step:", this._selectedStepId);
|
|
3293
3297
|
} else {
|
|
3294
3298
|
const r = {
|
|
3295
|
-
id:
|
|
3299
|
+
id: F(),
|
|
3296
3300
|
// Simple ID generation
|
|
3297
3301
|
type: i,
|
|
3298
3302
|
// Default type
|
|
@@ -3323,7 +3327,7 @@ Use **bold** and *italic* text.`;
|
|
|
3323
3327
|
return;
|
|
3324
3328
|
}
|
|
3325
3329
|
let t = {
|
|
3326
|
-
id:
|
|
3330
|
+
id: F(),
|
|
3327
3331
|
type: i,
|
|
3328
3332
|
order: (((s = e.elements) == null ? void 0 : s.length) || 0) + 1
|
|
3329
3333
|
};
|
|
@@ -3414,12 +3418,12 @@ Use **bold** and *italic* text.`;
|
|
|
3414
3418
|
switch (i.type) {
|
|
3415
3419
|
case "select":
|
|
3416
3420
|
case "radio":
|
|
3417
|
-
return
|
|
3421
|
+
return d`
|
|
3418
3422
|
<div class="question-options-section">
|
|
3419
3423
|
<label class="options-label">Options:</label>
|
|
3420
3424
|
<div class="options-list">
|
|
3421
3425
|
${(i.options || []).map(
|
|
3422
|
-
(e, t) =>
|
|
3426
|
+
(e, t) => d`
|
|
3423
3427
|
<div class="option-item">
|
|
3424
3428
|
<input
|
|
3425
3429
|
type="text"
|
|
@@ -3463,7 +3467,7 @@ Use **bold** and *italic* text.`;
|
|
|
3463
3467
|
</div>
|
|
3464
3468
|
`;
|
|
3465
3469
|
case "checkbox":
|
|
3466
|
-
return
|
|
3470
|
+
return d`
|
|
3467
3471
|
<div class="question-checkbox-config">
|
|
3468
3472
|
<div class="checkbox-type-selection">
|
|
3469
3473
|
<label class="checkbox-type-label">
|
|
@@ -3496,12 +3500,12 @@ Use **bold** and *italic* text.`;
|
|
|
3496
3500
|
</label>
|
|
3497
3501
|
</div>
|
|
3498
3502
|
|
|
3499
|
-
${i.options && i.options.length > 0 ?
|
|
3503
|
+
${i.options && i.options.length > 0 ? d`
|
|
3500
3504
|
<div class="question-options-section">
|
|
3501
3505
|
<label class="options-label">Checkbox Options:</label>
|
|
3502
3506
|
<div class="options-list">
|
|
3503
3507
|
${(i.options || []).map(
|
|
3504
|
-
(e, t) =>
|
|
3508
|
+
(e, t) => d`
|
|
3505
3509
|
<div class="option-item">
|
|
3506
3510
|
<input
|
|
3507
3511
|
type="text"
|
|
@@ -3543,7 +3547,7 @@ Use **bold** and *italic* text.`;
|
|
|
3543
3547
|
</button>
|
|
3544
3548
|
</div>
|
|
3545
3549
|
</div>
|
|
3546
|
-
` :
|
|
3550
|
+
` : d`
|
|
3547
3551
|
<div class="single-checkbox-info">
|
|
3548
3552
|
<p class="config-note">
|
|
3549
3553
|
Single checkbox - users can check/uncheck for Yes/No response
|
|
@@ -3553,7 +3557,7 @@ Use **bold** and *italic* text.`;
|
|
|
3553
3557
|
</div>
|
|
3554
3558
|
`;
|
|
3555
3559
|
case "textarea":
|
|
3556
|
-
return
|
|
3560
|
+
return d`
|
|
3557
3561
|
<div class="question-config-section">
|
|
3558
3562
|
<label class="config-label">
|
|
3559
3563
|
Placeholder:
|
|
@@ -3573,7 +3577,7 @@ Use **bold** and *italic* text.`;
|
|
|
3573
3577
|
</div>
|
|
3574
3578
|
`;
|
|
3575
3579
|
case "text_input":
|
|
3576
|
-
return
|
|
3580
|
+
return d`
|
|
3577
3581
|
<div class="question-config-section">
|
|
3578
3582
|
<label class="config-label">
|
|
3579
3583
|
Placeholder:
|
|
@@ -3593,7 +3597,7 @@ Use **bold** and *italic* text.`;
|
|
|
3593
3597
|
</div>
|
|
3594
3598
|
`;
|
|
3595
3599
|
case "number":
|
|
3596
|
-
return
|
|
3600
|
+
return d`
|
|
3597
3601
|
<div class="question-config-section">
|
|
3598
3602
|
<label class="config-label">
|
|
3599
3603
|
Placeholder:
|
|
@@ -3613,31 +3617,31 @@ Use **bold** and *italic* text.`;
|
|
|
3613
3617
|
</div>
|
|
3614
3618
|
`;
|
|
3615
3619
|
case "file_upload":
|
|
3616
|
-
return
|
|
3620
|
+
return d`
|
|
3617
3621
|
<div class="question-config-section">
|
|
3618
3622
|
<p class="config-note">File upload field - users can upload files</p>
|
|
3619
3623
|
</div>
|
|
3620
3624
|
`;
|
|
3621
3625
|
case "signature":
|
|
3622
|
-
return
|
|
3626
|
+
return d`
|
|
3623
3627
|
<div class="question-config-section">
|
|
3624
3628
|
<p class="config-note">Digital signature pad - users can sign with mouse/touch</p>
|
|
3625
3629
|
</div>
|
|
3626
3630
|
`;
|
|
3627
3631
|
case "date":
|
|
3628
|
-
return
|
|
3632
|
+
return d`
|
|
3629
3633
|
<div class="question-config-section">
|
|
3630
3634
|
<p class="config-note">Date picker field</p>
|
|
3631
3635
|
</div>
|
|
3632
3636
|
`;
|
|
3633
3637
|
default:
|
|
3634
|
-
return
|
|
3638
|
+
return d``;
|
|
3635
3639
|
}
|
|
3636
3640
|
}
|
|
3637
3641
|
_renderContentTypeSpecificFields(i) {
|
|
3638
3642
|
switch (i.type) {
|
|
3639
3643
|
case "text":
|
|
3640
|
-
return
|
|
3644
|
+
return d`
|
|
3641
3645
|
<div class="content-config-section">
|
|
3642
3646
|
<label class="config-label">
|
|
3643
3647
|
Text Content:
|
|
@@ -3656,7 +3660,7 @@ Use **bold** and *italic* text.`;
|
|
|
3656
3660
|
</div>
|
|
3657
3661
|
`;
|
|
3658
3662
|
case "html":
|
|
3659
|
-
return
|
|
3663
|
+
return d`
|
|
3660
3664
|
<div class="content-config-section">
|
|
3661
3665
|
<label class="config-label">
|
|
3662
3666
|
HTML Content:
|
|
@@ -3675,7 +3679,7 @@ Use **bold** and *italic* text.`;
|
|
|
3675
3679
|
</div>
|
|
3676
3680
|
`;
|
|
3677
3681
|
case "image":
|
|
3678
|
-
return
|
|
3682
|
+
return d`
|
|
3679
3683
|
<div class="content-config-section">
|
|
3680
3684
|
<label class="config-label">
|
|
3681
3685
|
Image URL:
|
|
@@ -3725,7 +3729,7 @@ Use **bold** and *italic* text.`;
|
|
|
3725
3729
|
</div>
|
|
3726
3730
|
`;
|
|
3727
3731
|
case "video":
|
|
3728
|
-
return
|
|
3732
|
+
return d`
|
|
3729
3733
|
<div class="content-config-section">
|
|
3730
3734
|
<label class="config-label">
|
|
3731
3735
|
Video URL:
|
|
@@ -3760,7 +3764,7 @@ Use **bold** and *italic* text.`;
|
|
|
3760
3764
|
</div>
|
|
3761
3765
|
`;
|
|
3762
3766
|
case "file":
|
|
3763
|
-
return
|
|
3767
|
+
return d`
|
|
3764
3768
|
<div class="content-config-section">
|
|
3765
3769
|
<label class="config-label">
|
|
3766
3770
|
File URL:
|
|
@@ -3795,7 +3799,7 @@ Use **bold** and *italic* text.`;
|
|
|
3795
3799
|
</div>
|
|
3796
3800
|
`;
|
|
3797
3801
|
case "divider":
|
|
3798
|
-
return
|
|
3802
|
+
return d`
|
|
3799
3803
|
<div class="content-config-section">
|
|
3800
3804
|
<label class="config-label">
|
|
3801
3805
|
Caption:
|
|
@@ -3815,7 +3819,7 @@ Use **bold** and *italic* text.`;
|
|
|
3815
3819
|
</div>
|
|
3816
3820
|
`;
|
|
3817
3821
|
case "markdown":
|
|
3818
|
-
return
|
|
3822
|
+
return d`
|
|
3819
3823
|
<div class="content-config-section">
|
|
3820
3824
|
<label class="config-label">
|
|
3821
3825
|
Markdown Content:
|
|
@@ -3834,7 +3838,7 @@ Use **bold** and *italic* text.`;
|
|
|
3834
3838
|
</div>
|
|
3835
3839
|
`;
|
|
3836
3840
|
default:
|
|
3837
|
-
return
|
|
3841
|
+
return d``;
|
|
3838
3842
|
}
|
|
3839
3843
|
}
|
|
3840
3844
|
_getQuestionTypeDisplayName(i) {
|
|
@@ -3888,6 +3892,20 @@ Use **bold** and *italic* text.`;
|
|
|
3888
3892
|
const i = !!(this._templateData.steps && this._templateData.steps.length > 0);
|
|
3889
3893
|
return i && !this._selectedStepId && this._templateData.steps && (this._selectedStepId = this._templateData.steps[0].id, console.log("🎯 Auto-selected first step:", this._templateData.steps[0].title)), !i && this._selectedStepId && (this._selectedStepId = null), i;
|
|
3890
3894
|
}
|
|
3895
|
+
_showStepMenu(i, e) {
|
|
3896
|
+
i.stopPropagation(), console.log("Step menu for:", e), confirm("Delete this step?") && this._deleteStep(e);
|
|
3897
|
+
}
|
|
3898
|
+
_deleteStep(i) {
|
|
3899
|
+
if (!confirm("Are you sure you want to delete this step?"))
|
|
3900
|
+
return;
|
|
3901
|
+
const e = (this._templateData.steps || []).filter((t) => t.id !== i);
|
|
3902
|
+
e.forEach((t, n) => {
|
|
3903
|
+
t.order = n + 1;
|
|
3904
|
+
}), this._templateData = {
|
|
3905
|
+
...this._templateData,
|
|
3906
|
+
steps: e
|
|
3907
|
+
}, this._selectedStepId === i && (this._selectedStepId = e.length > 0 ? e[0].id : null), console.log("Step deleted:", i);
|
|
3908
|
+
}
|
|
3891
3909
|
_getAssignmentDisplayText(i) {
|
|
3892
3910
|
switch (i.category) {
|
|
3893
3911
|
case "individual":
|
|
@@ -3915,8 +3933,9 @@ Use **bold** and *italic* text.`;
|
|
|
3915
3933
|
}
|
|
3916
3934
|
}
|
|
3917
3935
|
render() {
|
|
3936
|
+
var e;
|
|
3918
3937
|
const i = this._getSelectedStep();
|
|
3919
|
-
return
|
|
3938
|
+
return d`
|
|
3920
3939
|
<div class="header">
|
|
3921
3940
|
<div class="header-inputs">
|
|
3922
3941
|
<div class="form-group">
|
|
@@ -3956,15 +3975,49 @@ Use **bold** and *italic* text.`;
|
|
|
3956
3975
|
</div>
|
|
3957
3976
|
|
|
3958
3977
|
<div class="steps-list">
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3978
|
+
${((e = this._templateData.steps) == null ? void 0 : e.map(
|
|
3979
|
+
(t) => d`
|
|
3980
|
+
<div
|
|
3981
|
+
class="step-item ${this._selectedStepId === t.id ? "selected" : ""} ${this._dragOverStepId === t.id ? "drag-over" : ""}"
|
|
3982
|
+
@click=${() => this._selectStep(t.id)}
|
|
3983
|
+
draggable="true"
|
|
3984
|
+
@dragstart=${(n) => this._handleDragStart(n, t.id)}
|
|
3985
|
+
@dragend=${this._handleDragEnd}
|
|
3986
|
+
@dragover=${(n) => this._handleDragOver(n, t.id)}
|
|
3987
|
+
@dragleave=${this._handleDragLeave}
|
|
3988
|
+
@drop=${(n) => this._handleDrop(n, t.id)}
|
|
3989
|
+
>
|
|
3990
|
+
<div class="step-handle">
|
|
3991
|
+
<svg
|
|
3992
|
+
width="16"
|
|
3993
|
+
height="16"
|
|
3994
|
+
viewBox="0 0 16 16"
|
|
3995
|
+
fill="none"
|
|
3996
|
+
stroke="currentColor"
|
|
3997
|
+
stroke-width="2"
|
|
3998
|
+
>
|
|
3999
|
+
<line x1="4" y1="4" x2="12" y2="4" />
|
|
4000
|
+
<line x1="4" y1="8" x2="12" y2="8" />
|
|
4001
|
+
<line x1="4" y1="12" x2="12" y2="12" />
|
|
4002
|
+
</svg>
|
|
4003
|
+
</div>
|
|
4004
|
+
<div class="step-content">
|
|
4005
|
+
<strong>${t.title}</strong>
|
|
4006
|
+
<small>${this._getAssignmentDisplayText(t.assignment)}</small>
|
|
4007
|
+
</div>
|
|
4008
|
+
<div class="step-actions">
|
|
4009
|
+
<button
|
|
4010
|
+
class="step-menu"
|
|
4011
|
+
@click=${(n) => {
|
|
4012
|
+
n.stopPropagation(), this._showStepMenu(n, t.id);
|
|
4013
|
+
}}
|
|
4014
|
+
>
|
|
4015
|
+
⋯
|
|
4016
|
+
</button>
|
|
4017
|
+
</div>
|
|
4018
|
+
</div>
|
|
4019
|
+
`
|
|
4020
|
+
)) || []}
|
|
3968
4021
|
</div>
|
|
3969
4022
|
</div>
|
|
3970
4023
|
|
|
@@ -3975,40 +4028,40 @@ Use **bold** and *italic* text.`;
|
|
|
3975
4028
|
<button class="add-button" @click=${() => this._addQuestion()}>Add</button>
|
|
3976
4029
|
</div>
|
|
3977
4030
|
|
|
3978
|
-
${i && i.elements && i.elements.length > 0 ?
|
|
4031
|
+
${i && i.elements && i.elements.length > 0 ? d`
|
|
3979
4032
|
<div class="elements-list">
|
|
3980
|
-
${i.elements.map((
|
|
3981
|
-
const
|
|
3982
|
-
if (
|
|
3983
|
-
const
|
|
3984
|
-
return
|
|
4033
|
+
${i.elements.map((t) => {
|
|
4034
|
+
const n = "label" in t && "required" in t, s = "content" in t;
|
|
4035
|
+
if (n) {
|
|
4036
|
+
const r = t;
|
|
4037
|
+
return d`
|
|
3985
4038
|
<div class="question-item">
|
|
3986
4039
|
<div class="question-header">
|
|
3987
4040
|
<h3 class="question-title">
|
|
3988
|
-
${
|
|
4041
|
+
${r.label || (r.type === "checkbox" ? this._getCheckboxTypeDisplayName(r) : this._getQuestionTypeDisplayName(r.type))}
|
|
3989
4042
|
</h3>
|
|
3990
4043
|
<div class="question-header-controls">
|
|
3991
4044
|
<select
|
|
3992
4045
|
class="question-type-select"
|
|
3993
|
-
.value=${
|
|
4046
|
+
.value=${r.type || "text_input"}
|
|
3994
4047
|
style="color: #000 !important;"
|
|
3995
|
-
@change=${(
|
|
3996
|
-
const
|
|
4048
|
+
@change=${(o) => {
|
|
4049
|
+
const l = o.target.value;
|
|
3997
4050
|
if ([
|
|
3998
4051
|
"text",
|
|
3999
4052
|
"html",
|
|
4000
4053
|
"divider",
|
|
4001
4054
|
"markdown"
|
|
4002
|
-
].includes(
|
|
4003
|
-
this._addQuestion(
|
|
4055
|
+
].includes(l)) {
|
|
4056
|
+
this._addQuestion(l), this._deleteQuestion(r.id);
|
|
4004
4057
|
return;
|
|
4005
4058
|
}
|
|
4006
|
-
const
|
|
4007
|
-
["select", "radio", "checkbox"].includes(
|
|
4008
|
-
const
|
|
4009
|
-
|
|
4059
|
+
const c = { type: l };
|
|
4060
|
+
["select", "radio", "checkbox"].includes(l) && !r.options && (c.options = ["Option 1", "Option 2"]);
|
|
4061
|
+
const u = this._getQuestionTypeDisplayName(
|
|
4062
|
+
r.type
|
|
4010
4063
|
);
|
|
4011
|
-
(!
|
|
4064
|
+
(!r.label || r.label === u) && (c.label = this._getQuestionTypeDisplayName(l)), this._updateQuestion(r.id, c);
|
|
4012
4065
|
}}
|
|
4013
4066
|
>
|
|
4014
4067
|
<optgroup label="Questions">
|
|
@@ -4031,7 +4084,7 @@ Use **bold** and *italic* text.`;
|
|
|
4031
4084
|
</select>
|
|
4032
4085
|
<button
|
|
4033
4086
|
class="delete-question-button"
|
|
4034
|
-
@click=${() => this._deleteQuestion(
|
|
4087
|
+
@click=${() => this._deleteQuestion(r.id)}
|
|
4035
4088
|
title="Delete question"
|
|
4036
4089
|
>
|
|
4037
4090
|
🗑️
|
|
@@ -4043,25 +4096,25 @@ Use **bold** and *italic* text.`;
|
|
|
4043
4096
|
type="text"
|
|
4044
4097
|
class="question-label-input"
|
|
4045
4098
|
placeholder="Question label"
|
|
4046
|
-
.value=${
|
|
4047
|
-
@input=${(
|
|
4048
|
-
const
|
|
4049
|
-
this._updateQuestion(
|
|
4050
|
-
label:
|
|
4099
|
+
.value=${r.label || ""}
|
|
4100
|
+
@input=${(o) => {
|
|
4101
|
+
const a = o.target;
|
|
4102
|
+
this._updateQuestion(r.id, {
|
|
4103
|
+
label: a.value
|
|
4051
4104
|
}), this.requestUpdate();
|
|
4052
4105
|
}}
|
|
4053
4106
|
/>
|
|
4054
4107
|
|
|
4055
|
-
${this._renderQuestionTypeSpecificFields(
|
|
4108
|
+
${this._renderQuestionTypeSpecificFields(r)}
|
|
4056
4109
|
|
|
4057
4110
|
<label class="question-required-label">
|
|
4058
4111
|
<input
|
|
4059
4112
|
type="checkbox"
|
|
4060
|
-
.checked=${
|
|
4061
|
-
@change=${(
|
|
4062
|
-
const
|
|
4063
|
-
this._updateQuestion(
|
|
4064
|
-
required:
|
|
4113
|
+
.checked=${r.required || !1}
|
|
4114
|
+
@change=${(o) => {
|
|
4115
|
+
const a = o.target;
|
|
4116
|
+
this._updateQuestion(r.id, {
|
|
4117
|
+
required: a.checked
|
|
4065
4118
|
});
|
|
4066
4119
|
}}
|
|
4067
4120
|
/>
|
|
@@ -4069,31 +4122,31 @@ Use **bold** and *italic* text.`;
|
|
|
4069
4122
|
</label>
|
|
4070
4123
|
</div>
|
|
4071
4124
|
`;
|
|
4072
|
-
} else if (
|
|
4073
|
-
const
|
|
4074
|
-
return
|
|
4125
|
+
} else if (s) {
|
|
4126
|
+
const r = t;
|
|
4127
|
+
return d`
|
|
4075
4128
|
<div class="question-item">
|
|
4076
4129
|
<div class="question-header">
|
|
4077
4130
|
<h3 class="question-title">
|
|
4078
|
-
${this._getContentTypeDisplayName(
|
|
4131
|
+
${this._getContentTypeDisplayName(r.type)}
|
|
4079
4132
|
</h3>
|
|
4080
4133
|
<div class="question-header-controls">
|
|
4081
4134
|
<select
|
|
4082
4135
|
class="question-type-select"
|
|
4083
|
-
.value=${
|
|
4136
|
+
.value=${t.type || "text"}
|
|
4084
4137
|
style="color: #000 !important;"
|
|
4085
|
-
@change=${(
|
|
4086
|
-
const
|
|
4138
|
+
@change=${(o) => {
|
|
4139
|
+
const l = o.target.value;
|
|
4087
4140
|
if (![
|
|
4088
4141
|
"text",
|
|
4089
4142
|
"html",
|
|
4090
4143
|
"divider",
|
|
4091
4144
|
"markdown"
|
|
4092
|
-
].includes(
|
|
4093
|
-
this._addQuestion(
|
|
4145
|
+
].includes(l)) {
|
|
4146
|
+
this._addQuestion(l), this._deleteQuestion(t.id);
|
|
4094
4147
|
return;
|
|
4095
4148
|
}
|
|
4096
|
-
this._addQuestion(
|
|
4149
|
+
this._addQuestion(l), this._deleteQuestion(t.id);
|
|
4097
4150
|
}}
|
|
4098
4151
|
>
|
|
4099
4152
|
<optgroup label="Questions">
|
|
@@ -4116,7 +4169,7 @@ Use **bold** and *italic* text.`;
|
|
|
4116
4169
|
</select>
|
|
4117
4170
|
<button
|
|
4118
4171
|
class="delete-question-button"
|
|
4119
|
-
@click=${() => this._deleteQuestion(
|
|
4172
|
+
@click=${() => this._deleteQuestion(t.id)}
|
|
4120
4173
|
title="Delete content"
|
|
4121
4174
|
>
|
|
4122
4175
|
✕
|
|
@@ -4124,20 +4177,20 @@ Use **bold** and *italic* text.`;
|
|
|
4124
4177
|
</div>
|
|
4125
4178
|
</div>
|
|
4126
4179
|
<div class="question-content">
|
|
4127
|
-
${this._renderContentTypeSpecificFields(
|
|
4180
|
+
${this._renderContentTypeSpecificFields(r)}
|
|
4128
4181
|
</div>
|
|
4129
4182
|
</div>
|
|
4130
4183
|
`;
|
|
4131
4184
|
} else {
|
|
4132
|
-
const
|
|
4133
|
-
return
|
|
4185
|
+
const r = t;
|
|
4186
|
+
return d`
|
|
4134
4187
|
<div class="question-item">
|
|
4135
4188
|
<div class="question-header">
|
|
4136
4189
|
<h3 class="question-title">Unknown Element</h3>
|
|
4137
4190
|
<div class="question-header-controls">
|
|
4138
4191
|
<button
|
|
4139
4192
|
class="delete-question-button"
|
|
4140
|
-
@click=${() => this._deleteQuestion(
|
|
4193
|
+
@click=${() => this._deleteQuestion(r.id)}
|
|
4141
4194
|
title="Delete element"
|
|
4142
4195
|
>
|
|
4143
4196
|
✕
|
|
@@ -4149,7 +4202,7 @@ Use **bold** and *italic* text.`;
|
|
|
4149
4202
|
}
|
|
4150
4203
|
})}
|
|
4151
4204
|
</div>
|
|
4152
|
-
` :
|
|
4205
|
+
` : d`
|
|
4153
4206
|
<div class="empty-state">
|
|
4154
4207
|
<h3>Add questions</h3>
|
|
4155
4208
|
<p>Use the add button to start building your workflow</p>
|
|
@@ -4162,7 +4215,7 @@ Use **bold** and *italic* text.`;
|
|
|
4162
4215
|
`;
|
|
4163
4216
|
}
|
|
4164
4217
|
};
|
|
4165
|
-
w.styles =
|
|
4218
|
+
w.styles = O`
|
|
4166
4219
|
${pt}
|
|
4167
4220
|
${ct}
|
|
4168
4221
|
${ut}
|
|
@@ -4195,7 +4248,7 @@ C([
|
|
|
4195
4248
|
], w.prototype, "onCancel", 2);
|
|
4196
4249
|
C([
|
|
4197
4250
|
D({ attribute: !1 })
|
|
4198
|
-
], w.prototype, "
|
|
4251
|
+
], w.prototype, "workflow", 2);
|
|
4199
4252
|
w = C([
|
|
4200
4253
|
Le("builder-widget")
|
|
4201
4254
|
], w);
|
|
@@ -4214,11 +4267,11 @@ class mt {
|
|
|
4214
4267
|
if (this.isQuestionElement(o)) {
|
|
4215
4268
|
const a = o;
|
|
4216
4269
|
if (a.required) {
|
|
4217
|
-
const
|
|
4270
|
+
const l = this.validateQuestion(
|
|
4218
4271
|
a,
|
|
4219
4272
|
t[a.id]
|
|
4220
4273
|
);
|
|
4221
|
-
|
|
4274
|
+
l && (s = !1, r[a.id] = l.message);
|
|
4222
4275
|
}
|
|
4223
4276
|
}
|
|
4224
4277
|
return { isValid: s, errors: r };
|
|
@@ -4291,11 +4344,10 @@ class bt {
|
|
|
4291
4344
|
}
|
|
4292
4345
|
saveFormData(e, t, n, s, r, o) {
|
|
4293
4346
|
var c, u, h;
|
|
4294
|
-
const a = this.getStorageKey(e),
|
|
4347
|
+
const a = this.getStorageKey(e), l = o ? {
|
|
4295
4348
|
...o,
|
|
4296
4349
|
currentStepId: (u = (c = o.steps) == null ? void 0 : c[n]) == null ? void 0 : u.id,
|
|
4297
4350
|
completedSteps: Array.from(r),
|
|
4298
|
-
updatedAt: /* @__PURE__ */ new Date(),
|
|
4299
4351
|
steps: (h = o.steps) == null ? void 0 : h.map((g) => ({
|
|
4300
4352
|
...g,
|
|
4301
4353
|
responses: g.responses || []
|
|
@@ -4306,7 +4358,7 @@ class bt {
|
|
|
4306
4358
|
stepIndex: n,
|
|
4307
4359
|
savedSignatures: Array.from(s),
|
|
4308
4360
|
completedSteps: Array.from(r),
|
|
4309
|
-
instance:
|
|
4361
|
+
instance: l
|
|
4310
4362
|
};
|
|
4311
4363
|
try {
|
|
4312
4364
|
localStorage.setItem(a, JSON.stringify(p));
|
|
@@ -4348,7 +4400,7 @@ class bt {
|
|
|
4348
4400
|
* Signature Pad v5.0.10 | https://github.com/szimek/signature_pad
|
|
4349
4401
|
* (c) 2025 Szymon Nowak | Released under the MIT license
|
|
4350
4402
|
*/
|
|
4351
|
-
class
|
|
4403
|
+
class Z {
|
|
4352
4404
|
constructor(e, t, n, s) {
|
|
4353
4405
|
if (isNaN(e) || isNaN(t))
|
|
4354
4406
|
throw new Error(`Point is invalid: (${e}, ${t})`);
|
|
@@ -4370,10 +4422,10 @@ class be {
|
|
|
4370
4422
|
return new be(e[1], n, s, e[2], t.start, t.end);
|
|
4371
4423
|
}
|
|
4372
4424
|
static calculateControlPoints(e, t, n) {
|
|
4373
|
-
const s = e.x - t.x, r = e.y - t.y, o = t.x - n.x, a = t.y - n.y,
|
|
4425
|
+
const s = e.x - t.x, r = e.y - t.y, o = t.x - n.x, a = t.y - n.y, l = { x: (e.x + t.x) / 2, y: (e.y + t.y) / 2 }, p = { x: (t.x + n.x) / 2, y: (t.y + n.y) / 2 }, c = Math.sqrt(s * s + r * r), u = Math.sqrt(o * o + a * a), h = l.x - p.x, g = l.y - p.y, b = c + u == 0 ? 0 : u / (c + u), k = { x: p.x + h * b, y: p.y + g * b }, Y = t.x - k.x, q = t.y - k.y;
|
|
4374
4426
|
return {
|
|
4375
|
-
c1: new
|
|
4376
|
-
c2: new
|
|
4427
|
+
c1: new Z(l.x + Y, l.y + q),
|
|
4428
|
+
c2: new Z(p.x + Y, p.y + q)
|
|
4377
4429
|
};
|
|
4378
4430
|
}
|
|
4379
4431
|
constructor(e, t, n, s, r, o) {
|
|
@@ -4382,12 +4434,12 @@ class be {
|
|
|
4382
4434
|
length() {
|
|
4383
4435
|
let t = 0, n, s;
|
|
4384
4436
|
for (let r = 0; r <= 10; r += 1) {
|
|
4385
|
-
const o = r / 10, a = this.point(o, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x),
|
|
4437
|
+
const o = r / 10, a = this.point(o, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), l = this.point(o, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
|
4386
4438
|
if (r > 0) {
|
|
4387
|
-
const p = a - n, c =
|
|
4439
|
+
const p = a - n, c = l - s;
|
|
4388
4440
|
t += Math.sqrt(p * p + c * c);
|
|
4389
4441
|
}
|
|
4390
|
-
n = a, s =
|
|
4442
|
+
n = a, s = l;
|
|
4391
4443
|
}
|
|
4392
4444
|
return t;
|
|
4393
4445
|
}
|
|
@@ -4423,10 +4475,10 @@ function xt(i, e = 250) {
|
|
|
4423
4475
|
return r = this, o = p, u <= 0 || u > e ? (n && (clearTimeout(n), n = null), t = c, s = i.apply(r, o), n || (r = null, o = [])) : n || (n = window.setTimeout(a, u)), s;
|
|
4424
4476
|
};
|
|
4425
4477
|
}
|
|
4426
|
-
class
|
|
4478
|
+
class ee extends vt {
|
|
4427
4479
|
constructor(e, t = {}) {
|
|
4428
4480
|
var n, s, r;
|
|
4429
|
-
super(), this.canvas = e, this._drawingStroke = !1, this._isEmpty = !0, this._lastPoints = [], this._data = [], this._lastVelocity = 0, this._lastWidth = 0, this.velocityFilterWeight = t.velocityFilterWeight || 0.7, this.minWidth = t.minWidth || 0.5, this.maxWidth = t.maxWidth || 2.5, this.throttle = (n = t.throttle) !== null && n !== void 0 ? n : 16, this.minDistance = (s = t.minDistance) !== null && s !== void 0 ? s : 5, this.dotSize = t.dotSize || 0, this.penColor = t.penColor || "black", this.backgroundColor = t.backgroundColor || "rgba(0,0,0,0)", this.compositeOperation = t.compositeOperation || "source-over", this.canvasContextOptions = (r = t.canvasContextOptions) !== null && r !== void 0 ? r : {}, this._strokeMoveUpdate = this.throttle ? xt(
|
|
4481
|
+
super(), this.canvas = e, this._drawingStroke = !1, this._isEmpty = !0, this._lastPoints = [], this._data = [], this._lastVelocity = 0, this._lastWidth = 0, this.velocityFilterWeight = t.velocityFilterWeight || 0.7, this.minWidth = t.minWidth || 0.5, this.maxWidth = t.maxWidth || 2.5, this.throttle = (n = t.throttle) !== null && n !== void 0 ? n : 16, this.minDistance = (s = t.minDistance) !== null && s !== void 0 ? s : 5, this.dotSize = t.dotSize || 0, this.penColor = t.penColor || "black", this.backgroundColor = t.backgroundColor || "rgba(0,0,0,0)", this.compositeOperation = t.compositeOperation || "source-over", this.canvasContextOptions = (r = t.canvasContextOptions) !== null && r !== void 0 ? r : {}, this._strokeMoveUpdate = this.throttle ? xt(ee.prototype._strokeUpdate, this.throttle) : ee.prototype._strokeUpdate, this._handleMouseDown = this._handleMouseDown.bind(this), this._handleMouseMove = this._handleMouseMove.bind(this), this._handleMouseUp = this._handleMouseUp.bind(this), this._handleTouchStart = this._handleTouchStart.bind(this), this._handleTouchMove = this._handleTouchMove.bind(this), this._handleTouchEnd = this._handleTouchEnd.bind(this), this._handlePointerDown = this._handlePointerDown.bind(this), this._handlePointerMove = this._handlePointerMove.bind(this), this._handlePointerUp = this._handlePointerUp.bind(this), this._ctx = e.getContext("2d", this.canvasContextOptions), this.clear(), this.on();
|
|
4430
4482
|
}
|
|
4431
4483
|
clear() {
|
|
4432
4484
|
const { _ctx: e, canvas: t } = this;
|
|
@@ -4434,9 +4486,9 @@ class Z extends vt {
|
|
|
4434
4486
|
}
|
|
4435
4487
|
fromDataURL(e, t = {}) {
|
|
4436
4488
|
return new Promise((n, s) => {
|
|
4437
|
-
const r = new Image(), o = t.ratio || window.devicePixelRatio || 1, a = t.width || this.canvas.width / o,
|
|
4489
|
+
const r = new Image(), o = t.ratio || window.devicePixelRatio || 1, a = t.width || this.canvas.width / o, l = t.height || this.canvas.height / o, p = t.xOffset || 0, c = t.yOffset || 0;
|
|
4438
4490
|
this._reset(this._getPointGroupOptions()), r.onload = () => {
|
|
4439
|
-
this._ctx.drawImage(r, p, c, a,
|
|
4491
|
+
this._ctx.drawImage(r, p, c, a, l), n();
|
|
4440
4492
|
}, r.onerror = (u) => {
|
|
4441
4493
|
s(u);
|
|
4442
4494
|
}, r.crossOrigin = "anonymous", r.src = e, this._isEmpty = !1;
|
|
@@ -4597,8 +4649,8 @@ class Z extends vt {
|
|
|
4597
4649
|
this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: e }));
|
|
4598
4650
|
const t = this._createPoint(e.x, e.y, e.pressure), n = this._data[this._data.length - 1], s = n.points, r = s.length > 0 && s[s.length - 1], o = r ? t.distanceTo(r) <= this.minDistance : !1, a = this._getPointGroupOptions(n);
|
|
4599
4651
|
if (!r || !(r && o)) {
|
|
4600
|
-
const
|
|
4601
|
-
r ?
|
|
4652
|
+
const l = this._addPoint(t, a);
|
|
4653
|
+
r ? l && this._drawCurve(l, a) : this._drawDot(t, a), s.push({
|
|
4602
4654
|
time: t.time,
|
|
4603
4655
|
x: t.x,
|
|
4604
4656
|
y: t.y,
|
|
@@ -4630,7 +4682,7 @@ class Z extends vt {
|
|
|
4630
4682
|
}
|
|
4631
4683
|
_createPoint(e, t, n) {
|
|
4632
4684
|
const s = this.canvas.getBoundingClientRect();
|
|
4633
|
-
return new
|
|
4685
|
+
return new Z(e - s.left, t - s.top, n, (/* @__PURE__ */ new Date()).getTime());
|
|
4634
4686
|
}
|
|
4635
4687
|
_addPoint(e, t) {
|
|
4636
4688
|
const { _lastPoints: n } = this;
|
|
@@ -4659,11 +4711,11 @@ class Z extends vt {
|
|
|
4659
4711
|
const n = this._ctx, s = e.endWidth - e.startWidth, r = Math.ceil(e.length()) * 2;
|
|
4660
4712
|
n.beginPath(), n.fillStyle = t.penColor;
|
|
4661
4713
|
for (let o = 0; o < r; o += 1) {
|
|
4662
|
-
const a = o / r,
|
|
4714
|
+
const a = o / r, l = a * a, p = l * a, c = 1 - a, u = c * c, h = u * c;
|
|
4663
4715
|
let g = h * e.startPoint.x;
|
|
4664
|
-
g += 3 * u * a * e.control1.x, g += 3 * c *
|
|
4716
|
+
g += 3 * u * a * e.control1.x, g += 3 * c * l * e.control2.x, g += p * e.endPoint.x;
|
|
4665
4717
|
let b = h * e.startPoint.y;
|
|
4666
|
-
b += 3 * u * a * e.control1.y, b += 3 * c *
|
|
4718
|
+
b += 3 * u * a * e.control1.y, b += 3 * c * l * e.control2.y, b += p * e.endPoint.y;
|
|
4667
4719
|
const k = Math.min(e.startWidth + p * s, t.maxWidth);
|
|
4668
4720
|
this._drawCurveSegment(g, b, k);
|
|
4669
4721
|
}
|
|
@@ -4678,7 +4730,7 @@ class Z extends vt {
|
|
|
4678
4730
|
const { points: r } = s, o = this._getPointGroupOptions(s);
|
|
4679
4731
|
if (r.length > 1)
|
|
4680
4732
|
for (let a = 0; a < r.length; a += 1) {
|
|
4681
|
-
const
|
|
4733
|
+
const l = r[a], p = new Z(l.x, l.y, l.pressure, l.time);
|
|
4682
4734
|
a === 0 && this._reset(o);
|
|
4683
4735
|
const c = this._addPoint(p, o);
|
|
4684
4736
|
c && t(c, o);
|
|
@@ -4688,21 +4740,21 @@ class Z extends vt {
|
|
|
4688
4740
|
}
|
|
4689
4741
|
}
|
|
4690
4742
|
toSVG({ includeBackgroundColor: e = !1 } = {}) {
|
|
4691
|
-
const t = this._data, n = Math.max(window.devicePixelRatio || 1, 1), s = 0, r = 0, o = this.canvas.width / n, a = this.canvas.height / n,
|
|
4692
|
-
if (
|
|
4743
|
+
const t = this._data, n = Math.max(window.devicePixelRatio || 1, 1), s = 0, r = 0, o = this.canvas.width / n, a = this.canvas.height / n, l = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
4744
|
+
if (l.setAttribute("xmlns", "http://www.w3.org/2000/svg"), l.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"), l.setAttribute("viewBox", `${s} ${r} ${o} ${a}`), l.setAttribute("width", o.toString()), l.setAttribute("height", a.toString()), e && this.backgroundColor) {
|
|
4693
4745
|
const p = document.createElement("rect");
|
|
4694
|
-
p.setAttribute("width", "100%"), p.setAttribute("height", "100%"), p.setAttribute("fill", this.backgroundColor),
|
|
4746
|
+
p.setAttribute("width", "100%"), p.setAttribute("height", "100%"), p.setAttribute("fill", this.backgroundColor), l.appendChild(p);
|
|
4695
4747
|
}
|
|
4696
4748
|
return this._fromData(t, (p, { penColor: c }) => {
|
|
4697
4749
|
const u = document.createElement("path");
|
|
4698
4750
|
if (!isNaN(p.control1.x) && !isNaN(p.control1.y) && !isNaN(p.control2.x) && !isNaN(p.control2.y)) {
|
|
4699
4751
|
const h = `M ${p.startPoint.x.toFixed(3)},${p.startPoint.y.toFixed(3)} C ${p.control1.x.toFixed(3)},${p.control1.y.toFixed(3)} ${p.control2.x.toFixed(3)},${p.control2.y.toFixed(3)} ${p.endPoint.x.toFixed(3)},${p.endPoint.y.toFixed(3)}`;
|
|
4700
|
-
u.setAttribute("d", h), u.setAttribute("stroke-width", (p.endWidth * 2.25).toFixed(3)), u.setAttribute("stroke", c), u.setAttribute("fill", "none"), u.setAttribute("stroke-linecap", "round"),
|
|
4752
|
+
u.setAttribute("d", h), u.setAttribute("stroke-width", (p.endWidth * 2.25).toFixed(3)), u.setAttribute("stroke", c), u.setAttribute("fill", "none"), u.setAttribute("stroke-linecap", "round"), l.appendChild(u);
|
|
4701
4753
|
}
|
|
4702
4754
|
}, (p, { penColor: c, dotSize: u, minWidth: h, maxWidth: g }) => {
|
|
4703
4755
|
const b = document.createElement("circle"), k = u > 0 ? u : (h + g) / 2;
|
|
4704
|
-
b.setAttribute("r", k.toString()), b.setAttribute("cx", p.x.toString()), b.setAttribute("cy", p.y.toString()), b.setAttribute("fill", c),
|
|
4705
|
-
}),
|
|
4756
|
+
b.setAttribute("r", k.toString()), b.setAttribute("cx", p.x.toString()), b.setAttribute("cy", p.y.toString()), b.setAttribute("fill", c), l.appendChild(b);
|
|
4757
|
+
}), l.outerHTML;
|
|
4706
4758
|
}
|
|
4707
4759
|
}
|
|
4708
4760
|
class _t {
|
|
@@ -4713,7 +4765,7 @@ class _t {
|
|
|
4713
4765
|
const n = t == null ? void 0 : t.getElementById(`signature-${e}`);
|
|
4714
4766
|
if (!n) return null;
|
|
4715
4767
|
this.clearSignaturePad(e), this.resizeCanvas(n);
|
|
4716
|
-
const s = new
|
|
4768
|
+
const s = new ee(n, {
|
|
4717
4769
|
backgroundColor: "rgb(255, 255, 255)",
|
|
4718
4770
|
penColor: "rgb(0, 0, 0)",
|
|
4719
4771
|
minWidth: 0.5,
|
|
@@ -4915,9 +4967,9 @@ class yt {
|
|
|
4915
4967
|
newStepIndex: t,
|
|
4916
4968
|
reason: "Invalid step index"
|
|
4917
4969
|
};
|
|
4918
|
-
const
|
|
4919
|
-
if (this.isStepAssignedToUser(
|
|
4920
|
-
const p = s.has(
|
|
4970
|
+
const l = a[e];
|
|
4971
|
+
if (this.isStepAssignedToUser(l)) {
|
|
4972
|
+
const p = s.has(l.id), c = this.isStepWithinAllowedRange(
|
|
4921
4973
|
e,
|
|
4922
4974
|
n,
|
|
4923
4975
|
s
|
|
@@ -4938,22 +4990,22 @@ class yt {
|
|
|
4938
4990
|
}
|
|
4939
4991
|
isStepWithinAllowedRange(e, t, n) {
|
|
4940
4992
|
if (!(t != null && t.steps)) return !1;
|
|
4941
|
-
const r = this.getAssignedSteps(t).map((
|
|
4993
|
+
const r = this.getAssignedSteps(t).map((l) => t.steps.findIndex((p) => p.id === l.id)).sort((l, p) => l - p);
|
|
4942
4994
|
let o = -1;
|
|
4943
|
-
for (const
|
|
4944
|
-
const p = t.steps[
|
|
4945
|
-
n.has(p.id) && (o =
|
|
4995
|
+
for (const l of r) {
|
|
4996
|
+
const p = t.steps[l];
|
|
4997
|
+
n.has(p.id) && (o = l);
|
|
4946
4998
|
}
|
|
4947
4999
|
let a = -1;
|
|
4948
|
-
for (const
|
|
4949
|
-
if (
|
|
4950
|
-
a =
|
|
5000
|
+
for (const l of r)
|
|
5001
|
+
if (l > o) {
|
|
5002
|
+
a = l;
|
|
4951
5003
|
break;
|
|
4952
5004
|
}
|
|
4953
5005
|
return a !== -1 ? e <= a && this.isStepAssignedToUser(t.steps[e]) : this.isStepAssignedToUser(t.steps[e]);
|
|
4954
5006
|
}
|
|
4955
5007
|
}
|
|
4956
|
-
const
|
|
5008
|
+
const te = class te {
|
|
4957
5009
|
constructor() {
|
|
4958
5010
|
this.formData = {}, this.validationErrors = {};
|
|
4959
5011
|
}
|
|
@@ -5069,7 +5121,7 @@ const ee = class ee {
|
|
|
5069
5121
|
* Type guard to check if element is a question element
|
|
5070
5122
|
*/
|
|
5071
5123
|
isQuestionElement(e) {
|
|
5072
|
-
return
|
|
5124
|
+
return te.QUESTION_ELEMENT_TYPES.includes(e.type);
|
|
5073
5125
|
}
|
|
5074
5126
|
/**
|
|
5075
5127
|
* Gets form data for a specific step's questions
|
|
@@ -5103,7 +5155,7 @@ const ee = class ee {
|
|
|
5103
5155
|
return Object.keys(this.validationErrors).length;
|
|
5104
5156
|
}
|
|
5105
5157
|
};
|
|
5106
|
-
|
|
5158
|
+
te.QUESTION_ELEMENT_TYPES = [
|
|
5107
5159
|
"text_input",
|
|
5108
5160
|
"textarea",
|
|
5109
5161
|
"select",
|
|
@@ -5114,8 +5166,8 @@ ee.QUESTION_ELEMENT_TYPES = [
|
|
|
5114
5166
|
"file_upload",
|
|
5115
5167
|
"signature"
|
|
5116
5168
|
];
|
|
5117
|
-
let pe =
|
|
5118
|
-
const
|
|
5169
|
+
let pe = te;
|
|
5170
|
+
const ie = class ie {
|
|
5119
5171
|
// 5MB in bytes
|
|
5120
5172
|
constructor(e, t) {
|
|
5121
5173
|
this.formStateManager = e, this.responseTracker = t;
|
|
@@ -5138,8 +5190,8 @@ const te = class te {
|
|
|
5138
5190
|
this.formStateManager.clearValidationError(e);
|
|
5139
5191
|
const a = this.createFileInfo(r);
|
|
5140
5192
|
this.formStateManager.setFormField(e, a);
|
|
5141
|
-
const
|
|
5142
|
-
|
|
5193
|
+
const l = this.hasFileChanged(e, a, n.savedInstance);
|
|
5194
|
+
l && n.mode !== "preview" ? this.executeFileUploadCallback(e, r, a, n) : this.logSkippedCallback(e, n.mode, l), (h = n.onRequestUpdate) == null || h.call(n), n.mode !== "admin" && ((g = n.onFormDataSave) == null || g.call(n));
|
|
5143
5195
|
}
|
|
5144
5196
|
/**
|
|
5145
5197
|
* Clears file data for a question
|
|
@@ -5151,7 +5203,7 @@ const te = class te {
|
|
|
5151
5203
|
* Validates file size against maximum allowed size
|
|
5152
5204
|
*/
|
|
5153
5205
|
validateFileSize(e) {
|
|
5154
|
-
return e.size >
|
|
5206
|
+
return e.size > ie.MAX_FILE_SIZE ? `File size must be less than 5MB. Current size: ${(e.size / 1024 / 1024).toFixed(2)}MB` : null;
|
|
5155
5207
|
}
|
|
5156
5208
|
/**
|
|
5157
5209
|
* Handles file validation errors
|
|
@@ -5207,8 +5259,8 @@ const te = class te {
|
|
|
5207
5259
|
t === "preview" ? console.log("Preview mode: skipping file upload callback for:", e) : n || console.log("File unchanged, skipping callback for:", e);
|
|
5208
5260
|
}
|
|
5209
5261
|
};
|
|
5210
|
-
|
|
5211
|
-
let ce =
|
|
5262
|
+
ie.MAX_FILE_SIZE = 5 * 1024 * 1024;
|
|
5263
|
+
let ce = ie;
|
|
5212
5264
|
class y {
|
|
5213
5265
|
/**
|
|
5214
5266
|
* Determines if a form element should be disabled based on context
|
|
@@ -5260,9 +5312,9 @@ class y {
|
|
|
5260
5312
|
}[n] || `${n.toUpperCase()} File` : "Unknown";
|
|
5261
5313
|
}
|
|
5262
5314
|
static renderTextArea(e, t, n) {
|
|
5263
|
-
return n.mode === "print" ?
|
|
5264
|
-
${t ||
|
|
5265
|
-
</div>` :
|
|
5315
|
+
return n.mode === "print" ? d`<div class="print-response-value textarea-response">
|
|
5316
|
+
${t || d`<span class="print-no-response">No response</span>`}
|
|
5317
|
+
</div>` : d`<textarea
|
|
5266
5318
|
id=${e.id}
|
|
5267
5319
|
.value=${t}
|
|
5268
5320
|
?required=${e.required}
|
|
@@ -5273,9 +5325,9 @@ class y {
|
|
|
5273
5325
|
}
|
|
5274
5326
|
static renderSelect(e, t, n) {
|
|
5275
5327
|
var s;
|
|
5276
|
-
return n.mode === "print" ?
|
|
5277
|
-
${t ||
|
|
5278
|
-
</div>` :
|
|
5328
|
+
return n.mode === "print" ? d`<div class="print-response-value select-response">
|
|
5329
|
+
${t || d`<span class="print-no-response">No selection made</span>`}
|
|
5330
|
+
</div>` : d`<select
|
|
5279
5331
|
id=${e.id}
|
|
5280
5332
|
.value=${t}
|
|
5281
5333
|
?required=${e.required}
|
|
@@ -5284,17 +5336,17 @@ class y {
|
|
|
5284
5336
|
@change=${(r) => n.handlers.handleInputChange(e.id, r)}
|
|
5285
5337
|
>
|
|
5286
5338
|
<option value="">Choose</option>
|
|
5287
|
-
${(s = e.options) == null ? void 0 : s.map((r) =>
|
|
5339
|
+
${(s = e.options) == null ? void 0 : s.map((r) => d`<option value=${r}>${r}</option>`)}
|
|
5288
5340
|
</select>`;
|
|
5289
5341
|
}
|
|
5290
5342
|
static renderRadio(e, t, n) {
|
|
5291
5343
|
var o;
|
|
5292
5344
|
const s = this._isInputDisabled(n), r = n.mode === "print";
|
|
5293
|
-
return r ?
|
|
5294
|
-
${t ||
|
|
5295
|
-
</div>` :
|
|
5345
|
+
return r ? d`<div class="print-response-value radio-response">
|
|
5346
|
+
${t || d`<span class="print-no-response">No selection made</span>`}
|
|
5347
|
+
</div>` : d`<div class="radio-group ${r ? "print-mode" : ""}">
|
|
5296
5348
|
${(o = e.options) == null ? void 0 : o.map(
|
|
5297
|
-
(a) =>
|
|
5349
|
+
(a) => d`
|
|
5298
5350
|
<label class="radio-option">
|
|
5299
5351
|
<input
|
|
5300
5352
|
type="radio"
|
|
@@ -5302,7 +5354,7 @@ class y {
|
|
|
5302
5354
|
value=${a}
|
|
5303
5355
|
.checked=${t === a}
|
|
5304
5356
|
?disabled=${s}
|
|
5305
|
-
@change=${r ? null : (
|
|
5357
|
+
@change=${r ? null : (l) => n.handlers.handleInputChange(e.id, l)}
|
|
5306
5358
|
/>
|
|
5307
5359
|
<span class="radio-label">${a}</span>
|
|
5308
5360
|
</label>
|
|
@@ -5316,13 +5368,13 @@ class y {
|
|
|
5316
5368
|
if (e.options && e.options.length > 0) {
|
|
5317
5369
|
if (r) {
|
|
5318
5370
|
const a = Array.isArray(t) ? t : [];
|
|
5319
|
-
return
|
|
5320
|
-
${a.length > 0 ? a.map((
|
|
5371
|
+
return d`<div class="print-response-value checkbox-response">
|
|
5372
|
+
${a.length > 0 ? a.map((l) => d`<div>• ${l}</div>`) : d`<span class="print-no-response">No selections made</span>`}
|
|
5321
5373
|
</div>`;
|
|
5322
5374
|
}
|
|
5323
|
-
return
|
|
5375
|
+
return d`<div class="checkbox-group ${r ? "print-mode" : ""}">
|
|
5324
5376
|
${(o = e.options) == null ? void 0 : o.map(
|
|
5325
|
-
(a) =>
|
|
5377
|
+
(a) => d`
|
|
5326
5378
|
<label class="checkbox-option">
|
|
5327
5379
|
<input
|
|
5328
5380
|
type="checkbox"
|
|
@@ -5330,7 +5382,7 @@ class y {
|
|
|
5330
5382
|
value=${a}
|
|
5331
5383
|
.checked=${Array.isArray(t) ? t.includes(a) : !1}
|
|
5332
5384
|
?disabled=${s}
|
|
5333
|
-
@change=${r ? null : (
|
|
5385
|
+
@change=${r ? null : (l) => n.handlers.handleCheckboxGroupChange(e.id, a, l)}
|
|
5334
5386
|
/>
|
|
5335
5387
|
<span class="checkbox-label">${a}</span>
|
|
5336
5388
|
</label>
|
|
@@ -5338,9 +5390,9 @@ class y {
|
|
|
5338
5390
|
)}
|
|
5339
5391
|
</div>`;
|
|
5340
5392
|
} else
|
|
5341
|
-
return r ?
|
|
5393
|
+
return r ? d`<div class="print-response-value checkbox-response">
|
|
5342
5394
|
${t ? "Yes" : "No"}
|
|
5343
|
-
</div>` :
|
|
5395
|
+
</div>` : d`<label class="checkbox-single ${r ? "print-mode" : ""}">
|
|
5344
5396
|
<input
|
|
5345
5397
|
type="checkbox"
|
|
5346
5398
|
id=${e.id}
|
|
@@ -5354,15 +5406,15 @@ class y {
|
|
|
5354
5406
|
static renderSignature(e, t, n) {
|
|
5355
5407
|
const s = n.formData[e.id], r = !!n.formData[e.id], o = n.savedSignatures.has(e.id), a = n.replacingSignatures.has(e.id);
|
|
5356
5408
|
if (n.mode === "print")
|
|
5357
|
-
return s && typeof s == "string" ?
|
|
5409
|
+
return s && typeof s == "string" ? d`
|
|
5358
5410
|
<div class="print-response-value signature-response">
|
|
5359
5411
|
<img
|
|
5360
5412
|
src="${s}"
|
|
5361
5413
|
alt="Digital Signature"
|
|
5362
5414
|
class="signature-image"
|
|
5363
|
-
@error=${(
|
|
5415
|
+
@error=${(l) => {
|
|
5364
5416
|
var u;
|
|
5365
|
-
const p =
|
|
5417
|
+
const p = l.target;
|
|
5366
5418
|
p.style.display = "none";
|
|
5367
5419
|
const c = (u = p.parentElement) == null ? void 0 : u.querySelector(".signature-fallback");
|
|
5368
5420
|
c && c.classList.remove("hidden");
|
|
@@ -5372,19 +5424,19 @@ class y {
|
|
|
5372
5424
|
<span class="signature-error">Unable to display signature</span>
|
|
5373
5425
|
</div>
|
|
5374
5426
|
</div>
|
|
5375
|
-
` :
|
|
5427
|
+
` : d`<div class="print-response-value signature-response">
|
|
5376
5428
|
<span class="print-no-response">No signature provided</span>
|
|
5377
5429
|
</div>`;
|
|
5378
5430
|
if (n.mode === "view-only")
|
|
5379
|
-
return s && typeof s == "string" ?
|
|
5431
|
+
return s && typeof s == "string" ? d`
|
|
5380
5432
|
<div class="signature-view-only">
|
|
5381
5433
|
<img
|
|
5382
5434
|
src="${s}"
|
|
5383
5435
|
alt="Digital Signature"
|
|
5384
5436
|
class="signature-image"
|
|
5385
|
-
@error=${(
|
|
5437
|
+
@error=${(l) => {
|
|
5386
5438
|
var u;
|
|
5387
|
-
const p =
|
|
5439
|
+
const p = l.target;
|
|
5388
5440
|
p.style.display = "none";
|
|
5389
5441
|
const c = (u = p.parentElement) == null ? void 0 : u.querySelector(".signature-fallback");
|
|
5390
5442
|
c && c.classList.remove("hidden");
|
|
@@ -5394,17 +5446,17 @@ class y {
|
|
|
5394
5446
|
<span class="signature-error">Unable to display signature</span>
|
|
5395
5447
|
</div>
|
|
5396
5448
|
</div>
|
|
5397
|
-
` :
|
|
5449
|
+
` : d`
|
|
5398
5450
|
<div class="signature-view-only">
|
|
5399
5451
|
<span class="no-signature">No signature captured</span>
|
|
5400
5452
|
</div>
|
|
5401
5453
|
`;
|
|
5402
5454
|
if (n.mode === "admin" && s && typeof s == "string" && !a) {
|
|
5403
|
-
const
|
|
5404
|
-
return
|
|
5455
|
+
const l = s.trim().startsWith("<svg");
|
|
5456
|
+
return d`
|
|
5405
5457
|
<div class="signature-admin-display">
|
|
5406
5458
|
<div class="signature-existing">
|
|
5407
|
-
${
|
|
5459
|
+
${l ? d` <div class="signature-svg-container" .innerHTML=${s}></div> ` : d`
|
|
5408
5460
|
<img
|
|
5409
5461
|
src="${s}"
|
|
5410
5462
|
alt="Digital Signature"
|
|
@@ -5434,7 +5486,7 @@ class y {
|
|
|
5434
5486
|
</div>
|
|
5435
5487
|
`;
|
|
5436
5488
|
}
|
|
5437
|
-
return
|
|
5489
|
+
return d`
|
|
5438
5490
|
<div class="signature-container ${this._isInputDisabled(n) ? "disabled" : ""}">
|
|
5439
5491
|
<canvas id="signature-${e.id}" class="signature-canvas"></canvas>
|
|
5440
5492
|
<div class="signature-controls">
|
|
@@ -5446,7 +5498,7 @@ class y {
|
|
|
5446
5498
|
>
|
|
5447
5499
|
Clear
|
|
5448
5500
|
</button>
|
|
5449
|
-
${r && !o ?
|
|
5501
|
+
${r && !o ? d`
|
|
5450
5502
|
<button
|
|
5451
5503
|
type="button"
|
|
5452
5504
|
class="signature-save-btn"
|
|
@@ -5456,8 +5508,8 @@ class y {
|
|
|
5456
5508
|
Save
|
|
5457
5509
|
</button>
|
|
5458
5510
|
` : ""}
|
|
5459
|
-
${o ?
|
|
5460
|
-
${n.mode === "admin" && a ?
|
|
5511
|
+
${o ? d` <span class="signature-saved">✓ Saved</span> ` : ""}
|
|
5512
|
+
${n.mode === "admin" && a ? d`
|
|
5461
5513
|
<button
|
|
5462
5514
|
type="button"
|
|
5463
5515
|
class="signature-cancel-btn"
|
|
@@ -5477,25 +5529,25 @@ class y {
|
|
|
5477
5529
|
const r = typeof s == "string", o = typeof s == "object" && s.name;
|
|
5478
5530
|
if (n.mode === "print") {
|
|
5479
5531
|
if (o)
|
|
5480
|
-
return
|
|
5532
|
+
return d`
|
|
5481
5533
|
<div class="print-response-value file-response">
|
|
5482
5534
|
📎 ${s.name}
|
|
5483
|
-
${s.size ?
|
|
5535
|
+
${s.size ? d` <span class="file-size"
|
|
5484
5536
|
>(${y._formatFileSize(s.size)})</span
|
|
5485
5537
|
>` : ""}
|
|
5486
5538
|
</div>
|
|
5487
5539
|
`;
|
|
5488
5540
|
if (r) {
|
|
5489
5541
|
const a = y._extractFilenameFromUrl(s);
|
|
5490
|
-
return
|
|
5542
|
+
return d` <div class="print-response-value file-response">📎 ${a}</div> `;
|
|
5491
5543
|
} else
|
|
5492
|
-
return
|
|
5544
|
+
return d` <div class="print-response-value file-response">📎 ${s}</div> `;
|
|
5493
5545
|
} else {
|
|
5494
|
-
const a = r ? s : "#",
|
|
5495
|
-
return
|
|
5546
|
+
const a = r ? s : "#", l = o ? s.name : r ? y._extractFilenameFromUrl(s) : "View File";
|
|
5547
|
+
return d`
|
|
5496
5548
|
<div class="file-upload-view-only">
|
|
5497
|
-
<a href="${a}" target="_blank" class="file-link"> 📎 ${
|
|
5498
|
-
${o && s.size ?
|
|
5549
|
+
<a href="${a}" target="_blank" class="file-link"> 📎 ${l} </a>
|
|
5550
|
+
${o && s.size ? d`
|
|
5499
5551
|
<span class="file-size-info"
|
|
5500
5552
|
>(${y._formatFileSize(s.size)})</span
|
|
5501
5553
|
>
|
|
@@ -5504,16 +5556,16 @@ class y {
|
|
|
5504
5556
|
`;
|
|
5505
5557
|
}
|
|
5506
5558
|
} else
|
|
5507
|
-
return n.mode === "print" ?
|
|
5559
|
+
return n.mode === "print" ? d`
|
|
5508
5560
|
<div class="print-response-value file-response">
|
|
5509
5561
|
<span class="print-no-response">No file uploaded</span>
|
|
5510
5562
|
</div>
|
|
5511
|
-
` :
|
|
5563
|
+
` : d`
|
|
5512
5564
|
<div class="file-upload-view-only">
|
|
5513
5565
|
<span class="no-file">No file uploaded</span>
|
|
5514
5566
|
</div>
|
|
5515
5567
|
`;
|
|
5516
|
-
return
|
|
5568
|
+
return d`
|
|
5517
5569
|
<div class="file-upload-container">
|
|
5518
5570
|
<input
|
|
5519
5571
|
type="file"
|
|
@@ -5522,7 +5574,7 @@ class y {
|
|
|
5522
5574
|
?disabled=${this._isInputDisabled(n)}
|
|
5523
5575
|
@change=${(r) => n.handlers.handleFileUpload(e.id, r)}
|
|
5524
5576
|
/>
|
|
5525
|
-
${s ?
|
|
5577
|
+
${s ? d`
|
|
5526
5578
|
<div class="file-preview">
|
|
5527
5579
|
<span class="file-name">${s.name || "File selected"}</span>
|
|
5528
5580
|
<button
|
|
@@ -5543,12 +5595,12 @@ class y {
|
|
|
5543
5595
|
static renderDefaultInput(e, t, n) {
|
|
5544
5596
|
if (n.mode === "print") {
|
|
5545
5597
|
const r = e.type === "date" && t ? new Date(t).toLocaleDateString() : t;
|
|
5546
|
-
return
|
|
5547
|
-
${r ||
|
|
5598
|
+
return d`<div class="print-response-value input-response">
|
|
5599
|
+
${r || d`<span class="print-no-response">No response</span>`}
|
|
5548
5600
|
</div>`;
|
|
5549
5601
|
}
|
|
5550
5602
|
const s = e.type === "number" ? "number" : e.type === "date" ? "date" : "text";
|
|
5551
|
-
return
|
|
5603
|
+
return d`<input
|
|
5552
5604
|
type=${s}
|
|
5553
5605
|
id=${e.id}
|
|
5554
5606
|
.value=${t}
|
|
@@ -5577,22 +5629,22 @@ class y {
|
|
|
5577
5629
|
return y.renderDefaultInput(e, n, t);
|
|
5578
5630
|
}
|
|
5579
5631
|
}, o = e.type === "checkbox" && (!e.options || e.options.length === 0);
|
|
5580
|
-
return t.mode === "print" ?
|
|
5632
|
+
return t.mode === "print" ? d`
|
|
5581
5633
|
<div class="question-print">
|
|
5582
|
-
${o ? "" :
|
|
5634
|
+
${o ? "" : d` <div class="print-question-title">${e.label}:</div> `}
|
|
5583
5635
|
${r()}
|
|
5584
5636
|
<hr class="print-question-separator" />
|
|
5585
5637
|
</div>
|
|
5586
|
-
` :
|
|
5638
|
+
` : d`
|
|
5587
5639
|
<div class="question ${s ? "error" : ""}">
|
|
5588
|
-
${o ? "" :
|
|
5640
|
+
${o ? "" : d`
|
|
5589
5641
|
<div class="runner-question-title">
|
|
5590
|
-
${e.label}${e.required ?
|
|
5642
|
+
${e.label}${e.required ? d`<span class="runner-question-required">*</span>` : ""}
|
|
5591
5643
|
</div>
|
|
5592
5644
|
<hr class="runner-question-divider" />
|
|
5593
5645
|
`}
|
|
5594
5646
|
${r()}
|
|
5595
|
-
${s ?
|
|
5647
|
+
${s ? d`<div class="error-message">${s}</div>` : ""}
|
|
5596
5648
|
</div>
|
|
5597
5649
|
`;
|
|
5598
5650
|
}
|
|
@@ -5645,14 +5697,14 @@ class $ {
|
|
|
5645
5697
|
return e.replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*(.*?)\*\*/gim, "<strong>$1</strong>").replace(/\*(.*?)\*/gim, "<em>$1</em>").replace(/`(.*?)`/gim, "<code>$1</code>").replace(/^> (.*$)/gim, "<blockquote>$1</blockquote>").replace(/\n/gim, "<br>");
|
|
5646
5698
|
}
|
|
5647
5699
|
static renderText(e) {
|
|
5648
|
-
return
|
|
5700
|
+
return d`
|
|
5649
5701
|
<div class="content-element text-content">
|
|
5650
5702
|
<p>${e.content}</p>
|
|
5651
5703
|
</div>
|
|
5652
5704
|
`;
|
|
5653
5705
|
}
|
|
5654
5706
|
static renderMarkdownElement(e) {
|
|
5655
|
-
return
|
|
5707
|
+
return d`
|
|
5656
5708
|
<div class="content-element markdown-content">
|
|
5657
5709
|
<div class="markdown-text">
|
|
5658
5710
|
${Ae($.renderMarkdown(e.content))}
|
|
@@ -5661,22 +5713,22 @@ class $ {
|
|
|
5661
5713
|
`;
|
|
5662
5714
|
}
|
|
5663
5715
|
static renderDivider(e) {
|
|
5664
|
-
return
|
|
5716
|
+
return d`
|
|
5665
5717
|
<div class="content-element divider-content">
|
|
5666
5718
|
<hr class="content-divider" />
|
|
5667
|
-
${e.caption ?
|
|
5719
|
+
${e.caption ? d`<div class="divider-caption">${e.caption}</div>` : ""}
|
|
5668
5720
|
</div>
|
|
5669
5721
|
`;
|
|
5670
5722
|
}
|
|
5671
5723
|
static renderHtml(e) {
|
|
5672
|
-
return
|
|
5724
|
+
return d`
|
|
5673
5725
|
<div class="content-element html-content">
|
|
5674
5726
|
<div class="html-content-wrapper">${Ae(e.content)}</div>
|
|
5675
5727
|
</div>
|
|
5676
5728
|
`;
|
|
5677
5729
|
}
|
|
5678
5730
|
static renderImage(e) {
|
|
5679
|
-
return
|
|
5731
|
+
return d`
|
|
5680
5732
|
<div class="content-element image-content">
|
|
5681
5733
|
<div class="image-placeholder">
|
|
5682
5734
|
<p>📷 Image: ${e.caption || e.alt || "Image content"}</p>
|
|
@@ -5686,7 +5738,7 @@ class $ {
|
|
|
5686
5738
|
`;
|
|
5687
5739
|
}
|
|
5688
5740
|
static renderVideo(e) {
|
|
5689
|
-
return
|
|
5741
|
+
return d`
|
|
5690
5742
|
<div class="content-element video-content">
|
|
5691
5743
|
<div class="video-placeholder">
|
|
5692
5744
|
<p>🎥 Video: ${e.caption || "Video content"}</p>
|
|
@@ -5696,7 +5748,7 @@ class $ {
|
|
|
5696
5748
|
`;
|
|
5697
5749
|
}
|
|
5698
5750
|
static renderFile(e) {
|
|
5699
|
-
return
|
|
5751
|
+
return d`
|
|
5700
5752
|
<div class="content-element file-content">
|
|
5701
5753
|
<div class="file-placeholder">
|
|
5702
5754
|
<p>📄 File: ${e.caption || "File content"}</p>
|
|
@@ -5706,7 +5758,7 @@ class $ {
|
|
|
5706
5758
|
`;
|
|
5707
5759
|
}
|
|
5708
5760
|
static renderUnknown(e) {
|
|
5709
|
-
return
|
|
5761
|
+
return d`
|
|
5710
5762
|
<div class="content-element unknown-content">
|
|
5711
5763
|
<p>⚠️ Unknown content type: ${e.type}</p>
|
|
5712
5764
|
</div>
|
|
@@ -5733,10 +5785,10 @@ class $ {
|
|
|
5733
5785
|
return $.renderUnknown(e);
|
|
5734
5786
|
}
|
|
5735
5787
|
};
|
|
5736
|
-
return (t == null ? void 0 : t.mode) === "print" ?
|
|
5788
|
+
return (t == null ? void 0 : t.mode) === "print" ? d`
|
|
5737
5789
|
<div class="content-print">
|
|
5738
5790
|
${n()}
|
|
5739
|
-
${e.type !== "divider" ?
|
|
5791
|
+
${e.type !== "divider" ? d`<hr class="print-question-separator" />` : ""}
|
|
5740
5792
|
</div>
|
|
5741
5793
|
` : n();
|
|
5742
5794
|
}
|
|
@@ -5744,13 +5796,13 @@ class $ {
|
|
|
5744
5796
|
class Me {
|
|
5745
5797
|
static renderMobileStepsForStatus(e) {
|
|
5746
5798
|
const { steps: t, disabled: n = !1 } = e;
|
|
5747
|
-
return
|
|
5799
|
+
return d`
|
|
5748
5800
|
<div class="runner-mobile-steps">
|
|
5749
5801
|
<nav aria-label="Workflow steps">
|
|
5750
5802
|
<div class="runner-mobile-steps-container">
|
|
5751
5803
|
${t == null ? void 0 : t.map((s) => {
|
|
5752
5804
|
const r = e.isStepAssignedToUser(s), o = e.completedSteps.has(s.id);
|
|
5753
|
-
return
|
|
5805
|
+
return d`
|
|
5754
5806
|
<div
|
|
5755
5807
|
class="runner-mobile-step-tab ${o ? "completed" : ""} ${r ? "" : "unassigned"} ${n ? "disabled" : ""}"
|
|
5756
5808
|
style="cursor: not-allowed; opacity: ${n ? "0.6" : r ? "1" : "0.6"};"
|
|
@@ -5768,7 +5820,7 @@ class Me {
|
|
|
5768
5820
|
`;
|
|
5769
5821
|
}
|
|
5770
5822
|
static renderNotAssignedView() {
|
|
5771
|
-
return
|
|
5823
|
+
return d`
|
|
5772
5824
|
<div class="runner-content not-assigned-view">
|
|
5773
5825
|
<div class="not-assigned-container">
|
|
5774
5826
|
<div class="not-assigned-icon">
|
|
@@ -5795,7 +5847,7 @@ class Me {
|
|
|
5795
5847
|
}
|
|
5796
5848
|
static renderUnifiedSubmissionView(e) {
|
|
5797
5849
|
var t, n, s;
|
|
5798
|
-
return
|
|
5850
|
+
return d`
|
|
5799
5851
|
<div class="runner-layout">
|
|
5800
5852
|
<!-- Mobile Steps Navigation (visible only on mobile) -->
|
|
5801
5853
|
${this.renderMobileStepsForStatus({
|
|
@@ -5812,7 +5864,7 @@ class Me {
|
|
|
5812
5864
|
<ul class="runner-steps-list">
|
|
5813
5865
|
${(s = (n = e.instance) == null ? void 0 : n.steps) == null ? void 0 : s.map((r) => {
|
|
5814
5866
|
const o = e.isStepAssignedToUser(r), a = e.completedSteps.has(r.id);
|
|
5815
|
-
return
|
|
5867
|
+
return d`
|
|
5816
5868
|
<li
|
|
5817
5869
|
class="runner-step-item ${a ? "completed" : ""} ${o ? "" : "unassigned"}"
|
|
5818
5870
|
style="opacity: ${o ? "1" : "0.6"}; cursor: not-allowed;"
|
|
@@ -5855,7 +5907,7 @@ class Me {
|
|
|
5855
5907
|
`;
|
|
5856
5908
|
}
|
|
5857
5909
|
}
|
|
5858
|
-
class
|
|
5910
|
+
class W {
|
|
5859
5911
|
/**
|
|
5860
5912
|
* Determines if a step should show as completed in the badge.
|
|
5861
5913
|
* If completion screen is showing, all assigned steps are considered completed.
|
|
@@ -5865,22 +5917,22 @@ class R {
|
|
|
5865
5917
|
}
|
|
5866
5918
|
static renderSidebar(e) {
|
|
5867
5919
|
const { steps: t } = e;
|
|
5868
|
-
return
|
|
5920
|
+
return d`
|
|
5869
5921
|
<aside class="runner-sidebar">
|
|
5870
5922
|
<div class="runner-sidebar-header">Steps</div>
|
|
5871
5923
|
<nav aria-label="Workflow steps">
|
|
5872
5924
|
<ul class="runner-steps-list">
|
|
5873
5925
|
${t == null ? void 0 : t.map((n, s) => {
|
|
5874
|
-
const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r),
|
|
5875
|
-
return
|
|
5926
|
+
const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r), l = (e.isSubmitted || e.userStepsSubmitted) && e.mode !== "preview" && e.mode !== "admin" && e.mode !== "view-only" && e.mode !== "print", p = e.isLoading;
|
|
5927
|
+
return d`
|
|
5876
5928
|
<li
|
|
5877
|
-
class="runner-step-item ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${
|
|
5929
|
+
class="runner-step-item ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${l ? "disabled" : ""} ${p ? "loading-disabled" : ""}"
|
|
5878
5930
|
@click=${() => !p && e.goToStep(s)}
|
|
5879
|
-
style="${
|
|
5931
|
+
style="${l ? "opacity: 0.5; cursor: not-allowed;" : ""}"
|
|
5880
5932
|
>
|
|
5881
5933
|
<span class="runner-step-title">${n.title}</span>
|
|
5882
5934
|
<span class="runner-step-badge">
|
|
5883
|
-
${e.mode === "preview" ? "Preview" : e.mode === "admin" ? "Admin" : e.mode === "view-only" ? "View Only" : e.mode === "print" ? "Print" :
|
|
5935
|
+
${e.mode === "preview" ? "Preview" : e.mode === "admin" ? "Admin" : e.mode === "view-only" ? "View Only" : e.mode === "print" ? "Print" : l ? "Submitted" : a ? "Completed" : r ? "Assigned" : "Not Assigned"}
|
|
5884
5936
|
</span>
|
|
5885
5937
|
</li>
|
|
5886
5938
|
`;
|
|
@@ -5892,22 +5944,22 @@ class R {
|
|
|
5892
5944
|
}
|
|
5893
5945
|
static renderMobileSteps(e) {
|
|
5894
5946
|
const { steps: t } = e;
|
|
5895
|
-
return
|
|
5947
|
+
return d`
|
|
5896
5948
|
<div class="runner-mobile-steps">
|
|
5897
5949
|
<nav aria-label="Workflow steps">
|
|
5898
5950
|
<div class="runner-mobile-steps-container">
|
|
5899
5951
|
${t == null ? void 0 : t.map((n, s) => {
|
|
5900
|
-
const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r),
|
|
5901
|
-
return
|
|
5952
|
+
const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r), l = (e.isSubmitted || e.userStepsSubmitted) && e.mode !== "preview" && e.mode !== "admin" && e.mode !== "view-only" && e.mode !== "print", p = e.isLoading;
|
|
5953
|
+
return d`
|
|
5902
5954
|
<button
|
|
5903
|
-
class="runner-mobile-step-tab ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${
|
|
5955
|
+
class="runner-mobile-step-tab ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${l ? "disabled" : ""} ${p ? "loading-disabled" : ""}"
|
|
5904
5956
|
@click=${() => !p && e.goToStep(s)}
|
|
5905
|
-
?disabled=${
|
|
5957
|
+
?disabled=${l || p}
|
|
5906
5958
|
aria-current=${o ? "step" : "false"}
|
|
5907
5959
|
>
|
|
5908
5960
|
<span class="runner-mobile-step-title">${n.title}</span>
|
|
5909
5961
|
<span class="runner-mobile-step-badge">
|
|
5910
|
-
${e.mode === "preview" ? "Preview" : e.mode === "admin" ? "Admin" : e.mode === "view-only" ? "View Only" : e.mode === "print" ? "Print" :
|
|
5962
|
+
${e.mode === "preview" ? "Preview" : e.mode === "admin" ? "Admin" : e.mode === "view-only" ? "View Only" : e.mode === "print" ? "Print" : l ? "Submitted" : a ? "Completed" : r ? "Assigned" : "Not Assigned"}
|
|
5911
5963
|
</span>
|
|
5912
5964
|
</button>
|
|
5913
5965
|
`;
|
|
@@ -5919,24 +5971,24 @@ class R {
|
|
|
5919
5971
|
}
|
|
5920
5972
|
static renderStepHeader(e) {
|
|
5921
5973
|
const { step: t, mode: n } = e;
|
|
5922
|
-
return n === "print" ?
|
|
5974
|
+
return n === "print" ? d`
|
|
5923
5975
|
<div class="step-print-header">
|
|
5924
5976
|
<div class="print-step-title">${t.title}</div>
|
|
5925
|
-
${t.description ?
|
|
5977
|
+
${t.description ? d`<div class="print-step-description">${t.description}</div>` : ""}
|
|
5926
5978
|
<hr class="print-question-separator" />
|
|
5927
5979
|
</div>
|
|
5928
|
-
` :
|
|
5980
|
+
` : d`
|
|
5929
5981
|
<section class="runner-step-header">
|
|
5930
5982
|
<h2 class="runner-step-title">${t.title}</h2>
|
|
5931
5983
|
<hr class="runner-step-divider" />
|
|
5932
|
-
${t.description ?
|
|
5984
|
+
${t.description ? d`<p class="runner-step-desc">${t.description}</p>` : ""}
|
|
5933
5985
|
</section>
|
|
5934
5986
|
`;
|
|
5935
5987
|
}
|
|
5936
5988
|
}
|
|
5937
5989
|
class Dt {
|
|
5938
5990
|
static renderFormActions(e) {
|
|
5939
|
-
return e.mode === "preview" || e.mode === "view-only" || e.mode === "print" || !e.isCurrentStepAssigned ?
|
|
5991
|
+
return e.mode === "preview" || e.mode === "view-only" || e.mode === "print" || !e.isCurrentStepAssigned ? d`` : d`
|
|
5940
5992
|
<div class="runner-form-actions">
|
|
5941
5993
|
<button
|
|
5942
5994
|
class="next-button ${e.mode === "admin" && e.justSaved ? "saved-state" : ""}"
|
|
@@ -5949,37 +6001,37 @@ class Dt {
|
|
|
5949
6001
|
`;
|
|
5950
6002
|
}
|
|
5951
6003
|
}
|
|
5952
|
-
class
|
|
6004
|
+
class de {
|
|
5953
6005
|
/**
|
|
5954
6006
|
* Handles change events for basic text inputs, textareas, selects, numbers, dates
|
|
5955
6007
|
*/
|
|
5956
6008
|
static handleInputChange(e, t, n, s, r, o) {
|
|
5957
6009
|
const a = t.target;
|
|
5958
|
-
let
|
|
5959
|
-
a.type === "radio" ?
|
|
6010
|
+
let l;
|
|
6011
|
+
a.type === "radio" ? l = a.value : a.type === "checkbox" ? l = a.checked : l = a.value;
|
|
5960
6012
|
const p = {
|
|
5961
6013
|
...n,
|
|
5962
|
-
[e]:
|
|
6014
|
+
[e]: l
|
|
5963
6015
|
};
|
|
5964
|
-
s(p), o !== "preview" && r(e,
|
|
6016
|
+
s(p), o !== "preview" && r(e, l);
|
|
5965
6017
|
}
|
|
5966
6018
|
/**
|
|
5967
6019
|
* Handles change events for single checkboxes
|
|
5968
6020
|
*/
|
|
5969
6021
|
static handleCheckboxChange(e, t, n, s, r, o) {
|
|
5970
|
-
const
|
|
6022
|
+
const l = t.target.checked, p = {
|
|
5971
6023
|
...n,
|
|
5972
|
-
[e]:
|
|
6024
|
+
[e]: l
|
|
5973
6025
|
};
|
|
5974
|
-
s(p), o !== "preview" && r(e,
|
|
6026
|
+
s(p), o !== "preview" && r(e, l);
|
|
5975
6027
|
}
|
|
5976
6028
|
/**
|
|
5977
6029
|
* Handles change events for checkbox groups (multiple checkboxes with same name)
|
|
5978
6030
|
*/
|
|
5979
6031
|
static handleCheckboxGroupChange(e, t, n, s, r, o, a) {
|
|
5980
|
-
const
|
|
6032
|
+
const l = n.target, p = s[e];
|
|
5981
6033
|
let c = Array.isArray(p) ? [...p] : [];
|
|
5982
|
-
|
|
6034
|
+
l.checked ? c.includes(t) || c.push(t) : c = c.filter((h) => h !== t);
|
|
5983
6035
|
const u = {
|
|
5984
6036
|
...s,
|
|
5985
6037
|
[e]: c
|
|
@@ -5992,7 +6044,7 @@ var Ct = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, x = (i, e,
|
|
|
5992
6044
|
(o = i[r]) && (s = (n ? o(e, t, s) : o(s)) || s);
|
|
5993
6045
|
return n && s && Ct(e, t, s), s;
|
|
5994
6046
|
};
|
|
5995
|
-
let m = class extends
|
|
6047
|
+
let m = class extends L {
|
|
5996
6048
|
constructor() {
|
|
5997
6049
|
super(...arguments), this.mode = "default", this.isLoading = !1, this._currentStepIndex = 0, this._formData = {}, this._validationErrors = {}, this._internalCompletedSteps = /* @__PURE__ */ new Set(), this._formRestorationComplete = !1, this._savedSignatures = /* @__PURE__ */ new Set(), this._replacingSignatures = /* @__PURE__ */ new Set(), this._isSubmitted = !1, this._userStepsSubmitted = !1, this._justSaved = !1;
|
|
5998
6050
|
}
|
|
@@ -6148,7 +6200,7 @@ let m = class extends P {
|
|
|
6148
6200
|
return this.formStateManager.setValidationErrors(e.errors), this._validationErrors = this.formStateManager.getValidationErrors(), e.isValid;
|
|
6149
6201
|
}
|
|
6150
6202
|
_handleInputChange(i, e) {
|
|
6151
|
-
|
|
6203
|
+
de.handleInputChange(
|
|
6152
6204
|
i,
|
|
6153
6205
|
e,
|
|
6154
6206
|
this._formData,
|
|
@@ -6158,7 +6210,7 @@ let m = class extends P {
|
|
|
6158
6210
|
), this._handleFormDataUpdate(i);
|
|
6159
6211
|
}
|
|
6160
6212
|
_handleCheckboxChange(i, e) {
|
|
6161
|
-
|
|
6213
|
+
de.handleCheckboxChange(
|
|
6162
6214
|
i,
|
|
6163
6215
|
e,
|
|
6164
6216
|
this._formData,
|
|
@@ -6168,7 +6220,7 @@ let m = class extends P {
|
|
|
6168
6220
|
), this._handleFormDataUpdate(i);
|
|
6169
6221
|
}
|
|
6170
6222
|
_handleCheckboxGroupChange(i, e, t) {
|
|
6171
|
-
|
|
6223
|
+
de.handleCheckboxGroupChange(
|
|
6172
6224
|
i,
|
|
6173
6225
|
e,
|
|
6174
6226
|
t,
|
|
@@ -6258,19 +6310,19 @@ let m = class extends P {
|
|
|
6258
6310
|
return m.CONTENT_ELEMENT_TYPES.includes(i.type);
|
|
6259
6311
|
}
|
|
6260
6312
|
_renderStepElement(i) {
|
|
6261
|
-
return this.mode === "print" ? this._isQuestionElement(i) ? this._renderQuestion(i) : this._isContentElement(i) ? this._renderContentElement(i) :
|
|
6313
|
+
return this.mode === "print" ? this._isQuestionElement(i) ? this._renderQuestion(i) : this._isContentElement(i) ? this._renderContentElement(i) : d`<div class="unknown-element">
|
|
6262
6314
|
<p>⚠️ Unknown element type: ${i.type}</p>
|
|
6263
|
-
</div>` : this._isQuestionElement(i) ?
|
|
6315
|
+
</div>` : this._isQuestionElement(i) ? d`<div class="runner-card">${this._renderQuestion(i)}</div>` : this._isContentElement(i) ? d`<div class="runner-card">${this._renderContentElement(i)}</div>` : d`<div class="runner-card">
|
|
6264
6316
|
<div class="unknown-element">
|
|
6265
6317
|
<p>⚠️ Unknown element type: ${i.type}</p>
|
|
6266
6318
|
</div>
|
|
6267
6319
|
</div>`;
|
|
6268
6320
|
}
|
|
6269
6321
|
_renderStepWithElements(i) {
|
|
6270
|
-
return
|
|
6322
|
+
return d`
|
|
6271
6323
|
<div class="print-step">
|
|
6272
6324
|
<!-- Step Header -->
|
|
6273
|
-
${
|
|
6325
|
+
${W.renderStepHeader({ step: i, mode: "print" })}
|
|
6274
6326
|
|
|
6275
6327
|
<!-- Step Elements -->
|
|
6276
6328
|
${i.elements.map((e) => this._renderStepElement(e))}
|
|
@@ -6279,9 +6331,9 @@ let m = class extends P {
|
|
|
6279
6331
|
}
|
|
6280
6332
|
_renderAllStepsForPrint() {
|
|
6281
6333
|
var i;
|
|
6282
|
-
return !((i = this.instance) != null && i.steps) || this.instance.steps.length === 0 ?
|
|
6334
|
+
return !((i = this.instance) != null && i.steps) || this.instance.steps.length === 0 ? d`<div class="runner-content">
|
|
6283
6335
|
No workflow instance loaded or instance has no steps.
|
|
6284
|
-
</div>` :
|
|
6336
|
+
</div>` : d`
|
|
6285
6337
|
<div class="print-layout">
|
|
6286
6338
|
<!-- Instance Title at top -->
|
|
6287
6339
|
<div class="print-instance-title">${this.instance.name || "Untitled Form"}</div>
|
|
@@ -6300,8 +6352,8 @@ let m = class extends P {
|
|
|
6300
6352
|
if (e !== -1) {
|
|
6301
6353
|
const o = (t = this._currentStep) == null ? void 0 : t.id;
|
|
6302
6354
|
if (this._currentStepIndex = e, o && ((n = this.instance) != null && n.steps)) {
|
|
6303
|
-
const
|
|
6304
|
-
|
|
6355
|
+
const l = this.instance.steps.find((p) => p.id === o);
|
|
6356
|
+
l && (l.status = "completed");
|
|
6305
6357
|
}
|
|
6306
6358
|
const a = (r = (s = this.instance) == null ? void 0 : s.steps) == null ? void 0 : r[this._currentStepIndex];
|
|
6307
6359
|
a && (a.status = "active"), this._updateInstanceData(o, "step_navigation", {
|
|
@@ -6363,7 +6415,7 @@ let m = class extends P {
|
|
|
6363
6415
|
return;
|
|
6364
6416
|
}
|
|
6365
6417
|
const e = (t = this._currentStep) == null ? void 0 : t.id;
|
|
6366
|
-
e && this._internalCompletedSteps.add(e), console.log("Submitting entire workflow:", this.instance.id), console.log("Final form data:", this._formData), this.instance && (this.instance.status = "completed", this.instance.
|
|
6418
|
+
e && this._internalCompletedSteps.add(e), console.log("Submitting entire workflow:", this.instance.id), console.log("Final form data:", this._formData), this.instance && (this.instance.status = "completed", this.instance.currentStepId = void 0, this.instance.completedSteps = Array.from(this._internalCompletedSteps)), this._isSubmitted = !0, this._clearSavedFormData("full workflow submission"), this._scrollToTop(), this._updateInstanceData(e, "submission");
|
|
6367
6419
|
}
|
|
6368
6420
|
_saveStep() {
|
|
6369
6421
|
var t;
|
|
@@ -6400,12 +6452,12 @@ let m = class extends P {
|
|
|
6400
6452
|
});
|
|
6401
6453
|
}
|
|
6402
6454
|
_updateInstanceData(i, e, t) {
|
|
6403
|
-
var
|
|
6455
|
+
var l, p, c, u, h, g, b;
|
|
6404
6456
|
i && this._internalCompletedSteps.add(i);
|
|
6405
|
-
let n = (p = (
|
|
6457
|
+
let n = (p = (l = this.instance) == null ? void 0 : l.steps) == null ? void 0 : p.find((k) => k.id === i);
|
|
6406
6458
|
if (!n && this._internalCompletedSteps.size > 0) {
|
|
6407
|
-
const k = Array.from(this._internalCompletedSteps),
|
|
6408
|
-
n = (u = (c = this.instance) == null ? void 0 : c.steps) == null ? void 0 : u.find((
|
|
6459
|
+
const k = Array.from(this._internalCompletedSteps), Y = k[k.length - 1];
|
|
6460
|
+
n = (u = (c = this.instance) == null ? void 0 : c.steps) == null ? void 0 : u.find((q) => q.id === Y);
|
|
6409
6461
|
}
|
|
6410
6462
|
const s = e === "submission", r = ((h = this.instance) == null ? void 0 : h.steps) && this._internalCompletedSteps.size >= this.instance.steps.length, o = s || r ? null : this._currentStep ? {
|
|
6411
6463
|
id: this._currentStep.id,
|
|
@@ -6543,7 +6595,7 @@ let m = class extends P {
|
|
|
6543
6595
|
if (s.type === "text_input" || s.type === "textarea" || s.type === "select" || s.type === "number" || s.type === "radio" || s.type === "checkbox" || s.type === "date" || s.type === "file_upload" || s.type === "signature") {
|
|
6544
6596
|
const r = s, o = this._formData[r.id];
|
|
6545
6597
|
if (o !== void 0 && n.responses) {
|
|
6546
|
-
let a = n.responses.find((
|
|
6598
|
+
let a = n.responses.find((l) => l.elementId === r.id);
|
|
6547
6599
|
a ? (a.value = o, a.answeredAt = /* @__PURE__ */ new Date()) : (a = {
|
|
6548
6600
|
elementId: r.id,
|
|
6549
6601
|
value: o,
|
|
@@ -6631,7 +6683,7 @@ let m = class extends P {
|
|
|
6631
6683
|
if (this.mode === "print")
|
|
6632
6684
|
return this._renderAllStepsForPrint();
|
|
6633
6685
|
const i = this.mode === "preview" ? (e = this.workflow) == null ? void 0 : e.steps : (t = this.instance) == null ? void 0 : t.steps;
|
|
6634
|
-
return !i || i.length === 0 ?
|
|
6686
|
+
return !i || i.length === 0 ? d`<div class="runner-content">
|
|
6635
6687
|
${this.mode === "preview" ? "No workflow loaded or workflow has no steps." : "No workflow instance loaded or instance has no steps."}
|
|
6636
6688
|
</div>` : this.mode === "default" && this._getAssignedSteps().length === 0 ? this._renderNotAssignedView() : null;
|
|
6637
6689
|
}
|
|
@@ -6663,9 +6715,9 @@ let m = class extends P {
|
|
|
6663
6715
|
_renderCurrentStepLayout(i) {
|
|
6664
6716
|
var s, r;
|
|
6665
6717
|
const e = this._isLastAssignedStep(), t = this._isLastStepInWorkflow(), n = this.mode === "preview" ? (s = this.workflow) == null ? void 0 : s.steps : (r = this.instance) == null ? void 0 : r.steps;
|
|
6666
|
-
return
|
|
6718
|
+
return d`
|
|
6667
6719
|
<!-- Mobile Steps Navigation (visible only on mobile) -->
|
|
6668
|
-
${
|
|
6720
|
+
${W.renderMobileSteps({
|
|
6669
6721
|
steps: n,
|
|
6670
6722
|
currentStepIndex: this._currentStepIndex,
|
|
6671
6723
|
mode: this.mode || "default",
|
|
@@ -6678,7 +6730,7 @@ let m = class extends P {
|
|
|
6678
6730
|
})}
|
|
6679
6731
|
|
|
6680
6732
|
<!-- Sidebar: Steps List (hidden on mobile) -->
|
|
6681
|
-
${
|
|
6733
|
+
${W.renderSidebar({
|
|
6682
6734
|
steps: n,
|
|
6683
6735
|
currentStepIndex: this._currentStepIndex,
|
|
6684
6736
|
mode: this.mode || "default",
|
|
@@ -6692,8 +6744,8 @@ let m = class extends P {
|
|
|
6692
6744
|
|
|
6693
6745
|
<!-- Main Content: Step Details and Questions -->
|
|
6694
6746
|
<main class="runner-main-content">
|
|
6695
|
-
${this.mode === "print" ?
|
|
6696
|
-
${
|
|
6747
|
+
${this.mode === "print" ? W.renderStepHeader({ step: i, mode: this.mode }) : d`<div class="runner-card">
|
|
6748
|
+
${W.renderStepHeader({
|
|
6697
6749
|
step: i,
|
|
6698
6750
|
mode: this.mode
|
|
6699
6751
|
})}
|
|
@@ -6722,15 +6774,15 @@ let m = class extends P {
|
|
|
6722
6774
|
if (i)
|
|
6723
6775
|
return i;
|
|
6724
6776
|
const e = this._validateCurrentStep();
|
|
6725
|
-
return e ? (this._initializeStepAssets(e), this._renderCurrentStepLayout(e)) :
|
|
6777
|
+
return e ? (this._initializeStepAssets(e), this._renderCurrentStepLayout(e)) : d`<div class="runner-content">Invalid current step.</div>`;
|
|
6726
6778
|
}
|
|
6727
6779
|
render() {
|
|
6728
|
-
return
|
|
6780
|
+
return d`
|
|
6729
6781
|
<div class="runner-layout">
|
|
6730
6782
|
${this._renderMainContent()}
|
|
6731
6783
|
|
|
6732
6784
|
<!-- Loading overlay with white box (conditionally rendered) -->
|
|
6733
|
-
${this.isLoading ?
|
|
6785
|
+
${this.isLoading ? d`
|
|
6734
6786
|
<div class="runner-loading-overlay">
|
|
6735
6787
|
<div class="runner-loading-box">
|
|
6736
6788
|
<div class="runner-loading-spinner"></div>
|
|
@@ -6848,7 +6900,7 @@ function Jt(i, e = {}) {
|
|
|
6848
6900
|
<hr class="print-question-separator" />
|
|
6849
6901
|
|
|
6850
6902
|
${r ? Vt(i, o) : ""}
|
|
6851
|
-
${i.steps.map((
|
|
6903
|
+
${i.steps.map((l) => At(l)).join(`
|
|
6852
6904
|
`)}
|
|
6853
6905
|
</div>
|
|
6854
6906
|
</body>
|
|
@@ -6891,9 +6943,9 @@ function Tt(i, e) {
|
|
|
6891
6943
|
case "text_input":
|
|
6892
6944
|
case "number":
|
|
6893
6945
|
case "date":
|
|
6894
|
-
return r + Ut(i, n) + o;
|
|
6895
|
-
case "textarea":
|
|
6896
6946
|
return r + It(i, n) + o;
|
|
6947
|
+
case "textarea":
|
|
6948
|
+
return r + Ut(i, n) + o;
|
|
6897
6949
|
case "select":
|
|
6898
6950
|
return r + Pt(i, n) + o;
|
|
6899
6951
|
case "radio":
|
|
@@ -7008,7 +7060,7 @@ function zt(i) {
|
|
|
7008
7060
|
`;
|
|
7009
7061
|
}
|
|
7010
7062
|
}
|
|
7011
|
-
function
|
|
7063
|
+
function It(i, e) {
|
|
7012
7064
|
const t = e != null ? f(String(e)) : "";
|
|
7013
7065
|
return `
|
|
7014
7066
|
<div class="print-response-value input-response">
|
|
@@ -7016,7 +7068,7 @@ function Ut(i, e) {
|
|
|
7016
7068
|
</div>
|
|
7017
7069
|
`;
|
|
7018
7070
|
}
|
|
7019
|
-
function
|
|
7071
|
+
function Ut(i, e) {
|
|
7020
7072
|
return `
|
|
7021
7073
|
<div class="print-response-value textarea-response">
|
|
7022
7074
|
${(e != null ? f(String(e)) : "") || '<span class="print-no-response">No response</span>'}
|
|
@@ -7678,7 +7730,7 @@ function Xt(i, e = {}) {
|
|
|
7678
7730
|
return console.error(`Error: Target element with ID '${i}' not found.`), null;
|
|
7679
7731
|
t.innerHTML = "";
|
|
7680
7732
|
const n = document.createElement("builder-widget");
|
|
7681
|
-
return e.onWorkflowCreated && (n.onWorkflowCreated = e.onWorkflowCreated), e.onWorkflowDeleted && (n.onWorkflowDeleted = e.onWorkflowDeleted), e.onWorkflowUpdated && (n.onWorkflowUpdated = e.onWorkflowUpdated), t.appendChild(n), console.log(`Drill Builder mounted on #${i}`), n;
|
|
7733
|
+
return e.workflow && (n.workflow = e.workflow), e.onWorkflowCreated && (n.onWorkflowCreated = e.onWorkflowCreated), e.onWorkflowDeleted && (n.onWorkflowDeleted = e.onWorkflowDeleted), e.onWorkflowUpdated && (n.onWorkflowUpdated = e.onWorkflowUpdated), t.appendChild(n), console.log(`Drill Builder mounted on #${i}`), n;
|
|
7682
7734
|
}
|
|
7683
7735
|
function Zt(i, e) {
|
|
7684
7736
|
if (!customElements.get("runner-widget"))
|
|
@@ -7715,7 +7767,7 @@ function ei(i, e) {
|
|
|
7715
7767
|
if (r.type === "text_input" || r.type === "textarea" || r.type === "select" || r.type === "number" || r.type === "radio" || r.type === "checkbox" || r.type === "date" || r.type === "file_upload" || r.type === "signature") {
|
|
7716
7768
|
const o = t[r.id];
|
|
7717
7769
|
if (o !== void 0) {
|
|
7718
|
-
let a = s.responses.find((
|
|
7770
|
+
let a = s.responses.find((l) => l.elementId === r.id);
|
|
7719
7771
|
a ? (a.value = o, a.answeredAt = /* @__PURE__ */ new Date()) : (a = {
|
|
7720
7772
|
elementId: r.id,
|
|
7721
7773
|
value: o,
|