@ntix/components-scorad 1.0.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -22
- package/dist/@ntix/components-scorad.es.js +126 -106
- package/dist/@ntix/components-scorad.umd.js +25 -25
- package/dist/componentsScoradLogger.d.ts +2 -5
- package/dist/getScoradScore.d.ts +2 -1
- package/dist/validateScoradData.d.ts +2 -1
- package/docs/componentsScoradLogger.md +1 -2
- package/docs/getScoradScore.md +219 -1
- package/docs/validateScoradData.md +1 -1
- package/package.json +34 -37
package/README.md
CHANGED
|
@@ -49,28 +49,6 @@ Then add the component to your HTML:
|
|
|
49
49
|
<scorad-component></scorad-component>
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
## Documentation
|
|
53
|
-
|
|
54
|
-
### 🧱 Components
|
|
55
|
-
*Primary UI elements for building the assessment.*
|
|
56
|
-
|
|
57
|
-
- [**Scorad Root**](./docs/component.md) – The main coordinator and score aggregator.
|
|
58
|
-
- [**Extent (Section A)**](./docs/extent.component.md) – Surface area calculation.
|
|
59
|
-
- [**Intensity (Section B)**](./docs/intensity.component.md) – Clinical sign grading.
|
|
60
|
-
- [**Subjective (Section C)**](./docs/subjective.component.md) – Patient-reported symptoms.
|
|
61
|
-
- [**Weightings**](./docs/weightings.component.md) – Adult/Child toggle.
|
|
62
|
-
|
|
63
|
-
### 📊 Data Models & Logic
|
|
64
|
-
*Records and calculation engines.*
|
|
65
|
-
|
|
66
|
-
- [**ScoradScore**](./docs/ScoradScore.md) – The output structure (A, B, C, Total).
|
|
67
|
-
- [**ScoradData**](./docs/ScoradData.md) – The complete assessment state.
|
|
68
|
-
- [**getScoradScore**](./docs/getScoradScore.md) – The mathematical formula implementation.
|
|
69
|
-
- [**Clinical Constants**](./docs/constants.md) – Max values and defaults.
|
|
70
|
-
|
|
71
|
-
### 🌐 Resources
|
|
72
|
-
- [**Localization (ScoradResources)**](./docs/ScoradResources.md) – UI strings and descriptions.
|
|
73
|
-
|
|
74
52
|
## Licensing
|
|
75
53
|
|
|
76
54
|
This package is NOT open-source. Usage is governed by the Antix Software License.
|
|
@@ -148,28 +148,43 @@ var Success = class {
|
|
|
148
148
|
this.value = e;
|
|
149
149
|
}
|
|
150
150
|
value;
|
|
151
|
+
getErrors() {
|
|
152
|
+
return Result.EMPTY_ERRORS;
|
|
153
|
+
}
|
|
151
154
|
orThrow() {
|
|
152
155
|
return this.value;
|
|
153
156
|
}
|
|
154
157
|
orNull() {
|
|
155
158
|
return this.value;
|
|
156
159
|
}
|
|
157
|
-
|
|
160
|
+
fold(e, t) {
|
|
161
|
+
return e(this.value);
|
|
162
|
+
}
|
|
158
163
|
}, Failure = class e {
|
|
159
164
|
constructor(e) {
|
|
165
|
+
if (!e?.length) throw Error("errors are required");
|
|
160
166
|
this.errors = e;
|
|
161
167
|
}
|
|
162
168
|
errors;
|
|
169
|
+
getErrors() {
|
|
170
|
+
return this.errors;
|
|
171
|
+
}
|
|
163
172
|
orThrow() {
|
|
164
173
|
throw Error(e.formatErrors(this.errors));
|
|
165
174
|
}
|
|
166
175
|
orNull() {
|
|
167
176
|
return null;
|
|
168
177
|
}
|
|
178
|
+
fold(e, t) {
|
|
179
|
+
return t(this.errors);
|
|
180
|
+
}
|
|
169
181
|
static formatErrors = (e) => e.join("\n");
|
|
170
182
|
}, Result = {
|
|
183
|
+
EMPTY_ERRORS: Object.freeze([]),
|
|
171
184
|
Ok: (e) => new Success(e),
|
|
172
|
-
Fail: (e) => new Failure(e)
|
|
185
|
+
Fail: (e) => new Failure(e),
|
|
186
|
+
isSuccess: (e) => e instanceof Success,
|
|
187
|
+
isFailure: (e) => e instanceof Failure
|
|
173
188
|
}, padNumber = (e, t) => e.toString().padStart(t, "0").slice(-t), toKebabCase = (e) => e == null ? e : e?.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t ? "-" : "") + e).toLowerCase();
|
|
174
189
|
function Att(e = {}) {
|
|
175
190
|
return function(t, r) {
|
|
@@ -553,15 +568,15 @@ var html$1 = freeze(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.a
|
|
|
553
568
|
};
|
|
554
569
|
function createDOMPurify() {
|
|
555
570
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(), t = (e) => createDOMPurify(e);
|
|
556
|
-
if (t.version = "3.3.
|
|
571
|
+
if (t.version = "3.3.1", t.removed = [], !e || !e.document || e.document.nodeType !== NODE_TYPE.document || !e.Element) return t.isSupported = !1, t;
|
|
557
572
|
let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: d, DOMParser: f, trustedTypes: p } = e, m = c.prototype, h = lookupGetter(m, "cloneNode"), g = lookupGetter(m, "remove"), _ = lookupGetter(m, "nextSibling"), ze = lookupGetter(m, "childNodes"), v = lookupGetter(m, "parentNode");
|
|
558
573
|
if (typeof o == "function") {
|
|
559
574
|
let e = n.createElement("template");
|
|
560
575
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
561
576
|
}
|
|
562
|
-
let y, b = "", { implementation:
|
|
563
|
-
t.isSupported = typeof entries == "function" && typeof v == "function" &&
|
|
564
|
-
let { MUSTACHE_EXPR:
|
|
577
|
+
let y, b = "", { implementation: Be, createNodeIterator: Ve, createDocumentFragment: He, getElementsByTagName: Ue } = n, { importNode: We } = r, x = _createHooksMap();
|
|
578
|
+
t.isSupported = typeof entries == "function" && typeof v == "function" && Be && Be.createHTMLDocument !== void 0;
|
|
579
|
+
let { MUSTACHE_EXPR: S, ERB_EXPR: C, TMPLIT_EXPR: w, DATA_ATTR: Ge, ARIA_ATTR: Ke, IS_SCRIPT_OR_DATA: qe, ATTR_WHITESPACE: Je, CUSTOM_ELEMENT: Ye } = EXPRESSIONS, { IS_ALLOWED_URI: Xe } = EXPRESSIONS, T = null, Ze = addToSet({}, [
|
|
565
580
|
...html$1,
|
|
566
581
|
...svg$1,
|
|
567
582
|
...svgFilters,
|
|
@@ -591,7 +606,7 @@ function createDOMPurify() {
|
|
|
591
606
|
enumerable: !0,
|
|
592
607
|
value: !1
|
|
593
608
|
}
|
|
594
|
-
})), O = null,
|
|
609
|
+
})), O = null, k = null, A = Object.seal(create(null, {
|
|
595
610
|
tagCheck: {
|
|
596
611
|
writable: !0,
|
|
597
612
|
configurable: !1,
|
|
@@ -604,7 +619,7 @@ function createDOMPurify() {
|
|
|
604
619
|
enumerable: !0,
|
|
605
620
|
value: null
|
|
606
621
|
}
|
|
607
|
-
})),
|
|
622
|
+
})), $e = !0, j = !0, et = !1, tt = !0, M = !1, N = !0, P = !1, nt = !1, rt = !1, F = !1, I = !1, L = !1, it = !0, at = !1, ot = !0, R = !1, z = {}, B = null, st = addToSet({}, [
|
|
608
623
|
"annotation-xml",
|
|
609
624
|
"audio",
|
|
610
625
|
"colgroup",
|
|
@@ -630,14 +645,14 @@ function createDOMPurify() {
|
|
|
630
645
|
"title",
|
|
631
646
|
"video",
|
|
632
647
|
"xmp"
|
|
633
|
-
]),
|
|
648
|
+
]), ct = null, lt = addToSet({}, [
|
|
634
649
|
"audio",
|
|
635
650
|
"video",
|
|
636
651
|
"img",
|
|
637
652
|
"source",
|
|
638
653
|
"image",
|
|
639
654
|
"track"
|
|
640
|
-
]),
|
|
655
|
+
]), ut = null, dt = addToSet({}, [
|
|
641
656
|
"alt",
|
|
642
657
|
"class",
|
|
643
658
|
"for",
|
|
@@ -652,28 +667,28 @@ function createDOMPurify() {
|
|
|
652
667
|
"value",
|
|
653
668
|
"style",
|
|
654
669
|
"xmlns"
|
|
655
|
-
]), V = "http://www.w3.org/1998/Math/MathML", H = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml", W = U,
|
|
670
|
+
]), V = "http://www.w3.org/1998/Math/MathML", H = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml", W = U, ft = !1, pt = null, mt = addToSet({}, [
|
|
656
671
|
V,
|
|
657
672
|
H,
|
|
658
673
|
U
|
|
659
|
-
], stringToString),
|
|
674
|
+
], stringToString), G = addToSet({}, [
|
|
660
675
|
"mi",
|
|
661
676
|
"mo",
|
|
662
677
|
"mn",
|
|
663
678
|
"ms",
|
|
664
679
|
"mtext"
|
|
665
|
-
]),
|
|
680
|
+
]), K = addToSet({}, ["annotation-xml"]), ht = addToSet({}, [
|
|
666
681
|
"title",
|
|
667
682
|
"style",
|
|
668
683
|
"font",
|
|
669
684
|
"a",
|
|
670
685
|
"script"
|
|
671
|
-
]),
|
|
686
|
+
]), q = null, gt = ["application/xhtml+xml", "text/html"], J = null, Y = null, _t = n.createElement("form"), vt = function(e) {
|
|
672
687
|
return e instanceof RegExp || e instanceof Function;
|
|
673
|
-
},
|
|
688
|
+
}, yt = function() {
|
|
674
689
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
675
|
-
if (!(
|
|
676
|
-
if ((!e || typeof e != "object") && (e = {}), e = clone(e),
|
|
690
|
+
if (!(Y && Y === e)) {
|
|
691
|
+
if ((!e || typeof e != "object") && (e = {}), e = clone(e), q = gt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = q === "application/xhtml+xml" ? stringToString : stringToLowerCase, T = objectHasOwnProperty(e, "ALLOWED_TAGS") ? addToSet({}, e.ALLOWED_TAGS, J) : Ze, E = objectHasOwnProperty(e, "ALLOWED_ATTR") ? addToSet({}, e.ALLOWED_ATTR, J) : Qe, pt = objectHasOwnProperty(e, "ALLOWED_NAMESPACES") ? addToSet({}, e.ALLOWED_NAMESPACES, stringToString) : mt, ut = objectHasOwnProperty(e, "ADD_URI_SAFE_ATTR") ? addToSet(clone(dt), e.ADD_URI_SAFE_ATTR, J) : dt, ct = objectHasOwnProperty(e, "ADD_DATA_URI_TAGS") ? addToSet(clone(lt), e.ADD_DATA_URI_TAGS, J) : lt, B = objectHasOwnProperty(e, "FORBID_CONTENTS") ? addToSet({}, e.FORBID_CONTENTS, J) : st, O = objectHasOwnProperty(e, "FORBID_TAGS") ? addToSet({}, e.FORBID_TAGS, J) : clone({}), k = objectHasOwnProperty(e, "FORBID_ATTR") ? addToSet({}, e.FORBID_ATTR, J) : clone({}), z = objectHasOwnProperty(e, "USE_PROFILES") ? e.USE_PROFILES : !1, $e = e.ALLOW_ARIA_ATTR !== !1, j = e.ALLOW_DATA_ATTR !== !1, et = e.ALLOW_UNKNOWN_PROTOCOLS || !1, tt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, M = e.SAFE_FOR_TEMPLATES || !1, N = e.SAFE_FOR_XML !== !1, P = e.WHOLE_DOCUMENT || !1, F = e.RETURN_DOM || !1, I = e.RETURN_DOM_FRAGMENT || !1, L = e.RETURN_TRUSTED_TYPE || !1, rt = e.FORCE_BODY || !1, it = e.SANITIZE_DOM !== !1, at = e.SANITIZE_NAMED_PROPS || !1, ot = e.KEEP_CONTENT !== !1, R = e.IN_PLACE || !1, Xe = e.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, W = e.NAMESPACE || U, G = e.MATHML_TEXT_INTEGRATION_POINTS || G, K = e.HTML_INTEGRATION_POINTS || K, D = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && vt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (D.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && vt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (D.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (D.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), M && (j = !1), I && (F = !0), z && (T = addToSet({}, text), E = [], z.html === !0 && (addToSet(T, html$1), addToSet(E, html$2)), z.svg === !0 && (addToSet(T, svg$1), addToSet(E, svg), addToSet(E, xml)), z.svgFilters === !0 && (addToSet(T, svgFilters), addToSet(E, svg), addToSet(E, xml)), z.mathMl === !0 && (addToSet(T, mathMl$1), addToSet(E, mathMl), addToSet(E, xml))), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? A.tagCheck = e.ADD_TAGS : (T === Ze && (T = clone(T)), addToSet(T, e.ADD_TAGS, J))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? A.attributeCheck = e.ADD_ATTR : (E === Qe && (E = clone(E)), addToSet(E, e.ADD_ATTR, J))), e.ADD_URI_SAFE_ATTR && addToSet(ut, e.ADD_URI_SAFE_ATTR, J), e.FORBID_CONTENTS && (B === st && (B = clone(B)), addToSet(B, e.FORBID_CONTENTS, J)), e.ADD_FORBID_CONTENTS && (B === st && (B = clone(B)), addToSet(B, e.ADD_FORBID_CONTENTS, J)), ot && (T["#text"] = !0), P && addToSet(T, [
|
|
677
692
|
"html",
|
|
678
693
|
"head",
|
|
679
694
|
"body"
|
|
@@ -682,28 +697,28 @@ function createDOMPurify() {
|
|
|
682
697
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
683
698
|
y = e.TRUSTED_TYPES_POLICY, b = y.createHTML("");
|
|
684
699
|
} else y === void 0 && (y = _createTrustedTypesPolicy(p, i)), y !== null && typeof b == "string" && (b = y.createHTML(""));
|
|
685
|
-
freeze && freeze(e),
|
|
700
|
+
freeze && freeze(e), Y = e;
|
|
686
701
|
}
|
|
687
|
-
},
|
|
702
|
+
}, bt = addToSet({}, [
|
|
688
703
|
...svg$1,
|
|
689
704
|
...svgFilters,
|
|
690
705
|
...svgDisallowed
|
|
691
|
-
]),
|
|
706
|
+
]), xt = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), St = function(e) {
|
|
692
707
|
let t = v(e);
|
|
693
708
|
(!t || !t.tagName) && (t = {
|
|
694
709
|
namespaceURI: W,
|
|
695
710
|
tagName: "template"
|
|
696
711
|
});
|
|
697
712
|
let n = stringToLowerCase(e.tagName), r = stringToLowerCase(t.tagName);
|
|
698
|
-
return
|
|
699
|
-
},
|
|
713
|
+
return pt[e.namespaceURI] ? e.namespaceURI === H ? t.namespaceURI === U ? n === "svg" : t.namespaceURI === V ? n === "svg" && (r === "annotation-xml" || G[r]) : !!bt[n] : e.namespaceURI === V ? t.namespaceURI === U ? n === "math" : t.namespaceURI === H ? n === "math" && K[r] : !!xt[n] : e.namespaceURI === U ? t.namespaceURI === H && !K[r] || t.namespaceURI === V && !G[r] ? !1 : !xt[n] && (ht[n] || !bt[n]) : !!(q === "application/xhtml+xml" && pt[e.namespaceURI]) : !1;
|
|
714
|
+
}, X = function(e) {
|
|
700
715
|
arrayPush(t.removed, { element: e });
|
|
701
716
|
try {
|
|
702
717
|
v(e).removeChild(e);
|
|
703
718
|
} catch {
|
|
704
719
|
g(e);
|
|
705
720
|
}
|
|
706
|
-
},
|
|
721
|
+
}, Z = function(e, n) {
|
|
707
722
|
try {
|
|
708
723
|
arrayPush(t.removed, {
|
|
709
724
|
attribute: n.getAttributeNode(e),
|
|
@@ -715,55 +730,55 @@ function createDOMPurify() {
|
|
|
715
730
|
from: n
|
|
716
731
|
});
|
|
717
732
|
}
|
|
718
|
-
if (n.removeAttribute(e), e === "is") if (
|
|
719
|
-
|
|
733
|
+
if (n.removeAttribute(e), e === "is") if (F || I) try {
|
|
734
|
+
X(n);
|
|
720
735
|
} catch {}
|
|
721
736
|
else try {
|
|
722
737
|
n.setAttribute(e, "");
|
|
723
738
|
} catch {}
|
|
724
|
-
},
|
|
739
|
+
}, Ct = function(e) {
|
|
725
740
|
let t = null, r = null;
|
|
726
|
-
if (
|
|
741
|
+
if (rt) e = "<remove></remove>" + e;
|
|
727
742
|
else {
|
|
728
743
|
let t = stringMatch(e, /^[\r\n\t ]+/);
|
|
729
744
|
r = t && t[0];
|
|
730
745
|
}
|
|
731
|
-
|
|
746
|
+
q === "application/xhtml+xml" && W === U && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
732
747
|
let i = y ? y.createHTML(e) : e;
|
|
733
748
|
if (W === U) try {
|
|
734
|
-
t = new f().parseFromString(i,
|
|
749
|
+
t = new f().parseFromString(i, q);
|
|
735
750
|
} catch {}
|
|
736
751
|
if (!t || !t.documentElement) {
|
|
737
|
-
t =
|
|
752
|
+
t = Be.createDocument(W, "template", null);
|
|
738
753
|
try {
|
|
739
|
-
t.documentElement.innerHTML =
|
|
754
|
+
t.documentElement.innerHTML = ft ? b : i;
|
|
740
755
|
} catch {}
|
|
741
756
|
}
|
|
742
757
|
let a = t.body || t.documentElement;
|
|
743
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), W === U ?
|
|
744
|
-
}, Ct = function(e) {
|
|
745
|
-
return Be.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
758
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), W === U ? Ue.call(t, P ? "html" : "body")[0] : P ? t.documentElement : a;
|
|
746
759
|
}, wt = function(e) {
|
|
760
|
+
return Ve.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
761
|
+
}, Q = function(e) {
|
|
747
762
|
return e instanceof d && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof u) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
748
763
|
}, Tt = function(e) {
|
|
749
764
|
return typeof s == "function" && e instanceof s;
|
|
750
765
|
};
|
|
751
766
|
function $(e, n, r) {
|
|
752
767
|
arrayForEach(e, (e) => {
|
|
753
|
-
e.call(t, n, r,
|
|
768
|
+
e.call(t, n, r, Y);
|
|
754
769
|
});
|
|
755
770
|
}
|
|
756
771
|
let Et = function(e) {
|
|
757
772
|
let n = null;
|
|
758
|
-
if ($(
|
|
759
|
-
let r =
|
|
760
|
-
if ($(
|
|
773
|
+
if ($(x.beforeSanitizeElements, e, null), Q(e)) return X(e), !0;
|
|
774
|
+
let r = J(e.nodeName);
|
|
775
|
+
if ($(x.uponSanitizeElement, e, {
|
|
761
776
|
tagName: r,
|
|
762
777
|
allowedTags: T
|
|
763
|
-
}),
|
|
764
|
-
if (!(
|
|
778
|
+
}), N && e.hasChildNodes() && !Tt(e.firstElementChild) && regExpTest(/<[/\w!]/g, e.innerHTML) && regExpTest(/<[/\w!]/g, e.textContent) || e.nodeType === NODE_TYPE.progressingInstruction || N && e.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, e.data)) return X(e), !0;
|
|
779
|
+
if (!(A.tagCheck instanceof Function && A.tagCheck(r)) && (!T[r] || O[r])) {
|
|
765
780
|
if (!O[r] && Ot(r) && (D.tagNameCheck instanceof RegExp && regExpTest(D.tagNameCheck, r) || D.tagNameCheck instanceof Function && D.tagNameCheck(r))) return !1;
|
|
766
|
-
if (
|
|
781
|
+
if (ot && !B[r]) {
|
|
767
782
|
let t = v(e) || e.parentNode, n = ze(e) || e.childNodes;
|
|
768
783
|
if (n && t) {
|
|
769
784
|
let r = n.length;
|
|
@@ -773,29 +788,29 @@ function createDOMPurify() {
|
|
|
773
788
|
}
|
|
774
789
|
}
|
|
775
790
|
}
|
|
776
|
-
return
|
|
791
|
+
return X(e), !0;
|
|
777
792
|
}
|
|
778
|
-
return e instanceof c && !
|
|
793
|
+
return e instanceof c && !St(e) || (r === "noscript" || r === "noembed" || r === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, e.innerHTML) ? (X(e), !0) : (M && e.nodeType === NODE_TYPE.text && (n = e.textContent, arrayForEach([
|
|
794
|
+
S,
|
|
779
795
|
C,
|
|
780
|
-
w
|
|
781
|
-
We
|
|
796
|
+
w
|
|
782
797
|
], (e) => {
|
|
783
798
|
n = stringReplace(n, e, " ");
|
|
784
|
-
}), e.textContent !== n && (arrayPush(t.removed, { element: e.cloneNode() }), e.textContent = n)), $(
|
|
799
|
+
}), e.textContent !== n && (arrayPush(t.removed, { element: e.cloneNode() }), e.textContent = n)), $(x.afterSanitizeElements, e, null), !1);
|
|
785
800
|
}, Dt = function(e, t, r) {
|
|
786
|
-
if (
|
|
787
|
-
if (!(
|
|
788
|
-
if (!E[t] ||
|
|
801
|
+
if (it && (t === "id" || t === "name") && (r in n || r in _t)) return !1;
|
|
802
|
+
if (!(j && !k[t] && regExpTest(Ge, t)) && !($e && regExpTest(Ke, t)) && !(A.attributeCheck instanceof Function && A.attributeCheck(t, e))) {
|
|
803
|
+
if (!E[t] || k[t]) {
|
|
789
804
|
if (!(Ot(e) && (D.tagNameCheck instanceof RegExp && regExpTest(D.tagNameCheck, e) || D.tagNameCheck instanceof Function && D.tagNameCheck(e)) && (D.attributeNameCheck instanceof RegExp && regExpTest(D.attributeNameCheck, t) || D.attributeNameCheck instanceof Function && D.attributeNameCheck(t, e)) || t === "is" && D.allowCustomizedBuiltInElements && (D.tagNameCheck instanceof RegExp && regExpTest(D.tagNameCheck, r) || D.tagNameCheck instanceof Function && D.tagNameCheck(r)))) return !1;
|
|
790
|
-
} else if (!
|
|
805
|
+
} else if (!ut[t] && !regExpTest(Xe, stringReplace(r, Je, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && stringIndexOf(r, "data:") === 0 && ct[e]) && !(et && !regExpTest(qe, stringReplace(r, Je, ""))) && r) return !1;
|
|
791
806
|
}
|
|
792
807
|
return !0;
|
|
793
808
|
}, Ot = function(e) {
|
|
794
809
|
return e !== "annotation-xml" && stringMatch(e, Ye);
|
|
795
810
|
}, kt = function(e) {
|
|
796
|
-
$(
|
|
811
|
+
$(x.beforeSanitizeAttributes, e, null);
|
|
797
812
|
let { attributes: n } = e;
|
|
798
|
-
if (!n ||
|
|
813
|
+
if (!n || Q(e)) return;
|
|
799
814
|
let r = {
|
|
800
815
|
attrName: "",
|
|
801
816
|
attrValue: "",
|
|
@@ -804,34 +819,34 @@ function createDOMPurify() {
|
|
|
804
819
|
forceKeepAttr: void 0
|
|
805
820
|
}, i = n.length;
|
|
806
821
|
for (; i--;) {
|
|
807
|
-
let { name: a, namespaceURI: o, value: s } = n[i], c =
|
|
808
|
-
if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, $(
|
|
809
|
-
|
|
822
|
+
let { name: a, namespaceURI: o, value: s } = n[i], c = J(a), l = s, u = a === "value" ? l : stringTrim(l);
|
|
823
|
+
if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, $(x.uponSanitizeAttribute, e, r), u = r.attrValue, at && (c === "id" || c === "name") && (Z(a, e), u = "user-content-" + u), N && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, u)) {
|
|
824
|
+
Z(a, e);
|
|
810
825
|
continue;
|
|
811
826
|
}
|
|
812
827
|
if (c === "attributename" && stringMatch(u, "href")) {
|
|
813
|
-
|
|
828
|
+
Z(a, e);
|
|
814
829
|
continue;
|
|
815
830
|
}
|
|
816
831
|
if (r.forceKeepAttr) continue;
|
|
817
832
|
if (!r.keepAttr) {
|
|
818
|
-
|
|
833
|
+
Z(a, e);
|
|
819
834
|
continue;
|
|
820
835
|
}
|
|
821
|
-
if (!
|
|
822
|
-
|
|
836
|
+
if (!tt && regExpTest(/\/>/i, u)) {
|
|
837
|
+
Z(a, e);
|
|
823
838
|
continue;
|
|
824
839
|
}
|
|
825
|
-
|
|
840
|
+
M && arrayForEach([
|
|
841
|
+
S,
|
|
826
842
|
C,
|
|
827
|
-
w
|
|
828
|
-
We
|
|
843
|
+
w
|
|
829
844
|
], (e) => {
|
|
830
845
|
u = stringReplace(u, e, " ");
|
|
831
846
|
});
|
|
832
|
-
let d =
|
|
847
|
+
let d = J(e.nodeName);
|
|
833
848
|
if (!Dt(d, c, u)) {
|
|
834
|
-
|
|
849
|
+
Z(a, e);
|
|
835
850
|
continue;
|
|
836
851
|
}
|
|
837
852
|
if (y && typeof p == "object" && typeof p.getAttributeType == "function" && !o) switch (p.getAttributeType(d, c)) {
|
|
@@ -843,68 +858,68 @@ function createDOMPurify() {
|
|
|
843
858
|
break;
|
|
844
859
|
}
|
|
845
860
|
if (u !== l) try {
|
|
846
|
-
o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u),
|
|
861
|
+
o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), Q(e) ? X(e) : arrayPop(t.removed);
|
|
847
862
|
} catch {
|
|
848
|
-
|
|
863
|
+
Z(a, e);
|
|
849
864
|
}
|
|
850
865
|
}
|
|
851
|
-
$(
|
|
866
|
+
$(x.afterSanitizeAttributes, e, null);
|
|
852
867
|
}, At = function e(t) {
|
|
853
|
-
let n = null, r =
|
|
854
|
-
for ($(
|
|
855
|
-
$(
|
|
868
|
+
let n = null, r = wt(t);
|
|
869
|
+
for ($(x.beforeSanitizeShadowDOM, t, null); n = r.nextNode();) $(x.uponSanitizeShadowNode, n, null), Et(n), kt(n), n.content instanceof a && e(n.content);
|
|
870
|
+
$(x.afterSanitizeShadowDOM, t, null);
|
|
856
871
|
};
|
|
857
872
|
return t.sanitize = function(e) {
|
|
858
873
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
|
|
859
|
-
if (
|
|
874
|
+
if (ft = !e, ft && (e = "<!-->"), typeof e != "string" && !Tt(e)) if (typeof e.toString == "function") {
|
|
860
875
|
if (e = e.toString(), typeof e != "string") throw typeErrorCreate("dirty is not a string, aborting");
|
|
861
876
|
} else throw typeErrorCreate("toString is not a function");
|
|
862
877
|
if (!t.isSupported) return e;
|
|
863
|
-
if (
|
|
878
|
+
if (nt || yt(n), t.removed = [], typeof e == "string" && (R = !1), R) {
|
|
864
879
|
if (e.nodeName) {
|
|
865
|
-
let t =
|
|
880
|
+
let t = J(e.nodeName);
|
|
866
881
|
if (!T[t] || O[t]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
|
|
867
882
|
}
|
|
868
|
-
} else if (e instanceof s) i =
|
|
883
|
+
} else if (e instanceof s) i = Ct("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === NODE_TYPE.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
|
|
869
884
|
else {
|
|
870
|
-
if (!
|
|
871
|
-
if (i =
|
|
885
|
+
if (!F && !M && !P && e.indexOf("<") === -1) return y && L ? y.createHTML(e) : e;
|
|
886
|
+
if (i = Ct(e), !i) return F ? null : L ? b : "";
|
|
872
887
|
}
|
|
873
|
-
i &&
|
|
874
|
-
let u =
|
|
888
|
+
i && rt && X(i.firstChild);
|
|
889
|
+
let u = wt(R ? e : i);
|
|
875
890
|
for (; c = u.nextNode();) Et(c), kt(c), c.content instanceof a && At(c.content);
|
|
876
|
-
if (
|
|
877
|
-
if (
|
|
878
|
-
if (
|
|
891
|
+
if (R) return e;
|
|
892
|
+
if (F) {
|
|
893
|
+
if (I) for (l = He.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
|
|
879
894
|
else l = i;
|
|
880
|
-
return (E.shadowroot || E.shadowrootmode) && (l =
|
|
895
|
+
return (E.shadowroot || E.shadowrootmode) && (l = We.call(r, l, !0)), l;
|
|
881
896
|
}
|
|
882
|
-
let d =
|
|
883
|
-
return
|
|
897
|
+
let d = P ? i.outerHTML : i.innerHTML;
|
|
898
|
+
return P && T["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), M && arrayForEach([
|
|
899
|
+
S,
|
|
884
900
|
C,
|
|
885
|
-
w
|
|
886
|
-
We
|
|
901
|
+
w
|
|
887
902
|
], (e) => {
|
|
888
903
|
d = stringReplace(d, e, " ");
|
|
889
|
-
}), y &&
|
|
904
|
+
}), y && L ? y.createHTML(d) : d;
|
|
890
905
|
}, t.setConfig = function() {
|
|
891
|
-
|
|
906
|
+
yt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), nt = !0;
|
|
892
907
|
}, t.clearConfig = function() {
|
|
893
|
-
|
|
908
|
+
Y = null, nt = !1;
|
|
894
909
|
}, t.isValidAttribute = function(e, t, n) {
|
|
895
|
-
return
|
|
910
|
+
return Y || yt({}), Dt(J(e), J(t), n);
|
|
896
911
|
}, t.addHook = function(e, t) {
|
|
897
|
-
typeof t == "function" && arrayPush(
|
|
912
|
+
typeof t == "function" && arrayPush(x[e], t);
|
|
898
913
|
}, t.removeHook = function(e, t) {
|
|
899
914
|
if (t !== void 0) {
|
|
900
|
-
let n = arrayLastIndexOf(
|
|
901
|
-
return n === -1 ? void 0 : arraySplice(
|
|
915
|
+
let n = arrayLastIndexOf(x[e], t);
|
|
916
|
+
return n === -1 ? void 0 : arraySplice(x[e], n, 1)[0];
|
|
902
917
|
}
|
|
903
|
-
return arrayPop(
|
|
918
|
+
return arrayPop(x[e]);
|
|
904
919
|
}, t.removeHooks = function(e) {
|
|
905
|
-
|
|
920
|
+
x[e] = [];
|
|
906
921
|
}, t.removeAllHooks = function() {
|
|
907
|
-
|
|
922
|
+
x = _createHooksMap();
|
|
908
923
|
}, t;
|
|
909
924
|
}
|
|
910
925
|
var purify = createDOMPurify(), HTMLConfig = { sanitize: (e) => purify.sanitize(e) }, html = (e, ...t) => new HTMLLiteralResult(e.reduce((e, n, r) => {
|
|
@@ -1406,12 +1421,17 @@ var component_default$3 = ":host{--host-display:inline-flex;--scorad-label-text-
|
|
|
1406
1421
|
}
|
|
1407
1422
|
renderLevel(e) {
|
|
1408
1423
|
let t = (t) => {
|
|
1409
|
-
t && t.addEventListener("value-input", (t) => {
|
|
1424
|
+
t && (t.addEventListener("value-input", (t) => {
|
|
1410
1425
|
this.value = {
|
|
1411
1426
|
...this.value,
|
|
1412
1427
|
[e]: t.detail
|
|
1413
|
-
}, this.valueInput(this.value);
|
|
1414
|
-
})
|
|
1428
|
+
}, this.errors = void 0, this.valueInput(this.value);
|
|
1429
|
+
}), t.addEventListener("value-change", (t) => {
|
|
1430
|
+
this.value = {
|
|
1431
|
+
...this.value,
|
|
1432
|
+
[e]: t.detail
|
|
1433
|
+
}, this.errors = void 0, this.valueChange(this.value);
|
|
1434
|
+
}));
|
|
1415
1435
|
}, n = ScoradResources.subjective[e];
|
|
1416
1436
|
return html`
|
|
1417
1437
|
<scorad-label class="${toKebabCase(e)} row"
|
|
@@ -1478,12 +1498,12 @@ const getScoradScore = (e) => {
|
|
|
1478
1498
|
let t = validateScoradData(e);
|
|
1479
1499
|
if (t instanceof Failure) return t;
|
|
1480
1500
|
e = t.value;
|
|
1481
|
-
let n = selectScoradWeights(e), r = Object.entries(e.extent).reduce((e, [t, r]) => e + r * n[t], 0), i = Object.values(e.intensity).reduce((e, t) => e + t, 0), a = e.subjective.pruritus + e.subjective.sleeplessness, o = Math.round((r / 5 + 7 * i / 2 + a)
|
|
1501
|
+
let n = selectScoradWeights(e), r = Object.entries(e.extent).reduce((e, [t, r]) => e + r * n[t], 0), i = Object.values(e.intensity).reduce((e, t) => e + t, 0), a = e.subjective.pruritus + e.subjective.sleeplessness, o = (e) => Math.round((e + 2 ** -52) * 100) / 100, s = o(r / 5 + 7 * i / 2 + a);
|
|
1482
1502
|
return Result.Ok({
|
|
1483
|
-
A: r,
|
|
1503
|
+
A: o(r),
|
|
1484
1504
|
B: i,
|
|
1485
1505
|
C: a,
|
|
1486
|
-
total:
|
|
1506
|
+
total: s
|
|
1487
1507
|
});
|
|
1488
1508
|
};
|
|
1489
1509
|
var component_default$1 = ":host{--host-display:var(--scorad-label-display,inline-flex);--host-options:var(--scorad-label-options,solid 1px var(--host-color));--host-text-min-width:var(--scorad-label-text-min-width,none);--host-text-max-width:var(--scorad-label-text-max-width,none);grid-column:1/3;grid-template-columns:subgrid;padding:var(--host-padding-unit);border-radius:var(--host-border-radius-outer);flex-wrap:wrap;align-content:baseline;align-items:baseline;position:relative}:host(:hover){outline:var(--host-outline-hover)}:host(:focus-within){outline:var(--host-outline-focus)}:host>label{min-width:var(--host-text-min-width);max-width:var(--host-text-max-width)}:host>label>slot[name=text]{transition:all .2s ease-in-out;display:block}:host>label>slot[name=description]{opacity:0;margin-bottom:-1.1em;transition:all .4s ease-in-out;display:block}:host(:hover)>label>slot[name=text],:host(:focus-within)>label>slot[name=text]{transform:translateY(-.5em)}:host(:hover)>label>slot[name=description],:host(:focus-within)>label>slot[name=description]{opacity:.667;transform:translateY(-.6em)}@media print{:host>label>slot[name=text]{transform:translateY(-.5em)}:host>label>slot[name=description]{opacity:.667;transform:translateY(-.6em)}}:host>label{padding:var(--host-padding-unit);flex:1;padding-left:0}", tag$1 = "scorad-label", HTMLScoradLabelElement = class extends HTMLComponentElement {
|
|
@@ -1527,10 +1547,10 @@ var tag = "scorad-component", HTMLScoradElement = class extends HTMLComponentEle
|
|
|
1527
1547
|
if (!this.shadowRoot) return;
|
|
1528
1548
|
let e = this.shadowRoot.querySelector("#score");
|
|
1529
1549
|
if (!e) return;
|
|
1530
|
-
let t = getScoradScore(this.value).orNull(), n = {}, r = validateScoradData(this.value).
|
|
1550
|
+
let t = getScoradScore(this.value).orNull(), n = Object.freeze({}), r = validateScoradData(this.value).fold((e) => n, (e) => e.reduce((e, t) => {
|
|
1531
1551
|
let n = t.indexOf(":");
|
|
1532
1552
|
return setValue(e, t.substring(0, n), t.substring(n + 2));
|
|
1533
|
-
}, n);
|
|
1553
|
+
}, n));
|
|
1534
1554
|
e.innerText = `${t?.total ?? "Get Score"}`, e.style.color = this.showErrors && r != n ? "var(--host-error-color)" : "";
|
|
1535
1555
|
let i = this.shadowRoot.querySelector("scorad-subjective");
|
|
1536
1556
|
i && (i.value = this.value?.subjective ?? SCORAD_SUBJECTIVE_DEFAULT, i.score = t?.B, i.readonly = this.readonly, this.showErrors && (i.errors = getValue(r, "subjective")));
|
|
@@ -1612,7 +1632,7 @@ var tag = "scorad-component", HTMLScoradElement = class extends HTMLComponentEle
|
|
|
1612
1632
|
|
|
1613
1633
|
<scorad-label id="score-label"
|
|
1614
1634
|
text="SCORAD"
|
|
1615
|
-
description="(A / 5) + (7
|
|
1635
|
+
description="(A / 5) + (7 × B / 2) + C"
|
|
1616
1636
|
${(e) => {
|
|
1617
1637
|
e instanceof HTMLScoradLabelElement && e.addEventListener("click", () => {
|
|
1618
1638
|
if (!this.shadowRoot) return;
|
|
@@ -1641,4 +1661,4 @@ __decorate([Att({
|
|
|
1641
1661
|
delegatesFocus: !0
|
|
1642
1662
|
})], HTMLScoradElement);
|
|
1643
1663
|
const componentsScoradLogger = provideLogger("@ntix/components-scorad", typeof ANTIX_COMPONENTS_SCORAD_LOG_LEVEL > "u" ? LogLevel.warn : ANTIX_COMPONENTS_SCORAD_LOG_LEVEL);
|
|
1644
|
-
export { HTMLScoradElement, HTMLScoradExtentElement, HTMLScoradIntensityElement, HTMLScoradLabelElement, HTMLScoradOptionsElement, HTMLScoradSubjectiveElement, HTMLScoradWeightingsElement, SCORAD_ADULT_WEIGHTS, SCORAD_CHILD_WEIGHTS, SCORAD_DEFAULT, SCORAD_EXTENT_DEFAULT, SCORAD_EXTENT_MAX_VALUE, SCORAD_INTENSITY_DEFAULT, SCORAD_INTENSITY_MAX_VALUE, SCORAD_SUBJECTIVE_DEFAULT, SCORAD_SUBJECTIVE_MAX_VALUE, ScoradResources, componentsScoradLogger, getScoradScore, selectScoradWeights, validateScoradData };
|
|
1664
|
+
export { Failure, HTMLScoradElement, HTMLScoradExtentElement, HTMLScoradIntensityElement, HTMLScoradLabelElement, HTMLScoradOptionsElement, HTMLScoradSubjectiveElement, HTMLScoradWeightingsElement, LogLevel, Result, SCORAD_ADULT_WEIGHTS, SCORAD_CHILD_WEIGHTS, SCORAD_DEFAULT, SCORAD_EXTENT_DEFAULT, SCORAD_EXTENT_MAX_VALUE, SCORAD_INTENSITY_DEFAULT, SCORAD_INTENSITY_MAX_VALUE, SCORAD_SUBJECTIVE_DEFAULT, SCORAD_SUBJECTIVE_MAX_VALUE, ScoradResources, Success, componentsScoradLogger, getScoradScore, selectScoradWeights, validateScoradData };
|