@opensystemslab/map 0.7.1 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/component-lib.es.js +4 -27337
- package/dist/component-lib.umd.js +126 -40
- package/dist/html2canvas.esm-f5b1510b.mjs +4493 -0
- package/dist/index-fe50023b.mjs +37561 -0
- package/dist/index.es-ded369f5.mjs +5567 -0
- package/dist/index.html +3 -3
- package/dist/purify.es-22c1781a.mjs +451 -0
- package/dist/style.css +1 -1
- package/package.json +9 -4
- package/types/components/my-map/controls.d.ts +30 -0
- package/types/components/my-map/index.d.ts +1 -0
package/dist/index.html
CHANGED
@@ -39,11 +39,11 @@
|
|
39
39
|
}
|
40
40
|
</style> -->
|
41
41
|
</head>
|
42
|
-
<body>
|
42
|
+
<body style="font-family:Inter,Helvetica,sans-serif;">
|
43
43
|
<div style="display:flex;flex-direction:column;">
|
44
|
-
<h1 style="color:red;font-
|
44
|
+
<h1 style="color:red;font-size:16px;">*** This is a testing sandbox - these components are unaware of each other! ***</h1>
|
45
45
|
<div style="margin-bottom:1em">
|
46
|
-
<my-map zoom="20" maxZoom="23"
|
46
|
+
<my-map zoom="20" maxZoom="23" id="example-map" useScaleBarStyle showScale showNorthArrow showPrint osProxyEndpoint="https://api.editor.planx.dev/proxy/ordnance-survey" />
|
47
47
|
</div>
|
48
48
|
<div style="margin-bottom:1em">
|
49
49
|
<postcode-search hintText="Optional hint text shows up here" id="example-postcode" />
|
@@ -0,0 +1,451 @@
|
|
1
|
+
function C(r) {
|
2
|
+
return C = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
3
|
+
return typeof n;
|
4
|
+
} : function(n) {
|
5
|
+
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
6
|
+
}, C(r);
|
7
|
+
}
|
8
|
+
function ke(r, n) {
|
9
|
+
return ke = Object.setPrototypeOf || function(s, f) {
|
10
|
+
return s.__proto__ = f, s;
|
11
|
+
}, ke(r, n);
|
12
|
+
}
|
13
|
+
function Pt() {
|
14
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
15
|
+
return !1;
|
16
|
+
if (typeof Proxy == "function")
|
17
|
+
return !0;
|
18
|
+
try {
|
19
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
20
|
+
})), !0;
|
21
|
+
} catch {
|
22
|
+
return !1;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
function oe(r, n, o) {
|
26
|
+
return Pt() ? oe = Reflect.construct : oe = function(f, O, L) {
|
27
|
+
var N = [null];
|
28
|
+
N.push.apply(N, O);
|
29
|
+
var W = Function.bind.apply(f, N), $ = new W();
|
30
|
+
return L && ke($, L.prototype), $;
|
31
|
+
}, oe.apply(null, arguments);
|
32
|
+
}
|
33
|
+
function S(r) {
|
34
|
+
return Ft(r) || Ut(r) || Ht(r) || zt();
|
35
|
+
}
|
36
|
+
function Ft(r) {
|
37
|
+
if (Array.isArray(r))
|
38
|
+
return Pe(r);
|
39
|
+
}
|
40
|
+
function Ut(r) {
|
41
|
+
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null)
|
42
|
+
return Array.from(r);
|
43
|
+
}
|
44
|
+
function Ht(r, n) {
|
45
|
+
if (!!r) {
|
46
|
+
if (typeof r == "string")
|
47
|
+
return Pe(r, n);
|
48
|
+
var o = Object.prototype.toString.call(r).slice(8, -1);
|
49
|
+
if (o === "Object" && r.constructor && (o = r.constructor.name), o === "Map" || o === "Set")
|
50
|
+
return Array.from(r);
|
51
|
+
if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))
|
52
|
+
return Pe(r, n);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
function Pe(r, n) {
|
56
|
+
(n == null || n > r.length) && (n = r.length);
|
57
|
+
for (var o = 0, s = new Array(n); o < n; o++)
|
58
|
+
s[o] = r[o];
|
59
|
+
return s;
|
60
|
+
}
|
61
|
+
function zt() {
|
62
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
63
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
64
|
+
}
|
65
|
+
var Gt = Object.hasOwnProperty, ot = Object.setPrototypeOf, Bt = Object.isFrozen, Wt = Object.getPrototypeOf, $t = Object.getOwnPropertyDescriptor, A = Object.freeze, R = Object.seal, jt = Object.create, mt = typeof Reflect < "u" && Reflect, se = mt.apply, Fe = mt.construct;
|
66
|
+
se || (se = function(n, o, s) {
|
67
|
+
return n.apply(o, s);
|
68
|
+
});
|
69
|
+
A || (A = function(n) {
|
70
|
+
return n;
|
71
|
+
});
|
72
|
+
R || (R = function(n) {
|
73
|
+
return n;
|
74
|
+
});
|
75
|
+
Fe || (Fe = function(n, o) {
|
76
|
+
return oe(n, S(o));
|
77
|
+
});
|
78
|
+
var Yt = y(Array.prototype.forEach), lt = y(Array.prototype.pop), X = y(Array.prototype.push), le = y(String.prototype.toLowerCase), Le = y(String.prototype.toString), Vt = y(String.prototype.match), b = y(String.prototype.replace), Xt = y(String.prototype.indexOf), qt = y(String.prototype.trim), _ = y(RegExp.prototype.test), Me = Kt(TypeError);
|
79
|
+
function y(r) {
|
80
|
+
return function(n) {
|
81
|
+
for (var o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), f = 1; f < o; f++)
|
82
|
+
s[f - 1] = arguments[f];
|
83
|
+
return se(r, n, s);
|
84
|
+
};
|
85
|
+
}
|
86
|
+
function Kt(r) {
|
87
|
+
return function() {
|
88
|
+
for (var n = arguments.length, o = new Array(n), s = 0; s < n; s++)
|
89
|
+
o[s] = arguments[s];
|
90
|
+
return Fe(r, o);
|
91
|
+
};
|
92
|
+
}
|
93
|
+
function l(r, n, o) {
|
94
|
+
o = o || le, ot && ot(r, null);
|
95
|
+
for (var s = n.length; s--; ) {
|
96
|
+
var f = n[s];
|
97
|
+
if (typeof f == "string") {
|
98
|
+
var O = o(f);
|
99
|
+
O !== f && (Bt(n) || (n[s] = O), f = O);
|
100
|
+
}
|
101
|
+
r[f] = !0;
|
102
|
+
}
|
103
|
+
return r;
|
104
|
+
}
|
105
|
+
function P(r) {
|
106
|
+
var n = jt(null), o;
|
107
|
+
for (o in r)
|
108
|
+
se(Gt, r, [o]) === !0 && (n[o] = r[o]);
|
109
|
+
return n;
|
110
|
+
}
|
111
|
+
function ne(r, n) {
|
112
|
+
for (; r !== null; ) {
|
113
|
+
var o = $t(r, n);
|
114
|
+
if (o) {
|
115
|
+
if (o.get)
|
116
|
+
return y(o.get);
|
117
|
+
if (typeof o.value == "function")
|
118
|
+
return y(o.value);
|
119
|
+
}
|
120
|
+
r = Wt(r);
|
121
|
+
}
|
122
|
+
function s(f) {
|
123
|
+
return console.warn("fallback value for", f), null;
|
124
|
+
}
|
125
|
+
return s;
|
126
|
+
}
|
127
|
+
var st = A(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), we = A(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ie = A(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Zt = A(["animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Ce = A(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"]), Jt = A(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ut = A(["#text"]), ft = A(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]), xe = A(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ct = A(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), ie = A(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Qt = R(/\{\{[\w\W]*|[\w\W]*\}\}/gm), er = R(/<%[\w\W]*|[\w\W]*%>/gm), tr = R(/\${[\w\W]*}/gm), rr = R(/^data-[\-\w.\u00B7-\uFFFF]/), ar = R(/^aria-[\-\w]+$/), nr = R(
|
128
|
+
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
129
|
+
), ir = R(/^(?:\w+script|data):/i), or = R(
|
130
|
+
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
131
|
+
), lr = R(/^html$/i), sr = function() {
|
132
|
+
return typeof window > "u" ? null : window;
|
133
|
+
}, ur = function(n, o) {
|
134
|
+
if (C(n) !== "object" || typeof n.createPolicy != "function")
|
135
|
+
return null;
|
136
|
+
var s = null, f = "data-tt-policy-suffix";
|
137
|
+
o.currentScript && o.currentScript.hasAttribute(f) && (s = o.currentScript.getAttribute(f));
|
138
|
+
var O = "dompurify" + (s ? "#" + s : "");
|
139
|
+
try {
|
140
|
+
return n.createPolicy(O, {
|
141
|
+
createHTML: function(N) {
|
142
|
+
return N;
|
143
|
+
},
|
144
|
+
createScriptURL: function(N) {
|
145
|
+
return N;
|
146
|
+
}
|
147
|
+
});
|
148
|
+
} catch {
|
149
|
+
return console.warn("TrustedTypes policy " + O + " could not be created."), null;
|
150
|
+
}
|
151
|
+
};
|
152
|
+
function pt() {
|
153
|
+
var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : sr(), n = function(e) {
|
154
|
+
return pt(e);
|
155
|
+
};
|
156
|
+
if (n.version = "2.4.3", n.removed = [], !r || !r.document || r.document.nodeType !== 9)
|
157
|
+
return n.isSupported = !1, n;
|
158
|
+
var o = r.document, s = r.document, f = r.DocumentFragment, O = r.HTMLTemplateElement, L = r.Node, N = r.Element, W = r.NodeFilter, $ = r.NamedNodeMap, dt = $ === void 0 ? r.NamedNodeMap || r.MozNamedAttrMap : $, vt = r.HTMLFormElement, Tt = r.DOMParser, q = r.trustedTypes, K = N.prototype, ht = ne(K, "cloneNode"), _t = ne(K, "nextSibling"), At = ne(K, "childNodes"), ue = ne(K, "parentNode");
|
159
|
+
if (typeof O == "function") {
|
160
|
+
var fe = s.createElement("template");
|
161
|
+
fe.content && fe.content.ownerDocument && (s = fe.content.ownerDocument);
|
162
|
+
}
|
163
|
+
var g = ur(q, o), ce = g ? g.createHTML("") : "", Z = s, me = Z.implementation, Et = Z.createNodeIterator, yt = Z.createDocumentFragment, gt = Z.getElementsByTagName, bt = o.importNode, Ue = {};
|
164
|
+
try {
|
165
|
+
Ue = P(s).documentMode ? s.documentMode : {};
|
166
|
+
} catch {
|
167
|
+
}
|
168
|
+
var D = {};
|
169
|
+
n.isSupported = typeof ue == "function" && me && typeof me.createHTMLDocument < "u" && Ue !== 9;
|
170
|
+
var pe = Qt, de = er, ve = tr, St = rr, Rt = ar, Ot = ir, He = or, Te = nr, m = null, ze = l({}, [].concat(S(st), S(we), S(Ie), S(Ce), S(ut))), v = null, Ge = l({}, [].concat(S(ft), S(xe), S(ct), S(ie))), c = Object.seal(Object.create(null, {
|
171
|
+
tagNameCheck: {
|
172
|
+
writable: !0,
|
173
|
+
configurable: !1,
|
174
|
+
enumerable: !0,
|
175
|
+
value: null
|
176
|
+
},
|
177
|
+
attributeNameCheck: {
|
178
|
+
writable: !0,
|
179
|
+
configurable: !1,
|
180
|
+
enumerable: !0,
|
181
|
+
value: null
|
182
|
+
},
|
183
|
+
allowCustomizedBuiltInElements: {
|
184
|
+
writable: !0,
|
185
|
+
configurable: !1,
|
186
|
+
enumerable: !0,
|
187
|
+
value: !1
|
188
|
+
}
|
189
|
+
})), j = null, he = null, Be = !0, _e = !0, We = !1, F = !1, x = !1, Ae = !1, Ee = !1, U = !1, J = !1, Q = !1, $e = !0, je = !1, Nt = "user-content-", ye = !0, Y = !1, H = {}, z = null, Ye = l({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]), Ve = null, Xe = l({}, ["audio", "video", "img", "source", "image", "track"]), ge = null, qe = l({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ee = "http://www.w3.org/1998/Math/MathML", te = "http://www.w3.org/2000/svg", M = "http://www.w3.org/1999/xhtml", G = M, be = !1, Se = null, Dt = l({}, [ee, te, M], Le), k, Lt = ["application/xhtml+xml", "text/html"], Mt = "text/html", p, B = null, wt = s.createElement("form"), Ke = function(e) {
|
190
|
+
return e instanceof RegExp || e instanceof Function;
|
191
|
+
}, Re = function(e) {
|
192
|
+
B && B === e || ((!e || C(e) !== "object") && (e = {}), e = P(e), k = Lt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? k = Mt : k = e.PARSER_MEDIA_TYPE, p = k === "application/xhtml+xml" ? Le : le, m = "ALLOWED_TAGS" in e ? l({}, e.ALLOWED_TAGS, p) : ze, v = "ALLOWED_ATTR" in e ? l({}, e.ALLOWED_ATTR, p) : Ge, Se = "ALLOWED_NAMESPACES" in e ? l({}, e.ALLOWED_NAMESPACES, Le) : Dt, ge = "ADD_URI_SAFE_ATTR" in e ? l(
|
193
|
+
P(qe),
|
194
|
+
e.ADD_URI_SAFE_ATTR,
|
195
|
+
p
|
196
|
+
) : qe, Ve = "ADD_DATA_URI_TAGS" in e ? l(
|
197
|
+
P(Xe),
|
198
|
+
e.ADD_DATA_URI_TAGS,
|
199
|
+
p
|
200
|
+
) : Xe, z = "FORBID_CONTENTS" in e ? l({}, e.FORBID_CONTENTS, p) : Ye, j = "FORBID_TAGS" in e ? l({}, e.FORBID_TAGS, p) : {}, he = "FORBID_ATTR" in e ? l({}, e.FORBID_ATTR, p) : {}, H = "USE_PROFILES" in e ? e.USE_PROFILES : !1, Be = e.ALLOW_ARIA_ATTR !== !1, _e = e.ALLOW_DATA_ATTR !== !1, We = e.ALLOW_UNKNOWN_PROTOCOLS || !1, F = e.SAFE_FOR_TEMPLATES || !1, x = e.WHOLE_DOCUMENT || !1, U = e.RETURN_DOM || !1, J = e.RETURN_DOM_FRAGMENT || !1, Q = e.RETURN_TRUSTED_TYPE || !1, Ee = e.FORCE_BODY || !1, $e = e.SANITIZE_DOM !== !1, je = e.SANITIZE_NAMED_PROPS || !1, ye = e.KEEP_CONTENT !== !1, Y = e.IN_PLACE || !1, Te = e.ALLOWED_URI_REGEXP || Te, G = e.NAMESPACE || M, e.CUSTOM_ELEMENT_HANDLING && Ke(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (c.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Ke(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (c.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (c.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), F && (_e = !1), J && (U = !0), H && (m = l({}, S(ut)), v = [], H.html === !0 && (l(m, st), l(v, ft)), H.svg === !0 && (l(m, we), l(v, xe), l(v, ie)), H.svgFilters === !0 && (l(m, Ie), l(v, xe), l(v, ie)), H.mathMl === !0 && (l(m, Ce), l(v, ct), l(v, ie))), e.ADD_TAGS && (m === ze && (m = P(m)), l(m, e.ADD_TAGS, p)), e.ADD_ATTR && (v === Ge && (v = P(v)), l(v, e.ADD_ATTR, p)), e.ADD_URI_SAFE_ATTR && l(ge, e.ADD_URI_SAFE_ATTR, p), e.FORBID_CONTENTS && (z === Ye && (z = P(z)), l(z, e.FORBID_CONTENTS, p)), ye && (m["#text"] = !0), x && l(m, ["html", "head", "body"]), m.table && (l(m, ["tbody"]), delete j.tbody), A && A(e), B = e);
|
201
|
+
}, Ze = l({}, ["mi", "mo", "mn", "ms", "mtext"]), Je = l({}, ["foreignobject", "desc", "title", "annotation-xml"]), It = l({}, ["title", "style", "font", "a", "script"]), re = l({}, we);
|
202
|
+
l(re, Ie), l(re, Zt);
|
203
|
+
var Oe = l({}, Ce);
|
204
|
+
l(Oe, Jt);
|
205
|
+
var Ct = function(e) {
|
206
|
+
var t = ue(e);
|
207
|
+
(!t || !t.tagName) && (t = {
|
208
|
+
namespaceURI: G,
|
209
|
+
tagName: "template"
|
210
|
+
});
|
211
|
+
var a = le(e.tagName), u = le(t.tagName);
|
212
|
+
return Se[e.namespaceURI] ? e.namespaceURI === te ? t.namespaceURI === M ? a === "svg" : t.namespaceURI === ee ? a === "svg" && (u === "annotation-xml" || Ze[u]) : Boolean(re[a]) : e.namespaceURI === ee ? t.namespaceURI === M ? a === "math" : t.namespaceURI === te ? a === "math" && Je[u] : Boolean(Oe[a]) : e.namespaceURI === M ? t.namespaceURI === te && !Je[u] || t.namespaceURI === ee && !Ze[u] ? !1 : !Oe[a] && (It[a] || !re[a]) : !!(k === "application/xhtml+xml" && Se[e.namespaceURI]) : !1;
|
213
|
+
}, w = function(e) {
|
214
|
+
X(n.removed, {
|
215
|
+
element: e
|
216
|
+
});
|
217
|
+
try {
|
218
|
+
e.parentNode.removeChild(e);
|
219
|
+
} catch {
|
220
|
+
try {
|
221
|
+
e.outerHTML = ce;
|
222
|
+
} catch {
|
223
|
+
e.remove();
|
224
|
+
}
|
225
|
+
}
|
226
|
+
}, Ne = function(e, t) {
|
227
|
+
try {
|
228
|
+
X(n.removed, {
|
229
|
+
attribute: t.getAttributeNode(e),
|
230
|
+
from: t
|
231
|
+
});
|
232
|
+
} catch {
|
233
|
+
X(n.removed, {
|
234
|
+
attribute: null,
|
235
|
+
from: t
|
236
|
+
});
|
237
|
+
}
|
238
|
+
if (t.removeAttribute(e), e === "is" && !v[e])
|
239
|
+
if (U || J)
|
240
|
+
try {
|
241
|
+
w(t);
|
242
|
+
} catch {
|
243
|
+
}
|
244
|
+
else
|
245
|
+
try {
|
246
|
+
t.setAttribute(e, "");
|
247
|
+
} catch {
|
248
|
+
}
|
249
|
+
}, Qe = function(e) {
|
250
|
+
var t, a;
|
251
|
+
if (Ee)
|
252
|
+
e = "<remove></remove>" + e;
|
253
|
+
else {
|
254
|
+
var u = Vt(e, /^[\r\n\t ]+/);
|
255
|
+
a = u && u[0];
|
256
|
+
}
|
257
|
+
k === "application/xhtml+xml" && G === M && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
258
|
+
var E = g ? g.createHTML(e) : e;
|
259
|
+
if (G === M)
|
260
|
+
try {
|
261
|
+
t = new Tt().parseFromString(E, k);
|
262
|
+
} catch {
|
263
|
+
}
|
264
|
+
if (!t || !t.documentElement) {
|
265
|
+
t = me.createDocument(G, "template", null);
|
266
|
+
try {
|
267
|
+
t.documentElement.innerHTML = be ? ce : E;
|
268
|
+
} catch {
|
269
|
+
}
|
270
|
+
}
|
271
|
+
var h = t.body || t.documentElement;
|
272
|
+
return e && a && h.insertBefore(s.createTextNode(a), h.childNodes[0] || null), G === M ? gt.call(t, x ? "html" : "body")[0] : x ? t.documentElement : h;
|
273
|
+
}, et = function(e) {
|
274
|
+
return Et.call(
|
275
|
+
e.ownerDocument || e,
|
276
|
+
e,
|
277
|
+
W.SHOW_ELEMENT | W.SHOW_COMMENT | W.SHOW_TEXT,
|
278
|
+
null,
|
279
|
+
!1
|
280
|
+
);
|
281
|
+
}, xt = function(e) {
|
282
|
+
return e instanceof vt && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof dt) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
283
|
+
}, V = function(e) {
|
284
|
+
return C(L) === "object" ? e instanceof L : e && C(e) === "object" && typeof e.nodeType == "number" && typeof e.nodeName == "string";
|
285
|
+
}, I = function(e, t, a) {
|
286
|
+
!D[e] || Yt(D[e], function(u) {
|
287
|
+
u.call(n, t, a, B);
|
288
|
+
});
|
289
|
+
}, tt = function(e) {
|
290
|
+
var t;
|
291
|
+
if (I("beforeSanitizeElements", e, null), xt(e) || _(/[\u0080-\uFFFF]/, e.nodeName))
|
292
|
+
return w(e), !0;
|
293
|
+
var a = p(e.nodeName);
|
294
|
+
if (I("uponSanitizeElement", e, {
|
295
|
+
tagName: a,
|
296
|
+
allowedTags: m
|
297
|
+
}), e.hasChildNodes() && !V(e.firstElementChild) && (!V(e.content) || !V(e.content.firstElementChild)) && _(/<[/\w]/g, e.innerHTML) && _(/<[/\w]/g, e.textContent) || a === "select" && _(/<template/i, e.innerHTML))
|
298
|
+
return w(e), !0;
|
299
|
+
if (!m[a] || j[a]) {
|
300
|
+
if (!j[a] && at(a) && (c.tagNameCheck instanceof RegExp && _(c.tagNameCheck, a) || c.tagNameCheck instanceof Function && c.tagNameCheck(a)))
|
301
|
+
return !1;
|
302
|
+
if (ye && !z[a]) {
|
303
|
+
var u = ue(e) || e.parentNode, E = At(e) || e.childNodes;
|
304
|
+
if (E && u)
|
305
|
+
for (var h = E.length, T = h - 1; T >= 0; --T)
|
306
|
+
u.insertBefore(ht(E[T], !0), _t(e));
|
307
|
+
}
|
308
|
+
return w(e), !0;
|
309
|
+
}
|
310
|
+
return e instanceof N && !Ct(e) || (a === "noscript" || a === "noembed") && _(/<\/no(script|embed)/i, e.innerHTML) ? (w(e), !0) : (F && e.nodeType === 3 && (t = e.textContent, t = b(t, pe, " "), t = b(t, de, " "), t = b(t, ve, " "), e.textContent !== t && (X(n.removed, {
|
311
|
+
element: e.cloneNode()
|
312
|
+
}), e.textContent = t)), I("afterSanitizeElements", e, null), !1);
|
313
|
+
}, rt = function(e, t, a) {
|
314
|
+
if ($e && (t === "id" || t === "name") && (a in s || a in wt))
|
315
|
+
return !1;
|
316
|
+
if (!(_e && !he[t] && _(St, t))) {
|
317
|
+
if (!(Be && _(Rt, t))) {
|
318
|
+
if (!v[t] || he[t]) {
|
319
|
+
if (!(at(e) && (c.tagNameCheck instanceof RegExp && _(c.tagNameCheck, e) || c.tagNameCheck instanceof Function && c.tagNameCheck(e)) && (c.attributeNameCheck instanceof RegExp && _(c.attributeNameCheck, t) || c.attributeNameCheck instanceof Function && c.attributeNameCheck(t)) || t === "is" && c.allowCustomizedBuiltInElements && (c.tagNameCheck instanceof RegExp && _(c.tagNameCheck, a) || c.tagNameCheck instanceof Function && c.tagNameCheck(a))))
|
320
|
+
return !1;
|
321
|
+
} else if (!ge[t]) {
|
322
|
+
if (!_(Te, b(a, He, ""))) {
|
323
|
+
if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Xt(a, "data:") === 0 && Ve[e])) {
|
324
|
+
if (!(We && !_(Ot, b(a, He, "")))) {
|
325
|
+
if (a)
|
326
|
+
return !1;
|
327
|
+
}
|
328
|
+
}
|
329
|
+
}
|
330
|
+
}
|
331
|
+
}
|
332
|
+
}
|
333
|
+
return !0;
|
334
|
+
}, at = function(e) {
|
335
|
+
return e.indexOf("-") > 0;
|
336
|
+
}, nt = function(e) {
|
337
|
+
var t, a, u, E;
|
338
|
+
I("beforeSanitizeAttributes", e, null);
|
339
|
+
var h = e.attributes;
|
340
|
+
if (!!h) {
|
341
|
+
var T = {
|
342
|
+
attrName: "",
|
343
|
+
attrValue: "",
|
344
|
+
keepAttr: !0,
|
345
|
+
allowedAttributes: v
|
346
|
+
};
|
347
|
+
for (E = h.length; E--; ) {
|
348
|
+
t = h[E];
|
349
|
+
var ae = t, d = ae.name, De = ae.namespaceURI;
|
350
|
+
if (a = d === "value" ? t.value : qt(t.value), u = p(d), T.attrName = u, T.attrValue = a, T.keepAttr = !0, T.forceKeepAttr = void 0, I("uponSanitizeAttribute", e, T), a = T.attrValue, !T.forceKeepAttr && (Ne(d, e), !!T.keepAttr)) {
|
351
|
+
if (_(/\/>/i, a)) {
|
352
|
+
Ne(d, e);
|
353
|
+
continue;
|
354
|
+
}
|
355
|
+
F && (a = b(a, pe, " "), a = b(a, de, " "), a = b(a, ve, " "));
|
356
|
+
var it = p(e.nodeName);
|
357
|
+
if (!!rt(it, u, a)) {
|
358
|
+
if (je && (u === "id" || u === "name") && (Ne(d, e), a = Nt + a), g && C(q) === "object" && typeof q.getAttributeType == "function" && !De)
|
359
|
+
switch (q.getAttributeType(it, u)) {
|
360
|
+
case "TrustedHTML":
|
361
|
+
a = g.createHTML(a);
|
362
|
+
break;
|
363
|
+
case "TrustedScriptURL":
|
364
|
+
a = g.createScriptURL(a);
|
365
|
+
break;
|
366
|
+
}
|
367
|
+
try {
|
368
|
+
De ? e.setAttributeNS(De, d, a) : e.setAttribute(d, a), lt(n.removed);
|
369
|
+
} catch {
|
370
|
+
}
|
371
|
+
}
|
372
|
+
}
|
373
|
+
}
|
374
|
+
I("afterSanitizeAttributes", e, null);
|
375
|
+
}
|
376
|
+
}, kt = function i(e) {
|
377
|
+
var t, a = et(e);
|
378
|
+
for (I("beforeSanitizeShadowDOM", e, null); t = a.nextNode(); )
|
379
|
+
I("uponSanitizeShadowNode", t, null), !tt(t) && (t.content instanceof f && i(t.content), nt(t));
|
380
|
+
I("afterSanitizeShadowDOM", e, null);
|
381
|
+
};
|
382
|
+
return n.sanitize = function(i) {
|
383
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t, a, u, E, h;
|
384
|
+
if (be = !i, be && (i = "<!-->"), typeof i != "string" && !V(i)) {
|
385
|
+
if (typeof i.toString != "function")
|
386
|
+
throw Me("toString is not a function");
|
387
|
+
if (i = i.toString(), typeof i != "string")
|
388
|
+
throw Me("dirty is not a string, aborting");
|
389
|
+
}
|
390
|
+
if (!n.isSupported) {
|
391
|
+
if (C(r.toStaticHTML) === "object" || typeof r.toStaticHTML == "function") {
|
392
|
+
if (typeof i == "string")
|
393
|
+
return r.toStaticHTML(i);
|
394
|
+
if (V(i))
|
395
|
+
return r.toStaticHTML(i.outerHTML);
|
396
|
+
}
|
397
|
+
return i;
|
398
|
+
}
|
399
|
+
if (Ae || Re(e), n.removed = [], typeof i == "string" && (Y = !1), Y) {
|
400
|
+
if (i.nodeName) {
|
401
|
+
var T = p(i.nodeName);
|
402
|
+
if (!m[T] || j[T])
|
403
|
+
throw Me("root node is forbidden and cannot be sanitized in-place");
|
404
|
+
}
|
405
|
+
} else if (i instanceof L)
|
406
|
+
t = Qe("<!---->"), a = t.ownerDocument.importNode(i, !0), a.nodeType === 1 && a.nodeName === "BODY" || a.nodeName === "HTML" ? t = a : t.appendChild(a);
|
407
|
+
else {
|
408
|
+
if (!U && !F && !x && i.indexOf("<") === -1)
|
409
|
+
return g && Q ? g.createHTML(i) : i;
|
410
|
+
if (t = Qe(i), !t)
|
411
|
+
return U ? null : Q ? ce : "";
|
412
|
+
}
|
413
|
+
t && Ee && w(t.firstChild);
|
414
|
+
for (var ae = et(Y ? i : t); u = ae.nextNode(); )
|
415
|
+
u.nodeType === 3 && u === E || tt(u) || (u.content instanceof f && kt(u.content), nt(u), E = u);
|
416
|
+
if (E = null, Y)
|
417
|
+
return i;
|
418
|
+
if (U) {
|
419
|
+
if (J)
|
420
|
+
for (h = yt.call(t.ownerDocument); t.firstChild; )
|
421
|
+
h.appendChild(t.firstChild);
|
422
|
+
else
|
423
|
+
h = t;
|
424
|
+
return v.shadowroot && (h = bt.call(o, h, !0)), h;
|
425
|
+
}
|
426
|
+
var d = x ? t.outerHTML : t.innerHTML;
|
427
|
+
return x && m["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && _(lr, t.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
|
428
|
+
` + d), F && (d = b(d, pe, " "), d = b(d, de, " "), d = b(d, ve, " ")), g && Q ? g.createHTML(d) : d;
|
429
|
+
}, n.setConfig = function(i) {
|
430
|
+
Re(i), Ae = !0;
|
431
|
+
}, n.clearConfig = function() {
|
432
|
+
B = null, Ae = !1;
|
433
|
+
}, n.isValidAttribute = function(i, e, t) {
|
434
|
+
B || Re({});
|
435
|
+
var a = p(i), u = p(e);
|
436
|
+
return rt(a, u, t);
|
437
|
+
}, n.addHook = function(i, e) {
|
438
|
+
typeof e == "function" && (D[i] = D[i] || [], X(D[i], e));
|
439
|
+
}, n.removeHook = function(i) {
|
440
|
+
if (D[i])
|
441
|
+
return lt(D[i]);
|
442
|
+
}, n.removeHooks = function(i) {
|
443
|
+
D[i] && (D[i] = []);
|
444
|
+
}, n.removeAllHooks = function() {
|
445
|
+
D = {};
|
446
|
+
}, n;
|
447
|
+
}
|
448
|
+
var cr = pt();
|
449
|
+
export {
|
450
|
+
cr as default
|
451
|
+
};
|