@phillips/seldon 1.67.0 → 1.67.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/components/Accordion/AccordionItem.d.ts +4 -3
  2. package/dist/components/Accordion/AccordionItem.js +42 -41
  3. package/dist/components/Accordion/index.d.ts +1 -0
  4. package/dist/components/Accordion/types.d.ts +19 -0
  5. package/dist/components/Accordion/types.js +3 -1
  6. package/dist/components/Accordion/utils.d.ts +1 -12
  7. package/dist/components/Accordion/utils.js +7 -7
  8. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +8 -9
  9. package/dist/components/Search/SearchResults/SearchResults.js +17 -21
  10. package/dist/index.js +69 -66
  11. package/dist/patterns/LanguageSelector/LanguageSelector.js +0 -1
  12. package/dist/scss/componentStyles.scss +0 -1
  13. package/dist/scss/components/Accordion/_accordion.scss +5 -5
  14. package/package.json +1 -1
  15. package/dist/_virtual/attributes-to-props.js +0 -4
  16. package/dist/_virtual/constants.js +0 -4
  17. package/dist/_virtual/dom-to-react.js +0 -4
  18. package/dist/_virtual/domparser.js +0 -4
  19. package/dist/_virtual/html-to-dom.js +0 -4
  20. package/dist/_virtual/index10.js +0 -4
  21. package/dist/_virtual/index11.js +0 -4
  22. package/dist/_virtual/index7.js +0 -4
  23. package/dist/_virtual/index8.js +0 -4
  24. package/dist/_virtual/index9.js +0 -4
  25. package/dist/_virtual/node.js +0 -4
  26. package/dist/_virtual/possibleStandardNamesOptimized.js +0 -4
  27. package/dist/_virtual/utilities.js +0 -4
  28. package/dist/_virtual/utilities2.js +0 -4
  29. package/dist/_virtual/utilities3.js +0 -4
  30. package/dist/components/HTMLParser/HTMLParser.d.ts +0 -24
  31. package/dist/components/HTMLParser/HTMLParser.js +0 -21
  32. package/dist/components/HTMLParser/index.d.ts +0 -1
  33. package/dist/components/HTMLParser/utils.d.ts +0 -7
  34. package/dist/components/HTMLParser/utils.js +0 -31
  35. package/dist/node_modules/domelementtype/lib/index.js +0 -12
  36. package/dist/node_modules/domhandler/lib/index.js +0 -84
  37. package/dist/node_modules/domhandler/lib/node.js +0 -356
  38. package/dist/node_modules/dompurify/dist/purify.es.js +0 -522
  39. package/dist/node_modules/html-dom-parser/lib/client/constants.js +0 -38
  40. package/dist/node_modules/html-dom-parser/lib/client/domparser.js +0 -56
  41. package/dist/node_modules/html-dom-parser/lib/client/html-to-dom.js +0 -20
  42. package/dist/node_modules/html-dom-parser/lib/client/utilities.js +0 -55
  43. package/dist/node_modules/html-react-parser/esm/index.js +0 -7
  44. package/dist/node_modules/html-react-parser/lib/attributes-to-props.js +0 -40
  45. package/dist/node_modules/html-react-parser/lib/dom-to-react.js +0 -60
  46. package/dist/node_modules/html-react-parser/lib/index.js +0 -42
  47. package/dist/node_modules/html-react-parser/lib/utilities.js +0 -58
  48. package/dist/node_modules/inline-style-parser/index.js +0 -86
  49. package/dist/node_modules/react-property/lib/index.js +0 -440
  50. package/dist/node_modules/react-property/lib/possibleStandardNamesOptimized.js +0 -493
  51. package/dist/node_modules/style-to-js/cjs/index.js +0 -19
  52. package/dist/node_modules/style-to-js/cjs/utilities.js +0 -16
  53. package/dist/node_modules/style-to-object/cjs/index.js +0 -21
  54. package/dist/scss/components/HTMLParser/_htmlParser.scss +0 -5
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var a = {};
2
- export {
3
- a as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var t = {};
2
- export {
3
- t as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var t = {};
2
- export {
3
- t as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var t = {};
2
- export {
3
- t as __exports
4
- };
@@ -1,24 +0,0 @@
1
- export interface HTMLParserProps extends React.HTMLAttributes<HTMLDivElement> {
2
- /**
3
- * Rich Text content to be displayed
4
- */
5
- html: string;
6
- /**
7
- * Optional flag to only sanitize the content and bypass the transforms to our components
8
- */
9
- isOnlySanitize?: boolean;
10
- /**
11
- * Optional class name to add to the component
12
- */
13
- className?: string;
14
- }
15
- /**
16
- * ## Overview
17
- *
18
- * A component for taking in rich text content from CMS and safely rendering the content in a consistent manner.
19
- *
20
- *
21
- * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-htmlparser--overview)
22
- */
23
- declare const HTMLParser: ({ className, html, isOnlySanitize, ...props }: HTMLParserProps) => import("react/jsx-runtime").JSX.Element;
24
- export default HTMLParser;
@@ -1,21 +0,0 @@
1
- import { jsx as o, Fragment as c } from "react/jsx-runtime";
2
- import n from "../../node_modules/classnames/index.js";
3
- import f from "../../node_modules/dompurify/dist/purify.es.js";
4
- import p from "../../node_modules/html-react-parser/esm/index.js";
5
- import { getCommonProps as d } from "../../utils/index.js";
6
- import { options as g } from "./utils.js";
7
- const M = ({ className: s, html: r, isOnlySanitize: i = !1, ...e }) => {
8
- const { className: t, ...a } = d(e, "HTMLParser"), m = f.sanitize(r), l = p(m, g);
9
- return /* @__PURE__ */ o(c, { children: typeof r == "string" && r.length > 0 ? i ? /* @__PURE__ */ o(
10
- "div",
11
- {
12
- ...a,
13
- className: n(`${t}`, s),
14
- ...e,
15
- dangerouslySetInnerHTML: { __html: m }
16
- }
17
- ) : /* @__PURE__ */ o("div", { ...a, className: n(`${t}`, s), ...e, children: l }) : null });
18
- };
19
- export {
20
- M as default
21
- };
@@ -1 +0,0 @@
1
- export { default as HTMLParser, type HTMLParserProps } from './HTMLParser';
@@ -1,7 +0,0 @@
1
- export declare const options: {
2
- replace({ attribs, children, name }: {
3
- attribs: Record<string, string>;
4
- children: React.ReactNode;
5
- name: string;
6
- }): import("react/jsx-runtime").JSX.Element | undefined;
7
- };
@@ -1,31 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import "../../node_modules/html-react-parser/esm/index.js";
3
- import { TextVariants as e } from "../Text/types.js";
4
- import n from "../Text/Text.js";
5
- import { LinkVariants as p } from "../Link/types.js";
6
- import d from "../Link/Link.js";
7
- import "../../node_modules/html-react-parser/lib/index.js";
8
- import { __exports as r } from "../../_virtual/index7.js";
9
- const a = {
10
- replace({ attribs: s, children: t, name: o }) {
11
- if (o === "h1")
12
- return /* @__PURE__ */ i(n, { variant: e.heading1, children: r.domToReact(t, a) });
13
- if (o === "h2")
14
- return /* @__PURE__ */ i(n, { variant: e.heading2, children: r.domToReact(t, a) });
15
- if (o === "h3")
16
- return /* @__PURE__ */ i(n, { variant: e.heading3, children: r.domToReact(t, a) });
17
- if (o === "h4")
18
- return /* @__PURE__ */ i(n, { variant: e.heading4, children: r.domToReact(t, a) });
19
- if (o === "blockquote")
20
- return /* @__PURE__ */ i(n, { variant: e.blockquote, children: r.domToReact(t, a) });
21
- if (o === "p")
22
- return /* @__PURE__ */ i(n, { variant: e.body1, children: r.domToReact(t, a) });
23
- if (o === "a") {
24
- const { class: f, ...c } = s, m = r.attributesToProps(c);
25
- return /* @__PURE__ */ i(d, { variant: p.link, ...m, children: r.domToReact(t, a) });
26
- }
27
- }
28
- };
29
- export {
30
- a as options
31
- };
@@ -1,12 +0,0 @@
1
- import { __exports as D } from "../../../_virtual/index10.js";
2
- (function(i) {
3
- Object.defineProperty(i, "__esModule", { value: !0 }), i.Doctype = i.CDATA = i.Tag = i.Style = i.Script = i.Comment = i.Directive = i.Text = i.Root = i.isTag = i.ElementType = void 0;
4
- var t;
5
- (function(c) {
6
- c.Root = "root", c.Text = "text", c.Directive = "directive", c.Comment = "comment", c.Script = "script", c.Style = "style", c.Tag = "tag", c.CDATA = "cdata", c.Doctype = "doctype";
7
- })(t = i.ElementType || (i.ElementType = {}));
8
- function a(c) {
9
- return c.type === t.Tag || c.type === t.Script || c.type === t.Style;
10
- }
11
- i.isTag = a, i.Root = t.Root, i.Text = t.Text, i.Directive = t.Directive, i.Comment = t.Comment, i.Script = t.Script, i.Style = t.Style, i.Tag = t.Tag, i.CDATA = t.CDATA, i.Doctype = t.Doctype;
12
- })(D);
@@ -1,84 +0,0 @@
1
- import { commonjsGlobal as a } from "../../../_virtual/_commonjsHelpers.js";
2
- import { __exports as c } from "../../../_virtual/index8.js";
3
- import "../../domelementtype/lib/index.js";
4
- import "./node.js";
5
- import { __exports as p } from "../../../_virtual/node.js";
6
- import { __exports as m } from "../../../_virtual/index10.js";
7
- (function(r) {
8
- var u = a && a.__createBinding || (Object.create ? function(i, t, e, n) {
9
- n === void 0 && (n = e);
10
- var o = Object.getOwnPropertyDescriptor(t, e);
11
- (!o || ("get" in o ? !t.__esModule : o.writable || o.configurable)) && (o = { enumerable: !0, get: function() {
12
- return t[e];
13
- } }), Object.defineProperty(i, n, o);
14
- } : function(i, t, e, n) {
15
- n === void 0 && (n = e), i[n] = t[e];
16
- }), f = a && a.__exportStar || function(i, t) {
17
- for (var e in i) e !== "default" && !Object.prototype.hasOwnProperty.call(t, e) && u(t, i, e);
18
- };
19
- Object.defineProperty(r, "__esModule", { value: !0 }), r.DomHandler = void 0;
20
- var d = m, s = p;
21
- f(p, r);
22
- var l = {
23
- withStartIndices: !1,
24
- withEndIndices: !1,
25
- xmlMode: !1
26
- }, h = (
27
- /** @class */
28
- function() {
29
- function i(t, e, n) {
30
- this.dom = [], this.root = new s.Document(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof e == "function" && (n = e, e = l), typeof t == "object" && (e = t, t = void 0), this.callback = t != null ? t : null, this.options = e != null ? e : l, this.elementCB = n != null ? n : null;
31
- }
32
- return i.prototype.onparserinit = function(t) {
33
- this.parser = t;
34
- }, i.prototype.onreset = function() {
35
- this.dom = [], this.root = new s.Document(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null;
36
- }, i.prototype.onend = function() {
37
- this.done || (this.done = !0, this.parser = null, this.handleCallback(null));
38
- }, i.prototype.onerror = function(t) {
39
- this.handleCallback(t);
40
- }, i.prototype.onclosetag = function() {
41
- this.lastNode = null;
42
- var t = this.tagStack.pop();
43
- this.options.withEndIndices && (t.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(t);
44
- }, i.prototype.onopentag = function(t, e) {
45
- var n = this.options.xmlMode ? d.ElementType.Tag : void 0, o = new s.Element(t, e, void 0, n);
46
- this.addNode(o), this.tagStack.push(o);
47
- }, i.prototype.ontext = function(t) {
48
- var e = this.lastNode;
49
- if (e && e.type === d.ElementType.Text)
50
- e.data += t, this.options.withEndIndices && (e.endIndex = this.parser.endIndex);
51
- else {
52
- var n = new s.Text(t);
53
- this.addNode(n), this.lastNode = n;
54
- }
55
- }, i.prototype.oncomment = function(t) {
56
- if (this.lastNode && this.lastNode.type === d.ElementType.Comment) {
57
- this.lastNode.data += t;
58
- return;
59
- }
60
- var e = new s.Comment(t);
61
- this.addNode(e), this.lastNode = e;
62
- }, i.prototype.oncommentend = function() {
63
- this.lastNode = null;
64
- }, i.prototype.oncdatastart = function() {
65
- var t = new s.Text(""), e = new s.CDATA([t]);
66
- this.addNode(e), t.parent = e, this.lastNode = t;
67
- }, i.prototype.oncdataend = function() {
68
- this.lastNode = null;
69
- }, i.prototype.onprocessinginstruction = function(t, e) {
70
- var n = new s.ProcessingInstruction(t, e);
71
- this.addNode(n);
72
- }, i.prototype.handleCallback = function(t) {
73
- if (typeof this.callback == "function")
74
- this.callback(t, this.dom);
75
- else if (t)
76
- throw t;
77
- }, i.prototype.addNode = function(t) {
78
- var e = this.tagStack[this.tagStack.length - 1], n = e.children[e.children.length - 1];
79
- this.options.withStartIndices && (t.startIndex = this.parser.startIndex), this.options.withEndIndices && (t.endIndex = this.parser.endIndex), e.children.push(t), n && (t.prev = n, n.next = t), t.parent = e, this.lastNode = null;
80
- }, i;
81
- }()
82
- );
83
- r.DomHandler = h, r.default = h;
84
- })(c);
@@ -1,356 +0,0 @@
1
- import { commonjsGlobal as p } from "../../../_virtual/_commonjsHelpers.js";
2
- import { __exports as r } from "../../../_virtual/node.js";
3
- import "../../domelementtype/lib/index.js";
4
- import { __exports as I } from "../../../_virtual/index10.js";
5
- var s = p && p.__extends || /* @__PURE__ */ function() {
6
- var e = function(t, n) {
7
- return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, o) {
8
- i.__proto__ = o;
9
- } || function(i, o) {
10
- for (var a in o) Object.prototype.hasOwnProperty.call(o, a) && (i[a] = o[a]);
11
- }, e(t, n);
12
- };
13
- return function(t, n) {
14
- if (typeof n != "function" && n !== null)
15
- throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
16
- e(t, n);
17
- function i() {
18
- this.constructor = t;
19
- }
20
- t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
21
- };
22
- }(), c = p && p.__assign || function() {
23
- return c = Object.assign || function(e) {
24
- for (var t, n = 1, i = arguments.length; n < i; n++) {
25
- t = arguments[n];
26
- for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
27
- }
28
- return e;
29
- }, c.apply(this, arguments);
30
- };
31
- Object.defineProperty(r, "__esModule", { value: !0 });
32
- r.cloneNode = r.hasChildren = r.isDocument = r.isDirective = r.isComment = r.isText = r.isCDATA = r.isTag = r.Element = r.Document = r.CDATA = r.NodeWithChildren = r.ProcessingInstruction = r.Comment = r.Text = r.DataNode = r.Node = void 0;
33
- var u = I, b = (
34
- /** @class */
35
- function() {
36
- function e() {
37
- this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null;
38
- }
39
- return Object.defineProperty(e.prototype, "parentNode", {
40
- // Read-write aliases for properties
41
- /**
42
- * Same as {@link parent}.
43
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
44
- */
45
- get: function() {
46
- return this.parent;
47
- },
48
- set: function(t) {
49
- this.parent = t;
50
- },
51
- enumerable: !1,
52
- configurable: !0
53
- }), Object.defineProperty(e.prototype, "previousSibling", {
54
- /**
55
- * Same as {@link prev}.
56
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
57
- */
58
- get: function() {
59
- return this.prev;
60
- },
61
- set: function(t) {
62
- this.prev = t;
63
- },
64
- enumerable: !1,
65
- configurable: !0
66
- }), Object.defineProperty(e.prototype, "nextSibling", {
67
- /**
68
- * Same as {@link next}.
69
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
70
- */
71
- get: function() {
72
- return this.next;
73
- },
74
- set: function(t) {
75
- this.next = t;
76
- },
77
- enumerable: !1,
78
- configurable: !0
79
- }), e.prototype.cloneNode = function(t) {
80
- return t === void 0 && (t = !1), g(this, t);
81
- }, e;
82
- }()
83
- );
84
- r.Node = b;
85
- var m = (
86
- /** @class */
87
- function(e) {
88
- s(t, e);
89
- function t(n) {
90
- var i = e.call(this) || this;
91
- return i.data = n, i;
92
- }
93
- return Object.defineProperty(t.prototype, "nodeValue", {
94
- /**
95
- * Same as {@link data}.
96
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
97
- */
98
- get: function() {
99
- return this.data;
100
- },
101
- set: function(n) {
102
- this.data = n;
103
- },
104
- enumerable: !1,
105
- configurable: !0
106
- }), t;
107
- }(b)
108
- );
109
- r.DataNode = m;
110
- var v = (
111
- /** @class */
112
- function(e) {
113
- s(t, e);
114
- function t() {
115
- var n = e !== null && e.apply(this, arguments) || this;
116
- return n.type = u.ElementType.Text, n;
117
- }
118
- return Object.defineProperty(t.prototype, "nodeType", {
119
- get: function() {
120
- return 3;
121
- },
122
- enumerable: !1,
123
- configurable: !0
124
- }), t;
125
- }(m)
126
- );
127
- r.Text = v;
128
- var x = (
129
- /** @class */
130
- function(e) {
131
- s(t, e);
132
- function t() {
133
- var n = e !== null && e.apply(this, arguments) || this;
134
- return n.type = u.ElementType.Comment, n;
135
- }
136
- return Object.defineProperty(t.prototype, "nodeType", {
137
- get: function() {
138
- return 8;
139
- },
140
- enumerable: !1,
141
- configurable: !0
142
- }), t;
143
- }(m)
144
- );
145
- r.Comment = x;
146
- var T = (
147
- /** @class */
148
- function(e) {
149
- s(t, e);
150
- function t(n, i) {
151
- var o = e.call(this, i) || this;
152
- return o.name = n, o.type = u.ElementType.Directive, o;
153
- }
154
- return Object.defineProperty(t.prototype, "nodeType", {
155
- get: function() {
156
- return 1;
157
- },
158
- enumerable: !1,
159
- configurable: !0
160
- }), t;
161
- }(m)
162
- );
163
- r.ProcessingInstruction = T;
164
- var h = (
165
- /** @class */
166
- function(e) {
167
- s(t, e);
168
- function t(n) {
169
- var i = e.call(this) || this;
170
- return i.children = n, i;
171
- }
172
- return Object.defineProperty(t.prototype, "firstChild", {
173
- // Aliases
174
- /** First child of the node. */
175
- get: function() {
176
- var n;
177
- return (n = this.children[0]) !== null && n !== void 0 ? n : null;
178
- },
179
- enumerable: !1,
180
- configurable: !0
181
- }), Object.defineProperty(t.prototype, "lastChild", {
182
- /** Last child of the node. */
183
- get: function() {
184
- return this.children.length > 0 ? this.children[this.children.length - 1] : null;
185
- },
186
- enumerable: !1,
187
- configurable: !0
188
- }), Object.defineProperty(t.prototype, "childNodes", {
189
- /**
190
- * Same as {@link children}.
191
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
192
- */
193
- get: function() {
194
- return this.children;
195
- },
196
- set: function(n) {
197
- this.children = n;
198
- },
199
- enumerable: !1,
200
- configurable: !0
201
- }), t;
202
- }(b)
203
- );
204
- r.NodeWithChildren = h;
205
- var C = (
206
- /** @class */
207
- function(e) {
208
- s(t, e);
209
- function t() {
210
- var n = e !== null && e.apply(this, arguments) || this;
211
- return n.type = u.ElementType.CDATA, n;
212
- }
213
- return Object.defineProperty(t.prototype, "nodeType", {
214
- get: function() {
215
- return 4;
216
- },
217
- enumerable: !1,
218
- configurable: !0
219
- }), t;
220
- }(h)
221
- );
222
- r.CDATA = C;
223
- var P = (
224
- /** @class */
225
- function(e) {
226
- s(t, e);
227
- function t() {
228
- var n = e !== null && e.apply(this, arguments) || this;
229
- return n.type = u.ElementType.Root, n;
230
- }
231
- return Object.defineProperty(t.prototype, "nodeType", {
232
- get: function() {
233
- return 9;
234
- },
235
- enumerable: !1,
236
- configurable: !0
237
- }), t;
238
- }(h)
239
- );
240
- r.Document = P;
241
- var O = (
242
- /** @class */
243
- function(e) {
244
- s(t, e);
245
- function t(n, i, o, a) {
246
- o === void 0 && (o = []), a === void 0 && (a = n === "script" ? u.ElementType.Script : n === "style" ? u.ElementType.Style : u.ElementType.Tag);
247
- var l = e.call(this, o) || this;
248
- return l.name = n, l.attribs = i, l.type = a, l;
249
- }
250
- return Object.defineProperty(t.prototype, "nodeType", {
251
- get: function() {
252
- return 1;
253
- },
254
- enumerable: !1,
255
- configurable: !0
256
- }), Object.defineProperty(t.prototype, "tagName", {
257
- // DOM Level 1 aliases
258
- /**
259
- * Same as {@link name}.
260
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
261
- */
262
- get: function() {
263
- return this.name;
264
- },
265
- set: function(n) {
266
- this.name = n;
267
- },
268
- enumerable: !1,
269
- configurable: !0
270
- }), Object.defineProperty(t.prototype, "attributes", {
271
- get: function() {
272
- var n = this;
273
- return Object.keys(this.attribs).map(function(i) {
274
- var o, a;
275
- return {
276
- name: i,
277
- value: n.attribs[i],
278
- namespace: (o = n["x-attribsNamespace"]) === null || o === void 0 ? void 0 : o[i],
279
- prefix: (a = n["x-attribsPrefix"]) === null || a === void 0 ? void 0 : a[i]
280
- };
281
- });
282
- },
283
- enumerable: !1,
284
- configurable: !0
285
- }), t;
286
- }(h)
287
- );
288
- r.Element = O;
289
- function D(e) {
290
- return (0, u.isTag)(e);
291
- }
292
- r.isTag = D;
293
- function j(e) {
294
- return e.type === u.ElementType.CDATA;
295
- }
296
- r.isCDATA = j;
297
- function N(e) {
298
- return e.type === u.ElementType.Text;
299
- }
300
- r.isText = N;
301
- function E(e) {
302
- return e.type === u.ElementType.Comment;
303
- }
304
- r.isComment = E;
305
- function A(e) {
306
- return e.type === u.ElementType.Directive;
307
- }
308
- r.isDirective = A;
309
- function _(e) {
310
- return e.type === u.ElementType.Root;
311
- }
312
- r.isDocument = _;
313
- function S(e) {
314
- return Object.prototype.hasOwnProperty.call(e, "children");
315
- }
316
- r.hasChildren = S;
317
- function g(e, t) {
318
- t === void 0 && (t = !1);
319
- var n;
320
- if (N(e))
321
- n = new v(e.data);
322
- else if (E(e))
323
- n = new x(e.data);
324
- else if (D(e)) {
325
- var i = t ? d(e.children) : [], o = new O(e.name, c({}, e.attribs), i);
326
- i.forEach(function(w) {
327
- return w.parent = o;
328
- }), e.namespace != null && (o.namespace = e.namespace), e["x-attribsNamespace"] && (o["x-attribsNamespace"] = c({}, e["x-attribsNamespace"])), e["x-attribsPrefix"] && (o["x-attribsPrefix"] = c({}, e["x-attribsPrefix"])), n = o;
329
- } else if (j(e)) {
330
- var i = t ? d(e.children) : [], a = new C(i);
331
- i.forEach(function(y) {
332
- return y.parent = a;
333
- }), n = a;
334
- } else if (_(e)) {
335
- var i = t ? d(e.children) : [], l = new P(i);
336
- i.forEach(function(y) {
337
- return y.parent = l;
338
- }), e["x-mode"] && (l["x-mode"] = e["x-mode"]), n = l;
339
- } else if (A(e)) {
340
- var f = new T(e.name, e.data);
341
- e["x-name"] != null && (f["x-name"] = e["x-name"], f["x-publicId"] = e["x-publicId"], f["x-systemId"] = e["x-systemId"]), n = f;
342
- } else
343
- throw new Error("Not implemented yet: ".concat(e.type));
344
- return n.startIndex = e.startIndex, n.endIndex = e.endIndex, e.sourceCodeLocation != null && (n.sourceCodeLocation = e.sourceCodeLocation), n;
345
- }
346
- r.cloneNode = g;
347
- function d(e) {
348
- for (var t = e.map(function(i) {
349
- return g(i, !0);
350
- }), n = 1; n < t.length; n++)
351
- t[n].prev = t[n - 1], t[n - 1].next = t[n];
352
- return t;
353
- }
354
- export {
355
- r as default
356
- };