@fluid-topics/ft-app-context 0.3.58
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 +22 -0
- package/build/ft-app-context.css.d.ts +3 -0
- package/build/ft-app-context.css.js +6 -0
- package/build/ft-app-context.d.ts +24 -0
- package/build/ft-app-context.js +114 -0
- package/build/ft-app-context.light.js +4 -0
- package/build/ft-app-context.min.js +95 -0
- package/build/ft-app-context.properties.d.ts +13 -0
- package/build/ft-app-context.properties.js +2 -0
- package/build/index.d.ts +6 -0
- package/build/index.js +9 -0
- package/build/redux-stores/FtAppInfoStore.d.ts +27 -0
- package/build/redux-stores/FtAppInfoStore.js +36 -0
- package/build/services/FtI18nService.d.ts +34 -0
- package/build/services/FtI18nService.js +99 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Global application context for Fluid Topics integrations
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```shell
|
|
6
|
+
npm install @fluid-topics/ft-app-context
|
|
7
|
+
yarn add @fluid-topics/ft-app-context
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import { html } from "lit"
|
|
14
|
+
import "@fluid-topics/ft-app-context"
|
|
15
|
+
|
|
16
|
+
function render() {
|
|
17
|
+
return html` <ft-app-context
|
|
18
|
+
baseUrl="https://ft-tenant.com"
|
|
19
|
+
apiIntegrationIdentifier="my-ft-tenant-integration"
|
|
20
|
+
></ft-app-context> `
|
|
21
|
+
}
|
|
22
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PropertyValues } from "lit";
|
|
2
|
+
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FtAppContextProperties } from "./ft-app-context.properties";
|
|
4
|
+
import { FtMessageContext, FtSession } from "@fluid-topics/public-api";
|
|
5
|
+
export declare class FtAppContext extends FtLitElement implements FtAppContextProperties {
|
|
6
|
+
static elementDefinitions: ElementDefinitionsMap;
|
|
7
|
+
static styles: import("lit").CSSResult;
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
apiIntegrationIdentifier: string;
|
|
10
|
+
uiLocale: string;
|
|
11
|
+
editorMode: boolean;
|
|
12
|
+
noCustom: boolean;
|
|
13
|
+
noCustomComponent: boolean | string;
|
|
14
|
+
withManualResources: boolean;
|
|
15
|
+
messageContexts: FtMessageContext[];
|
|
16
|
+
session?: FtSession;
|
|
17
|
+
apiProvider: () => import("@fluid-topics/public-api").FluidTopicsApi | undefined;
|
|
18
|
+
private cache;
|
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
20
|
+
updated(props: PropertyValues<FtAppContext>): void;
|
|
21
|
+
private cleanSessionDebouncer;
|
|
22
|
+
private updateIfNeeded;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=ft-app-context.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html } from "lit";
|
|
8
|
+
import { property } from "lit/decorators.js";
|
|
9
|
+
import { CacheRegistry, Debouncer, FtLitElement, jsonProperty } from "@fluid-topics/ft-wc-utils";
|
|
10
|
+
import { styles } from "./ft-app-context.css";
|
|
11
|
+
import { ftAppInfoStore } from "./redux-stores/FtAppInfoStore";
|
|
12
|
+
import { ftI18nService } from "./services/FtI18nService";
|
|
13
|
+
export class FtAppContext extends FtLitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.apiIntegrationIdentifier = "ft-integration";
|
|
17
|
+
this.uiLocale = "en-US";
|
|
18
|
+
this.editorMode = false;
|
|
19
|
+
this.noCustom = false;
|
|
20
|
+
this.noCustomComponent = false;
|
|
21
|
+
this.withManualResources = false;
|
|
22
|
+
this.messageContexts = [];
|
|
23
|
+
this.apiProvider = () => window.fluidtopics && this.baseUrl ? new window.fluidtopics.FluidTopicsApi(this.baseUrl, this.apiIntegrationIdentifier, true) : undefined;
|
|
24
|
+
this.cache = new CacheRegistry();
|
|
25
|
+
this.cleanSessionDebouncer = new Debouncer();
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return html `
|
|
29
|
+
<slot></slot>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
updated(props) {
|
|
33
|
+
super.updated(props);
|
|
34
|
+
if (props.has("baseUrl")) {
|
|
35
|
+
ftAppInfoStore.actions.setBaseUrl(this.baseUrl);
|
|
36
|
+
}
|
|
37
|
+
if (props.has("apiIntegrationIdentifier")) {
|
|
38
|
+
ftAppInfoStore.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier);
|
|
39
|
+
}
|
|
40
|
+
if (props.has("uiLocale")) {
|
|
41
|
+
ftAppInfoStore.actions.setUiLocale(this.uiLocale);
|
|
42
|
+
}
|
|
43
|
+
if (props.has("noCustom")) {
|
|
44
|
+
ftAppInfoStore.actions.setNoCustom(this.noCustom);
|
|
45
|
+
}
|
|
46
|
+
if (props.has("editorMode")) {
|
|
47
|
+
ftAppInfoStore.actions.setEditorMode(this.editorMode);
|
|
48
|
+
}
|
|
49
|
+
if (props.has("noCustomComponent")) {
|
|
50
|
+
ftAppInfoStore.actions.setNoCustomComponent(this.noCustomComponent);
|
|
51
|
+
}
|
|
52
|
+
if (props.has("session")) {
|
|
53
|
+
ftAppInfoStore.actions.setSession(this.session);
|
|
54
|
+
}
|
|
55
|
+
if (props.has("messageContexts") && this.messageContexts != null) {
|
|
56
|
+
this.messageContexts.forEach(context => ftI18nService.addContext(context));
|
|
57
|
+
}
|
|
58
|
+
setTimeout(() => this.updateIfNeeded());
|
|
59
|
+
}
|
|
60
|
+
async updateIfNeeded() {
|
|
61
|
+
const api = this.apiProvider();
|
|
62
|
+
if (!this.withManualResources && api && this.session == null) {
|
|
63
|
+
this.session = await this.cache.get("session", async () => {
|
|
64
|
+
const currentSession = await api.getCurrentSession();
|
|
65
|
+
if (currentSession.idleTimeoutInMillis > 0) {
|
|
66
|
+
this.cleanSessionDebouncer.run(() => {
|
|
67
|
+
this.cache.clear("session");
|
|
68
|
+
this.session = undefined;
|
|
69
|
+
}, currentSession.idleTimeoutInMillis);
|
|
70
|
+
}
|
|
71
|
+
return currentSession;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
FtAppContext.elementDefinitions = {};
|
|
77
|
+
FtAppContext.styles = styles;
|
|
78
|
+
__decorate([
|
|
79
|
+
property()
|
|
80
|
+
], FtAppContext.prototype, "baseUrl", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
property()
|
|
83
|
+
], FtAppContext.prototype, "apiIntegrationIdentifier", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property()
|
|
86
|
+
], FtAppContext.prototype, "uiLocale", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
property({ type: Boolean })
|
|
89
|
+
], FtAppContext.prototype, "editorMode", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ type: Boolean })
|
|
92
|
+
], FtAppContext.prototype, "noCustom", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
property({
|
|
95
|
+
converter: {
|
|
96
|
+
fromAttribute(value) {
|
|
97
|
+
return value === "false" ? false : (value === "true" || (value !== null && value !== void 0 ? value : false));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
], FtAppContext.prototype, "noCustomComponent", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
property({ type: Boolean })
|
|
104
|
+
], FtAppContext.prototype, "withManualResources", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
jsonProperty([])
|
|
107
|
+
], FtAppContext.prototype, "messageContexts", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
jsonProperty(undefined)
|
|
110
|
+
], FtAppContext.prototype, "session", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
property({ type: Object })
|
|
113
|
+
], FtAppContext.prototype, "apiProvider", void 0);
|
|
114
|
+
//# sourceMappingURL=ft-app-context.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
!function(t,i,s,e){const o=s.css`
|
|
2
|
+
`,n="ft-app-info",h=i.FtReduxStore.get({name:n,reducers:{setBaseUrl:(t,i)=>{t.baseUrl=i.payload},setApiIntegrationIdentifier:(t,i)=>{t.apiIntegrationIdentifier=i.payload},setUiLocale:(t,i)=>{t.uiLocale=i.payload},setEditorMode:(t,i)=>{t.editorMode=i.payload},setNoCustom:(t,i)=>{t.noCustom=i.payload},setNoCustomComponent:(t,i)=>{t.noCustomComponent=i.payload},setSession:(t,i)=>{t.session=i.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",editorMode:!1,noCustom:!1,noCustomComponent:!1}});var a;const r=Symbol("clearAfterUnitTest");class l{constructor(t){this.apiProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentBaseUrl="",this.currentUiLocale="",this[a]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},h.subscribe((()=>this.updateApi())),this.updateApi()}updateApi(){const{baseUrl:t,apiIntegrationIdentifier:i,uiLocale:s}=h.getState();t&&i?(this.api=this.apiProvider(t,i),(this.api&&this.currentBaseUrl!==t||this.currentUiLocale!==s)&&(this.currentBaseUrl=t,this.currentUiLocale=s,this.cache.clearAll(),this.notifyAll())):this.api=void 0}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,s){var e;if(t=t.toLowerCase(),Object.keys(s).length>0){const o={...null!==(e=this.defaultMessages[t])&&void 0!==e?e:{},...s};i.deepEqual(this.defaultMessages[t],o)||(this.defaultMessages[t]=o,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,s,...e){var o,n,h;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(o=this.cache.getNow(t))||void 0===o?void 0:o.messages)&&void 0!==n?n:{};return new i.ParametrizedLabelResolver(null!==(h=this.defaultMessages[t])&&void 0!==h?h:{},a).resolve(s,...e)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(async()=>{var i;return await(null===(i=this.api)||void 0===i?void 0:i.getFluidTopicsMessageContext(this.currentUiLocale,t))})),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var s;return t=t.toLowerCase(),this.listeners[t]=null!==(s=this.listeners[t])&&void 0!==s?s:new Set,this.listeners[t].add(i),()=>{var s;return null===(s=this.listeners[t])||void 0===s?void 0:s.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}a=r,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new l(((t,i)=>window.fluidtopics?new window.fluidtopics.FluidTopicsApi(t,i,!0):void 0)));const d=window.FluidTopicsI18nService;var u=function(t,i,s,e){for(var o,n=arguments.length,h=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(h=(n<3?o(h):n>3?o(i,s,h):o(i,s))||h);return n>3&&h&&Object.defineProperty(i,s,h),h};class c extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>window.fluidtopics&&this.baseUrl?new window.fluidtopics.FluidTopicsApi(this.baseUrl,this.apiIntegrationIdentifier,!0):void 0,this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return s.html`
|
|
3
|
+
<slot></slot>
|
|
4
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&h.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&h.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&h.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&h.actions.setNoCustom(this.noCustom),t.has("editorMode")&&h.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&h.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&h.actions.setSession(this.session),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>d.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&null==this.session&&(this.session=await this.cache.get("session",(async()=>{const i=await t.getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),i.idleTimeoutInMillis),i})))}}c.elementDefinitions={},c.styles=o,u([e.property()],c.prototype,"baseUrl",void 0),u([e.property()],c.prototype,"apiIntegrationIdentifier",void 0),u([e.property()],c.prototype,"uiLocale",void 0),u([e.property({type:Boolean})],c.prototype,"editorMode",void 0),u([e.property({type:Boolean})],c.prototype,"noCustom",void 0),u([e.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],c.prototype,"noCustomComponent",void 0),u([e.property({type:Boolean})],c.prototype,"withManualResources",void 0),u([i.jsonProperty([])],c.prototype,"messageContexts",void 0),u([i.jsonProperty(void 0)],c.prototype,"session",void 0),u([e.property({type:Object})],c.prototype,"apiProvider",void 0),i.customElement("ft-app-context")(c),t.FtAppContext=c,t.FtAppContextCssVariables={},t.FtAppInfoStoreName=n,t.FtI18nServiceInternalClass=l,t.clearAfterUnitTest=r,t.ftAppInfoStore=h,t.ftI18nService=d,t.styles=o,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
!function(t){
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
|
|
5
|
+
* This code may only be used under the BSD style license found at
|
|
6
|
+
* http://polymer.github.io/LICENSE.txt
|
|
7
|
+
* The complete set of authors may be found at
|
|
8
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
9
|
+
* The complete set of contributors may be found at
|
|
10
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
11
|
+
* Code distributed by Google as part of the polymer project is also
|
|
12
|
+
* subject to an additional IP rights grant found at
|
|
13
|
+
* http://polymer.github.io/PATENTS.txt
|
|
14
|
+
*
|
|
15
|
+
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
16
|
+
*/
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,n=window.customElements.get,i=window.customElements,r=new WeakMap,o=new WeakMap,s=new WeakMap,u=new WeakMap;let c;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,r){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(r))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const u=r.prototype.attributeChangedCallback,c=new Set(r.observedAttributes||[]);h(r,c,u);const a={elementClass:r,connectedCallback:r.prototype.connectedCallback,disconnectedCallback:r.prototype.disconnectedCallback,adoptedCallback:r.prototype.adoptedCallback,attributeChangedCallback:u,formAssociated:r.formAssociated,formAssociatedCallback:r.prototype.formAssociatedCallback,formDisabledCallback:r.prototype.formDisabledCallback,formResetCallback:r.prototype.formResetCallback,formStateRestoreCallback:r.prototype.formStateRestoreCallback,observedAttributes:c};this._definitionsByTag.set(t,a),this._definitionsByClass.set(r,a);let l=n.call(i,t);l||(l=f(t),e.call(i,t,l)),this===window.customElements&&(s.set(r,a),a.standInClass=l);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)o.delete(t),v(t,a,!0)}const p=this._whenDefinedPromises.get(t);return void 0!==p&&(p.resolve(r),this._whenDefinedPromises.delete(t)),r}upgrade(){b.push(this),i.upgrade.apply(i,arguments),b.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let n=this._whenDefinedPromises.get(t);return void 0===n&&(n={},n.promise=new Promise((t=>n.resolve=t)),this._whenDefinedPromises.set(t,n)),n.promise}_upgradeWhenDefined(t,e,n){let i=this._awaitingUpgrade.get(e);i||this._awaitingUpgrade.set(e,i=new Set),n?i.add(t):i.delete(t)}},window.HTMLElement=function(){let e=c;if(e)return c=void 0,e;const n=s.get(this.constructor);if(!n)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],n.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),r.set(e,n),e},window.HTMLElement.prototype=t.prototype;const a=t=>t===document||t instanceof ShadowRoot,l=t=>{let e=t.getRootNode();if(!a(e)){const t=b[b.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),a(e)||(e=u.get(e)?.getRootNode()||document)}return e.customElements},f=e=>class{static get formAssociated(){return!0}constructor(){const n=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(n,HTMLElement.prototype);const i=l(n)||window.customElements,r=i._getDefinition(e);return r?v(n,r):o.set(n,i),n}connectedCallback(){const t=r.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):o.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=r.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):o.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){r.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=r.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=r.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=r.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=r.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},h=(t,e,n)=>{if(0===e.size||void 0===n)return;const i=t.prototype.setAttribute;i&&(t.prototype.setAttribute=function(t,r){const o=t.toLowerCase();if(e.has(o)){const t=this.getAttribute(o);i.call(this,o,r),n.call(this,o,t,r)}else i.call(this,o,r)});const r=t.prototype.removeAttribute;r&&(t.prototype.removeAttribute=function(t){const i=t.toLowerCase();if(e.has(i)){const t=this.getAttribute(i);r.call(this,i),n.call(this,i,t,null)}else r.call(this,i)})},d=e=>{const n=Object.getPrototypeOf(e);if(n!==window.HTMLElement)return n===t||"HTMLElement"===n?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):d(n)},v=(t,e,n=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),r.set(t,e),c=t;try{new e.elementClass}catch(t){d(e.elementClass),new e.elementClass}e.observedAttributes.forEach((n=>{t.hasAttribute(n)&&e.attributeChangedCallback.call(t,n,null,t.getAttribute(n))})),n&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},p=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=p.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let b=[document];const w=(t,e,n)=>{const i=(n?Object.getPrototypeOf(n):t.prototype)[e];t.prototype[e]=function(){b.push(this);const t=i.apply(n||this,arguments);return void 0!==t&&u.set(t,this),b.pop(),t}};w(ShadowRoot,"createElement",document),w(ShadowRoot,"importNode",document),w(Element,"insertAdjacentHTML");const y=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...n,set(t){b.push(this),n.set.call(this,t),b.pop()}})};if(y(Element,"innerHTML"),y(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,n=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...n){const i=e.call(this,...n);return t.set(i,this),i},n.forEach((e=>{const n=window.ElementInternals.prototype,i=n[e];n[e]=function(...e){const n=t.get(this);if(!0!==r.get(n).formAssociated)throw new DOMException(`Failed to execute ${i} on 'ElementInternals': The target element is not a form-associated custom element.`);i?.call(this,...e)}}));class i extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class o{constructor(t){const e=new Map;t.forEach(((t,n)=>{const i=t.getAttribute("name"),r=e.get(i)||[];this[+n]=t,r.push(t),e.set(i,r)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new i(t))}))}namedItem(t){return this[t]}}const s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=s.get.call(this,[]),e=[];for(const n of t){const t=r.get(n);t&&!0!==t.formAssociated||e.push(n)}return new o(e)}})}}try{window.customElements.define("custom-element",null)}catch(t){const e=window.customElements.define;window.customElements.define=(t,n,i)=>{try{e.bind(window.customElements)(t,n,i)}catch(e){console.info(t,n,i,e)}}}class e extends Promise{constructor(t){super(((e,n)=>t((t=>{this.isCanceled?n(new Error("Promise has been canceled")):e(t)}),(t=>{this.isCanceled?n(new Error("Promise has been canceled")):n(t)})))),this.isCanceled=!1}cancel(){this.isCanceled=!0}}class n{constructor(){this.loaders={},this.content={},this.finalContent=new Set}register(t,e){this.loaders[t]=e,this.finalContent.delete(t)}registerFinal(t,e){this.loaders[t]=e,this.finalContent.add(t)}clearAll(){for(let t in this.content)this.clear(t)}clear(t){this.finalContent.has(t)||this.forceClear(t)}forceClear(t){this.content[t]instanceof e&&this.content[t].cancel(),delete this.content[t]}set(t,e){this.forceClear(t),this.register(t,(async()=>e)),this.content[t]=e}setFinal(t,e){this.forceClear(t),this.registerFinal(t,(async()=>e)),this.content[t]=e}async get(t,n){if(void 0===this.content[t]){if(null==(n=null!=n?n:this.loaders[t]))throw new Error("Unknown cache key "+t);const r=(i=n(),new e(((t,e)=>i.then(t).catch(e))));return this.content[t]=r,r.then((e=>(this.content[t]=e,e)))}var i;if(this.content[t]instanceof Error)throw this.content[t];return this.content[t]}isResolvedValue(t){return!(null==t||t instanceof Promise||t instanceof Error)}getNow(t){if(this.isResolvedValue(this.content[t]))return this.content[t]}has(t){return null!=this.content[t]}resolvedKeys(){return Object.keys(this.content).filter((t=>this.isResolvedValue(this.content[t])))}resolvedValues(){return Object.values(this.content).filter((t=>this.isResolvedValue(t)))}keys(){return Object.keys(this.content)}values(){return Object.values(this.content)}}class i{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,e){return this.callbacks=[t],this.debounce(e)}queue(t,e){return this.callbacks.push(t),this.debounce(e)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return null==this.promise&&(this.promise=new Promise(((t,e)=>{this.resolvePromise=t,this.rejectPromise=e}))),this.clearTimeout(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout),this.promise}async runCallbacks(){var t,e;const n=[...this.callbacks];this.callbacks=[];const i=null!==(t=this.rejectPromise)&&void 0!==t?t:()=>null,r=null!==(e=this.resolvePromise)&&void 0!==e?e:()=>null;this.clearPromise();for(let t of n)try{await t()}catch(t){return void i(t)}r(!0)}clearTimeout(){null!=this._debounce&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}}
|
|
18
|
+
/**
|
|
19
|
+
* @license
|
|
20
|
+
* Copyright 2017 Google LLC
|
|
21
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
+
*/const r=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}};function o(t){return(e,n)=>void 0!==n?((t,e,n)=>{e.constructor.createProperty(n,t)})(t,e,n):r(t,e)
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2021 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/}var s;function u(t,e){try{return function(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var n,i,r;if(Array.isArray(t)){if((n=t.length)!=e.length)return!1;for(i=n;0!=i--;)if(!u(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!u(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if((n=(r=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(e,r[i]))return!1;for(i=n;0!=i--;){var o=r[i];if(!u(t[o],e[o]))return!1}return!0}return t!=t&&e!=e}(t,e)}catch(t){return!1}}null===(s=window.HTMLSlotElement)||void 0===s||s.prototype.assignedElements;function c(t,e){const n=()=>JSON.parse(JSON.stringify(t));return o({type:Object,converter:{fromAttribute:t=>{if(null==t)return n();try{return JSON.parse(t)}catch{return n()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,e)=>!u(t,e),...null!=e?e:{}})}const a=window,l=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,f=Symbol(),h=new WeakMap;
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2019 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
+
*/class d{constructor(t,e,n){if(this._$cssResult$=!0,n!==f)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(l&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=h.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&h.set(e,t))}return t}toString(){return this.cssText}}const v=t=>new d("string"==typeof t?t:t+"",void 0,f),p=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[i+1]),t[0]);return new d(n,t,f)},b=(t,e)=>{l?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const n=document.createElement("style"),i=a.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,t.appendChild(n)}))},w=l?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return v(e)})(t):t
|
|
33
|
+
/**
|
|
34
|
+
* @license
|
|
35
|
+
* Copyright 2017 Google LLC
|
|
36
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
+
*/;var y;const m=window,x=m.trustedTypes,g=x?x.emptyScript:"",O=m.reactiveElementPolyfillSupport,E={toAttribute(t,e){switch(e){case Boolean:t=t?g:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},j=(t,e)=>e!==t&&(e==e||t==t),C={attribute:!0,type:String,converter:E,reflect:!1,hasChanged:j};class S extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,n)=>{const i=this._$Ep(n,e);void 0!==i&&(this._$Ev.set(i,n),t.push(i))})),t}static createProperty(t,e=C){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,n,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(i){const r=this[t];this[e]=i,this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||C}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(w(t))}else void 0!==t&&e.push(w(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return b(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=C){var i;const r=this.constructor._$Ep(t,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:E).toAttribute(e,n.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var n;const i=this.constructor,r=i._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:E;this._$El=r,this[r]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let i=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||j)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
|
|
38
|
+
/**
|
|
39
|
+
* @license
|
|
40
|
+
* Copyright 2017 Google LLC
|
|
41
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
42
|
+
*/
|
|
43
|
+
var N;S.finalized=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},null==O||O({ReactiveElement:S}),(null!==(y=m.reactiveElementVersions)&&void 0!==y?y:m.reactiveElementVersions=[]).push("1.4.1");const R=window,M=R.trustedTypes,A=M?M.createPolicy("lit-html",{createHTML:t=>t}):void 0,U=`lit$${(Math.random()+"").slice(9)}$`,$="?"+U,k=`<${$}>`,F=document,P=(t="")=>F.createComment(t),L=t=>null===t||"object"!=typeof t&&"function"!=typeof t,_=Array.isArray,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,I=/>/g,W=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),K=/'/g,D=/"/g,H=/^(?:script|style|textarea|title)$/i,z=(t=>(e,...n)=>({_$litType$:t,strings:e,values:n}))(1),V=Symbol.for("lit-noChange"),J=Symbol.for("lit-nothing"),Z=new WeakMap,q=F.createTreeWalker(F,129,null,!1);class X{constructor({strings:t,_$litType$:e},n){let i;this.parts=[];let r=0,o=0;const s=t.length-1,u=this.parts,[c,a]=((t,e)=>{const n=t.length-1,i=[];let r,o=2===e?"<svg>":"",s=B;for(let e=0;e<n;e++){const n=t[e];let u,c,a=-1,l=0;for(;l<n.length&&(s.lastIndex=l,c=s.exec(n),null!==c);)l=s.lastIndex,s===B?"!--"===c[1]?s=T:void 0!==c[1]?s=I:void 0!==c[2]?(H.test(c[2])&&(r=RegExp("</"+c[2],"g")),s=W):void 0!==c[3]&&(s=W):s===W?">"===c[0]?(s=null!=r?r:B,a=-1):void 0===c[1]?a=-2:(a=s.lastIndex-c[2].length,u=c[1],s=void 0===c[3]?W:'"'===c[3]?D:K):s===D||s===K?s=W:s===T||s===I?s=B:(s=W,r=void 0);const f=s===W&&t[e+1].startsWith("/>")?" ":"";o+=s===B?n+k:a>=0?(i.push(u),n.slice(0,a)+"$lit$"+n.slice(a)+U+f):n+U+(-2===a?(i.push(void 0),e):f)}const u=o+(t[n]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==A?A.createHTML(u):u,i]})(t,e);if(this.el=X.createElement(c,n),q.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(i=q.nextNode())&&u.length<s;){if(1===i.nodeType){if(i.hasAttributes()){const t=[];for(const e of i.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(U)){const n=a[o++];if(t.push(e),void 0!==n){const t=i.getAttribute(n.toLowerCase()+"$lit$").split(U),e=/([.?@])?(.*)/.exec(n);u.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?et:"?"===e[1]?it:"@"===e[1]?rt:tt})}else u.push({type:6,index:r})}for(const e of t)i.removeAttribute(e)}if(H.test(i.tagName)){const t=i.textContent.split(U),e=t.length-1;if(e>0){i.textContent=M?M.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],P()),q.nextNode(),u.push({type:2,index:++r});i.append(t[e],P())}}}else if(8===i.nodeType)if(i.data===$)u.push({type:2,index:r});else{let t=-1;for(;-1!==(t=i.data.indexOf(U,t+1));)u.push({type:7,index:r}),t+=U.length-1}r++}}static createElement(t,e){const n=F.createElement("template");return n.innerHTML=t,n}}function G(t,e,n=t,i){var r,o,s,u;if(e===V)return e;let c=void 0!==i?null===(r=n._$Co)||void 0===r?void 0:r[i]:n._$Cl;const a=L(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==a&&(null===(o=null==c?void 0:c._$AO)||void 0===o||o.call(c,!1),void 0===a?c=void 0:(c=new a(t),c._$AT(t,n,i)),void 0!==i?(null!==(s=(u=n)._$Co)&&void 0!==s?s:u._$Co=[])[i]=c:n._$Cl=c),void 0!==c&&(e=G(t,c._$AS(t,e.values),c,i)),e}class Q{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:n},parts:i}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:F).importNode(n,!0);q.currentNode=r;let o=q.nextNode(),s=0,u=0,c=i[0];for(;void 0!==c;){if(s===c.index){let e;2===c.type?e=new Y(o,o.nextSibling,this,t):1===c.type?e=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(e=new ot(o,this,t)),this.u.push(e),c=i[++u]}s!==(null==c?void 0:c.index)&&(o=q.nextNode(),s++)}return r}p(t){let e=0;for(const n of this.u)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class Y{constructor(t,e,n,i){var r;this.type=2,this._$AH=J,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=i,this._$Cm=null===(r=null==i?void 0:i.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=G(this,t,e),L(t)?t===J||null==t||""===t?(this._$AH!==J&&this._$AR(),this._$AH=J):t!==this._$AH&&t!==V&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>_(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==J&&L(this._$AH)?this._$AA.nextSibling.data=t:this.T(F.createTextNode(t)),this._$AH=t}$(t){var e;const{values:n,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=X.createElement(i.h,this.options)),i);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.p(n);else{const t=new Q(r,this),e=t.v(this.options);t.p(n),this.T(e),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new X(t)),e}k(t){_(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,i=0;for(const r of t)i===e.length?e.push(n=new Y(this.O(P()),this.O(P()),this,this.options)):n=e[i],n._$AI(r),i++;i<e.length&&(this._$AR(n&&n._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var n;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class tt{constructor(t,e,n,i,r){this.type=1,this._$AH=J,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=J}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,i){const r=this.strings;let o=!1;if(void 0===r)t=G(this,t,e,0),o=!L(t)||t!==this._$AH&&t!==V,o&&(this._$AH=t);else{const i=t;let s,u;for(t=r[0],s=0;s<r.length-1;s++)u=G(this,i[n+s],e,s),u===V&&(u=this._$AH[s]),o||(o=!L(u)||u!==this._$AH[s]),u===J?t=J:t!==J&&(t+=(null!=u?u:"")+r[s+1]),this._$AH[s]=u}o&&!i&&this.j(t)}j(t){t===J?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===J?void 0:t}}const nt=M?M.emptyScript:"";class it extends tt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==J?this.element.setAttribute(this.name,nt):this.element.removeAttribute(this.name)}}class rt extends tt{constructor(t,e,n,i,r){super(t,e,n,i,r),this.type=5}_$AI(t,e=this){var n;if((t=null!==(n=G(this,t,e,0))&&void 0!==n?n:J)===V)return;const i=this._$AH,r=t===J&&i!==J||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==J&&(i===J||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==n?n:this.element,t):this._$AH.handleEvent(t)}}class ot{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){G(this,t)}}const st=R.litHtmlPolyfillSupport;null==st||st(X,Y),(null!==(N=R.litHtmlVersions)&&void 0!==N?N:R.litHtmlVersions=[]).push("2.4.0");
|
|
44
|
+
/**
|
|
45
|
+
* @license
|
|
46
|
+
* Copyright 2017 Google LLC
|
|
47
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
|
+
*/
|
|
49
|
+
var ut,ct;class at extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const n=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=n.firstChild),n}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,n)=>{var i,r;const o=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:e;let s=o._$litPart$;if(void 0===s){const t=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:null;o._$litPart$=s=new Y(e.insertBefore(P(),t),t,void 0,null!=n?n:{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return V}}at.finalized=!0,at._$litElement$=!0,null===(ut=globalThis.litElementHydrateSupport)||void 0===ut||ut.call(globalThis,{LitElement:at});const lt=globalThis.litElementPolyfillSupport;null==lt||lt({LitElement:at}),(null!==(ct=globalThis.litElementVersions)&&void 0!==ct?ct:globalThis.litElementVersions=[]).push("3.2.2");class ft{static create(t,e,n){let i=t=>v(null!=t?t:n),r=p`var(${v(t)}, ${i(n)})`;return r.name=t,r.category=e,r.defaultValue=n,r.defaultCssValue=i,r.get=e=>p`var(${v(t)}, ${i(e)})`,r.breadcrumb=()=>[],r.lastResortDefaultValue=()=>n,r}static extend(t,e,n){let i=t=>e.get(null!=t?t:n),r=p`var(${v(t)}, ${i(n)})`;return r.name=t,r.category=e.category,r.fallbackVariable=e,r.defaultValue=n,r.defaultCssValue=i,r.get=e=>p`var(${v(t)}, ${i(e)})`,r.breadcrumb=()=>[e.name,...e.breadcrumb()],r.lastResortDefaultValue=()=>n,r}static external(t,e){let n=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):v(null!=e?e:t.defaultValue),i=p`var(${v(t.name)}, ${n(t.defaultValue)})`;return i.name=t.name,i.category=t.category,i.fallbackVariable=t.fallbackVariable,i.defaultValue=t.defaultValue,i.context=e,i.defaultCssValue=n,i.get=e=>p`var(${v(t.name)}, ${n(e)})`,i.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],i.lastResortDefaultValue=()=>{var e,n;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(n=t.fallbackVariable)||void 0===n?void 0:n.lastResortDefaultValue()},i}}ft.create("--ft-color-primary","COLOR","#2196F3"),ft.create("--ft-color-primary-variant","COLOR","#1976D2"),ft.create("--ft-color-secondary","COLOR","#FFCC80"),ft.create("--ft-color-secondary-variant","COLOR","#F57C00"),ft.create("--ft-color-surface","COLOR","#FFFFFF"),ft.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),ft.create("--ft-color-error","COLOR","#B00020"),ft.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),ft.create("--ft-color-opacity-high","NUMBER","1"),ft.create("--ft-color-opacity-medium","NUMBER","0.74"),ft.create("--ft-color-opacity-disabled","NUMBER","0.38"),ft.create("--ft-color-on-primary","COLOR","#FFFFFF"),ft.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),ft.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),ft.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),ft.create("--ft-color-on-secondary","COLOR","#FFFFFF"),ft.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),ft.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),ft.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),ft.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),ft.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),ft.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),ft.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),ft.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),ft.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),ft.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),ft.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),ft.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),ft.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),ft.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),ft.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),ft.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),ft.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),ft.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),ft.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),ft.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),ft.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),ft.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),ft.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),ft.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),ft.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),ft.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),ft.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),ft.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),ft.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),ft.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),ft.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),ft.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),ft.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),ft.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),ft.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),ft.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),ft.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),ft.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),ft.create("--ft-border-radius-S","SIZE","4px"),ft.create("--ft-border-radius-M","SIZE","8px"),ft.create("--ft-border-radius-L","SIZE","12px"),ft.create("--ft-border-radius-XL","SIZE","16px"),ft.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),ft.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),ft.create("--ft-transition-duration","UNKNOWN","250ms"),ft.create("--ft-transition-timing-function","UNKNOWN","ease-in-out");var ht=function(t,e,n,i){for(var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class dt extends(
|
|
50
|
+
/**
|
|
51
|
+
* @license
|
|
52
|
+
* Copyright 2021 Google LLC
|
|
53
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
+
*/
|
|
55
|
+
function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:e,elementDefinitions:n,shadowRootOptions:i}=t;n&&!e&&(t.registry=new CustomElementRegistry,Object.entries(n).forEach((([e,n])=>t.registry.define(e,n))));const r=this.renderOptions.creationScope=this.attachShadow({...i,customElements:t.registry});return b(r,this.constructor.elementStyles),r}}}(at)){constructor(){super(),this.exportpartsDebouncer=new i(5),this.constructorName=this.constructor.name,this.constructorPrototype=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this.constructorName&&Object.setPrototypeOf(this,this.constructorPrototype)}getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),z`
|
|
56
|
+
${t.map((t=>z`
|
|
57
|
+
<style>${t}</style>
|
|
58
|
+
`))}
|
|
59
|
+
${this.getTemplate()}
|
|
60
|
+
`}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var e,n;if((null!==(n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==n?n:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this.exportpartsDebouncer.run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,n,i,r,o,s;const u=t=>null!=t&&t.trim().length>0,c=t.filter(u).map((t=>t.trim()));if(0===c.length)return void this.removeAttribute("exportparts");const a=new Set;for(let t of null!==(n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll("[part],[exportparts]"))&&void 0!==n?n:[]){const e=null!==(r=null===(i=t.getAttribute("part"))||void 0===i?void 0:i.split(" "))&&void 0!==r?r:[],n=null!==(s=null===(o=t.getAttribute("exportparts"))||void 0===o?void 0:o.split(",").map((t=>t.split(":")[1])))&&void 0!==s?s:[];new Array(...e,...n).filter(u).map((t=>t.trim())).forEach((t=>a.add(t)))}if(0===a.size)return void this.removeAttribute("exportparts");const l=[...a.values()].flatMap((t=>c.map((e=>`${t}:${e}--${t}`))));this.setAttribute("exportparts",[...this.part,...l].join(", "))}}ht([o()],dt.prototype,"exportpartsPrefix",void 0),ht([c([])],dt.prototype,"exportpartsPrefixes",void 0),ht([o()],dt.prototype,"customStylesheet",void 0),p`
|
|
61
|
+
.ft-no-text-select {
|
|
62
|
+
-webkit-touch-callout: none;
|
|
63
|
+
-webkit-user-select: none;
|
|
64
|
+
-khtml-user-select: none;
|
|
65
|
+
-moz-user-select: none;
|
|
66
|
+
-ms-user-select: none;
|
|
67
|
+
user-select: none;
|
|
68
|
+
}
|
|
69
|
+
`,p`
|
|
70
|
+
.ft-word-wrap {
|
|
71
|
+
white-space: normal;
|
|
72
|
+
word-wrap: break-word;
|
|
73
|
+
-ms-word-break: break-all;
|
|
74
|
+
word-break: break-all;
|
|
75
|
+
word-break: break-word;
|
|
76
|
+
-ms-hyphens: auto;
|
|
77
|
+
-moz-hyphens: auto;
|
|
78
|
+
-webkit-hyphens: auto;
|
|
79
|
+
hyphens: auto
|
|
80
|
+
}
|
|
81
|
+
`,p`
|
|
82
|
+
.ft-safari-ellipsis-fix {
|
|
83
|
+
margin-right: 0;
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ft-safari-ellipsis-fix:after {
|
|
88
|
+
content: "\\0000a0";
|
|
89
|
+
display: inline-block;
|
|
90
|
+
width: 0;
|
|
91
|
+
}
|
|
92
|
+
`;class vt{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var n,i;t=this.resolvePluralKey(t,e);let r=null!==(i=null!==(n=this.labels[t])&&void 0!==n?n:this.defaultLabels[t])&&void 0!==i?i:t;return e.forEach(((t,e)=>r=r.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,n)=>this.formatValue(t,n))))),r}resolvePluralKey(t,e){for(let n of e)if("number"==typeof n){const e=`${t}[\\=${n}]`;if(e in this.labels||e in this.defaultLabels)return e}return t}formatValue(t,e){return t instanceof Date?this.formatDate(t,e):t}formatDate(t,e){const n=n=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(n):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(n):t.toLocaleString(n);try{return n(document.documentElement.lang)}catch(t){return n()}}}function pt(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw Error("[Immer] minified error nr: "+t+(n.length?" "+n.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function bt(t){return!!t&&!!t[ne]}function wt(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ie}(t)||Array.isArray(t)||!!t[ee]||!!t.constructor[ee]||Et(t)||jt(t))}function yt(t,e,n){void 0===n&&(n=!1),0===mt(t)?(n?Object.keys:re)(t).forEach((function(i){n&&"symbol"==typeof i||e(i,t[i],t)})):t.forEach((function(n,i){return e(i,n,t)}))}function mt(t){var e=t[ne];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Et(t)?2:jt(t)?3:0}function xt(t,e){return 2===mt(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function gt(t,e,n){var i=mt(t);2===i?t.set(e,n):3===i?(t.delete(e),t.add(n)):t[e]=n}function Ot(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function Et(t){return Gt&&t instanceof Map}function jt(t){return Qt&&t instanceof Set}function Ct(t){return t.o||t.t}function St(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=oe(t);delete e[ne];for(var n=re(e),i=0;i<n.length;i++){var r=n[i],o=e[r];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[r]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[r]})}return Object.create(Object.getPrototypeOf(t),e)}function Nt(t,e){return void 0===e&&(e=!1),Mt(t)||bt(t)||!wt(t)||(mt(t)>1&&(t.set=t.add=t.clear=t.delete=Rt),Object.freeze(t),e&&yt(t,(function(t,e){return Nt(e,!0)}),!0)),t}function Rt(){pt(2)}function Mt(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function At(t){var e=se[t];return e||pt(18,t),e}function Ut(){return qt}function $t(t,e){e&&(At("Patches"),t.u=[],t.s=[],t.v=e)}function kt(t){Ft(t),t.p.forEach(Lt),t.p=null}function Ft(t){t===qt&&(qt=t.l)}function Pt(t){return qt={p:[],l:qt,h:t,m:!0,_:0}}function Lt(t){var e=t[ne];0===e.i||1===e.i?e.j():e.O=!0}function _t(t,e){e._=e.p.length;var n=e.p[0],i=void 0!==t&&t!==n;return e.h.g||At("ES5").S(e,t,i),i?(n[ne].P&&(kt(e),pt(4)),wt(t)&&(t=Bt(e,t),e.l||It(e,t)),e.u&&At("Patches").M(n[ne].t,t,e.u,e.s)):t=Bt(e,n,[]),kt(e),e.u&&e.v(e.u,e.s),t!==te?t:void 0}function Bt(t,e,n){if(Mt(e))return e;var i=e[ne];if(!i)return yt(e,(function(r,o){return Tt(t,i,e,r,o,n)}),!0),e;if(i.A!==t)return e;if(!i.P)return It(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var r=4===i.i||5===i.i?i.o=St(i.k):i.o;yt(3===i.i?new Set(r):r,(function(e,o){return Tt(t,i,r,e,o,n)})),It(t,r,!1),n&&t.u&&At("Patches").R(i,n,t.u,t.s)}return i.o}function Tt(t,e,n,i,r,o){if(bt(r)){var s=Bt(t,r,o&&e&&3!==e.i&&!xt(e.D,i)?o.concat(i):void 0);if(gt(n,i,s),!bt(s))return;t.m=!1}if(wt(r)&&!Mt(r)){if(!t.h.F&&t._<1)return;Bt(t,r),e&&e.A.l||It(t,r)}}function It(t,e,n){void 0===n&&(n=!1),t.h.F&&t.m&&Nt(e,n)}function Wt(t,e){var n=t[ne];return(n?Ct(n):t)[e]}function Kt(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var i=Object.getOwnPropertyDescriptor(n,e);if(i)return i;n=Object.getPrototypeOf(n)}}function Dt(t){t.P||(t.P=!0,t.l&&Dt(t.l))}function Ht(t){t.o||(t.o=St(t.t))}function zt(t,e,n){var i=Et(e)?At("MapSet").N(e,n):jt(e)?At("MapSet").T(e,n):t.g?function(t,e){var n=Array.isArray(t),i={i:n?1:0,A:e?e.A:Ut(),P:!1,I:!1,D:{},l:e,t,k:null,o:null,j:null,C:!1},r=i,o=ue;n&&(r=[i],o=ce);var s=Proxy.revocable(r,o),u=s.revoke,c=s.proxy;return i.k=c,i.j=u,c}(e,n):At("ES5").J(e,n);return(n?n.A:Ut()).p.push(i),i}function Vt(t){return bt(t)||pt(22,t),function t(e){if(!wt(e))return e;var n,i=e[ne],r=mt(e);if(i){if(!i.P&&(i.i<4||!At("ES5").K(i)))return i.t;i.I=!0,n=Jt(e,r),i.I=!1}else n=Jt(e,r);return yt(n,(function(e,r){i&&function(t,e){return 2===mt(t)?t.get(e):t[e]}(i.t,e)===r||gt(n,e,t(r))})),3===r?new Set(n):n}(t)}function Jt(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return St(t)}var Zt,qt,Xt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Gt="undefined"!=typeof Map,Qt="undefined"!=typeof Set,Yt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,te=Xt?Symbol.for("immer-nothing"):((Zt={})["immer-nothing"]=!0,Zt),ee=Xt?Symbol.for("immer-draftable"):"__$immer_draftable",ne=Xt?Symbol.for("immer-state"):"__$immer_state",ie=""+Object.prototype.constructor,re="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,oe=Object.getOwnPropertyDescriptors||function(t){var e={};return re(t).forEach((function(n){e[n]=Object.getOwnPropertyDescriptor(t,n)})),e},se={},ue={get:function(t,e){if(e===ne)return t;var n=Ct(t);if(!xt(n,e))return function(t,e,n){var i,r=Kt(e,n);return r?"value"in r?r.value:null===(i=r.get)||void 0===i?void 0:i.call(t.k):void 0}(t,n,e);var i=n[e];return t.I||!wt(i)?i:i===Wt(t.t,e)?(Ht(t),t.o[e]=zt(t.A.h,i,t)):i},has:function(t,e){return e in Ct(t)},ownKeys:function(t){return Reflect.ownKeys(Ct(t))},set:function(t,e,n){var i=Kt(Ct(t),e);if(null==i?void 0:i.set)return i.set.call(t.k,n),!0;if(!t.P){var r=Wt(Ct(t),e),o=null==r?void 0:r[ne];if(o&&o.t===n)return t.o[e]=n,t.D[e]=!1,!0;if(Ot(n,r)&&(void 0!==n||xt(t.t,e)))return!0;Ht(t),Dt(t)}return t.o[e]===n&&"number"!=typeof n&&(void 0!==n||e in t.o)||(t.o[e]=n,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==Wt(t.t,e)||e in t.t?(t.D[e]=!1,Ht(t),Dt(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var n=Ct(t),i=Reflect.getOwnPropertyDescriptor(n,e);return i?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:i.enumerable,value:n[e]}:i},defineProperty:function(){pt(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){pt(12)}},ce={};yt(ue,(function(t,e){ce[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),ce.deleteProperty=function(t,e){return ce.set.call(this,t,e,void 0)},ce.set=function(t,e,n){return ue.set.call(this,t[0],e,n,t[0])};var ae=function(){function t(t){var e=this;this.g=Yt,this.F=!0,this.produce=function(t,n,i){if("function"==typeof t&&"function"!=typeof n){var r=n;n=t;var o=e;return function(t){var e=this;void 0===t&&(t=r);for(var i=arguments.length,s=Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return o.produce(t,(function(t){var i;return(i=n).call.apply(i,[e,t].concat(s))}))}}var s;if("function"!=typeof n&&pt(6),void 0!==i&&"function"!=typeof i&&pt(7),wt(t)){var u=Pt(e),c=zt(e,t,void 0),a=!0;try{s=n(c),a=!1}finally{a?kt(u):Ft(u)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(t){return $t(u,i),_t(t,u)}),(function(t){throw kt(u),t})):($t(u,i),_t(s,u))}if(!t||"object"!=typeof t){if(void 0===(s=n(t))&&(s=t),s===te&&(s=void 0),e.F&&Nt(s,!0),i){var l=[],f=[];At("Patches").M(t,s,l,f),i(l,f)}return s}pt(21,t)},this.produceWithPatches=function(t,n){if("function"==typeof t)return function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return e.produceWithPatches(n,(function(e){return t.apply(void 0,[e].concat(r))}))};var i,r,o=e.produce(t,n,(function(t,e){i=t,r=e}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,i,r]})):[o,i,r]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){wt(t)||pt(8),bt(t)&&(t=Vt(t));var e=Pt(this),n=zt(this,t,void 0);return n[ne].C=!0,Ft(e),n},e.finishDraft=function(t,e){var n=(t&&t[ne]).A;return $t(n,e),_t(void 0,n)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!Yt&&pt(20),this.g=t},e.applyPatches=function(t,e){var n;for(n=e.length-1;n>=0;n--){var i=e[n];if(0===i.path.length&&"replace"===i.op){t=i.value;break}}n>-1&&(e=e.slice(n+1));var r=At("Patches").$;return bt(t)?r(t,e):this.produce(t,(function(t){return r(t,e)}))},t}(),le=new ae,fe=le.produce;le.produceWithPatches.bind(le),le.setAutoFreeze.bind(le),le.setUseProxies.bind(le),le.applyPatches.bind(le),le.createDraft.bind(le),le.finishDraft.bind(le);var he=fe;function de(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ve(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function pe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ve(Object(n),!0).forEach((function(e){de(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function be(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var we="function"==typeof Symbol&&Symbol.observable||"@@observable",ye=function(){return Math.random().toString(36).substring(7).split("").join(".")},me={INIT:"@@redux/INIT"+ye(),REPLACE:"@@redux/REPLACE"+ye(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ye()}};function xe(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ge(t,e,n){var i;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(be(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(be(1));return n(ge)(t,e)}if("function"!=typeof t)throw new Error(be(2));var r=t,o=e,s=[],u=s,c=!1;function a(){u===s&&(u=s.slice())}function l(){if(c)throw new Error(be(3));return o}function f(t){if("function"!=typeof t)throw new Error(be(4));if(c)throw new Error(be(5));var e=!0;return a(),u.push(t),function(){if(e){if(c)throw new Error(be(6));e=!1,a();var n=u.indexOf(t);u.splice(n,1),s=null}}}function h(t){if(!xe(t))throw new Error(be(7));if(void 0===t.type)throw new Error(be(8));if(c)throw new Error(be(9));try{c=!0,o=r(o,t)}finally{c=!1}for(var e=s=u,n=0;n<e.length;n++){(0,e[n])()}return t}function d(t){if("function"!=typeof t)throw new Error(be(10));r=t,h({type:me.REPLACE})}function v(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(be(11));function n(){t.next&&t.next(l())}return n(),{unsubscribe:e(n)}}})[we]=function(){return this},t}return h({type:me.INIT}),(i={dispatch:h,subscribe:f,getState:l,replaceReducer:d})[we]=v,i}function Oe(t){for(var e=Object.keys(t),n={},i=0;i<e.length;i++){var r=e[i];"function"==typeof t[r]&&(n[r]=t[r])}var o,s=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:me.INIT}))throw new Error(be(12));if(void 0===n(void 0,{type:me.PROBE_UNKNOWN_ACTION()}))throw new Error(be(13))}))}(n)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var i=!1,r={},u=0;u<s.length;u++){var c=s[u],a=n[c],l=t[c],f=a(l,e);if(void 0===f)throw e&&e.type,new Error(be(14));r[c]=f,i=i||f!==l}return(i=i||s.length!==Object.keys(t).length)?r:t}}function Ee(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function je(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),i=function(){throw new Error(be(15))},r={getState:n.getState,dispatch:function(){return i.apply(void 0,arguments)}},o=e.map((function(t){return t(r)}));return i=Ee.apply(void 0,o)(n.dispatch),pe(pe({},n),{},{dispatch:i})}}}function Ce(t){return function(e){var n=e.dispatch,i=e.getState;return function(e){return function(r){return"function"==typeof r?r(n,i,t):e(r)}}}}var Se=Ce();Se.withExtraArgument=Ce;var Ne,Re=Se,Me=(Ne=function(t,e){return Ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ne(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ne(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),Ae=function(t,e){for(var n=0,i=e.length,r=t.length;n<i;n++,r++)t[r]=e[n];return t},Ue=Object.defineProperty,$e=Object.getOwnPropertySymbols,ke=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,Pe=function(t,e,n){return e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Le=function(t,e){for(var n in e||(e={}))ke.call(e,n)&&Pe(t,n,e[n]);if($e)for(var i=0,r=$e(e);i<r.length;i++){n=r[i];Fe.call(e,n)&&Pe(t,n,e[n])}return t},_e="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Ee:Ee.apply(null,arguments)};var Be=function(t){function e(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=t.apply(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return Me(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,Ae([void 0],t[0].concat(this)))):new(e.bind.apply(e,Ae([void 0],t.concat(this))))},e}(Array);function Te(t){return wt(t)?he(t,(function(){})):t}function Ie(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,n=void 0===e||e;t.immutableCheck,t.serializableCheck;var i=new Be;n&&(!function(t){return"boolean"==typeof t}(n)?i.push(Re.withExtraArgument(n.extraArgument)):i.push(Re));return i}(t)}}function We(t){var e,n=Ie(),i=t||{},r=i.reducer,o=void 0===r?void 0:r,s=i.middleware,u=void 0===s?n():s,c=i.devTools,a=void 0===c||c,l=i.preloadedState,f=void 0===l?void 0:l,h=i.enhancers,d=void 0===h?void 0:h;if("function"==typeof o)e=o;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n}(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=Oe(o)}var v=u;"function"==typeof v&&(v=v(n));var p=je.apply(void 0,v),b=Ee;a&&(b=_e(Le({trace:!1},"object"==typeof a&&a)));var w=[p];return Array.isArray(d)?w=Ae([p],d):"function"==typeof d&&(w=d(w)),ge(e,f,b.apply(void 0,w))}function Ke(t,e){function n(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var r=e.apply(void 0,n);if(!r)throw new Error("prepareAction did not return an object");return Le(Le({type:t,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:t,payload:n[0]}}return n.toString=function(){return""+t},n.type=t,n.match=function(e){return e.type===t},n}function De(t){var e,n={},i=[],r={addCase:function(t,e){var i="string"==typeof t?t:t.type;if(i in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[i]=e,r},addMatcher:function(t,e){return i.push({matcher:t,reducer:e}),r},addDefaultCase:function(t){return e=t,r}};return t(r),[n,i,e]}function He(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var n,i="function"==typeof t.initialState?t.initialState:Te(t.initialState),r=t.reducers||{},o=Object.keys(r),s={},u={},c={};function a(){var e="function"==typeof t.extraReducers?De(t.extraReducers):[t.extraReducers],n=e[0],r=void 0===n?{}:n,o=e[1],s=void 0===o?[]:o,c=e[2],a=void 0===c?void 0:c,l=Le(Le({},r),u);return function(t,e,n,i){void 0===n&&(n=[]);var r,o="function"==typeof e?De(e):[e,n,i],s=o[0],u=o[1],c=o[2];if(function(t){return"function"==typeof t}(t))r=function(){return Te(t())};else{var a=Te(t);r=function(){return a}}function l(t,e){void 0===t&&(t=r());var n=Ae([s[e.type]],u.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===n.filter((function(t){return!!t})).length&&(n=[c]),n.reduce((function(t,n){if(n){var i;if(bt(t))return void 0===(i=n(t,e))?t:i;if(wt(t))return he(t,(function(t){return n(t,e)}));if(void 0===(i=n(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return i}return t}),t)}return l.getInitialState=r,l}(i,l,s,a)}return o.forEach((function(t){var n,i,o=r[t],a=e+"/"+t;"reducer"in o?(n=o.reducer,i=o.prepare):n=o,s[t]=n,u[a]=n,c[t]=i?Ke(a,i):Ke(a)})),{name:e,reducer:function(t,e){return n||(n=a()),n(t,e)},actions:c,caseReducers:s,getInitialState:function(){return n||(n=a()),n.getInitialState()}}}var ze,Ve,Je="listenerMiddleware";Ke(Je+"/add"),Ke(Je+"/removeAll"),Ke(Je+"/remove"),function(){function t(t,e){var n=r[t];return n?n.enumerable=e:r[t]=n={configurable:!0,enumerable:e,get:function(){var e=this[ne];return ue.get(e,t)},set:function(e){var n=this[ne];ue.set(n,t,e)}},n}function e(t){for(var e=t.length-1;e>=0;e--){var r=t[e][ne];if(!r.P)switch(r.i){case 5:i(r)&&Dt(r);break;case 4:n(r)&&Dt(r)}}}function n(t){for(var e=t.t,n=t.k,i=re(n),r=i.length-1;r>=0;r--){var o=i[r];if(o!==ne){var s=e[o];if(void 0===s&&!xt(e,o))return!0;var u=n[o],c=u&&u[ne];if(c?c.t!==s:!Ot(u,s))return!0}}var a=!!e[ne];return i.length!==re(e).length+(a?0:1)}function i(t){var e=t.k;if(e.length!==t.t.length)return!0;var n=Object.getOwnPropertyDescriptor(e,e.length-1);if(n&&!n.get)return!0;for(var i=0;i<e.length;i++)if(!e.hasOwnProperty(i))return!0;return!1}var r={};!function(t,e){se[t]||(se[t]=e)}("ES5",{J:function(e,n){var i=Array.isArray(e),r=function(e,n){if(e){for(var i=Array(n.length),r=0;r<n.length;r++)Object.defineProperty(i,""+r,t(r,!0));return i}var o=oe(n);delete o[ne];for(var s=re(o),u=0;u<s.length;u++){var c=s[u];o[c]=t(c,e||!!o[c].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(i,e),o={i:i?5:4,A:n?n.A:Ut(),P:!1,I:!1,D:{},l:n,t:e,k:r,o:null,O:!1,C:!1};return Object.defineProperty(r,ne,{value:o,writable:!0}),r},S:function(t,n,r){r?bt(n)&&n[ne].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var n=e[ne];if(n){var r=n.t,o=n.k,s=n.D,u=n.i;if(4===u)yt(o,(function(e){e!==ne&&(void 0!==r[e]||xt(r,e)?s[e]||t(o[e]):(s[e]=!0,Dt(n)))})),yt(r,(function(t){void 0!==o[t]||xt(o,t)||(s[t]=!1,Dt(n))}));else if(5===u){if(i(n)&&(Dt(n),s.length=!0),o.length<r.length)for(var c=o.length;c<r.length;c++)s[c]=!1;else for(var a=r.length;a<o.length;a++)s[a]=!0;for(var l=Math.min(o.length,r.length),f=0;f<l;f++)o.hasOwnProperty(f)||(s[f]=!0),void 0===s[f]&&t(o[f])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?n(t):i(t)}})}();class Ze{constructor(t,e){this.reduxSlice=t,this.reduxStore=e,this.isFtReduxStore=!0,this.actions=new Proxy(this.reduxSlice.actions,{get:(t,e,n)=>{const i=t[e];if(i)return(...t)=>{const e=i(...t);return this.reduxStore.dispatch(e),e}}})}static get(t){window.ftReduxStores||(window.ftReduxStores={});const e="string"==typeof t?t:t.name,n="string"==typeof t?void 0:t,i=window.ftReduxStores[e];if(function(t){var e;return null===(e=t)||void 0===e?void 0:e.isFtReduxStore}(i))return i;if(null==n)return;const r=He(n);if(i)return new Ze(r,i);const o=We({reducer:r.reducer});return window.ftReduxStores[n.name]=new Ze(r,o)}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}}navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Ve=null===(ze=window.safari)||void 0===ze?void 0:ze.pushNotification)||void 0===Ve||Ve.toString());const qe=p`
|
|
93
|
+
`,Xe="ft-app-info",Ge=Ze.get({name:Xe,reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",editorMode:!1,noCustom:!1,noCustomComponent:!1}});var Qe;const Ye=Symbol("clearAfterUnitTest");class tn{constructor(t){this.apiProvider=t,this.defaultMessages={},this.cache=new n,this.listeners={},this.currentBaseUrl="",this.currentUiLocale="",this[Qe]=()=>{this.defaultMessages={},this.cache=new n,this.listeners={}},Ge.subscribe((()=>this.updateApi())),this.updateApi()}updateApi(){const{baseUrl:t,apiIntegrationIdentifier:e,uiLocale:n}=Ge.getState();t&&e?(this.api=this.apiProvider(t,e),(this.api&&this.currentBaseUrl!==t||this.currentUiLocale!==n)&&(this.currentBaseUrl=t,this.currentUiLocale=n,this.cache.clearAll(),this.notifyAll())):this.api=void 0}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var n;if(t=t.toLowerCase(),Object.keys(e).length>0){const i={...null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},...e};u(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...n){var i,r,o;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(r=null===(i=this.cache.getNow(t))||void 0===i?void 0:i.messages)&&void 0!==r?r:{};return new vt(null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},s).resolve(e,...n)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(async()=>{var e;return await(null===(e=this.api)||void 0===e?void 0:e.getFluidTopicsMessageContext(this.currentUiLocale,t))})),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var n;return t=t.toLowerCase(),this.listeners[t]=null!==(n=this.listeners[t])&&void 0!==n?n:new Set,this.listeners[t].add(e),()=>{var n;return null===(n=this.listeners[t])||void 0===n?void 0:n.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>{return(e=0,new Promise((t=>setTimeout(t,e)))).then((()=>t())).catch((()=>null));var e})))}}Qe=Ye,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new tn(((t,e)=>window.fluidtopics?new window.fluidtopics.FluidTopicsApi(t,e,!0):void 0)));const en=window.FluidTopicsI18nService;var nn,rn=function(t,e,n,i){for(var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class on extends dt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>window.fluidtopics&&this.baseUrl?new window.fluidtopics.FluidTopicsApi(this.baseUrl,this.apiIntegrationIdentifier,!0):void 0,this.cache=new n,this.cleanSessionDebouncer=new i}render(){return z`
|
|
94
|
+
<slot></slot>
|
|
95
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&Ge.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Ge.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ge.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Ge.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Ge.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Ge.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Ge.actions.setSession(this.session),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>en.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&null==this.session&&(this.session=await this.cache.get("session",(async()=>{const e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e})))}}on.elementDefinitions={},on.styles=qe,rn([o()],on.prototype,"baseUrl",void 0),rn([o()],on.prototype,"apiIntegrationIdentifier",void 0),rn([o()],on.prototype,"uiLocale",void 0),rn([o({type:Boolean})],on.prototype,"editorMode",void 0),rn([o({type:Boolean})],on.prototype,"noCustom",void 0),rn([o({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],on.prototype,"noCustomComponent",void 0),rn([o({type:Boolean})],on.prototype,"withManualResources",void 0),rn([c([])],on.prototype,"messageContexts",void 0),rn([c(void 0)],on.prototype,"session",void 0),rn([o({type:Object})],on.prototype,"apiProvider",void 0),(nn="ft-app-context",t=>{window.customElements.get(nn)||window.customElements.define(nn,t)})(on),t.FtAppContext=on,t.FtAppContextCssVariables={},t.FtAppInfoStoreName=Xe,t.FtI18nServiceInternalClass=tn,t.clearAfterUnitTest=Ye,t.ftAppInfoStore=Ge,t.ftI18nService=en,t.styles=qe,Object.defineProperty(t,"U",{value:!0})}({});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FtMessageContext, FtSession } from "@fluid-topics/public-api";
|
|
2
|
+
export interface FtAppContextProperties {
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
apiIntegrationIdentifier?: string;
|
|
5
|
+
uiLocale?: string;
|
|
6
|
+
editorMode?: boolean;
|
|
7
|
+
noCustom?: boolean;
|
|
8
|
+
noCustomComponent?: boolean | string;
|
|
9
|
+
withManualResources?: boolean;
|
|
10
|
+
messageContexts?: FtMessageContext[];
|
|
11
|
+
session?: FtSession;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ft-app-context.properties.d.ts.map
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { customElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { FtAppContext } from "./ft-app-context";
|
|
3
|
+
export * from "./redux-stores/FtAppInfoStore";
|
|
4
|
+
export * from "./services/FtI18nService";
|
|
5
|
+
export * from "./ft-app-context.css";
|
|
6
|
+
export * from "./ft-app-context.properties";
|
|
7
|
+
export * from "./ft-app-context";
|
|
8
|
+
customElement("ft-app-context")(FtAppContext);
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FtReduxStore } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { PayloadAction } from "@reduxjs/toolkit";
|
|
3
|
+
import { FtSession } from "@fluid-topics/public-api";
|
|
4
|
+
export declare const FtAppInfoStoreName = "ft-app-info";
|
|
5
|
+
export interface FtAppInfoState {
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
apiIntegrationIdentifier?: string;
|
|
8
|
+
uiLocale: string;
|
|
9
|
+
editorMode: boolean;
|
|
10
|
+
noCustom: boolean;
|
|
11
|
+
noCustomComponent: boolean | string;
|
|
12
|
+
session?: FtSession;
|
|
13
|
+
}
|
|
14
|
+
declare const reducers: {
|
|
15
|
+
setBaseUrl: (state: FtAppInfoState, action: PayloadAction<FtAppInfoState["baseUrl"]>) => void;
|
|
16
|
+
setApiIntegrationIdentifier: (state: FtAppInfoState, action: PayloadAction<FtAppInfoState["apiIntegrationIdentifier"]>) => void;
|
|
17
|
+
setUiLocale: (state: FtAppInfoState, action: PayloadAction<FtAppInfoState["uiLocale"]>) => void;
|
|
18
|
+
setEditorMode: (state: FtAppInfoState, action: PayloadAction<FtAppInfoState["editorMode"]>) => void;
|
|
19
|
+
setNoCustom: (state: FtAppInfoState, action: PayloadAction<FtAppInfoState["noCustom"]>) => void;
|
|
20
|
+
setNoCustomComponent: (state: FtAppInfoState, action: PayloadAction<FtAppInfoState["noCustomComponent"]>) => void;
|
|
21
|
+
setSession: (state: FtAppInfoState, action: PayloadAction<FtAppInfoState["session"]>) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare type FtAppInfoStateReducers = typeof reducers;
|
|
24
|
+
export declare type FtAppInfoStore = FtReduxStore<FtAppInfoState, FtAppInfoStateReducers>;
|
|
25
|
+
export declare const ftAppInfoStore: FtAppInfoStore;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=FtAppInfoStore.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FtReduxStore } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
export const FtAppInfoStoreName = "ft-app-info";
|
|
3
|
+
const reducers = {
|
|
4
|
+
setBaseUrl: (state, action) => {
|
|
5
|
+
state.baseUrl = action.payload;
|
|
6
|
+
},
|
|
7
|
+
setApiIntegrationIdentifier: (state, action) => {
|
|
8
|
+
state.apiIntegrationIdentifier = action.payload;
|
|
9
|
+
},
|
|
10
|
+
setUiLocale: (state, action) => {
|
|
11
|
+
state.uiLocale = action.payload;
|
|
12
|
+
},
|
|
13
|
+
setEditorMode: (state, action) => {
|
|
14
|
+
state.editorMode = action.payload;
|
|
15
|
+
},
|
|
16
|
+
setNoCustom: (state, action) => {
|
|
17
|
+
state.noCustom = action.payload;
|
|
18
|
+
},
|
|
19
|
+
setNoCustomComponent: (state, action) => {
|
|
20
|
+
state.noCustomComponent = action.payload;
|
|
21
|
+
},
|
|
22
|
+
setSession: (state, action) => {
|
|
23
|
+
state.session = action.payload;
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export const ftAppInfoStore = FtReduxStore.get({
|
|
27
|
+
name: FtAppInfoStoreName,
|
|
28
|
+
reducers: reducers,
|
|
29
|
+
initialState: {
|
|
30
|
+
uiLocale: document.documentElement.lang || "en-US",
|
|
31
|
+
editorMode: false,
|
|
32
|
+
noCustom: false,
|
|
33
|
+
noCustomComponent: false,
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=FtAppInfoStore.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FluidTopicsApi, FtMessageContext } from "@fluid-topics/public-api";
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
fluidtopics?: {
|
|
5
|
+
FluidTopicsApi: new (tenantBaseUrl: string, integrationIdentifier: string, overrideIdentifierIfOnTenant?: boolean) => FluidTopicsApi;
|
|
6
|
+
};
|
|
7
|
+
FluidTopicsI18nService?: FtI18nService;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare type Unsubscribe = () => void;
|
|
11
|
+
export declare const clearAfterUnitTest: unique symbol;
|
|
12
|
+
export declare class FtI18nServiceInternalClass {
|
|
13
|
+
private apiProvider;
|
|
14
|
+
private api?;
|
|
15
|
+
private defaultMessages;
|
|
16
|
+
private cache;
|
|
17
|
+
private listeners;
|
|
18
|
+
private currentBaseUrl;
|
|
19
|
+
private currentUiLocale;
|
|
20
|
+
constructor(apiProvider: (baseUrl: string, apiIntegrationIdentifier: string) => FluidTopicsApi | undefined);
|
|
21
|
+
[clearAfterUnitTest]: () => void;
|
|
22
|
+
private updateApi;
|
|
23
|
+
addContext(context: FtMessageContext): void;
|
|
24
|
+
getAllContexts(): Array<FtMessageContext>;
|
|
25
|
+
prepareContext(name: string, defaultMessages: Record<string, string>): Promise<void>;
|
|
26
|
+
resolveMessage(contextName: string, message: string, ...args: any[]): string;
|
|
27
|
+
private fetchContext;
|
|
28
|
+
subscribe(contextName: string, callback: Function): Unsubscribe;
|
|
29
|
+
private notifyAll;
|
|
30
|
+
private notify;
|
|
31
|
+
}
|
|
32
|
+
export declare type FtI18nService = FtI18nServiceInternalClass;
|
|
33
|
+
export declare const ftI18nService: FtI18nService;
|
|
34
|
+
//# sourceMappingURL=FtI18nService.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { ftAppInfoStore } from "../redux-stores/FtAppInfoStore";
|
|
3
|
+
import { CacheRegistry, deepEqual, delay, ParametrizedLabelResolver } from "@fluid-topics/ft-wc-utils";
|
|
4
|
+
export const clearAfterUnitTest = Symbol("clearAfterUnitTest");
|
|
5
|
+
export class FtI18nServiceInternalClass {
|
|
6
|
+
constructor(apiProvider) {
|
|
7
|
+
this.apiProvider = apiProvider;
|
|
8
|
+
this.defaultMessages = {};
|
|
9
|
+
this.cache = new CacheRegistry();
|
|
10
|
+
this.listeners = {};
|
|
11
|
+
this.currentBaseUrl = "";
|
|
12
|
+
this.currentUiLocale = "";
|
|
13
|
+
this[_a] = () => {
|
|
14
|
+
this.defaultMessages = {};
|
|
15
|
+
this.cache = new CacheRegistry();
|
|
16
|
+
this.listeners = {};
|
|
17
|
+
};
|
|
18
|
+
ftAppInfoStore.subscribe(() => this.updateApi());
|
|
19
|
+
this.updateApi();
|
|
20
|
+
}
|
|
21
|
+
updateApi() {
|
|
22
|
+
const { baseUrl, apiIntegrationIdentifier, uiLocale } = ftAppInfoStore.getState();
|
|
23
|
+
if (baseUrl && apiIntegrationIdentifier) {
|
|
24
|
+
this.api = this.apiProvider(baseUrl, apiIntegrationIdentifier);
|
|
25
|
+
if (this.api && this.currentBaseUrl !== baseUrl || this.currentUiLocale !== uiLocale) {
|
|
26
|
+
this.currentBaseUrl = baseUrl;
|
|
27
|
+
this.currentUiLocale = uiLocale;
|
|
28
|
+
this.cache.clearAll();
|
|
29
|
+
this.notifyAll();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.api = undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
addContext(context) {
|
|
37
|
+
const name = context.name.toLowerCase();
|
|
38
|
+
this.cache.setFinal(name, context);
|
|
39
|
+
this.notify(name);
|
|
40
|
+
}
|
|
41
|
+
getAllContexts() {
|
|
42
|
+
return this.cache.resolvedValues();
|
|
43
|
+
}
|
|
44
|
+
async prepareContext(name, defaultMessages) {
|
|
45
|
+
var _b;
|
|
46
|
+
name = name.toLowerCase();
|
|
47
|
+
if (Object.keys(defaultMessages).length > 0) {
|
|
48
|
+
const newDefaultMessages = {
|
|
49
|
+
...((_b = this.defaultMessages[name]) !== null && _b !== void 0 ? _b : {}),
|
|
50
|
+
...defaultMessages
|
|
51
|
+
};
|
|
52
|
+
if (!deepEqual(this.defaultMessages[name], newDefaultMessages)) {
|
|
53
|
+
this.defaultMessages[name] = newDefaultMessages;
|
|
54
|
+
await this.notify(name);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
await this.fetchContext(name);
|
|
58
|
+
}
|
|
59
|
+
resolveMessage(contextName, message, ...args) {
|
|
60
|
+
var _b, _c, _d;
|
|
61
|
+
contextName = contextName.toLowerCase();
|
|
62
|
+
this.fetchContext(contextName);
|
|
63
|
+
const messages = (_c = (_b = this.cache.getNow(contextName)) === null || _b === void 0 ? void 0 : _b.messages) !== null && _c !== void 0 ? _c : {};
|
|
64
|
+
return new ParametrizedLabelResolver(((_d = this.defaultMessages[contextName]) !== null && _d !== void 0 ? _d : {}), messages).resolve(message, ...args);
|
|
65
|
+
}
|
|
66
|
+
async fetchContext(name) {
|
|
67
|
+
if (!this.cache.has(name)) {
|
|
68
|
+
try {
|
|
69
|
+
await this.cache.get(name, async () => { var _b; return await ((_b = this.api) === null || _b === void 0 ? void 0 : _b.getFluidTopicsMessageContext(this.currentUiLocale, name)); });
|
|
70
|
+
await this.notify(name);
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
console.error(e);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
subscribe(contextName, callback) {
|
|
78
|
+
var _b;
|
|
79
|
+
contextName = contextName.toLowerCase();
|
|
80
|
+
this.listeners[contextName] = (_b = this.listeners[contextName]) !== null && _b !== void 0 ? _b : new Set();
|
|
81
|
+
this.listeners[contextName].add(callback);
|
|
82
|
+
return () => { var _b; return (_b = this.listeners[contextName]) === null || _b === void 0 ? void 0 : _b.delete(callback); };
|
|
83
|
+
}
|
|
84
|
+
async notifyAll() {
|
|
85
|
+
await Promise.all(Object.keys(this.listeners).map(context => this.notify(context)));
|
|
86
|
+
}
|
|
87
|
+
async notify(contextName) {
|
|
88
|
+
if (this.listeners[contextName] != null) {
|
|
89
|
+
await Promise.all([...this.listeners[contextName].values()]
|
|
90
|
+
.map(listener => delay(0).then(() => listener()).catch(() => null)));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
_a = clearAfterUnitTest;
|
|
95
|
+
if (window.FluidTopicsI18nService == null) {
|
|
96
|
+
window.FluidTopicsI18nService = new FtI18nServiceInternalClass((u, i) => window.fluidtopics ? new window.fluidtopics.FluidTopicsApi(u, i, true) : undefined);
|
|
97
|
+
}
|
|
98
|
+
export const ftI18nService = window.FluidTopicsI18nService;
|
|
99
|
+
//# sourceMappingURL=FtI18nService.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fluid-topics/ft-app-context",
|
|
3
|
+
"version": "0.3.58",
|
|
4
|
+
"description": "Global application context for Fluid Topics integrations",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Lit"
|
|
7
|
+
],
|
|
8
|
+
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"main": "build/index.js",
|
|
11
|
+
"web": "build/ft-app-context.min.js",
|
|
12
|
+
"typings": "build/index",
|
|
13
|
+
"files": [
|
|
14
|
+
"build/**/*.js",
|
|
15
|
+
"build/**/*.ts"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "0.3.58",
|
|
23
|
+
"lit": "2.2.8"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@fluid-topics/public-api": "1.0.31"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@fluid-topics/public-api": "1.0.31"
|
|
30
|
+
},
|
|
31
|
+
"gitHead": "c053ee1216238ba6b2c62e5add329343f735c77e"
|
|
32
|
+
}
|