@sitecore-feaas/clientside 0.3.16 → 0.4.0-alpha.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 +6 -10
- package/build/components/FEAASElement.js +5 -0
- package/build/components/FEAASElement.js.map +1 -1
- package/build/dom/rendering.js +2 -2
- package/build/dom/rendering.js.map +1 -1
- package/build/dom/thumbnail.js +2 -2
- package/build/dom/thumbnail.js.map +1 -1
- package/build/ui/FEAASExternal.js +13 -229
- package/build/ui/FEAASExternal.js.map +1 -1
- package/build/ui/FEAASPicker.js +5 -3
- package/build/ui/FEAASPicker.js.map +1 -1
- package/build/ui/react.js +13 -90
- package/build/ui/react.js.map +1 -1
- package/dist/browser/headless.cjs +7 -7
- package/dist/browser/headless.cjs.map +3 -3
- package/dist/browser/headless.esm.js +7 -7
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.cjs +6 -6
- package/dist/browser/index.cjs.map +3 -3
- package/dist/browser/index.esm.js +6 -6
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +7 -7
- package/dist/browser/react.cjs.map +4 -4
- package/dist/browser/react.esm.js +7 -7
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +5 -5
- package/dist/node/headless.cjs.map +3 -3
- package/dist/node/headless.esm.js +5 -5
- package/dist/node/headless.esm.js.map +3 -3
- package/dist/node/index.cjs +5 -5
- package/dist/node/index.cjs.map +3 -3
- package/dist/node/index.esm.js +5 -5
- package/dist/node/index.esm.js.map +3 -3
- package/dist/node/react.cjs +5 -5
- package/dist/node/react.cjs.map +4 -4
- package/dist/node/react.esm.js +5 -5
- package/dist/node/react.esm.js.map +4 -4
- package/headless.cjs +5 -5
- package/headless.cjs.map +3 -3
- package/headless.js +5 -5
- package/headless.js.map +3 -3
- package/package.json +5 -1
- package/react.cjs +7 -7
- package/react.cjs.map +4 -4
- package/react.js +7 -7
- package/react.js.map +4 -4
- package/src/components/FEAASElement.tsx +5 -0
- package/src/dom/rendering.ts +3 -1
- package/src/dom/thumbnail.ts +6 -3
- package/src/ui/FEAASExternal.tsx +16 -276
- package/src/ui/FEAASPicker.tsx +6 -5
- package/src/ui/react.tsx +18 -120
- package/test/FEAASComponent.test.tsx +1 -1
- package/test/dom.test.ts +1 -1
- package/tsconfig.json +3 -0
- package/types/components/FEAASElement.d.ts.map +1 -1
- package/types/dom/rendering.d.ts.map +1 -1
- package/types/dom/thumbnail.d.ts +2 -2
- package/types/dom/thumbnail.d.ts.map +1 -1
- package/types/tsbuildinfo +1 -1
- package/types/ui/FEAASContext.d.ts +1 -1
- package/types/ui/FEAASExternal.d.ts +7 -92
- package/types/ui/FEAASExternal.d.ts.map +1 -1
- package/types/ui/FEAASPicker.d.ts +3 -3
- package/types/ui/FEAASPicker.d.ts.map +1 -1
- package/types/ui/react.d.ts +11 -47
- package/types/ui/react.d.ts.map +1 -1
- package/types/ui/tsbuildinfo +1 -1
- package/src/utils/string.ts +0 -12
package/build/ui/react.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { fetchComponent, getComponentURL, getStylesheetURL, parseComponentSource, parseStylesheetSource, getStylesheetSource } from './index.js';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { parseHTMLContent, renderHTMLContent } from '../dom/html.js';
|
|
4
3
|
import { DataSettings } from '../utils/settings.js';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
export { renderHTMLContent };
|
|
8
|
-
export { External, linkComponents, registerComponent, getComponent, FEAASExternalPropsObject } from './FEAASExternal.js';
|
|
9
|
-
export * from './index.js';
|
|
4
|
+
import { fetchComponent, getComponentURL, getStylesheetSource, getStylesheetURL, parseComponentSource, parseStylesheetSource } from './index.js';
|
|
5
|
+
import * as BYOC from '@sitecore/byoc';
|
|
10
6
|
export * from '../headless.js';
|
|
7
|
+
export { External, FEAASExternalPropsObject, getComponent, linkComponents, registerComponent } from './FEAASExternal.js';
|
|
8
|
+
export * from './index.js';
|
|
9
|
+
export { renderHTMLContent };
|
|
11
10
|
/**
|
|
12
11
|
* A component to include a stylesheet using a <link> tag. Placing one in the HEAD ensures that there will be no flash
|
|
13
12
|
* of unstyled content.
|
|
@@ -55,10 +54,10 @@ export function FEAASReactComponent({ data, ...props }) {
|
|
|
55
54
|
if (node.localName == 'feaas-external') {
|
|
56
55
|
const camelized = {};
|
|
57
56
|
for (var prop in attributes) {
|
|
58
|
-
const key = prop == 'data-external-id' ? 'componentName' :
|
|
57
|
+
const key = prop == 'data-external-id' ? 'componentName' : BYOC.toCamelCase(prop);
|
|
59
58
|
camelized[key] = attributes[prop];
|
|
60
59
|
}
|
|
61
|
-
return [
|
|
60
|
+
return [BYOC.Component, camelized];
|
|
62
61
|
}
|
|
63
62
|
}, index));
|
|
64
63
|
}
|
|
@@ -71,25 +70,6 @@ export function FEAASReactComponent({ data, ...props }) {
|
|
|
71
70
|
React.createElement("link", { rel: 'preload', as: 'style', href: getStylesheetURL(props.src), crossOrigin: 'anonymous' }))),
|
|
72
71
|
React.createElement("feaas-component", { ...props, suppressHydrationWarning: true, template: null, data: typeof data == 'string' ? data : data ? JSON.stringify(data) : null, hydrate: 'false' }, children)));
|
|
73
72
|
}
|
|
74
|
-
/**
|
|
75
|
-
* A wrapper over External component that accepts a fallback for rendering in case of a missing component.
|
|
76
|
-
* It accepts properties in camelcase format and ensures no hydration errors on the client-side.
|
|
77
|
-
*
|
|
78
|
-
* @param {FEAASReactExternalComponentProps} props - The properties for the component.
|
|
79
|
-
* @returns {JSX.Element} The JSX element representing the component.
|
|
80
|
-
*/
|
|
81
|
-
export function FEAASReactExternalComponent(props) {
|
|
82
|
-
var _a;
|
|
83
|
-
const { componentName, fallback, ...attributes } = props;
|
|
84
|
-
const Component = (_a = getComponent(componentName)) === null || _a === void 0 ? void 0 : _a.component;
|
|
85
|
-
if ((!Component && fallback) || !componentName)
|
|
86
|
-
return (React.createElement("feaas-external", { "data-external-id": componentName, suppressHydrationWarning: true, hydrate: 'false' }, fallback));
|
|
87
|
-
const parsed = FEAASExternalPropsObject(componentName, attributes);
|
|
88
|
-
delete parsed['suppressHydrationWarning'];
|
|
89
|
-
// execute component as a function to supress hydration errors inside
|
|
90
|
-
return (React.createElement(React.Fragment, null,
|
|
91
|
-
React.createElement("feaas-external", { ...objectKeysToKebabCase(parsed), "data-external-id": componentName, suppressHydrationWarning: true, hydrate: 'false' }, Component == null ? null : React.createElement(Component, { ...parsed }))));
|
|
92
|
-
}
|
|
93
73
|
/**
|
|
94
74
|
* Converts an HTMLNode into a React tree, ensuring proper context access for external components.
|
|
95
75
|
*
|
|
@@ -130,68 +110,11 @@ export function HTMLNodeToReact(node, callback, key) {
|
|
|
130
110
|
const reactAttributes = Object.assign({ key, suppressHydrationWarning: true }, (reactNode === null || reactNode === void 0 ? void 0 : reactNode[1]) || attributes);
|
|
131
111
|
return React.createElement(reactName, reactAttributes, ['img', 'br', 'input'].includes(reactName) ? null : children);
|
|
132
112
|
}
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
* It uses `next/dynamic` to control rendering on the client, server, or both.
|
|
139
|
-
*
|
|
140
|
-
* @param {FEAASReactExternalComponentProps} props - The properties for the component.
|
|
141
|
-
* @returns {JSX.Element} The JSX element representing the component.
|
|
142
|
-
*/
|
|
143
|
-
export function FEAASNextExternalComponent(props) {
|
|
144
|
-
var _a;
|
|
145
|
-
// See if component is registered in current context
|
|
146
|
-
const { componentName, ...attributes } = props;
|
|
147
|
-
const Component = (_a = getComponent(componentName)) === null || _a === void 0 ? void 0 : _a.component;
|
|
148
|
-
if (!NextComponents.get(componentName)) {
|
|
149
|
-
// Designate component for rendering on clientside
|
|
150
|
-
const Dynamic = NextDynamicFunction(() => Promise.resolve(NextClientsideRenderer), {
|
|
151
|
-
ssr: false,
|
|
152
|
-
loading: () => React.createElement(FEAASReactExternalComponent, { ...attributes, componentName: componentName })
|
|
153
|
-
});
|
|
154
|
-
NextComponents.set(componentName, Dynamic);
|
|
155
|
-
}
|
|
156
|
-
const External = NextComponents.get(componentName);
|
|
157
|
-
return React.createElement(External, { ...props, fallback: Component ? React.createElement(Component, { ...props }) : null });
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Enables Next.js client/server rendering options for registered components.
|
|
161
|
-
* The `component` argument should be a function exported from a file with a `use client` directive.
|
|
162
|
-
*
|
|
163
|
-
* @param {any} dynamic - The Next dynamic function.
|
|
164
|
-
* @param {any} component - The component function.
|
|
165
|
-
* @returns {any} Augmented bundle.
|
|
166
|
-
*/
|
|
167
|
-
export function enableNextClientsideComponents(dynamic, component) {
|
|
168
|
-
NextDynamicFunction = dynamic;
|
|
169
|
-
NextClientsideRenderer = component;
|
|
170
|
-
return component;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Renders a registered external component in a React tree.
|
|
174
|
-
*
|
|
175
|
-
* @param {FEAASReactExternalComponentProps} props - The properties for the component.
|
|
176
|
-
* @returns {JSX.Element} The JSX element representing the component.
|
|
177
|
-
*/
|
|
178
|
-
export function FEAASExternalComponent(props) {
|
|
179
|
-
if (Object.keys(props).length == 0) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
if (NextDynamicFunction)
|
|
183
|
-
return FEAASNextExternalComponent(props);
|
|
184
|
-
return FEAASReactExternalComponent(props);
|
|
185
|
-
}
|
|
186
|
-
export function FEAASReactExternalComponentBundle() {
|
|
187
|
-
return (React.createElement(React.Fragment, null,
|
|
188
|
-
React.createElement("feaas-registration", { components: JSON.stringify(Object.values(External.registered)), suppressHydrationWarning: true }),
|
|
189
|
-
React.createElement(NextClientsideRenderer, null)));
|
|
190
|
-
}
|
|
191
|
-
export const ExternalComponentBundle = FEAASReactExternalComponentBundle;
|
|
192
|
-
export const ExternalComponent = FEAASExternalComponent;
|
|
193
|
-
export const ReactExternalComponent = FEAASReactExternalComponent;
|
|
194
|
-
export const NextExternalComponent = FEAASNextExternalComponent;
|
|
113
|
+
export const enableNextClientsideComponents = BYOC.enableNextClientsideComponents;
|
|
114
|
+
export const ExternalComponentBundle = BYOC.Bundle;
|
|
115
|
+
export const ExternalComponent = BYOC.Component;
|
|
116
|
+
export const ReactExternalComponent = BYOC.RegularComponent;
|
|
117
|
+
export const NextExternalComponent = BYOC.NextComponent;
|
|
195
118
|
export const Component = FEAASReactComponent;
|
|
196
119
|
export const ServerComponent = FEAASReactServerComponent;
|
|
197
120
|
export const Stylesheet = FEAASReactStylesheet;
|
package/build/ui/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/ui/react.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/ui/react.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAY,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAIL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACxH,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,CAAA;AAO5B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAA0D,EAAE,EAAE;IACjG,IAAI,KAAK,IAAI,KAAK,EAAE;QAClB,KAAK,GAAG,qBAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;KACzC;IACD,OAAO,8BAAM,GAAG,EAAC,YAAY,EAAC,IAAI,EAAE,mBAAmB,CAAC,KAAK,CAAC,GAAI,CAAA;AACpE,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EAA4B,EAAE,EAAE;IACxF,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,KAAK,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,KAAI,EAAE,CAAC,CAAA;IAE/D,MAAM,CAAC,GAA6B,EAAE,GAAG,KAAK,EAAE,CAAA;IAEhD,IAAI,CAAC,KAAK,IAAI,KAAK,IAAI,WAAW,IAAI,KAAK,CAAC,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,KAAI,IAAI,EAAE;QACvE,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,CAAA;QAE5C,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAA;QAC9B,CAAC,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAA;QACtC,YAAY;QACZ,CAAC,CAAC,OAAO,GAAG,KAAK,CAAA;KAClB;IAED,OAAO,mBAAmB,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAA;AACzD,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAA4B;IAC9E,IAAI,OAAO,GAAG,IAAI,CAAA;IAClB,IAAI,QAAgC,CAAA;IAEpC,IAAI,UAAU,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE;QACzC,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC1E,eAAe,CACb,IAAI,EACJ,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE;YACnB,IAAI,IAAI,CAAC,SAAS,IAAI,gBAAgB,EAAE;gBACtC,MAAM,SAAS,GAAG,EAAS,CAAA;gBAC3B,KAAK,IAAI,IAAI,IAAI,UAAU,EAAE;oBAC3B,MAAM,GAAG,GAAG,IAAI,IAAI,kBAAkB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;oBACjF,SAAS,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;iBAClC;gBACD,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;aACnC;QACH,CAAC,EACD,KAAK,CACN,CACF,CAAA;KACF;IAED,IAAI,KAAK,IAAI,KAAK,EAAE;QAClB,KAAK,GAAG,EAAE,GAAG,oBAAoB,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,EAAE,CAAA;KACzD;IAED,OAAO,CACL;QACG,SAAS,IAAI,KAAK,IAAI,OAAO,KAAK,IAAI,IAAI,KAAK,IAAI,KAAK,IAAI,CAC3D;YACE,8BAAM,GAAG,EAAC,SAAS,EAAC,EAAE,EAAC,OAAO,EAAC,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAC,WAAW,GAAG;YAC3F,8BAAM,GAAG,EAAC,SAAS,EAAC,EAAE,EAAC,OAAO,EAAC,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAC,WAAW,GAAG,CAC3F,CACJ;QACD,4CACM,KAAK,EACT,wBAAwB,QACxB,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,OAAO,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EACzE,OAAO,EAAE,OAAO,IAEf,QAAQ,CACO,CACjB,CACJ,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAc,EACd,QAA+G,EAC/G,GAAS;IAET,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,EAAE;QACvB,OAAO,IAAI,CAAC,WAAW,CAAA;KACxB;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;IAE3G,MAAM,UAAU,GAAuD,EAAE,CAAA;IACzE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QAC1C,IAAI,IAAI,IAAI,OAAO,EAAE;YACnB,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;iBACnC,IAAI,EAAE;iBACN,KAAK,CAAC,SAAS,CAAC;iBAChB,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;gBACvB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;gBAC9B,OAAO;oBACL,GAAG,MAAM;oBACT,CAAC,CAAC,CAAC,EAAE,CAAC;iBACP,CAAA;YACH,CAAC,EAAE,EAAE,CAAC,CAAA;SACT;aAAM,IAAI,IAAI,IAAI,OAAO,EAAE;YAC1B,UAAU,CAAC,SAAS,GAAG,KAAK,CAAA;SAC7B;aAAM;YACL,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;SACzB;KACF;IAED,MAAM,SAAS,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,IAAI,EAAE,UAAU,CAAC,CAAA;IAC9C,MAAM,SAAS,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,CAAC,CAAC,KAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAA;IAC/D,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,wBAAwB,EAAE,IAAI,EAAE,EAAE,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,CAAC,CAAC,KAAI,UAAU,CAAC,CAAA;IAC5G,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,eAAe,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;AACtH,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,CAAC,8BAA8B,CAAA;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,MAAM,CAAA;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAA;AAC/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,gBAAgB,CAAA;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,aAAa,CAAA;AACvD,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAAA;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,yBAAyB,CAAA;AACxD,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var pe=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames;var bt=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},gt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of vt(t))!bt.call(e,i)&&i!==r&&pe(e,i,{get:()=>t[i],enumerable:!(n=yt(t,i))||n.enumerable});return e};var wt=e=>gt(pe({},"__esModule",{value:!0}),e);var qt={};j(qt,{Component:()=>Y,ComponentProps:()=>it,ControlledPromise:()=>S,DEFAULT_CDN_URL:()=>_,DOM:()=>ie,DataPath:()=>ne,DataScope:()=>te,DataSettings:()=>w,Element:()=>x,FEAASComponent:()=>Y,FEAASComponentsProps:()=>it,FEAASElement:()=>x,FEAASLoader:()=>Q,FEAASLoaderProps:()=>ot,FEAASStylesheet:()=>de,FEAASStylesheetProps:()=>at,InvalidResponse:()=>oe,JSONPath:()=>p,Loader:()=>Q,MyComponent:()=>ee,Stylesheet:()=>de,Thumbnail:()=>he,WebComponent:()=>Ne,adjustNumbers:()=>We,autoloadScripts:()=>je,cleanCollectionBit:()=>J,clearFetchCache:()=>jt,createStylesheet:()=>tt,fetchAndRevalidate:()=>V,fetchAndRevalidateComponent:()=>k,fetchAndRevalidateStylesheet:()=>ue,fetchBypassingCache:()=>ae,fetchCache:()=>z,fetchComponent:()=>Bt,fetchData:()=>Ce,fetchToValidateCache:()=>q,fetchWithCacheAwareness:()=>$,findStylesheet:()=>et,getComponentSource:()=>It,getComponentURL:()=>Se,getFetchCache:()=>Xe,getHumanizedLabel:()=>He,getLastPathBit:()=>Je,getQualifier:()=>Be,getStylesheetSource:()=>Ut,getStylesheetURL:()=>K,loadScript:()=>H,loadStylesheet:()=>le,loadStylesheetAllowStale:()=>xe,normalizeCollectionScope:()=>re,observeDOMElement:()=>Le,parseComponentSource:()=>G,parseLimit:()=>Ie,parseRange:()=>Ue,parseStylesheetSource:()=>se,queryObject:()=>M,queryObjectRaw:()=>ge,queryScopes:()=>W,renderComponent:()=>Ee,renderComponentElement:()=>Ht,renderComponentPromise:()=>rt,renderDOMContent:()=>T,renderDOMElement:()=>A,renderHTMLContent:()=>Ye,renderStylesheet:()=>Wt,renderStylesheetPromise:()=>Ze,serializeCH1RichText:()=>R,setDOMAttribute:()=>O});module.exports=wt(qt);function S(e,t=r=>{}){var r;let n=()=>{var i,a;let o=new Promise((u,c)=>{i=l=>{e==null||e(l),u(l)},a=c});var s=Object.assign(o,{resolve:i,reject:a,restart:n,first:r});return r=s,s.catch(t),s};return n()}var Ne=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,x=class extends Ne{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=S(t=>{this.payload=t}),this.whenRendered=S(()=>this.initialized=!0,()=>this.cancelRender()),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let t=this.getParent();if(t&&!t.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(t){this.onError(t)}}dispatchEventIndirectly(t){this.dispatchEvent(t);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(t,"target",{value:this,writable:!1}),Object.defineProperty(t,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(t))}isJSONAttribute(t){return!1}log(...t){if(typeof process!="undefined"&&process.env.TESTING)return;let r=t[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+t.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...t.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.cancelRender(),this.connected=!1,this.initialized&&this.render&&this.update())}getParent(t=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!t||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(t=this.getRoot(),r=!0){return Array.from(t.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(t){let r=t.composedPath()[0];switch(t.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(t){let r=this.descendants.indexOf(t);r!=-1&&(this.log("FEAAS: Unnest",this,t),this.descendants.splice(r,1),this.refs[t.getComponentName()]=null,t.refs.parent==this&&(t.refs.parent=null),t.refs.top==this&&(t.refs.top=t.refs.parent))}nestedCallback(t){var r,n;if(this.descendants.indexOf(t)==-1&&(this.descendants.push(t),this.log("FEAAS: Nest",this,t),this.refs[t.getComponentName()]=t,t.refs.top=this,(r=t.refs).parent||(r.parent=this),t.render))for(var a=t.refs.parent;a;a=a.refs.parent)a.render&&((n=t.refs).parentReact||(n.parentReact=a),t.refs.topReact=a)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(t,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:t});if(this.dispatchEventIndirectly(i),this.whenLoaded.reject(t),!i.defaultPrevented&&!n){this.whenRendered.reject(t);try{this.unmount()}catch(a){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let t=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(t),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(t){this.onError(t)}}flush(){var t,r;if(!this.connected)return;let n=(r=(t=this.payload)===null||t===void 0?void 0:t.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var t,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:a,ReactDOMClient:o}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!a)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);this.getAttribute("hydrate")!="false"&&(!this.refs.topReact&&!this.forceUpdateReact?o?(this.reactRoot||(this.reactRoot=o.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):a.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact&&this.connected?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact)===null||r===void 0?void 0:r.forceUpdateReact)===null||n===void 0||n.call(r))}invokeReactRendering(){let{React:t,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload&&i.connected).map((i,a)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(t=this,r=t.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=t.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(o){return{error:o}}componentDidCatch(o,s){console.error(`FEAAS: ${t.tagName} Error:`,o,s),t.onError(o,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},a=this.getReactErrorBoundary(),o=this.getReactWrapper(t);return n.createElement(a,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(o,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=a=>{if(t.render){let[o,s]=n.useReducer(u=>u+1,0);return t.forceUpdateReact=s,i.createPortal(n.createElement(n.Fragment,null,t.invokeReactRendering()),t.getReactRootElement())}else return t.update()},Object.assign(t.reactWrapper,{key:t.tagName+"-"+t.getUID(),displayName:r}),t.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(t){try{this.scheduleRender(),this.overrides={...this.overrides,...t},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let i=this.isJSONAttribute(r),a=this.props[r],o=i?JSON.stringify(a):String(a),s=this.defaultProps[r],u=i?JSON.stringify(s):String(s),c=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),l=this.getAttribute(c);try{var n=i?JSON.stringify(JSON.parse(l)):l}catch(f){var n=null}a==null||o===u?this.removeAttribute(c):(typeof a=="string"||typeof a=="number"||typeof a=="boolean"||i)&&n!=o&&this.setAttribute(c,o)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(t,r){return typeof t=="string"&&t.match(/^\/[^\/]/)?r+t:t}getContextAttribute(t,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(t)!=null)return n.getAttribute(t);return this.getAttribute(t)}static register(t,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(t)&&r.customElements.define(t,this)}};var P=class extends x{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},ee=class extends P{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:t},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(a=>a+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};ee.observedAttributes=["counter"];var ie={};j(ie,{renderDOMContent:()=>T,renderDOMElement:()=>A,renderHTMLContent:()=>Ye,setDOMAttribute:()=>O});var te={};j(te,{JSONPath:()=>p,queryObject:()=>M,queryObjectRaw:()=>ge,queryScopes:()=>W,serializeCH1RichText:()=>R});function E(e){return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(e)}function Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $e(e,t,r){return t&&Oe(e.prototype,t),r&&Oe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function At(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}function U(e){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},U(e)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},B(e,t)}function Pe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function I(e,t,r){return Pe()?I=Reflect.construct.bind():I=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&B(c,o.prototype),c},I.apply(null,arguments)}function St(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function me(e){var t=typeof Map=="function"?new Map:void 0;return me=function(n){if(n===null||!St(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return I(n,arguments,U(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),B(i,n)},me(e)}function xt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Et(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xt(e)}function _t(e){var t=Pe();return function(){var n=U(e),i;if(t){var a=U(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Et(this,i)}}function Ct(e){return Dt(e)||Ft(e)||Me(e)||Rt()}function Dt(e){if(Array.isArray(e))return ye(e)}function Ft(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Me(e,t){if(e){if(typeof e=="string")return ye(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ye(e,t)}}function ye(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Rt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nt(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Me(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}var g=Object.prototype.hasOwnProperty;function F(e,t){return e=e.slice(),e.push(t),e}function ve(e,t){return t=t.slice(),t.unshift(e),t}var Ot=function(e){At(r,e);var t=_t(r);function r(n){var i;return Te(this,r),i=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return $e(r)}(me(Error));function p(e,t,r,n,i){if(!(this instanceof p))try{return new p(e,t,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var a=e&&E(e)==="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=g.call(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){var o={path:a?e.path:t};a?"json"in e&&(o.json=e.json):o.json=r;var s=this.evaluate(o);if(!s||E(s)!=="object")throw new Ot(s);return s}}p.prototype.evaluate=function(e,t,r,n){var i=this,a=this.parent,o=this.parentProperty,s=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&E(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!g.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var c=e;t=c.json,s=g.call(e,"flatten")?e.flatten:s,this.currResultType=g.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=g.call(e,"sandbox")?e.sandbox:this.currSandbox,u=g.call(e,"wrap")?e.wrap:u,this.currPreventEval=g.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=g.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=g.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,a=g.call(e,"parent")?e.parent:a,o=g.call(e,"parentProperty")?e.parentProperty:o,e=e.path}if(a=a||null,o=o||null,Array.isArray(e)&&(e=p.toPathString(e)),!(!e&&e!==""||!t)){var l=p.toPathArray(e);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var f=this._trace(l,t,["$"],a,o,r).filter(function(d){return d&&!d.isParentSelector});return f.length?!u&&f.length===1&&!f[0].hasArrExpr?this._getPreferredOutput(f[0]):f.reduce(function(d,h){var v=i._getPreferredOutput(h);return s&&Array.isArray(v)?d=d.concat(v):d.push(v),d},[]):u?[]:void 0}};p.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":{var r=Array.isArray(e.path)?e.path:p.toPathArray(e.path);return e.pointer=p.toPointer(r),e.path=typeof e.path=="string"?e.path:p.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return p.toPathString(e[t]);case"pointer":return p.toPointer(e.path);default:throw new TypeError("Unknown result type")}};p.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:p.toPathString(e.path),t(n,r,e)}};p.prototype._trace=function(e,t,r,n,i,a,o,s){var u=this,c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:o},this._handleCallback(c,a,"value"),c;var l=e[0],f=e.slice(1),d=[];function h(y){Array.isArray(y)?y.forEach(function(mt){d.push(mt)}):d.push(y)}if((typeof l!="string"||s)&&t&&g.call(t,l))h(this._trace(f,t[l],F(r,l),t,l,a,o));else if(l==="*")this._walk(t,function(y){h(u._trace(f,t[y],F(r,y),t,y,a,!0,!0))});else if(l==="..")h(this._trace(f,t,r,n,i,a,o)),this._walk(t,function(y){E(t[y])==="object"&&h(u._trace(e.slice(),t[y],F(r,y),t,y,a,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:f,isParentSelector:!0};if(l==="~")return c={path:F(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(c,a,"property"),c;if(l==="$")h(this._trace(f,t,r,null,null,a,o));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))h(this._slice(l,f,t,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var v=l.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(t,function(y){u._eval(v,t[y],y,r,n,i)&&h(u._trace(f,t[y],F(r,y),t,y,a,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(ve(this._eval(l,t,r[r.length-1],r.slice(0,-1),n,i),f),t,r,n,i,a,o))}else if(l[0]==="@"){var m=!1,b=l.slice(1,-2);switch(b){case"scalar":(!t||!["object","function"].includes(E(t)))&&(m=!0);break;case"boolean":case"string":case"undefined":case"function":E(t)===b&&(m=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(m=!0);break;case"number":Number.isFinite(t)&&(m=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(m=!0);break;case"object":t&&E(t)===b&&(m=!0);break;case"array":Array.isArray(t)&&(m=!0);break;case"other":m=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(m=!0);break;default:throw new TypeError("Unknown value type "+b)}if(m)return c={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(c,a,"value"),c}else if(l[0]==="`"&&t&&g.call(t,l.slice(1))){var C=l.slice(1);h(this._trace(f,t[C],F(r,C),t,C,a,o,!0))}else if(l.includes(",")){var ht=l.split(","),X=Nt(ht),Re;try{for(X.s();!(Re=X.n()).done;){var ft=Re.value;h(this._trace(ve(ft,f),t,r,n,i,a,!0))}}catch(y){X.e(y)}finally{X.f()}}else!s&&t&&g.call(t,l)&&h(this._trace(f,t[l],F(r,l),t,l,a,o,!0))}if(this._hasParentSelector)for(var D=0;D<d.length;D++){var Z=d[D];if(Z&&Z.isParentSelector){var L=this._trace(Z.expr,t,Z.path,n,i,a,o);if(Array.isArray(L)){d[D]=L[0];for(var pt=L.length,fe=1;fe<pt;fe++)D++,d.splice(D,0,L[fe])}else d[D]=L}}return d};p.prototype._walk=function(e,t){if(Array.isArray(e))for(var r=e.length,n=0;n<r;n++)t(n);else e&&E(e)==="object"&&Object.keys(e).forEach(function(i){t(i)})};p.prototype._slice=function(e,t,r,n,i,a,o){if(Array.isArray(r)){var s=r.length,u=e.split(":"),c=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,f=u[1]&&Number.parseInt(u[1])||s;l=l<0?Math.max(0,l+s):Math.min(s,l),f=f<0?Math.max(0,f+s):Math.min(s,f);for(var d=[],h=l;h<f;h+=c){var v=this._trace(ve(h,t),r,n,i,a,o,!0);v.forEach(function(m){d.push(m)})}return d}};p.prototype._eval=function(e,t,r,n,i,a){this.currSandbox._$_parentProperty=a,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;var o=e.includes("@path");o&&(this.currSandbox._$_path=p.toPathString(n.concat([r])));var s="script:"+e;if(!p.cache[s]){var u=e.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");o&&(u=u.replace(/@path/g,"_$_path")),p.cache[s]=new this.vm.Script(u)}try{return p.cache[s].runInNewContext(this.currSandbox)}catch(c){throw new Error("jsonPath: "+c.message+": "+e)}};p.cache={};p.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};p.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};p.toPathArray=function(e){var t=p.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(a,o){return"[#"+(r.push(o)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,o){return"['"+o.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,o){return";"+o.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var o=a.match(/#([0-9]+)/);return!o||!o[1]?a:r[o[1]]});return t[e]=i,t[e].concat()};var Tt=function(t,r,n){for(var i=t.length,a=0;a<i;a++){var o=t[a];n(o)&&r.push(t.splice(a--,1)[0])}},$t=function(){function e(t){Te(this,e),this.code=t}return $e(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),a=[];Tt(i,a,function(l){return typeof r[l]=="function"});var o=i.map(function(l,f){return r[l]}),s=a.reduce(function(l,f){var d=r[f].toString();return/function/.test(d)||(d="function "+d),"var "+f+"="+d+";"+l},"");n=s+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var u=n.lastIndexOf(";"),c=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return I(Function,i.concat([c])).apply(void 0,Ct(o))}}]),e}();p.prototype.vm={Script:$t};function ge(e,t){try{return p({path:t,json:e})}catch(r){return[]}}function M(e,t){var r;return((r=ge(e,t))===null||r===void 0?void 0:r.flat(1/0))||[]}function W(e,t,r=!1,n=e){var i=t;let a=Object.keys(e).sort((s,u)=>u.length-s.length);for(let s of a)if(t.startsWith(s)){if(s==t){if(r)return e[s];continue}i=t.substring(s.length+1),n=e[s];break}var o=M(n,i);return Array.isArray(o)&&(o==null?void 0:o.length)==0&&(o=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),i.replace(/^.*?\.\$([\.\[])/,"_$1"),i.replace(/^.*?\.\$([\.\[])/,"$$$1"),i.replace(/^[^.]+$/,"_")].filter((s,u,c)=>c.indexOf(s)===u).reduce((s,u)=>s.length>0?s:M(n,u),[])),r&&Array.isArray(o)?o[0]:o}function be(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${R(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):R(e)}function R(e){var t;if(Array.isArray(e))return e.map(R).join(`
|
|
4
|
-
`).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return be(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,a)=>be(i,a.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[a.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return be(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var N=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new N(i)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return we(this.childNodes)}set innerHTML(t){this.childNodes=Ae(String(t!=null?t:""))}get outerHTML(){return we([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(ke(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=a=>{for(let o of r)if(ke(o,a)){n.push(a);break}for(let o of a.childNodes)i(o)};for(let a of this.childNodes)i(a);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let a=i+t;a>=0&&a<n.length;a+=t){let o=n[a];if(!r||o.nodeType===1)return o}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new N(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function ke(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let a=i[1],o=i[3],s=t.getAttribute(a);if(typeof o=="undefined"){if(s===void 0)return!1}else if(s!==o)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function Ae(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),a=e.match(/^<\/([\w-]+)>/);if(i){let o=i[1],u=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(l=>{let[f,d,,h]=l.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:Mt(h||"")}}))||[],c=new N(o,1);if(c.attributes=u,n.length>0){let l=n[n.length-1];l.childNodes.push(c),c.parentNode=l}else r.push(c);n.push(c),e=e.slice(i[0].length)}else if(a)n.pop(),e=e.slice(a[0].length);else{let o=e.indexOf("<"),s=e.slice(0,o!==-1?o:void 0),u=new N("#text",3);if(u.textContent=s,n.length>0){let c=n[n.length-1];c.childNodes.push(u),u.parentNode=c}else r.push(u);e=e.slice(s.length)}}return r}function Pt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Mt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function we(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:o,value:s})=>` ${o}="${Pt(String(s))}"`).join(""),a=we(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${a}</${r}>`}).join("")}function Le(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&H(i,a),n.addedNodes&&n.addedNodes.forEach(o=>{o.nodeType==1&&je(o,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function je(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];H(i,i.getAttribute("data-embed-src"))}if(t)return Le(e)}function H(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let a=r.ownerDocument.createElement("script");a.setAttribute("type","module"),a.setAttribute("src",t),r.appendChild(a);break}}var ne={};j(ne,{adjustNumbers:()=>We,cleanCollectionBit:()=>J,getHumanizedLabel:()=>He,getLastPathBit:()=>Je,getQualifier:()=>Be,normalizeCollectionScope:()=>re,parseLimit:()=>Ie,parseRange:()=>Ue});var Ie=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},Ue=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},Be=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function J(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function re(e){return J(e)+".*"}function We(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+t)))}function He(e,t=2){var r=J(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-t).join(" ")}function Je(e){return J(e).split(".").pop()}var kt=["January","February","March","April","May","June","July","August","September","October","November","December"],ze=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=kt[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`},Ve=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function Ge(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function Lt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=Ge(e);if(i!=0)return;let a=e.parentNode;if(a!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var o=i+1,s=e,u=e;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(o++,s=u);for(var c=o;c<t;c++)a.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var c=Math.max(1,t);c<o;c++)s=s.previousElementSibling,a.removeChild(s.nextElementSibling)}}function O(e,t,r,n){var i,a;if(!e)return;var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=R(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var s=t.replace("data-path-","");if(t=="data-path-src"||t=="data-path-alt"){let m=Array.from(e.children).find(b=>b.localName=="picture")||e;o=e.localName=="img"?e:m.querySelector("img, video")}else if(t=="data-path-href")o=e.querySelector("a")||e.closest("a");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")s="innerHTML";else if(t=="data-embed-src")H(e,r);else if(t=="data-path-attributes"){let m=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var u in r){var c=r[u];O(e,u,typeof c=="object"&&c?JSON.stringify(c):c,n)}for(var l=0;l<m.length;l++)(r==null||!(m[l]in r))&&O(e,m[l],null,n);O(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!o)return;if((s=="innerHTML"||s=="src")&&(r==null||r==="")){var d=String((a=e.getAttribute("data-path-placeholder")||o[s])!==null&&a!==void 0?a:o.getAttribute(s));s=="innerHTML"?o.innerHTML=d:d?o.setAttribute(s,d):o.removeAttribute(s)}else if(r!=null)if(s=="innerHTML"){for(var h=String(r),v=o;v.parentElement&&v.localName.match(/^(a|var|strong|em|i|b)$/);)v=v.parentElement;v.localName.match(/p|h\d|button|time|li/)&&(h=h.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(v.getAttribute("class")).includes("-inline--time")&&Ve(h)&&(h=ze(new Date(h))),o.innerHTML!=h&&(o.innerHTML=h)}else o.getAttribute(s)!=r&&o.setAttribute(s,r);else o.removeAttribute(s)}var qe=["data-attributes-keys","data-path-attributes","data-path-scope"];function A(e,t,r,n){var i,a,o;let s=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,s,t))||t),s.nodeType==1){let l=s.getAttribute("data-path-scope");if(l){let d=Ge(s),h=W(t,l,!1);d==0&&Lt(s,((a=r==null?void 0:r.shouldRepeat)===null||a===void 0?void 0:a.call(r,s,h))===!1?1:h.length,r),t={...t,[re(l)]:h[d]}}let f=Array.prototype.slice.call(s.attributes).sort((d,h)=>qe.indexOf(d.name)-qe.indexOf(h.name));for(var u=0;u<f.length;u++){let{name:d,value:h}=f[u];d.startsWith("data-path")&&d!="data-path-scope"&&O(s,d,W(t,h,!0),r),d=="data-embed-src"&&O(s,d,s.getAttribute(d),r)}}for(var u=0,c;c=s.childNodes[u++];)Ke(c)&&A(c,t,r,!0);return n||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,s,t),s}function Ke(e){return e.nodeType==1}function T(e,t,r,n){var i;let a=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=a,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var s=0,u;u=e.childNodes[s++];)Ke(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return A(e,r,n)}function Ye(e,t,r,n=!1){var i;let a=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let o=Ae(a);return A(o[0],t,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=a,A(o,t,r),o.innerHTML}}var Qe=["initial","check","updated"],z={};function jt(){z={}}async function V(e,t,r,n,i=z){return $({url:e,options:t,validator:r,callback:n,cache:i}).then(q).then(a=>a.response)}function Xe(e,t=!1){let r=String(e).replace("?head","");var n=z[r];return!n&&!t&&(n=z[r]={phase:null,initial:S(),check:S(),updated:S(),final:S()}),n}var oe=class extends Error{};async function $({url:e,options:t,validator:r,callback:n,cache:i},a="initial"){let o=new Date;if(i!=null){var s=Xe(e);if(Qe.indexOf(s.phase)>=Qe.indexOf(a))var u=s[a];else s.phase=a}let c=await(u||fetch(e,t));if(!u&&s&&(c.ok?s[a].resolve(c):s[a].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");let l=new Date(c.headers.get("date"))<o||u&&a=="initial"&&(s.phase=="updated"||s.phase=="check");if((r==null?void 0:r(c,l))===!1)throw new oe("Response is not valid");return await(n==null?void 0:n(c,a,l)),{url:e,options:t,isCached:l,response:c,validator:r,callback:n,cache:i}}async function q(e){let{url:t,isCached:r,options:n,validator:i,response:a,cache:o}=e;if(r){let{response:s}=await $({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:o},"check");if(s.headers.get("last-modified")!=a.headers.get("last-modified"))return ae(e)}return e}async function ae(e){return $({...e,options:{...e.options,cache:"reload"}},"updated")}var _="https://feaas.blob.core.windows.net";function G(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,a,o]=t;return{cdn:r,library:n,component:i,version:a,revision:o}}}function It(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=_?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Ut(e){return`${e.cdn&&e.cdn!=_?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function se(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let a=G(e);if(a){var{cdn:r,library:n,revision:i}=a;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function Se(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...G(e.src)}),`${e.cdn||e.hostname||_}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function K(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...se(e.src)}),`${e.cdn||e.hostname||_}/styles/${e.library}/${e.revision||"published"}.css`}async function k(e,t,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>s.clone().text().then(t),a=await Promise.all([e.instance&&$({options:{headers:{Accept:"text/html"},credentials:"omit"},url:Se({...e,version:e.instance}),validator:n}).catch(s=>s),$({url:Se(e),validator:n}).catch(s=>s)]),o=a.find(s=>s&&"isCached"in s&&s);if(!o||o instanceof Error)throw a.find(u=>u&&u instanceof Error)||new Error("Can not fetch component");return a[0]==o&&console.log("Using fork!",a),await i(o.response),r?o:q({...o,callback:i}).catch(s=>{if(a[0]==o&&(ae({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(a[1]instanceof Error)))return i(a[1].response),q({...a[1],callback:i});throw s})}async function Bt(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await k(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function ue(e,t){return typeof e=="string"&&(e={src:e}),V(K(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function Wt(e,t){return Ze(e,t||(t=document.createElement("style"))),t}function Ze(e,t){return t||(t=document.createElement("style")),ue(e,(r,n)=>{t.textContent=r}).then(()=>t)}function le(e,t){var r=et(e);if(!r)var n=tt(e);return ue(e,(i,a)=>{n&&(n.textContent=i),t==null||t(i,a)}).then(()=>r||n)}function xe(e){return new Promise((t,r)=>{le(e,t).catch(r)})}function et(e){return document.head.querySelector(`style[data-href="${K(e)}"]`)}function tt(e){let t=K(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function Ht(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,t),r}function Ee(e,t){return rt(e,t||(t=document.createElement("div"))),t}async function rt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?A(t,e.data,e):"template"in e?T(t,e.template,e.data,e):k(e,r=>T(t,r,e.data,e)).then(()=>t)}function Jt(e){let{params:t,method:r,headers:n,body:i,url:a}=w(e);var o={url:a},s={...n};return n["Content-Type"]==="application/json"&&delete s["Content-Type"],n.Accept==="application/json"&&delete s.Accept,Object.keys(s).length>0&&(o.headers=s),r!=="GET"&&(o.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(o.body=i),Object.keys(t).length>0&&(o={...o,params:t}),o}var ce=e=>{if(typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0};function nt(e){let{url:t,headers:r,params:n,method:i,body:a}=w(e),o,s=r["Content-Type"];i!="GET"&&i!="HEAD"&&(s==="application/json"&&(o=JSON.stringify(a)),s==="multipart/form-data"&&(o=Object.keys(a).reduce((c,l)=>(c.append(l,a[l]),c),new FormData)),s==="application/x-www-form-urlencoded"&&(o=new URLSearchParams(a)));let u=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${u}`,{headers:r,body:o,method:i}]}function w(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());t[n]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(e==null?void 0:e.params)||{},headers:t,jsonpath:String((e==null?void 0:e.jsonpath)||"$"),method:((e==null?void 0:e.method)||"GET").toUpperCase(),body:(e==null?void 0:e.body)||{},url:String((e==null?void 0:e.url)||"")}}var _e=async e=>{try{let[t,r]=nt(e),i=await(await w.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?M(i,e.jsonpath):i}catch(t){return{}}};async function Ce(e){if(!e)return e;if(ce(e))return _e(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>ce(e[n])?_e(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:ce(e[i])?r.shift():e[i]}),{})}w.clean=Jt;w.toFetchArguments=nt;w.fetchOne=_e;w.fetch=Ce;w.isDataSettings=ce;w.fetchImplementation=(...e)=>fetch(...e);function it(e){var t,r,n,i,a,o,s,u;let c,l=e.getAttribute("src");if(l){let C=G(l);if(!C)throw new Error(`Could not parse FEAAS Component source: ${l}`);var{cdn:f,library:d,component:h,version:v,revision:m}=C}let b=e.getAttribute("data");if(b!=null&&b!="")try{c=typeof b=="string"?JSON.parse(b):{}}catch(C){console.error(C)}return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:f)!==null&&r!==void 0?r:_,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:h,version:(o=(a=e.getAttribute("version"))!==null&&a!==void 0?a:v)!==null&&o!==void 0?o:"responsive",revision:(u=(s=e.getAttribute("revision"))!==null&&s!==void 0?s:m)!==null&&u!==void 0?u:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var Y=class extends x{setData(t){this.set({data:t})}getProps(){return it(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,n),t==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await w.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=S(t=>this.readyData=t,t=>this.onError(t)),this.defaultProps={cdn:_,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=t=>{this.payload=t,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(this.getOriginal())return;let t=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=xe({...this.props,revision:"published"}).then(()=>{r=null,t()});return Promise.all([r,this.whenDataReady.then(()=>t()),k(this.props,n=>{this.payload=n,t()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,this.getAttribute("hydrate")!="false")if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)A(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;T(this,this.payload,this.readyData)}}};Y.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];Y.register("feaas-component");function ot(e){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var Q=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return ot(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
|
|
1
|
+
var pe=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames;var bt=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},gt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of vt(t))!bt.call(e,i)&&i!==r&&pe(e,i,{get:()=>t[i],enumerable:!(n=yt(t,i))||n.enumerable});return e};var wt=e=>gt(pe({},"__esModule",{value:!0}),e);var qt={};j(qt,{Component:()=>Y,ComponentProps:()=>it,ControlledPromise:()=>S,DEFAULT_CDN_URL:()=>C,DOM:()=>ie,DataPath:()=>ne,DataScope:()=>te,DataSettings:()=>w,Element:()=>x,FEAASComponent:()=>Y,FEAASComponentsProps:()=>it,FEAASElement:()=>x,FEAASLoader:()=>Q,FEAASLoaderProps:()=>ot,FEAASStylesheet:()=>de,FEAASStylesheetProps:()=>at,InvalidResponse:()=>oe,JSONPath:()=>p,Loader:()=>Q,MyComponent:()=>ee,Stylesheet:()=>de,Thumbnail:()=>he,WebComponent:()=>Ne,adjustNumbers:()=>We,autoloadScripts:()=>je,cleanCollectionBit:()=>J,clearFetchCache:()=>jt,createStylesheet:()=>tt,fetchAndRevalidate:()=>V,fetchAndRevalidateComponent:()=>k,fetchAndRevalidateStylesheet:()=>le,fetchBypassingCache:()=>ae,fetchCache:()=>z,fetchComponent:()=>Bt,fetchData:()=>Ce,fetchToValidateCache:()=>q,fetchWithCacheAwareness:()=>$,findStylesheet:()=>et,getComponentSource:()=>It,getComponentURL:()=>Se,getFetchCache:()=>Xe,getHumanizedLabel:()=>He,getLastPathBit:()=>Je,getQualifier:()=>Be,getStylesheetSource:()=>Ut,getStylesheetURL:()=>K,loadScript:()=>H,loadStylesheet:()=>ue,loadStylesheetAllowStale:()=>xe,normalizeCollectionScope:()=>re,observeDOMElement:()=>Le,parseComponentSource:()=>G,parseLimit:()=>Ie,parseRange:()=>Ue,parseStylesheetSource:()=>se,queryObject:()=>M,queryObjectRaw:()=>ge,queryScopes:()=>W,renderComponent:()=>Ee,renderComponentElement:()=>Ht,renderComponentPromise:()=>rt,renderDOMContent:()=>T,renderDOMElement:()=>A,renderHTMLContent:()=>Ye,renderStylesheet:()=>Wt,renderStylesheetPromise:()=>Ze,serializeCH1RichText:()=>R,setDOMAttribute:()=>O});module.exports=wt(qt);function S(e,t=r=>{}){var r;let n=()=>{var i,o;let a=new Promise((l,c)=>{i=u=>{e==null||e(u),l(u)},o=c});var s=Object.assign(a,{resolve:i,reject:o,restart:n,first:r});return r=s,s.catch(t),s};return n()}var Ne=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,x=class extends Ne{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=S(t=>{this.payload=t}),this.whenRendered=S(()=>this.initialized=!0,()=>this.cancelRender()),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let t=this.getParent();if(t&&!t.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(t){this.onError(t)}}dispatchEventIndirectly(t){this.dispatchEvent(t);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(t,"target",{value:this,writable:!1}),Object.defineProperty(t,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(t))}isJSONAttribute(t){return!1}log(...t){if(typeof process!="undefined"&&process.env.TESTING)return;let r=t[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+t.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...t.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected&&this.initialized&&this.render&&this.update(),this.cancelRender(),this.connected=!1,this.initialized&&this.render&&this.update())}getParent(t=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!t||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(t=this.getRoot(),r=!0){return Array.from(t.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(t){let r=t.composedPath()[0];switch(t.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(t){let r=this.descendants.indexOf(t);r!=-1&&(this.log("FEAAS: Unnest",this,t),this.descendants.splice(r,1),this.refs[t.getComponentName()]=null,t.refs.parent==this&&(t.refs.parent=null),t.refs.top==this&&(t.refs.top=t.refs.parent))}nestedCallback(t){var r,n;if(this.descendants.indexOf(t)==-1&&(this.descendants.push(t),this.log("FEAAS: Nest",this,t),this.refs[t.getComponentName()]=t,t.refs.top=this,(r=t.refs).parent||(r.parent=this),t.render))for(var o=t.refs.parent;o;o=o.refs.parent)o.render&&((n=t.refs).parentReact||(n.parentReact=o),t.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(t,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:t});if(this.dispatchEventIndirectly(i),this.whenLoaded.reject(t),!i.defaultPrevented&&!n){this.whenRendered.reject(t);try{this.unmount()}catch(o){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let t=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(t),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(t){this.onError(t)}}flush(){var t,r;if(!this.connected)return;let n=(r=(t=this.payload)===null||t===void 0?void 0:t.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var t,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:o,ReactDOMClient:a}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);this.getAttribute("hydrate")!="false"&&(!this.refs.topReact&&!this.forceUpdateReact?a?(this.reactRoot||(this.reactRoot=a.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact&&this.connected?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact)===null||r===void 0?void 0:r.forceUpdateReact)===null||n===void 0||n.call(r))}invokeReactRendering(){let{React:t,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload&&i.connected).map((i,o)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(t=this,r=t.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=t.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,s){console.error(`FEAAS: ${t.tagName} Error:`,a,s),t.onError(a,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},o=this.getReactErrorBoundary(),a=this.getReactWrapper(t);return n.createElement(o,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(a,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=o=>{if(t.render){let[a,s]=n.useReducer(l=>l+1,0);return t.forceUpdateReact=s,i.createPortal(n.createElement(n.Fragment,null,t.invokeReactRendering()),t.getReactRootElement())}else return t.update()},Object.assign(t.reactWrapper,{key:t.tagName+"-"+t.getUID(),displayName:r}),t.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(t){try{this.scheduleRender(),this.overrides={...this.overrides,...t},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let i=this.isJSONAttribute(r),o=this.props[r],a=i?JSON.stringify(o):String(o),s=this.defaultProps[r],l=i?JSON.stringify(s):String(s),c=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),u=this.getAttribute(c);try{var n=i?JSON.stringify(JSON.parse(u)):u}catch(h){var n=null}o==null||a===l?this.removeAttribute(c):(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||i)&&n!=a&&this.setAttribute(c,a)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(t,r){return typeof t=="string"&&t.match(/^\/[^\/]/)?r+t:t}getContextAttribute(t,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(t)!=null)return n.getAttribute(t);return this.getAttribute(t)}static register(t,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(t)&&r.customElements.define(t,this)}};var P=class extends x{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},ee=class extends P{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:t},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(o=>o+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};ee.observedAttributes=["counter"];var ie={};j(ie,{renderDOMContent:()=>T,renderDOMElement:()=>A,renderHTMLContent:()=>Ye,setDOMAttribute:()=>O});var te={};j(te,{JSONPath:()=>p,queryObject:()=>M,queryObjectRaw:()=>ge,queryScopes:()=>W,serializeCH1RichText:()=>R});function _(e){return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(e)}function Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $e(e,t,r){return t&&Oe(e.prototype,t),r&&Oe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function At(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}function U(e){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},U(e)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},B(e,t)}function Pe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function I(e,t,r){return Pe()?I=Reflect.construct.bind():I=function(i,o,a){var s=[null];s.push.apply(s,o);var l=Function.bind.apply(i,s),c=new l;return a&&B(c,a.prototype),c},I.apply(null,arguments)}function St(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function me(e){var t=typeof Map=="function"?new Map:void 0;return me=function(n){if(n===null||!St(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return I(n,arguments,U(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),B(i,n)},me(e)}function xt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Et(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xt(e)}function _t(e){var t=Pe();return function(){var n=U(e),i;if(t){var o=U(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Et(this,i)}}function Ct(e){return Dt(e)||Ft(e)||Me(e)||Rt()}function Dt(e){if(Array.isArray(e))return ye(e)}function Ft(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Me(e,t){if(e){if(typeof e=="string")return ye(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ye(e,t)}}function ye(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Rt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nt(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Me(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}}}var g=Object.prototype.hasOwnProperty;function F(e,t){return e=e.slice(),e.push(t),e}function ve(e,t){return t=t.slice(),t.unshift(e),t}var Ot=function(e){At(r,e);var t=_t(r);function r(n){var i;return Te(this,r),i=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return $e(r)}(me(Error));function p(e,t,r,n,i){if(!(this instanceof p))try{return new p(e,t,r,n,i)}catch(l){if(!l.avoidNew)throw l;return l.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var o=e&&_(e)==="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=g.call(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){var a={path:o?e.path:t};o?"json"in e&&(a.json=e.json):a.json=r;var s=this.evaluate(a);if(!s||_(s)!=="object")throw new Ot(s);return s}}p.prototype.evaluate=function(e,t,r,n){var i=this,o=this.parent,a=this.parentProperty,s=this.flatten,l=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&_(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!g.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var c=e;t=c.json,s=g.call(e,"flatten")?e.flatten:s,this.currResultType=g.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=g.call(e,"sandbox")?e.sandbox:this.currSandbox,l=g.call(e,"wrap")?e.wrap:l,this.currPreventEval=g.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=g.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=g.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=g.call(e,"parent")?e.parent:o,a=g.call(e,"parentProperty")?e.parentProperty:a,e=e.path}if(o=o||null,a=a||null,Array.isArray(e)&&(e=p.toPathString(e)),!(!e&&e!==""||!t)){var u=p.toPathArray(e);u[0]==="$"&&u.length>1&&u.shift(),this._hasParentSelector=null;var h=this._trace(u,t,["$"],o,a,r).filter(function(d){return d&&!d.isParentSelector});return h.length?!l&&h.length===1&&!h[0].hasArrExpr?this._getPreferredOutput(h[0]):h.reduce(function(d,f){var b=i._getPreferredOutput(f);return s&&Array.isArray(b)?d=d.concat(b):d.push(b),d},[]):l?[]:void 0}};p.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":{var r=Array.isArray(e.path)?e.path:p.toPathArray(e.path);return e.pointer=p.toPointer(r),e.path=typeof e.path=="string"?e.path:p.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return p.toPathString(e[t]);case"pointer":return p.toPointer(e.path);default:throw new TypeError("Unknown result type")}};p.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:p.toPathString(e.path),t(n,r,e)}};p.prototype._trace=function(e,t,r,n,i,o,a,s){var l=this,c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(c,o,"value"),c;var u=e[0],h=e.slice(1),d=[];function f(v){Array.isArray(v)?v.forEach(function(mt){d.push(mt)}):d.push(v)}if((typeof u!="string"||s)&&t&&g.call(t,u))f(this._trace(h,t[u],F(r,u),t,u,o,a));else if(u==="*")this._walk(t,function(v){f(l._trace(h,t[v],F(r,v),t,v,o,!0,!0))});else if(u==="..")f(this._trace(h,t,r,n,i,o,a)),this._walk(t,function(v){_(t[v])==="object"&&f(l._trace(e.slice(),t[v],F(r,v),t,v,o,!0))});else{if(u==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(u==="~")return c={path:F(r,u),value:i,parent:n,parentProperty:null},this._handleCallback(c,o,"property"),c;if(u==="$")f(this._trace(h,t,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(u))f(this._slice(u,h,t,r,n,i,o));else if(u.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var b=u.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(t,function(v){l._eval(b,t[v],v,r,n,i)&&f(l._trace(h,t[v],F(r,v),t,v,o,!0))})}else if(u[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");f(this._trace(ve(this._eval(u,t,r[r.length-1],r.slice(0,-1),n,i),h),t,r,n,i,o,a))}else if(u[0]==="@"){var m=!1,y=u.slice(1,-2);switch(y){case"scalar":(!t||!["object","function"].includes(_(t)))&&(m=!0);break;case"boolean":case"string":case"undefined":case"function":_(t)===y&&(m=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(m=!0);break;case"number":Number.isFinite(t)&&(m=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(m=!0);break;case"object":t&&_(t)===y&&(m=!0);break;case"array":Array.isArray(t)&&(m=!0);break;case"other":m=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(m=!0);break;default:throw new TypeError("Unknown value type "+y)}if(m)return c={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(c,o,"value"),c}else if(u[0]==="`"&&t&&g.call(t,u.slice(1))){var E=u.slice(1);f(this._trace(h,t[E],F(r,E),t,E,o,a,!0))}else if(u.includes(",")){var ht=u.split(","),X=Nt(ht),Re;try{for(X.s();!(Re=X.n()).done;){var ft=Re.value;f(this._trace(ve(ft,h),t,r,n,i,o,!0))}}catch(v){X.e(v)}finally{X.f()}}else!s&&t&&g.call(t,u)&&f(this._trace(h,t[u],F(r,u),t,u,o,a,!0))}if(this._hasParentSelector)for(var D=0;D<d.length;D++){var Z=d[D];if(Z&&Z.isParentSelector){var L=this._trace(Z.expr,t,Z.path,n,i,o,a);if(Array.isArray(L)){d[D]=L[0];for(var pt=L.length,fe=1;fe<pt;fe++)D++,d.splice(D,0,L[fe])}else d[D]=L}}return d};p.prototype._walk=function(e,t){if(Array.isArray(e))for(var r=e.length,n=0;n<r;n++)t(n);else e&&_(e)==="object"&&Object.keys(e).forEach(function(i){t(i)})};p.prototype._slice=function(e,t,r,n,i,o,a){if(Array.isArray(r)){var s=r.length,l=e.split(":"),c=l[2]&&Number.parseInt(l[2])||1,u=l[0]&&Number.parseInt(l[0])||0,h=l[1]&&Number.parseInt(l[1])||s;u=u<0?Math.max(0,u+s):Math.min(s,u),h=h<0?Math.max(0,h+s):Math.min(s,h);for(var d=[],f=u;f<h;f+=c){var b=this._trace(ve(f,t),r,n,i,o,a,!0);b.forEach(function(m){d.push(m)})}return d}};p.prototype._eval=function(e,t,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;var a=e.includes("@path");a&&(this.currSandbox._$_path=p.toPathString(n.concat([r])));var s="script:"+e;if(!p.cache[s]){var l=e.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");a&&(l=l.replace(/@path/g,"_$_path")),p.cache[s]=new this.vm.Script(l)}try{return p.cache[s].runInNewContext(this.currSandbox)}catch(c){throw new Error("jsonPath: "+c.message+": "+e)}};p.cache={};p.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};p.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};p.toPathArray=function(e){var t=p.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(o,a){return"[#"+(r.push(a)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,a){return"['"+a.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,a){return";"+a.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var a=o.match(/#([0-9]+)/);return!a||!a[1]?o:r[a[1]]});return t[e]=i,t[e].concat()};var Tt=function(t,r,n){for(var i=t.length,o=0;o<i;o++){var a=t[o];n(a)&&r.push(t.splice(o--,1)[0])}},$t=function(){function e(t){Te(this,e),this.code=t}return $e(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];Tt(i,o,function(u){return typeof r[u]=="function"});var a=i.map(function(u,h){return r[u]}),s=o.reduce(function(u,h){var d=r[h].toString();return/function/.test(d)||(d="function "+d),"var "+h+"="+d+";"+u},"");n=s+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var l=n.lastIndexOf(";"),c=l>-1?n.slice(0,l+1)+" return "+n.slice(l+1):" return "+n;return I(Function,i.concat([c])).apply(void 0,Ct(a))}}]),e}();p.prototype.vm={Script:$t};function ge(e,t){try{return p({path:t,json:e})}catch(r){return[]}}function M(e,t){var r;return((r=ge(e,t))===null||r===void 0?void 0:r.flat(1/0))||[]}function W(e,t,r=!1,n=e){var i=t;let o=Object.keys(e).sort((s,l)=>l.length-s.length);for(let s of o)if(t.startsWith(s)){if(s==t){if(r)return e[s];continue}i=t.substring(s.length+1),n=e[s];break}var a=M(n,i);return Array.isArray(a)&&(a==null?void 0:a.length)==0&&(a=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),i.replace(/^.*?\.\$([\.\[])/,"_$1"),i.replace(/^.*?\.\$([\.\[])/,"$$$1"),i.replace(/^[^.]+$/,"_")].filter((s,l,c)=>c.indexOf(s)===l).reduce((s,l)=>s.length>0?s:M(n,l),[])),r&&Array.isArray(a)?a[0]:a}function be(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${R(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):R(e)}function R(e){var t;if(Array.isArray(e))return e.map(R).join(`
|
|
4
|
+
`).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return be(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>be(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return be(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var N=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new N(i)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return we(this.childNodes)}set innerHTML(t){this.childNodes=Ae(String(t!=null?t:""))}get outerHTML(){return we([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(ke(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=o=>{for(let a of r)if(ke(a,o)){n.push(o);break}for(let a of o.childNodes)i(a)};for(let o of this.childNodes)i(o);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let o=i+t;o>=0&&o<n.length;o+=t){let a=n[o];if(!r||a.nodeType===1)return a}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new N(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function ke(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let o=i[1],a=i[3],s=t.getAttribute(o);if(typeof a=="undefined"){if(s===void 0)return!1}else if(s!==a)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function Ae(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),o=e.match(/^<\/([\w-]+)>/);if(i){let a=i[1],l=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(u=>{let[h,d,,f]=u.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:Mt(f||"")}}))||[],c=new N(a,1);if(c.attributes=l,n.length>0){let u=n[n.length-1];u.childNodes.push(c),c.parentNode=u}else r.push(c);n.push(c),e=e.slice(i[0].length)}else if(o)n.pop(),e=e.slice(o[0].length);else{let a=e.indexOf("<"),s=e.slice(0,a!==-1?a:void 0),l=new N("#text",3);if(l.textContent=s,n.length>0){let c=n[n.length-1];c.childNodes.push(l),l.parentNode=c}else r.push(l);e=e.slice(s.length)}}return r}function Pt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Mt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function we(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:a,value:s})=>` ${a}="${Pt(String(s))}"`).join(""),o=we(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function Le(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&H(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&je(a,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function je(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];H(i,i.getAttribute("data-embed-src"))}if(t)return Le(e)}function H(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",t),r.appendChild(o);break}}var ne={};j(ne,{adjustNumbers:()=>We,cleanCollectionBit:()=>J,getHumanizedLabel:()=>He,getLastPathBit:()=>Je,getQualifier:()=>Be,normalizeCollectionScope:()=>re,parseLimit:()=>Ie,parseRange:()=>Ue});var Ie=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},Ue=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},Be=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function J(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function re(e){return J(e)+".*"}function We(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+t)))}function He(e,t=2){var r=J(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-t).join(" ")}function Je(e){return J(e).split(".").pop()}var kt=["January","February","March","April","May","June","July","August","September","October","November","December"],ze=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=kt[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`},Ve=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function Ge(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function Lt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=Ge(e);if(i!=0)return;let o=e.parentNode;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var a=i+1,s=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(a++,s=l);for(var c=a;c<t;c++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var c=Math.max(1,t);c<a;c++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function O(e,t,r,n){var i,o,a;if(!e)return;var s=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=R(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var l=t.replace("data-path-","");if(t=="data-path-src"||t=="data-path-alt"){let y=Array.from(e.children).find(E=>E.localName=="picture")||e;s=e.localName=="img"?e:y.querySelector("img, video")}else if(t=="data-path-href")s=e.querySelector("a")||e.closest("a");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")l="innerHTML";else if(t=="data-embed-src")H(e,r);else if(t=="data-path-attributes"){let y=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var c in r){var u=r[c];O(e,c,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var h=0;h<y.length;h++)(r==null||!(y[h]in r))&&O(e,y[h],null,n);O(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!s)return;if((l=="innerHTML"||l=="src")&&(r==null||r==="")){var f=String((a=(o=e.getAttribute("data-path-placeholder")||s[l])!==null&&o!==void 0?o:s.getAttribute(l))!==null&&a!==void 0?a:"");l=="innerHTML"?s.innerHTML=f:f?s.setAttribute(l,f):s.removeAttribute(l)}else if(r!=null)if(l=="innerHTML"){for(var b=String(r),m=s;m.parentElement&&m.localName.match(/^(a|var|strong|em|i|b)$/);)m=m.parentElement;m.localName.match(/p|h\d|button|time|li/)&&(b=b.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(m.getAttribute("class")).includes("-inline--time")&&Ve(b)&&(b=ze(new Date(b))),s.innerHTML!=b&&(s.innerHTML=b)}else s.getAttribute(l)!=r&&s.setAttribute(l,r);else s.removeAttribute(l)}var qe=["data-attributes-keys","data-path-attributes","data-path-scope"];function A(e,t,r,n){var i,o,a;let s=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,s,t))||t),s.nodeType==1){let u=s.getAttribute("data-path-scope");if(u){let d=Ge(s),f=W(t,u,!1);d==0&&Lt(s,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,s,f))===!1?1:f.length,r),t={...t,[re(u)]:f[d]}}let h=Array.prototype.slice.call(s.attributes).sort((d,f)=>qe.indexOf(d.name)-qe.indexOf(f.name));for(var l=0;l<h.length;l++){let{name:d,value:f}=h[l];d.startsWith("data-path")&&d!="data-path-scope"&&O(s,d,W(t,f,!0),r),d=="data-embed-src"&&O(s,d,s.getAttribute(d),r)}}for(var l=0,c;c=s.childNodes[l++];)Ke(c)&&A(c,t,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,t),s}function Ke(e){return e.nodeType==1}function T(e,t,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=o,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var s=0,l;l=e.childNodes[s++];)Ke(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return A(e,r,n)}function Ye(e,t,r,n=!1){var i;let o=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let a=Ae(o);return A(a[0],t,r).outerHTML}else{let a=document.createElement("div");return a.innerHTML=o,A(a,t,r),a.innerHTML}}var Qe=["initial","check","updated"],z={};function jt(){z={}}async function V(e,t,r,n,i=z){return $({url:e,options:t,validator:r,callback:n,cache:i}).then(q).then(o=>o.response)}function Xe(e,t=!1){let r=String(e).replace("?head","");var n=z[r];return!n&&!t&&(n=z[r]={phase:null,initial:S(),check:S(),updated:S(),final:S()}),n}var oe=class extends Error{};async function $({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let a=new Date;if(i!=null){var s=Xe(e);if(Qe.indexOf(s.phase)>=Qe.indexOf(o))var l=s[o];else s.phase=o}let c=await(l||fetch(e,t));if(!l&&s&&(c.ok?s[o].resolve(c):s[o].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");let u=new Date(c.headers.get("date"))<a||l&&o=="initial"&&(s.phase=="updated"||s.phase=="check");if((r==null?void 0:r(c,u))===!1)throw new oe("Response is not valid");return await(n==null?void 0:n(c,o,u)),{url:e,options:t,isCached:u,response:c,validator:r,callback:n,cache:i}}async function q(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:a}=e;if(r){let{response:s}=await $({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:a},"check");if(s.headers.get("last-modified")!=o.headers.get("last-modified"))return ae(e)}return e}async function ae(e){return $({...e,options:{...e.options,cache:"reload"}},"updated")}var C="https://feaas.blob.core.windows.net";function G(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,a]=t;return{cdn:r,library:n,component:i,version:o,revision:a}}}function It(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=C?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Ut(e){return`${e.cdn&&e.cdn!=C?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function se(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let o=G(e);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function Se(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...G(e.src)}),`${e.cdn||e.hostname||C}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function K(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...se(e.src)}),`${e.cdn||e.hostname||C}/styles/${e.library}/${e.revision||"published"}.css`}async function k(e,t,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>s.clone().text().then(t),o=await Promise.all([e.instance&&$({options:{headers:{Accept:"text/html"},credentials:"omit"},url:Se({...e,version:e.instance}),validator:n}).catch(s=>s),$({url:Se(e),validator:n}).catch(s=>s)]),a=o.find(s=>s&&"isCached"in s&&s);if(!a||a instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==a&&console.log("Using fork!",o),await i(a.response),r?a:q({...a,callback:i}).catch(s=>{if(o[0]==a&&(ae({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),q({...o[1],callback:i});throw s})}async function Bt(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await k(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function le(e,t){return typeof e=="string"&&(e={src:e}),V(K(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function Wt(e,t){return Ze(e,t||(t=document.createElement("style"))),t}function Ze(e,t){return t||(t=document.createElement("style")),le(e,(r,n)=>{t.textContent=r}).then(()=>t)}function ue(e,t){var r=et(e);if(!r)var n=tt(e);return le(e,(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function xe(e){return new Promise((t,r)=>{ue(e,t).catch(r)})}function et(e){return document.head.querySelector(`style[data-href="${K(e)}"]`)}function tt(e){let t=K(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function Ht(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,t),r}function Ee(e,t){return rt(e,t||(t=document.createElement("div"))),t}async function rt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?A(t,e.data,e):"template"in e?T(t,e.template,e.data,e):k(e,r=>T(t,r,e.data,e)).then(()=>t)}function Jt(e){let{params:t,method:r,headers:n,body:i,url:o}=w(e);var a={url:o},s={...n};return n["Content-Type"]==="application/json"&&delete s["Content-Type"],n.Accept==="application/json"&&delete s.Accept,Object.keys(s).length>0&&(a.headers=s),r!=="GET"&&(a.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(a.body=i),Object.keys(t).length>0&&(a={...a,params:t}),a}var ce=e=>{if(typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0};function nt(e){let{url:t,headers:r,params:n,method:i,body:o}=w(e),a,s=r["Content-Type"];i!="GET"&&i!="HEAD"&&(s==="application/json"&&(a=JSON.stringify(o)),s==="multipart/form-data"&&(a=Object.keys(o).reduce((c,u)=>(c.append(u,o[u]),c),new FormData)),s==="application/x-www-form-urlencoded"&&(a=new URLSearchParams(o)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${l}`,{headers:r,body:a,method:i}]}function w(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());t[n]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(e==null?void 0:e.params)||{},headers:t,jsonpath:String((e==null?void 0:e.jsonpath)||"$"),method:((e==null?void 0:e.method)||"GET").toUpperCase(),body:(e==null?void 0:e.body)||{},url:String((e==null?void 0:e.url)||"")}}var _e=async e=>{try{let[t,r]=nt(e),i=await(await w.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?M(i,e.jsonpath):i}catch(t){return{}}};async function Ce(e){if(!e)return e;if(ce(e))return _e(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>ce(e[n])?_e(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:ce(e[i])?r.shift():e[i]}),{})}w.clean=Jt;w.toFetchArguments=nt;w.fetchOne=_e;w.fetch=Ce;w.isDataSettings=ce;w.fetchImplementation=(...e)=>fetch(...e);function it(e){var t,r,n,i,o,a,s,l;let c,u=e.getAttribute("src");if(u){let E=G(u);if(!E)throw new Error(`Could not parse FEAAS Component source: ${u}`);var{cdn:h,library:d,component:f,version:b,revision:m}=E}let y=e.getAttribute("data");if(y!=null&&y!="")try{c=typeof y=="string"?JSON.parse(y):{}}catch(E){console.error(E)}return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:h)!==null&&r!==void 0?r:C,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:f,version:(a=(o=e.getAttribute("version"))!==null&&o!==void 0?o:b)!==null&&a!==void 0?a:"responsive",revision:(l=(s=e.getAttribute("revision"))!==null&&s!==void 0?s:m)!==null&&l!==void 0?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var Y=class extends x{setData(t){this.set({data:t})}getProps(){return it(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,n),t==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await w.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=S(t=>this.readyData=t,t=>this.onError(t)),this.defaultProps={cdn:C,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=t=>{this.payload=t,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(this.getOriginal())return;let t=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=xe({...this.props,revision:"published"}).then(()=>{r=null,t()});return Promise.all([r,this.whenDataReady.then(()=>t()),k(this.props,n=>{this.payload=n,t()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,this.getAttribute("hydrate")!="false")if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)A(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;T(this,this.payload,this.readyData)}}};Y.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];Y.register("feaas-component");function ot(e){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var Q=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return ot(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
|
|
5
5
|
#loader {
|
|
6
6
|
position: absolute;
|
|
7
7
|
top: 0;
|
|
@@ -65,10 +65,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
65
65
|
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
66
66
|
></circle>
|
|
67
67
|
</svg>
|
|
68
|
-
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};Q.observedAttributes=["hidden","opacity"];Q.register("feaas-loader");function at(e){var t,r,n,i;let
|
|
68
|
+
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};Q.observedAttributes=["hidden","opacity"];Q.register("feaas-loader");function at(e){var t,r,n,i;let o=e.getAttribute("src");if(o)var{cdn:a,library:s,revision:l}=se(o);return{library:e==null?void 0:e.getContextAttribute("library"),revision:(r=(t=e==null?void 0:e.getAttribute("revision"))!==null&&t!==void 0?t:l)!==null&&r!==void 0?r:"published",cdn:(i=(n=e==null?void 0:e.getContextAttribute("cdn"))!==null&&n!==void 0?n:e==null?void 0:e.getContextAttribute("hostname"))!==null&&i!==void 0?i:C}}var de=class extends x{constructor(){super(...arguments),this.onLoad=t=>{this.payload=t,this.advance()}}getProps(){return at(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return ue(this.props,this.onLoad)}};de.register("feaas-stylesheet");var he={};j(he,{convertBase64toBlob:()=>st,generate:()=>ct,get:()=>zt,getVersionForThumbnail:()=>lt,load:()=>ut,responseToImage:()=>De,upload:()=>dt});var st=e=>fetch(e).then(t=>t.blob()),De=e=>e.blob().then(t=>new Promise((r,n)=>{let i=new Image;i.onerror=n,i.onload=()=>{r(i)},i.src=URL.createObjectURL(t)}));async function lt(e){return e.versions.length||await e.versions.fetch(),e.getVersionForWidth(800)}async function zt(e,t,r){try{if(!e.isNew)return await ut(e,t,r)}catch(i){e.sdk.log(`FEAAS: Thumbnail ${e.id}, version: ${(t==null?void 0:t.id)||"responsive"}, status: generating ${status}, reason: ${i}`)}let n=await ct(e,t);return r==null||r(n,!1),n&&!e.isNew&&st(n.src).then(i=>dt(e,t,i)),n}async function ut(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=e.library.stylesheet,o=new Date(Math.max(Number(e.modifiedAt),Number(i.modifiedAt)));e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, loading`);var a;return await V(n,{},(s,l)=>{let c=Math.abs(Number(new Date(s.headers.get("x-ms-meta-componentRenderedAt")))-Number(o))<2e3;return l&&!c&&De(s).then(u=>{a=u,r(u,l)}),c},(s,l,c)=>{e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, status: ${l}`),De(s).then(u=>{a=u,r(u,c)})},null),a}async function ct(e,t,r){let n=t||(e.isNew?null:await lt(e));if(!n||n.isViewEmpty())return null;let i=r||e.library.stylesheets.first,{datasources:o}=e.sdk;return await Vt(n.classList,i.getBreakpointForWidth(800,n.getBreakpoints()),n.view,o.reduce((s,l)=>Object.assign(s,{[l.id]:l.sample}),{}),i.css,e.sdk)}function Vt(e,t,r,n,i,o){let a=document.createElement("iframe");return a.style.position="absolute",a.style.top="-2000px",a.style.left="-2000px",a.style.width=t.props.minWidth+"px",a.style.height="720px",a.style.zIndex="100011",document.body.appendChild(a),new Promise((s,l)=>{let c=document.createElement("script");c.onerror=l,c.src=o.frontend+"/assets/html2canvas.js",c.onload=()=>{var f;(((f=a.contentWindow.document.fonts)===null||f===void 0?void 0:f.ready)||Promise.resolve()).then(function(){return a.contentWindow.html2canvas(d,{scale:Math.max(1.1,1e3/Math.min(1401,Math.max(320,t.props.minWidth))),width:Math.min(1401,Math.max(320,t.props.minWidth)),height:Math.max(1,Math.min(2e3,d.offsetHeight)),windowWidth:t.props.minWidth+"px",windowHeight:1e3,proxy:o.backend+"/proxy/media",backgroundColor:"#ffffff"}).then(b=>{let m=b.toDataURL("image/jpeg",.6);a.parentElement.removeChild(a);let y=new Image;y.onload=()=>{s(y)},y.onerror=l,y.src=m})})},a.contentWindow.document.head.appendChild(c);let u=a.contentWindow.document.createElement("style");u.textContent=`
|
|
69
69
|
${i}
|
|
70
70
|
body, html { padding: 0; margin: 0; overflow: hidden }
|
|
71
|
-
`;let
|
|
71
|
+
`;let h=a.contentWindow.document.createElement("style");h.textContent=`
|
|
72
72
|
body, html { padding: 0; margin: 0; overflow: hidden }
|
|
73
|
-
`,
|
|
73
|
+
`,a.contentWindow.document.head.appendChild(u),a.contentWindow.document.head.appendChild(h);let d=Ee({template:r,data:n});d.classList.add(...e,"-feaas--preview","-emulate--"+t.details.slug),a.contentWindow.document.body.appendChild(d)})}async function dt(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=new Date(Math.max(Number(e.modifiedAt),Number(e.library.stylesheet.modifiedAt)));try{await e.sdk.uploadBlob("thumbnails",n.split(/\/thumbnails\//)[1],r,{headers:{"x-ms-blob-content-type":"image/jpg","x-ms-blob-cache-control":"public,max-age=31536000,immutable","x-ms-meta-versionId":t?t.id:null,"x-ms-meta-versionRevision":t?t.revision.toString():null,"x-ms-meta-componentId":e.id,"x-ms-meta-componentRenderedAt":i.toUTCString(),"x-ms-meta-componentModifiedAt":e.modifiedAt.toUTCString(),"x-ms-meta-componentCreatedAt":e.createdAt.toUTCString(),"x-ms-meta-modifiedAt":e.modifiedAt.toUTCString()}}),fetch(n,{cache:"no-cache"}).then(()=>{e.sdk.log("FEAAS: Thumbnail uploaded",n)})}catch(o){e.sdk.log("FEAAS: Thumbnail failed to upload",n,o)}return n}var Fe;typeof window!="undefined"&&(window.FEAASReactElement=P,(Fe=window.FEAASLoading)!==null&&Fe!==void 0||(window.FEAASLoading=Promise.resolve()));
|
|
74
74
|
//# sourceMappingURL=headless.cjs.map
|