web-component-wrapper 0.0.329 → 0.0.333
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/React.d.ts +9 -9
- package/React.js +1 -1
- package/ReactNext.js +1 -1
- package/Web.d.ts +33 -47
- package/Web.js +1 -1
- package/WebNext.js +1 -1
- package/decorator.d.ts +9 -0
- package/decorator.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/package.json +2 -2
- package/type.d.ts +12 -9
package/Web.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropertyTypes from 'clientnode/property-types';
|
2
2
|
import { Mapping, ValueOf } from 'clientnode/type';
|
3
|
-
import { AttributesReflectionConfiguration, CompiledDomNodeTemplate, ComponentAdapter, EventToPropertyMapping, WebComponentAPI } from './type';
|
3
|
+
import { AttributesReflectionConfiguration, CompiledDomNodeTemplate, ComponentAdapter, EventCallbackMapping, EventToPropertyMapping, ScopeDeclaration, WebComponentAPI } from './type';
|
4
4
|
/**
|
5
5
|
* Generic web component to render a content against instance specific values.
|
6
6
|
* @property static:applyRootBinding - If determined itself as root declarative
|
@@ -29,8 +29,8 @@ import { AttributesReflectionConfiguration, CompiledDomNodeTemplate, ComponentAd
|
|
29
29
|
* @property static:renderProperties - List of known render properties.
|
30
30
|
*
|
31
31
|
* @property static:cloneSlots - Indicates whether to clone slot nots before
|
32
|
-
* transcluding them. If a slot should be used multiple times (
|
33
|
-
* works as a template node) they should be copied to avoid unexpected
|
32
|
+
* transcluding them. If a slot should be used multiple times (for example when
|
33
|
+
* it works as a template node) they should be copied to avoid unexpected
|
34
34
|
* mutations.
|
35
35
|
* @property static:evaluateSlots - Indicates whether to evaluate slot content
|
36
36
|
* when before rendering them.
|
@@ -98,7 +98,7 @@ import { AttributesReflectionConfiguration, CompiledDomNodeTemplate, ComponentAd
|
|
98
98
|
*/
|
99
99
|
export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
100
100
|
static applyRootBinding: boolean;
|
101
|
-
static content:
|
101
|
+
static content: unknown;
|
102
102
|
static determineRootBinding: boolean;
|
103
103
|
static shadowDOM: boolean | null | {
|
104
104
|
delegateFocus?: boolean;
|
@@ -128,7 +128,7 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
128
128
|
parent: null | Web;
|
129
129
|
rootInstance: null | Web;
|
130
130
|
scope: Mapping<unknown>;
|
131
|
-
domNodeEventBindings: Map<Node,
|
131
|
+
domNodeEventBindings: Map<Node, EventCallbackMapping>;
|
132
132
|
domNodeTemplateCache: CompiledDomNodeTemplate;
|
133
133
|
externalProperties: Mapping<unknown>;
|
134
134
|
ignoreAttributeUpdateObservations: boolean;
|
@@ -146,14 +146,12 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
146
146
|
};
|
147
147
|
/**
|
148
148
|
* Initializes host dom content and properties.
|
149
|
-
*
|
150
149
|
* @returns Nothing.
|
151
150
|
*/
|
152
151
|
constructor();
|
153
152
|
/**
|
154
153
|
* Triggered when ever a given attribute has changed and triggers to update
|
155
154
|
* configured dom content.
|
156
|
-
*
|
157
155
|
* @param name - Attribute name which was updates.
|
158
156
|
* @param oldValue - Old attribute value.
|
159
157
|
* @param newValue - New updated value.
|
@@ -163,7 +161,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
163
161
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
164
162
|
/**
|
165
163
|
* Updates given attribute representation.
|
166
|
-
*
|
167
164
|
* @param name - Attribute name which was updates.
|
168
165
|
* @param newValue - New updated value.
|
169
166
|
*
|
@@ -174,7 +171,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
174
171
|
* Triggered when this component is mounted into the document.
|
175
172
|
* Attaches event handler, grabs given slots, reflects external properties
|
176
173
|
* and enqueues first rendering.
|
177
|
-
*
|
178
174
|
* @returns Nothing.
|
179
175
|
*/
|
180
176
|
connectedCallback(): void;
|
@@ -185,14 +181,12 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
185
181
|
/**
|
186
182
|
* Registers needed getter and setter to get notified about changes and
|
187
183
|
* reflect them.
|
188
|
-
*
|
189
184
|
* @returns Nothing.
|
190
185
|
*/
|
191
186
|
defineGetterAndSetterInterface(): void;
|
192
187
|
/**
|
193
188
|
* Creates an index to match alias source and target against each other on
|
194
189
|
* constant runtime.
|
195
|
-
*
|
196
190
|
* @param name - Name to search an alternate name for.
|
197
191
|
*
|
198
192
|
* @returns Found alias or "null".
|
@@ -202,12 +196,12 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
202
196
|
* Generic property getter. Forwards properties from the "properties"
|
203
197
|
* field.
|
204
198
|
* @param name - Property name to retrieve.
|
199
|
+
*
|
205
200
|
* @returns Retrieved property value.
|
206
201
|
*/
|
207
202
|
getPropertyValue(name: string): unknown;
|
208
203
|
/**
|
209
204
|
* External property setter. Respects configured aliases.
|
210
|
-
*
|
211
205
|
* @param name - Property name to write.
|
212
206
|
* @param value - New value to write.
|
213
207
|
*
|
@@ -216,7 +210,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
216
210
|
setExternalPropertyValue(name: string, value: unknown): void;
|
217
211
|
/**
|
218
212
|
* Internal property setter. Respects configured aliases.
|
219
|
-
*
|
220
213
|
* @param name - Property name to write.
|
221
214
|
* @param value - New value to write.
|
222
215
|
*
|
@@ -226,7 +219,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
226
219
|
/**
|
227
220
|
* Generic property setter. Forwards field writes into internal and
|
228
221
|
* external property representations.
|
229
|
-
*
|
230
222
|
* @param name - Property name to write.
|
231
223
|
* @param value - New value to write.
|
232
224
|
*
|
@@ -236,17 +228,14 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
236
228
|
/**
|
237
229
|
* Triggers a new rendering cycle and respects property specific state
|
238
230
|
* connection.
|
239
|
-
*
|
240
231
|
* @param name - Property name to write.
|
241
232
|
* @param value - New value to write.
|
242
|
-
* @param render - Indicates to trigger a new render cycle.
|
243
233
|
*
|
244
234
|
* @returns Nothing.
|
245
235
|
*/
|
246
236
|
triggerPropertySpecificRendering(name: string, value: unknown): void;
|
247
237
|
/**
|
248
238
|
* Binds properties and event handler to given dom node.
|
249
|
-
*
|
250
239
|
* @param domNode - Node to start traversing from.
|
251
240
|
* @param scope - Scope to render property value again.
|
252
241
|
*
|
@@ -255,7 +244,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
255
244
|
applyBinding(domNode: Node, scope: Mapping<unknown>): void;
|
256
245
|
/**
|
257
246
|
* Binds properties and event handler to given, sibling and nested nodes.
|
258
|
-
*
|
259
247
|
* @param domNode - Node to start traversing from.
|
260
248
|
* @param scope - Scope to render property value again.
|
261
249
|
* @param renderSlots - Indicates whether to render nested elements of
|
@@ -268,15 +256,24 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
268
256
|
* Compiles given node content and their children. Provides corresponding
|
269
257
|
* map of compiled template functions connected to their (sub) nodes and
|
270
258
|
* expected scope names.
|
271
|
-
*
|
272
259
|
* @param domNode - Node to compile.
|
273
260
|
* @param scope - Scope to extract names from.
|
274
261
|
* @param options - Additional compile options.
|
262
|
+
* @param options.filter - Callback to exclude some node from being
|
263
|
+
* compiled.
|
264
|
+
* @param options.ignoreComponents - Indicates if component properties
|
265
|
+
* should be traversed or not.
|
266
|
+
* @param options.ignoreNestedComponents - Indicates if nested components
|
267
|
+
* should be traversed or not.
|
268
|
+
* @param options.map - Yet compiled dom nodes to just reference instead of
|
269
|
+
* recompiling.
|
270
|
+
* @param options.unsafe - Indicates if full html generation should be
|
271
|
+
* allowed.
|
275
272
|
*
|
276
273
|
* @returns Map of compiled templates.
|
277
274
|
*/
|
278
|
-
compileDomNodeTemplate<NodeType extends Node = Node>(domNode: NodeType, scope?:
|
279
|
-
filter?: (
|
275
|
+
compileDomNodeTemplate<NodeType extends Node = Node>(domNode: NodeType, scope?: ScopeDeclaration, options?: {
|
276
|
+
filter?: (_domNode: NodeType) => boolean;
|
280
277
|
ignoreComponents?: boolean;
|
281
278
|
ignoreNestedComponents?: boolean;
|
282
279
|
map?: CompiledDomNodeTemplate;
|
@@ -285,16 +282,27 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
285
282
|
/**
|
286
283
|
* Compiles and evaluates given node content and their children. Replaces
|
287
284
|
* each node content with their evaluated representation.
|
288
|
-
*
|
289
285
|
* @param domNode - Node to evaluate.
|
290
286
|
* @param scope - Scope to render against.
|
291
287
|
* @param options - Compile options.
|
288
|
+
* @param options.applyBindings - Indicates whether to apply bindings to
|
289
|
+
* given dom nodes.
|
290
|
+
* @param options.filter - Callback to exclude some node from being
|
291
|
+
* compiled.
|
292
|
+
* @param options.ignoreComponents - Indicates if component properties
|
293
|
+
* should be traversed or not.
|
294
|
+
* @param options.ignoreNestedComponents - Indicates if nested components
|
295
|
+
* should be traversed or not.
|
296
|
+
* @param options.map - Yet compiled dom nodes to just reference instead of
|
297
|
+
* recompiling.
|
298
|
+
* @param options.unsafe - Indicates if full html generation should be
|
299
|
+
* allowed.
|
292
300
|
*
|
293
301
|
* @returns Map of compiled templates.
|
294
302
|
*/
|
295
|
-
evaluateDomNodeTemplate<NodeType extends Node = Node>(domNode: NodeType, scope?:
|
303
|
+
evaluateDomNodeTemplate<NodeType extends Node = Node>(domNode: NodeType, scope?: Mapping<unknown>, options?: {
|
296
304
|
applyBindings?: boolean;
|
297
|
-
filter?: (
|
305
|
+
filter?: (_domNode: NodeType) => boolean;
|
298
306
|
ignoreComponents?: boolean;
|
299
307
|
ignoreNestedComponents?: boolean;
|
300
308
|
map?: CompiledDomNodeTemplate;
|
@@ -302,7 +310,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
302
310
|
}): CompiledDomNodeTemplate<NodeType>;
|
303
311
|
/**
|
304
312
|
* Replaces given dom node with given nodes.
|
305
|
-
*
|
306
313
|
* @param domNode - Node to replace its children.
|
307
314
|
* @param children - Element or array of elements to set as children.
|
308
315
|
*
|
@@ -311,7 +318,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
311
318
|
static replaceDomNodes(domNode: HTMLElement, children: Array<Node> | Node): void;
|
312
319
|
/**
|
313
320
|
* Moves content of given dom node one level up and removes given node.
|
314
|
-
*
|
315
321
|
* @param domNode - Node to unwrap.
|
316
322
|
*
|
317
323
|
* @returns List of unwrapped nodes.
|
@@ -319,21 +325,18 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
319
325
|
static unwrapDomNode(domNode: HTMLElement): Array<ChildNode>;
|
320
326
|
/**
|
321
327
|
* Determines initial root wich initializes rendering digest.
|
322
|
-
*
|
323
328
|
* @returns Nothing.
|
324
329
|
*/
|
325
330
|
determineRootBinding(): void;
|
326
331
|
/**
|
327
332
|
* Checks if given content hast code (to compile and render).
|
328
|
-
*
|
329
333
|
* @param content - Potential string with code inside.
|
330
334
|
*
|
331
335
|
* @returns A boolean indicating whether given content has code.
|
332
336
|
*/
|
333
|
-
static hasCode(content:
|
337
|
+
static hasCode(content: unknown): boolean;
|
334
338
|
/**
|
335
339
|
* Converts given list, item or map to a map (with ordering).
|
336
|
-
*
|
337
340
|
* @param value - Attribute reflection configuration.
|
338
341
|
*
|
339
342
|
* @returns Generated map.
|
@@ -342,21 +345,18 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
342
345
|
/**
|
343
346
|
* Attaches event handler to keep in sync with nested components properties
|
344
347
|
* states.
|
345
|
-
*
|
346
348
|
* @returns Nothing.
|
347
349
|
*/
|
348
350
|
attachEventHandler(): void;
|
349
351
|
/**
|
350
352
|
* Attach explicitly defined event handler to synchronize internal and
|
351
353
|
* external property states.
|
352
|
-
*
|
353
354
|
* @returns Returns "true" if there are some defined and "false" otherwise.
|
354
355
|
*/
|
355
356
|
attachExplicitDefinedOutputEventHandler(): boolean;
|
356
357
|
/**
|
357
358
|
* Attach implicitly defined event handler to synchronize internal and
|
358
359
|
* external property states.
|
359
|
-
*
|
360
360
|
* @param reflectProperties - Indicates whether implicitly determined
|
361
361
|
* properties should be reflected.
|
362
362
|
*
|
@@ -366,13 +366,11 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
366
366
|
/**
|
367
367
|
* Triggers all identified events to communicate internal property / state
|
368
368
|
* changes.
|
369
|
-
*
|
370
369
|
* @returns Nothing.
|
371
370
|
*/
|
372
371
|
triggerOuputEvents(): void;
|
373
372
|
/**
|
374
373
|
* Forwards given event as native web event.
|
375
|
-
*
|
376
374
|
* @param name - Event name.
|
377
375
|
* @param parameters - Event parameters.
|
378
376
|
*
|
@@ -383,7 +381,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
383
381
|
* Renders component given slot contents into given dom node. If expected
|
384
382
|
* slots are not given but a fallback is specified they will be loaded into
|
385
383
|
* internal slot mapping.
|
386
|
-
*
|
387
384
|
* @param targetDomNode - Target dom node to render slots into.
|
388
385
|
* @param scope - Environment to render slots again if specified.
|
389
386
|
*
|
@@ -392,7 +389,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
392
389
|
applySlots(targetDomNode: HTMLElement, scope: Mapping<unknown>): void;
|
393
390
|
/**
|
394
391
|
* Determines slot content from given node.
|
395
|
-
*
|
396
392
|
* @param slot - Node to grab slot content from.
|
397
393
|
*
|
398
394
|
* @returns Determined slot.
|
@@ -400,13 +396,11 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
400
396
|
grabSlotContent(slot: Node): Node;
|
401
397
|
/**
|
402
398
|
* Saves given slots.
|
403
|
-
*
|
404
399
|
* @returns Nothing.
|
405
400
|
*/
|
406
401
|
grabGivenSlots(): void;
|
407
402
|
/**
|
408
403
|
* Determines if given property name exists in wrapped component state.
|
409
|
-
*
|
410
404
|
* @param name - Property name to check if exists in state.
|
411
405
|
*
|
412
406
|
* @returns Boolean result.
|
@@ -419,7 +413,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
419
413
|
generateAliasIndex(): void;
|
420
414
|
/**
|
421
415
|
* Reflects wrapped component state back to web-component's attributes.
|
422
|
-
*
|
423
416
|
* @param properties - Properties to update in reflected attribute state.
|
424
417
|
*
|
425
418
|
* @returns Nothing.
|
@@ -428,7 +421,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
428
421
|
/**
|
429
422
|
* Reflects wrapped component state back to web-component's attributes and
|
430
423
|
* properties.
|
431
|
-
*
|
432
424
|
* @param properties - Properties to update in reflected property state.
|
433
425
|
*
|
434
426
|
* @returns Nothing.
|
@@ -436,7 +428,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
436
428
|
reflectProperties(properties: Mapping<unknown>): void;
|
437
429
|
/**
|
438
430
|
* Triggers a new rendering cycle by respecting batch configuration.
|
439
|
-
*
|
440
431
|
* @param reason - A description why rendering should be triggered.
|
441
432
|
*
|
442
433
|
* @returns Nothing.
|
@@ -445,7 +436,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
445
436
|
/**
|
446
437
|
* Reflect given event handler call with given parameter back to current
|
447
438
|
* properties state.
|
448
|
-
*
|
449
439
|
* @param name - Event name.
|
450
440
|
* @param parameters - List of parameter to given event handler call.
|
451
441
|
*
|
@@ -455,7 +445,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
455
445
|
/**
|
456
446
|
* Evaluates given property value depending on its type specification and
|
457
447
|
* registers in properties mapping object.
|
458
|
-
*
|
459
448
|
* @param attributeName - Name of given value.
|
460
449
|
* @param value - Value to evaluate.
|
461
450
|
*
|
@@ -465,7 +454,6 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
465
454
|
/**
|
466
455
|
* Determines new scope object with useful default set of environment
|
467
456
|
* values.
|
468
|
-
*
|
469
457
|
* @param scope - To apply to generated scope.
|
470
458
|
*
|
471
459
|
* @returns Generated scope.
|
@@ -474,14 +462,12 @@ export declare class Web<TElement = HTMLElement> extends HTMLElement {
|
|
474
462
|
/**
|
475
463
|
* Creates shadow root if not created yet and assigns to current root
|
476
464
|
* property.
|
477
|
-
*
|
478
465
|
* @returns Nothing.
|
479
466
|
*/
|
480
467
|
applyShadowRootIfNotExisting(): void;
|
481
468
|
/**
|
482
469
|
* Method which does the rendering job. Should be called when ever state
|
483
470
|
* changes should be projected to the hosts dom content.
|
484
|
-
*
|
485
471
|
* @param reason - Description why rendering is necessary.
|
486
472
|
*
|
487
473
|
* @returns Nothing.
|
package/Web.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/wrapNativeSuper"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","@babel/runtime/helpers/initializerDefineProperty","@babel/runtime/helpers/assertThisInitialized","@babel/runtime/helpers/inheritsLoose","@babel/runtime/helpers/wrapNativeSuper","@babel/runtime/helpers/applyDecoratedDescriptor","@babel/runtime/helpers/initializerWarningHelper","clientnode","clientnode/property-types"],t);else{var r="object"==typeof exports?t(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/wrapNativeSuper"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types")):t(e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/initializerDefineProperty"],e["@babel/runtime/helpers/assertThisInitialized"],e["@babel/runtime/helpers/inheritsLoose"],e["@babel/runtime/helpers/wrapNativeSuper"],e["@babel/runtime/helpers/applyDecoratedDescriptor"],e["@babel/runtime/helpers/initializerWarningHelper"],e.clientnode,e["clientnode/property-types"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(e,t,r,n,i,s,o,a,l){return function(){"use strict";var p=[function(t){t.exports=e},function(e){e.exports=a},function(e){e.exports=l},function(e){e.exports=n},function(e,t,r){var n=r(0),i=r.n(n),s=r(1),o=r.n(s),a=r(2);t.default=function(e){return void 0===e&&(e={}),e=i()({readAttribute:!0,type:a.string},e),function(t,r){if("string"==typeof r){var n=t.self||t.constructor;if(e.readAttribute){n.hasOwnProperty("observedAttributes")||(n.observedAttributes=n.observedAttributes?[].concat(n.observedAttributes):[]);var s=o().stringCamelCaseToDelimited(r);n.observedAttributes.includes(s)||n.observedAttributes.push(s)}if(e.type&&(n.hasOwnProperty("propertyTypes")||(n.propertyTypes=n.propertyTypes?i()({},n.propertyTypes):{}),!e.update&&n.propertyTypes.hasOwnProperty(r)||(n.propertyTypes[r]=e.type)),e.writeAttribute&&(n.hasOwnProperty("propertiesToReflectAsAttributes")||(n.propertiesToReflectAsAttributes=n.propertiesToReflectAsAttributes?o().copy(n.propertiesToReflectAsAttributes):new Map),e.update||n.propertiesToReflectAsAttributes instanceof Map&&!n.propertiesToReflectAsAttributes.has(r)||Array.isArray(n.propertiesToReflectAsAttributes)&&!n.propertiesToReflectAsAttributes.includes(r)||null!==n.propertiesToReflectAsAttributes&&"object"==typeof n.propertiesToReflectAsAttributes&&!n.propertiesToReflectAsAttributes.hasOwnProperty(r))){var a,l;if("boolean"==typeof e.writeAttribute)!0===e.writeAttribute&&null!=(l=n.propertyTypes)&&l.hasOwnProperty(r)&&(a=n.propertyTypes[r]);else a=e.writeAttribute;void 0!==a&&(Array.isArray(n.propertiesToReflectAsAttributes)&&(!0===e.writeAttribute?n.propertiesToReflectAsAttributes.push(r):n.propertiesToReflectAsAttributes=n.normalizePropertyTypeList(n.propertiesToReflectAsAttributes)),n.propertiesToReflectAsAttributes instanceof Map&&n.propertiesToReflectAsAttributes.set(r,a),null!==n.propertiesToReflectAsAttributes&&"object"==typeof n.propertiesToReflectAsAttributes&&(n.propertiesToReflectAsAttributes[r]=a))}e.alias&&(n.hasOwnProperty("propertyAliases")||(n.propertyAliases=n.propertyAliases?i()({},n.propertyAliases):{}),!e.update&&n.propertyAliases.hasOwnProperty(r)||(n.propertyAliases[r]=e.alias))}}}},,function(e){e.exports=t},function(e){e.exports=r},function(e){e.exports=i},function(e){e.exports=s},function(e){e.exports=o}],u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return p[e](r,r.exports,c),r.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var h={};return function(){c.r(h),c.d(h,{Web:function(){return O},api:function(){return C}});var e,t,r,n,i,s=c(0),o=c.n(s),a=c(6),l=c.n(a),p=c(7),u=c.n(p),d=c(3),f=c.n(d),b=c(8),y=c.n(b),v=c(9),m=c.n(v),g=(c(10),c(1)),A=c.n(g),P=c(2);function w(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var O=(e=(0,c(4).default)({type:P.boolean,writeAttribute:!0}),i=n=function(e){function t(){var n;return(n=e.call(this)||this).batchAttributeUpdates=!0,n.batchPropertyUpdates=!0,n.batchUpdates=!0,n.batchedAttributeUpdateRunning=!0,n.batchedPropertyUpdateRunning=!0,n.batchedUpdateRunning=!0,n.parent=null,n.rootInstance=null,n.scope={Tools:A()},n.domNodeEventBindings=new Map,n.domNodeTemplateCache=new Map,n.externalProperties={},n.ignoreAttributeUpdateObservations=!1,n.internalProperties={},n.outputEventNames=new Set,n.instance=null,l()(n,"isRoot",r,u()(n)),n.root=void 0,n.runDomConnectionAndRenderingInSameEventQueue=!1,n.self=t,n.slots={},n.self=n.constructor,n.self._propertiesToReflectAsAttributes||(n.self._propertiesToReflectAsAttributes=n.self.normalizePropertyTypeList(n.self.propertiesToReflectAsAttributes)),n.generateAliasIndex(),n.root=u()(n),n.defineGetterAndSetterInterface(),n}f()(t,e);var n=t.prototype;return n.attributeChangedCallback=function(e,t,r){this.ignoreAttributeUpdateObservations||t===r||this.updateAttribute(e,r)},n.updateAttribute=function(e,t){var r=this;this.evaluateStringOrNullAndSetAsProperty(e,t),this.batchAttributeUpdates?this.batchedAttributeUpdateRunning||this.batchedUpdateRunning||(this.batchedAttributeUpdateRunning=!0,this.batchedUpdateRunning=!0,A().timeout((function(){r.batchedAttributeUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("attributeChanged")}))):this.render("attributeChanged")},n.connectedCallback=function(){var e=this;try{this.isConnected=!0}catch(e){}this.parent=this,this.rootInstance=this,this.attachEventHandler(),this.self.determineRootBinding&&this.determineRootBinding(),this.self.applyRootBinding&&this.isRoot&&(this.determineRenderScope(),this.applyBinding(this,this.scope)),this.batchedAttributeUpdateRunning=!1,this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.grabGivenSlots(),this.reflectExternalProperties(this.externalProperties),this.runDomConnectionAndRenderingInSameEventQueue?this.render("connected"):A().timeout((function(){return e.render("connected")}))},n.disconnectedCallback=function(){try{this.isConnected=!1}catch(e){}for(var e,t=w(this.domNodeEventBindings);!(e=t()).done;)for(var r,n=e.value,i=(n[0],w(n[1].values()));!(r=i()).done;){(0,r.value)()}this.slots={}},n.defineGetterAndSetterInterface=function(){for(var e,t=this,r=function(){var r=e.value;Object.prototype.hasOwnProperty.call(t,r)&&t.setPropertyValue(r,t[r]),Object.defineProperty(t,r,{configurable:!0,get:function(){return this.getPropertyValue(r)},set:function(e){this.setPropertyValue(r,e),this.triggerPropertySpecificRendering(r,e)}})},n=w(A().arrayUnique(Object.keys(this.self.propertyTypes).concat(Object.keys(this.self._propertyAliasIndex))));!(e=n()).done;)r()},n.getPropertyAlias=function(e){return Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,e)?this.self._propertyAliasIndex[e]:null},n.getPropertyValue=function(e){var r,n,i,s,o=null==(r=this.instance)||null==(n=r.current)||!n.properties||t.propertyTypes.hasOwnProperty(e)&&!this.instance.current.properties.hasOwnProperty(e)?this.externalProperties[e]:this.instance.current.properties[e];return null!=(i=this.instance)&&null!=(s=i.current)&&s.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,e)?this.instance.current.state[e]:o},n.setExternalPropertyValue=function(e,t){this.externalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.externalProperties[r]=t)},n.setInternalPropertyValue=function(e,t){this.internalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.internalProperties[r]=t)},n.setPropertyValue=function(e,t){var r;this.reflectProperties(((r={})[e]=t,r)),this.setInternalPropertyValue(e,t)},n.triggerPropertySpecificRendering=function(e,t){var r=this;if(this.batchPropertyUpdates)this.batchedPropertyUpdateRunning||this.batchedUpdateRunning||(this.batchedPropertyUpdateRunning=!0,this.batchedUpdateRunning=!0,A().timeout((function(){void 0!==t&&r.isStateProperty(e)?(r.render("preStatePropertyChanged"),A().timeout((function(){r.setInternalPropertyValue(e,void 0),r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("postStatePropertyChanged"),r.triggerOuputEvents()}))):(r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("propertyChanged"),r.triggerOuputEvents())})));else{var n=this.isStateProperty(e);this.render(n?"preStatePropertyChanged":"propertyChanged"),void 0!==t&&n&&(this.setInternalPropertyValue(e,void 0),this.render("postStatePropertyChanged")),this.triggerOuputEvents()}},n.applyBinding=function(e,t){var r=this;if(e.getAttributeNames)for(var n,i=function(){var i=n.value,s="";if(i.startsWith("data-bind-")?s=i.substring("data-bind-".length):i.startsWith("bind-")&&(s=i.substring("bind-".length)),s){var a=e.getAttribute(i);if(null===a)return"continue";if(s.startsWith("attribute-")||s.startsWith("property-")){var l=A().stringEvaluate(a,t,!1,e);if(l.error)return console.warn('Error occurred during processing given attribute binding "'+i+'" on node:',e,l.error),"continue";s.startsWith("attribute-")?e.setAttribute(s.substring("attribute-".length),l.result):e[A().stringDelimitedToCamelCase(s.substring("property-".length))]=l.result}else if(s.startsWith("on-")){r.domNodeEventBindings.has(e)||r.domNodeEventBindings.set(e,new Map);var p=r.domNodeEventBindings.get(e);s=A().stringDelimitedToCamelCase(s.substring("on-".length)),p.has(s)&&p.get(s)(),t=o()({event:void 0,parameters:void 0},t);var u=A().stringCompile(a,t,!0);if(u.error)console.warn('Error occurred during compiling given event binding "'+i+'" on node:',e,u.error);else{var c=u.templateFunction.bind(e),h=function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];t.event=n[0],t.parameters=n;try{c.apply(void 0,u.originalScopeNames.map((function(e){return t[e]})))}catch(t){console.warn('Error occurred during processing given event binding "'+i+'" on node:',e,'Given expression "'+a+'" could not be evaluated with given scope names "'+u.scopeNames.join('", "')+'": '+A().represent(t))}};e.addEventListener(s,h),p.set(s,(function(){e.removeEventListener(s,h),p.delete(s),0===p.size&&r.domNodeEventBindings.delete(e)}))}}}},s=w(e.getAttributeNames());!(n=s()).done;)i()},n.applyBindings=function(e,t,r){for(void 0===r&&(r=!0);e;){var n;null==(n=e.attributes)||!n.length||!r&&e.getAttribute("slot")||this.applyBinding(e,t),e.nodeName.toLowerCase().includes("-")||this.applyBindings(e.firstChild,t),e=e.nextSibling}},n.compileDomNodeTemplate=function(e,t,r){var n;if(void 0===t&&(t=[]),void 0===r&&(r={}),(r=o()({ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe},r)).ignoreComponents&&null!=(n=e.nodeName)&&n.toLowerCase().includes("-"))return r.map;if(r.unsafe){var i=e.innerHTML;if(!i&&e.template&&(i=e.template),this.self.hasCode(i)){var s=A().stringCompile("`"+i+"`",t);r.map.set(e,{children:[],error:s.error,scopeNames:s.scopeNames,template:i,templateFunction:s.templateFunction})}}else{var a,l=e.nodeName.toLowerCase();if(["a","#text"].includes(l)){var p="a"===l?e.getAttribute("href"):e.textContent;this.self.hasCode(p)&&(a=p.replace(/ /g," ").trim())}var u=[];if(a){var c=A().stringCompile("`"+a+"`",t);r.map.set(e,{children:u,error:c.error,scopeNames:c.scopeNames,template:a,templateFunction:c.templateFunction})}for(var h=e.firstChild;h;)r.filter&&!r.filter(h)||u.push(this.compileDomNodeTemplate(h,t,o()({},r,{ignoreComponents:r.ignoreNestedComponents}))),h=h.nextSibling}return r.map},n.evaluateDomNodeTemplate=function(e,t,r){var n;if(void 0===t&&(t={}),void 0===r&&(r={}),(r=o()({applyBindings:!0,ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe},r)).map.has(e)||this.compileDomNodeTemplate(e,t,r),r.map.has(e)){var i=r.map.get(e),s=i.error,a=i.scopeNames,l=i.templateFunction;if(s)console.warn("Error occurred during compiling node content: "+s);else{var p=null;try{p=l.apply(void 0,a.map((function(e){return t[e]})))}catch(s){console.warn('Error occurred when "'+this.self._name+'" is running "'+l+'": with bound names "'+a.join('", "')+'": "'+s+'". Rendering node:',e)}null!==p&&(r.unsafe?e.innerHTML=p:"a"===e.nodeName.toLowerCase()?e.setAttribute("href",p):e.textContent=p)}}if(!(r.unsafe||r.ignoreComponents&&null!=(n=e.nodeName)&&n.toLowerCase().includes("-")))for(var u=e.firstChild;u;)r.filter&&!r.filter(u)||this.evaluateDomNodeTemplate(u,t,o()({},r,{applyBindings:!1,ignoreComponents:r.ignoreNestedComponents})),u=u.nextSibling;return r.applyBindings&&this.applyBindings(e,t),r.map},t.replaceDomNodes=function(e,r){for(var n,i=w([].concat(r).reverse());!(n=i()).done;){var s,o=n.value;t.trimSlots&&o.nodeType===Node.TEXT_NODE&&""===(null==(s=o.nodeValue)?void 0:s.trim())||e.after(o)}e.remove()},t.unwrapDomNode=function(e){for(var t=e.parentNode,r=[];e.firstChild;)r.push(e.firstChild),t.insertBefore(e.firstChild,e);return t.removeChild(e),r},n.determineRootBinding=function(){for(var e=this.parentNode;e;){var r;(e instanceof t||null!=(r=e.nodeName)&&r.includes("-")||null===e.parentNode&&"[object ShadowRoot]"===e.toString())&&(this.rootInstance===this?(this.parent=e,this.rootInstance=e,this.setPropertyValue("isRoot",!1)):this.rootInstance=e),e=e.parentNode}},t.hasCode=function(e){return"string"==typeof e&&e.includes("${")&&e.includes("}")&&/\${[\s\S]+}/.test(e)},t.normalizePropertyTypeList=function(e){if("string"==typeof e&&(e=[e]),Array.isArray(e)){var r=e;e=new Map;for(var n,i=w(r);!(n=i()).done;){var s=n.value;t.propertyTypes.hasOwnProperty(s)&&e.set(s,t.propertyTypes[s])}}else e=A().convertPlainObjectToMap(e);return e},n.attachEventHandler=function(){if(null!==this.self.eventToPropertyMapping){var e=this.attachExplicitDefinedOutputEventHandler();this.attachImplicitDefinedOutputEventHandler(!e)}},n.attachExplicitDefinedOutputEventHandler=function(){for(var e=this,t=!1,r=function(){var r=i[n];Object.prototype.hasOwnProperty.call(e.internalProperties,r)||(t=!0,e.outputEventNames.add(r),e.setInternalPropertyValue(r,(function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var s=e.reflectEventToProperties(r,n);s&&(n[0]=s),e.forwardEvent(r,n)})))},n=0,i=Object.keys(this.self.eventToPropertyMapping);n<i.length;n++)r();return t},n.attachImplicitDefinedOutputEventHandler=function(e){var t=this;void 0===e&&(e=!0);for(var r=function(){var r=i[n],s=r[0];r[1];Object.prototype.hasOwnProperty.call(t.internalProperties,s)||![P.func,"function"].includes(t.self.propertyTypes[s])||t.self.renderProperties.includes(s)||(t.outputEventNames.add(s),t.setInternalPropertyValue(s,(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e&&t.reflectEventToProperties(s,n),t.forwardEvent(s,n)})))},n=0,i=Object.entries(this.self.propertyTypes);n<i.length;n++)r()},n.triggerOuputEvents=function(){for(var e,t=w(this.outputEventNames);!(e=t()).done;){var r=e.value;this.forwardEvent(r,[this.externalProperties])}},n.forwardEvent=function(e,t){return e.length>"onX".length&&e.startsWith("on")&&(e=A().stringLowerCase(e.substring(2))),this.dispatchEvent(new CustomEvent(e,{detail:{parameters:t}}))},n.applySlots=function(e,t){for(var r=this,n=0,i=Array.from(e.querySelectorAll("slot"));n<i.length;n++){var s=i[n],o=s.getAttribute("name");if(null===o||"default"===o)if(this.slots.default){if(this.self.renderSlots){if(this.self.evaluateSlots)for(var a,l=w(this.slots.default);!(a=l()).done;){var p=a.value;this.evaluateDomNodeTemplate(p,t)}this.self.replaceDomNodes(s,this.slots.default)}}else this.slots.default=this.self.unwrapDomNode(s).map((function(e){return r.grabSlotContent(e)}));else Object.prototype.hasOwnProperty.call(this.slots,o)?this.self.renderSlots&&(this.self.evaluateSlots&&this.evaluateDomNodeTemplate(this.slots[o],t),this.self.replaceDomNodes(s,this.slots[o])):this.slots[o]=this.grabSlotContent(this.self.unwrapDomNode(s).filter((function(e){return"#text"!==e.nodeName.toLowerCase()}))[0])}},n.grabSlotContent=function(e){var t;if("textarea"===(null==(t=e.firstElementChild)?void 0:t.nodeName.toLowerCase())&&(!e.firstElementChild.hasAttribute("data-no-template")||"false"===e.firstElementChild.getAttribute("data-no-template"))){var r,n,i=e.firstElementChild.value;null==(r=e.classList)||r.remove("web-component-template");var s=e.cloneNode();return null==(n=e.classList)||n.add("web-component-template"),s.innerHTML="",s.template=i,s}return this.self.cloneSlots?e.cloneNode(!0):e},n.grabGivenSlots=function(){var e=this;this.slots={};for(var t=0,r=Array.from(this.querySelectorAll("[slot]"));t<r.length;t++){for(var n=r[t],i=n.parentNode,s=!0;i;){if(i.nodeName.includes("-")){i===this&&(s=!1);break}i=i.parentNode}s||(this.slots[n.getAttribute&&n.getAttribute("slot")&&n.getAttribute("slot").trim()?n.getAttribute("slot").trim():n.nodeName.toLowerCase()]=this.grabSlotContent(n))}this.slots.default?this.slots.default=[this.slots.default]:this.childNodes.length>0?this.slots.default=Array.from(this.childNodes).map((function(t){return e.grabSlotContent(t)})):this.slots.default=[]},n.isStateProperty=function(e){var t,r,n,i;return Boolean((null==(t=this.instance)||null==(r=t.current)?void 0:r.state)&&(Object.prototype.hasOwnProperty.call(null==(n=this.instance)||null==(i=n.current)?void 0:i.state,e)||this.instance.current.state.modelState&&Object.prototype.hasOwnProperty.call(this.instance.current.state.modelState,e)))},n.generateAliasIndex=function(){if(!this.self._propertyAliasIndex){this.self._propertyAliasIndex=o()({},this.self.propertyAliases);for(var e=0,t=Object.entries(this.self._propertyAliasIndex);e<t.length;e++){var r=t[e],n=r[0],i=r[1];Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,i)||(this.self._propertyAliasIndex[i]=n)}}},n.reflectExternalProperties=function(e){this.ignoreAttributeUpdateObservations=!0;for(var t=0,r=Object.entries(e);t<r.length;t++){var n=r[t],i=n[0],s=n[1];if(this.setExternalPropertyValue(i,s),this.isConnected){var o=A().stringCamelCaseToDelimited(i);if(this.self._propertiesToReflectAsAttributes.has(i))switch(this.self._propertiesToReflectAsAttributes.get(i)){case P.boolean:case"boolean":s?""!==this.getAttribute(o)&&this.setAttribute(o,""):this.hasAttribute(o)&&this.removeAttribute(o);break;case P.func:case"function":break;case"json":if(s){var a=JSON.stringify(s);if(a&&this.getAttribute(o)!==a){this.setAttribute(o,a);break}}this.hasAttribute(o)&&this.removeAttribute(o);break;case P.number:case"number":if("number"!=typeof s||isNaN(s))this.hasAttribute(o)&&this.removeAttribute(o);else{var l=""+s;this.getAttribute(o)!==l&&this.setAttribute(o,l)}break;case P.string:case"string":s?this.getAttribute(o)!==s&&this.setAttribute(o,s):this.hasAttribute(o)&&this.removeAttribute(o);break;case P.any:case P.array:case P.arrayOf:case P.element:case P.elementType:case P.instanceOf:case P.node:case P.object:case"object":case P.objectOf:case P.shape:case P.exact:case P.symbol:default:if(s){var p=A().represent(s);if(p&&this.getAttribute(o)!==p){this.setAttribute(o,p);break}}this.hasAttribute(o)&&this.removeAttribute(o)}}}this.ignoreAttributeUpdateObservations=!1},n.reflectProperties=function(e){var t,r,n,i;if(this.reflectExternalProperties(e),null!=(t=this.instance)&&null!=(r=t.current)&&r.state&&"object"==typeof this.instance.current.state)for(var s,o=w(Object.keys(this.instance.current.state).concat(this.instance.current.state.modelState?Object.keys(this.instance.current.state.modelState):[]));!(s=o()).done;){var a=s.value;Object.prototype.hasOwnProperty.call(this.internalProperties,a)&&this.setInternalPropertyValue(a,void 0)}null!=(n=this.internalProperties.model)&&n.state&&(null==(i=this.internalProperties.model)||delete i.state,this.setInternalPropertyValue("model",this.internalProperties.model));for(var l,p=w(this.self.controllableProperties);!(l=p()).done;){var u=l.value;Object.prototype.hasOwnProperty.call(e,u)&&this.setInternalPropertyValue(u,e[u])}},n.triggerRender=function(e){var t=this;this.batchUpdates?this.batchedUpdateRunning||(this.batchedUpdateRunning=!0,A().timeout((function(){t.batchedUpdateRunning=!1,t.render(e)}))):this.render(e)},n.reflectEventToProperties=function(e,t){var r=this.batchUpdates;this.batchUpdates=!1;var n=null;if(this.self.eventToPropertyMapping&&Object.prototype.hasOwnProperty.call(this.self.eventToPropertyMapping,e)&&A().isFunction(this.self.eventToPropertyMapping[e])){var i,s=(i=this.self.eventToPropertyMapping)[e].apply(i,t.concat([this]));Array.isArray(s)?(n=s[0],this.reflectProperties(n),A().extend(!0,this.internalProperties,s[1])):null!==s&&"object"==typeof s&&(n=s,this.reflectProperties(s))}else if(t.length>0&&null!==t[0]&&"object"==typeof t[0]){var a,l=t[0];if("persist"in t[0]&&A().isFunction(t[0].persist)){l={};for(var p=0,u=Object.keys(this.self.propertyTypes);p<u.length;p++)for(var c,h=u[p],d=w([h].concat(null!==(f=this.getPropertyAlias(h))&&void 0!==f?f:[]));!(c=d()).done;){var f,b=c.value,y=t[0].currentTarget&&Object.prototype.hasOwnProperty.call(t[0].currentTarget,b)?t[0].currentTarget[b]:this.getPropertyValue(b);y!==this.externalProperties[b]&&(l[b]=y)}}else[null,void 0].includes(null==(a=l.detail)?void 0:a.value)||(l=o()({},l.detail));n=l,this.reflectProperties(l)}return this.triggerRender("propertyReflected"),this.batchUpdates=r,n},n.evaluateStringOrNullAndSetAsProperty=function(e,t){var r=this,n=e.startsWith("-"),i=n?e.substring(1):e,s=A().stringDelimitedToCamelCase(i),o=this.getPropertyAlias(s);if(o&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,o)&&(s=o),Object.prototype.hasOwnProperty.call(this.self.propertyTypes,s)){var a=this.self.propertyTypes[s];if(n){if(t){var l=A().stringEvaluate(t,{Tools:A()},!1,this);l.error?(console.warn('Faild to process pre-evaluation attribute "'+e+'": '+l.error+'. Will be set to "undefined".'),this.setInternalPropertyValue(s,void 0)):(this.setInternalPropertyValue(s,l.result),this.setExternalPropertyValue(s,l.result))}}else switch(a){case P.boolean:case"boolean":var p=![null,"false"].includes(t);this.setInternalPropertyValue(s,p),this.setExternalPropertyValue(s,p);break;case P.func:case"function":var u,c=null,h=["data","event","firstArgument","firstParameter","options","scope","parameters","Tools"];if(t){var d=A().stringCompile(t,h);c=d.error,u=d.templateFunction,c&&console.warn('Failed to compile given handler "'+e+'": '+c+".")}this.setInternalPropertyValue(s,(function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];r.outputEventNames.has(s)&&r.reflectEventToProperties(s,i);var a=void 0;if(!c)try{a=u.call(r,i[0],i[0],i[0],i[0],i[0],i[0],i,A())}catch(r){console.warn('Failed to evaluate function "'+e+'" with expression "'+t+'" and scope variables "'+h.join('", "')+'" set to "'+A().represent(i)+'": '+r+'. Set property to "undedefined".')}return r.self.renderProperties.includes(s)||r.forwardEvent(s,i),a})),c||this.setExternalPropertyValue(s,u);break;case"json":if(t){var f;try{f=JSON.parse(t)}catch(c){console.warn('Error occurred during parsing given json attribute "'+e+'": '+A().represent(c));break}this.setInternalPropertyValue(s,f),this.setExternalPropertyValue(s,A().copy(f,1))}else this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null);break;case P.number:case"number":if(null===t){this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break}var b=parseFloat(t);isNaN(b)&&(b=void 0),this.setInternalPropertyValue(s,b),this.setExternalPropertyValue(s,b);break;case P.string:case"string":this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break;case P.any:case P.array:case P.arrayOf:case P.element:case P.elementType:case P.instanceOf:case P.node:case P.object:case"object":case P.objectOf:case P.oneOf:case P.oneOfType:case P.shape:case P.exact:case P.symbol:default:if(t){var y=A().stringEvaluate(t,{},!1,this);if(y.error){console.warn('Error occurred during processing given attribute configuration "'+e+'": '+y.error);break}this.setInternalPropertyValue(s,y.result),this.setExternalPropertyValue(s,A().copy(y.result,1))}else this.hasAttribute(e)?(this.setInternalPropertyValue(s,!0),this.setExternalPropertyValue(s,!0)):(this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null))}}},n.determineRenderScope=function(e){var t,r;void 0===e&&(e={}),this.scope=o()({},(null==(t=this.parent)?void 0:t.scope)||{},this.scope,this.internalProperties,((r={parent:this.parent,root:this.rootInstance,self:this})[A().stringLowerCase(this.self._name)||"instance"]=this,r),e),this.scope.scope=this.scope},n.applyShadowRootIfNotExisting=function(){this.self.shadowDOM&&this.root===this&&(this.root=(!("attachShadow"in this)&&"ShadyDOM"in window?window.ShadyDOM.wrap(this):this).attachShadow(null!==this.self.shadowDOM&&"object"==typeof this.self.shadowDOM?this.self.shadowDOM:{mode:"open"}))},n.render=function(e){if(void 0===e&&(e="unknown"),this.determineRenderScope(),this.dispatchEvent(new CustomEvent("render",{detail:{reason:e,scope:this.scope}}))){var t=A().stringEvaluate("`"+this.self.content+"`",this.scope);if(t.error)console.warn("Faild to process template: "+t.error);else{this.applyShadowRootIfNotExisting();var r=document.createElement("div");r.innerHTML=t.result,this.applySlots(r,o()({},this.scope,{parent:this})),this.root.innerHTML=r.innerHTML,this.applyBindings(this.root.firstChild,this.scope,this.self.renderSlots)}}},t}(y()(HTMLElement)),n.applyRootBinding=!0,n.content="<slot>Please provide a template to transclude.</slot>",n.determineRootBinding=!0,n.shadowDOM=null,n.observedAttributes=[],n.controllableProperties=[],n.eventToPropertyMapping={},n.propertyAliases={},n.propertyTypes={},n.propertiesToReflectAsAttributes=[],n.renderProperties=["children"],n.cloneSlots=!1,n.evaluateSlots=!1,n.renderSlots=!0,n.trimSlots=!0,n.renderUnsafe=!1,n._name="BaseWeb",n._propertyAliasIndex=void 0,n._propertiesToReflectAsAttributes=void 0,t=i,r=m()(t.prototype,"isRoot",[e],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),t),C={component:O,register:function(e){return void 0===e&&(e=A().stringCamelCaseToDelimited(O._name)),customElements.define(e,O)}};h.default=O}(),h}()}));
|
1
|
+
'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/wrapNativeSuper"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","@babel/runtime/helpers/initializerDefineProperty","@babel/runtime/helpers/assertThisInitialized","@babel/runtime/helpers/inheritsLoose","@babel/runtime/helpers/wrapNativeSuper","@babel/runtime/helpers/applyDecoratedDescriptor","@babel/runtime/helpers/initializerWarningHelper","clientnode","clientnode/property-types"],t);else{var r="object"==typeof exports?t(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/wrapNativeSuper"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types")):t(e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/initializerDefineProperty"],e["@babel/runtime/helpers/assertThisInitialized"],e["@babel/runtime/helpers/inheritsLoose"],e["@babel/runtime/helpers/wrapNativeSuper"],e["@babel/runtime/helpers/applyDecoratedDescriptor"],e["@babel/runtime/helpers/initializerWarningHelper"],e.clientnode,e["clientnode/property-types"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(e,t,r,n,i,s,o,a,l){return function(){"use strict";var p=[function(t){t.exports=e},function(e){e.exports=a},function(e){e.exports=l},function(e){e.exports=n},function(e,t,r){var n=r(0),i=r.n(n),s=r(1),o=r.n(s),a=r(2);t.default=function(e){return void 0===e&&(e={}),e=i()({readAttribute:!0,type:a.string},e),function(t,r){if("string"==typeof r){var n,s=t.self||t.constructor;if(e.readAttribute){Object.prototype.hasOwnProperty.call(s,"observedAttributes")||(s.observedAttributes=s.observedAttributes?[].concat(s.observedAttributes):[]);var a=o().stringCamelCaseToDelimited(r);s.observedAttributes.includes(a)||s.observedAttributes.push(a)}if(e.type&&(Object.prototype.hasOwnProperty.call(s,"propertyTypes")||(s.propertyTypes=s.propertyTypes?i()({},s.propertyTypes):{}),!e.update&&Object.prototype.hasOwnProperty.call(s,r)||(s.propertyTypes[r]=e.type)),e.writeAttribute)if(Object.prototype.hasOwnProperty.call(s,"propertiesToReflectAsAttributes")||(s.propertiesToReflectAsAttributes=s.propertiesToReflectAsAttributes?o().copy(s.propertiesToReflectAsAttributes):new Map),e.update||s.propertiesToReflectAsAttributes instanceof Map&&!s.propertiesToReflectAsAttributes.has(r)||Array.isArray(s.propertiesToReflectAsAttributes)&&!s.propertiesToReflectAsAttributes.includes(r)||null!==s.propertiesToReflectAsAttributes&&"object"==typeof s.propertiesToReflectAsAttributes&&!Object.prototype.hasOwnProperty.call(s.propertiesToReflectAsAttributes,r))"boolean"==typeof e.writeAttribute?!0===e.writeAttribute&&s.propertyTypes&&Object.prototype.hasOwnProperty.call(s.propertyTypes,r)&&(n=s.propertyTypes[r]):n=e.writeAttribute,void 0!==n&&(Array.isArray(s.propertiesToReflectAsAttributes)&&(!0===e.writeAttribute?s.propertiesToReflectAsAttributes.push(r):s.propertiesToReflectAsAttributes=s.normalizePropertyTypeList(s.propertiesToReflectAsAttributes)),s.propertiesToReflectAsAttributes instanceof Map&&s.propertiesToReflectAsAttributes.set(r,n),null!==s.propertiesToReflectAsAttributes&&"object"==typeof s.propertiesToReflectAsAttributes&&(s.propertiesToReflectAsAttributes[r]=n));e.alias&&(Object.prototype.hasOwnProperty.call(s,"propertyAliases")||(s.propertyAliases=s.propertyAliases?i()({},s.propertyAliases):{}),!e.update&&Object.prototype.hasOwnProperty.call(s,r)||(s.propertyAliases[r]=e.alias))}}}},,function(e){e.exports=t},function(e){e.exports=r},function(e){e.exports=i},function(e){e.exports=s},function(e){e.exports=o}],u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return p[e](r,r.exports,c),r.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var h={};return function(){c.r(h),c.d(h,{Web:function(){return T},api:function(){return C}});var e,t,r,n,i,s=c(0),o=c.n(s),a=c(6),l=c.n(a),p=c(7),u=c.n(p),d=c(3),f=c.n(d),b=c(8),y=c.n(b),v=c(9),m=c.n(v),g=(c(10),c(1)),A=c.n(g),P=c(2);function w(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var T=(e=(0,c(4).default)({type:P.boolean,writeAttribute:!0}),i=n=function(e){function t(){var n;return(n=e.call(this)||this).batchAttributeUpdates=!0,n.batchPropertyUpdates=!0,n.batchUpdates=!0,n.batchedAttributeUpdateRunning=!0,n.batchedPropertyUpdateRunning=!0,n.batchedUpdateRunning=!0,n.parent=null,n.rootInstance=null,n.scope={Tools:A()},n.domNodeEventBindings=new Map,n.domNodeTemplateCache=new Map,n.externalProperties={},n.ignoreAttributeUpdateObservations=!1,n.internalProperties={},n.outputEventNames=new Set,n.instance=null,l()(n,"isRoot",r,u()(n)),n.root=void 0,n.runDomConnectionAndRenderingInSameEventQueue=!1,n.self=t,n.slots={},n.self=n.constructor,n.self._propertiesToReflectAsAttributes||(n.self._propertiesToReflectAsAttributes=n.self.normalizePropertyTypeList(n.self.propertiesToReflectAsAttributes)),n.generateAliasIndex(),n.root=u()(n),n.defineGetterAndSetterInterface(),n}f()(t,e);var n=t.prototype;return n.attributeChangedCallback=function(e,t,r){this.ignoreAttributeUpdateObservations||t===r||this.updateAttribute(e,r)},n.updateAttribute=function(e,t){var r=this;this.evaluateStringOrNullAndSetAsProperty(e,t),this.batchAttributeUpdates?this.batchedAttributeUpdateRunning||this.batchedUpdateRunning||(this.batchedAttributeUpdateRunning=!0,this.batchedUpdateRunning=!0,A().timeout((function(){r.batchedAttributeUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("attributeChanged")}))):this.render("attributeChanged")},n.connectedCallback=function(){var e=this;try{this.isConnected=!0}catch(e){}this.parent=this,this.rootInstance=this,this.attachEventHandler(),this.self.determineRootBinding&&this.determineRootBinding(),this.self.applyRootBinding&&this.isRoot&&(this.determineRenderScope(),this.applyBinding(this,this.scope)),this.batchedAttributeUpdateRunning=!1,this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.grabGivenSlots(),this.reflectExternalProperties(this.externalProperties),this.runDomConnectionAndRenderingInSameEventQueue?this.render("connected"):A().timeout((function(){return e.render("connected")}))},n.disconnectedCallback=function(){try{this.isConnected=!1}catch(e){}for(var e,t=w(this.domNodeEventBindings.values());!(e=t()).done;)for(var r,n=w(e.value.values());!(r=n()).done;){(0,r.value)()}this.slots={}},n.defineGetterAndSetterInterface=function(){for(var e,t=this,r=function(){var r=e.value;Object.prototype.hasOwnProperty.call(t,r)&&t.setPropertyValue(r,t[r]),Object.defineProperty(t,r,{configurable:!0,get:function(){return t.getPropertyValue(r)},set:function(e){t.setPropertyValue(r,e),t.triggerPropertySpecificRendering(r,e)}})},n=w(A().arrayUnique(Object.keys(this.self.propertyTypes).concat(Object.keys(this.self._propertyAliasIndex))));!(e=n()).done;)r()},n.getPropertyAlias=function(e){return Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,e)?this.self._propertyAliasIndex[e]:null},n.getPropertyValue=function(e){var r,n,i,s,o=null!=(r=this.instance)&&null!=(n=r.current)&&n.properties&&(Object.prototype.hasOwnProperty.call(!t.propertyTypes,e)||Object.prototype.hasOwnProperty.call(this.instance.current.properties,e))?this.instance.current.properties[e]:this.externalProperties[e];return null!=(i=this.instance)&&null!=(s=i.current)&&s.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,e)?this.instance.current.state[e]:o},n.setExternalPropertyValue=function(e,t){this.externalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.externalProperties[r]=t)},n.setInternalPropertyValue=function(e,t){this.internalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.internalProperties[r]=t)},n.setPropertyValue=function(e,t){var r;this.reflectProperties(((r={})[e]=t,r)),this.setInternalPropertyValue(e,t)},n.triggerPropertySpecificRendering=function(e,t){var r=this;if(this.batchPropertyUpdates)this.batchedPropertyUpdateRunning||this.batchedUpdateRunning||(this.batchedPropertyUpdateRunning=!0,this.batchedUpdateRunning=!0,A().timeout((function(){void 0!==t&&r.isStateProperty(e)?(r.render("preStatePropertyChanged"),A().timeout((function(){r.setInternalPropertyValue(e,void 0),r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("postStatePropertyChanged"),r.triggerOuputEvents()})).then(A().noop,A().noop)):(r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("propertyChanged"),r.triggerOuputEvents())})));else{var n=this.isStateProperty(e);this.render(n?"preStatePropertyChanged":"propertyChanged"),void 0!==t&&n&&(this.setInternalPropertyValue(e,void 0),this.render("postStatePropertyChanged")),this.triggerOuputEvents()}},n.applyBinding=function(e,t){var r=this;if(e.getAttributeNames)for(var n,i=function(){var i=n.value,s="";if(i.startsWith("data-bind-")?s=i.substring("data-bind-".length):i.startsWith("bind-")&&(s=i.substring("bind-".length)),s){var a=e.getAttribute(i);if(null===a)return"continue";if(s.startsWith("attribute-")||s.startsWith("property-")){var l=A().stringEvaluate(a,t,!1,e);if(l.error)return console.warn('Error occurred during processing given attribute binding "'+i+'" on node:',e,l.error),"continue";s.startsWith("attribute-")?e.setAttribute(s.substring("attribute-".length),l.result):e[A().stringDelimitedToCamelCase(s.substring("property-".length))]=l.result}else if(s.startsWith("on-")){r.domNodeEventBindings.has(e)||r.domNodeEventBindings.set(e,new Map);var p=r.domNodeEventBindings.get(e);s=A().stringDelimitedToCamelCase(s.substring("on-".length)),p.has(s)&&p.get(s)(),t=o()({event:void 0,parameters:void 0},t);var u=A().stringCompile(a,t,!0);if(u.error)console.warn('Error occurred during compiling given event binding "'+i+'" on node:',e,u.error);else{var c=u.templateFunction.bind(e),h=function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];t.event=n[0],t.parameters=n;try{c.apply(void 0,u.originalScopeNames.map((function(e){return t[e]})))}catch(t){console.warn('Error occurred during processing given event binding "'+i+'" on node:',e,'Given expression "'+a+'" could not be evaluated with given scope names "'+u.scopeNames.join('", "')+'": '+A().represent(t))}};e.addEventListener(s,h),p.set(s,(function(){e.removeEventListener(s,h),p.delete(s),0===p.size&&r.domNodeEventBindings.delete(e)}))}}}},s=w(e.getAttributeNames());!(n=s()).done;)i()},n.applyBindings=function(e,t,r){for(void 0===r&&(r=!0);e;){var n;null==(n=e.attributes)||!n.length||!r&&e.getAttribute("slot")||this.applyBinding(e,t),e.nodeName.toLowerCase().includes("-")||this.applyBindings(e.firstChild,t),e=e.nextSibling}},n.compileDomNodeTemplate=function(e,t,r){var n;if(void 0===t&&(t=[]),void 0===r&&(r={}),(r=o()({ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe},r)).ignoreComponents&&null!=(n=e.nodeName)&&n.toLowerCase().includes("-"))return r.map;if(r.unsafe){var i=e.innerHTML;if(!i&&e.template&&(i=e.template),this.self.hasCode(i)){var s=A().stringCompile("`"+i+"`",t);r.map.set(e,{children:[],error:s.error,scopeNames:s.scopeNames,template:i,templateFunction:s.templateFunction})}}else{var a,l=e.nodeName.toLowerCase();if(["a","#text"].includes(l)){var p="a"===l?e.getAttribute("href"):e.textContent;this.self.hasCode(p)&&(a=p.replace(/ /g," ").trim())}var u=[];if(a){var c=A().stringCompile("`"+a+"`",t);r.map.set(e,{children:u,error:c.error,scopeNames:c.scopeNames,template:a,templateFunction:c.templateFunction})}for(var h=e.firstChild;h;)r.filter&&!r.filter(h)||u.push(this.compileDomNodeTemplate(h,t,o()({},r,{ignoreComponents:r.ignoreNestedComponents}))),h=h.nextSibling}return r.map},n.evaluateDomNodeTemplate=function(e,t,r){var n;if(void 0===t&&(t={}),void 0===r&&(r={}),(r=o()({applyBindings:!0,ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe},r)).map.has(e)||this.compileDomNodeTemplate(e,t,r),r.map.has(e)){var i=r.map.get(e),s=i.error,a=i.scopeNames,l=i.templateFunction;if(s)console.warn("Error occurred during compiling node content: "+s);else{var p=null;try{p=l.apply(void 0,a.map((function(e){return t[e]})))}catch(s){console.warn('Error occurred when "'+this.self._name+'" is running "'+l+'": with bound names "'+a.join('", "')+'": "'+s+'". Rendering node:',e)}null!==p&&(r.unsafe?e.innerHTML=p:"a"===e.nodeName.toLowerCase()?e.setAttribute("href",p):e.textContent=p)}}if(!(r.unsafe||r.ignoreComponents&&null!=(n=e.nodeName)&&n.toLowerCase().includes("-")))for(var u=e.firstChild;u;)r.filter&&!r.filter(u)||this.evaluateDomNodeTemplate(u,t,o()({},r,{applyBindings:!1,ignoreComponents:r.ignoreNestedComponents})),u=u.nextSibling;return r.applyBindings&&this.applyBindings(e,t),r.map},t.replaceDomNodes=function(e,r){for(var n,i=w([].concat(r).reverse());!(n=i()).done;){var s,o=n.value;t.trimSlots&&o.nodeType===Node.TEXT_NODE&&""===(null==(s=o.nodeValue)?void 0:s.trim())||e.after(o)}e.remove()},t.unwrapDomNode=function(e){for(var t=e.parentNode,r=[];e.firstChild;)r.push(e.firstChild),t.insertBefore(e.firstChild,e);return t.removeChild(e),r},n.determineRootBinding=function(){for(var e=this.parentNode;e;){var r;(e instanceof t||null!=(r=e.nodeName)&&r.includes("-")||null===e.parentNode&&"[object ShadowRoot]"===e.toString())&&(this.rootInstance===this?(this.parent=e,this.rootInstance=e,this.setPropertyValue("isRoot",!1)):this.rootInstance=e),e=e.parentNode}},t.hasCode=function(e){return"string"==typeof e&&e.includes("${")&&e.includes("}")&&/\${[\s\S]+}/.test(e)},t.normalizePropertyTypeList=function(e){if("string"==typeof e&&(e=[e]),Array.isArray(e)){var r=e;e=new Map;for(var n,i=w(r);!(n=i()).done;){var s=n.value;Object.prototype.hasOwnProperty.call(t.propertyTypes,s)&&e.set(s,t.propertyTypes[s])}}else e=A().convertPlainObjectToMap(e);return e},n.attachEventHandler=function(){if(null!==this.self.eventToPropertyMapping){var e=this.attachExplicitDefinedOutputEventHandler();this.attachImplicitDefinedOutputEventHandler(!e)}},n.attachExplicitDefinedOutputEventHandler=function(){for(var e=this,t=!1,r=function(){var r=i[n];Object.prototype.hasOwnProperty.call(e.internalProperties,r)||(t=!0,e.outputEventNames.add(r),e.setInternalPropertyValue(r,(function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var s=e.reflectEventToProperties(r,n);s&&(n[0]=s),e.forwardEvent(r,n)})))},n=0,i=Object.keys(this.self.eventToPropertyMapping);n<i.length;n++)r();return t},n.attachImplicitDefinedOutputEventHandler=function(e){var t=this;void 0===e&&(e=!0);for(var r=function(){var r=i[n],s=r[0],o=r[1];Object.prototype.hasOwnProperty.call(t.internalProperties,s)||![P.func,"function"].includes(o)||t.self.renderProperties.includes(s)||(t.outputEventNames.add(s),t.setInternalPropertyValue(s,(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e&&t.reflectEventToProperties(s,n),t.forwardEvent(s,n)})))},n=0,i=Object.keys(this.self.propertyTypes);n<i.length;n++)r()},n.triggerOuputEvents=function(){for(var e,t=w(this.outputEventNames);!(e=t()).done;){var r=e.value;this.forwardEvent(r,[this.externalProperties])}},n.forwardEvent=function(e,t){return e.length>"onX".length&&e.startsWith("on")&&(e=A().stringLowerCase(e.substring(2))),this.dispatchEvent(new CustomEvent(e,{detail:{parameters:t}}))},n.applySlots=function(e,t){for(var r=this,n=0,i=Array.from(e.querySelectorAll("slot"));n<i.length;n++){var s=i[n],o=s.getAttribute("name");if(null===o||"default"===o)if(this.slots.default){if(this.self.renderSlots){if(this.self.evaluateSlots)for(var a,l=w(this.slots.default);!(a=l()).done;){var p=a.value;this.evaluateDomNodeTemplate(p,t)}this.self.replaceDomNodes(s,this.slots.default)}}else this.slots.default=this.self.unwrapDomNode(s).map((function(e){return r.grabSlotContent(e)}));else Object.prototype.hasOwnProperty.call(this.slots,o)?this.self.renderSlots&&(this.self.evaluateSlots&&this.evaluateDomNodeTemplate(this.slots[o],t),this.self.replaceDomNodes(s,this.slots[o])):this.slots[o]=this.grabSlotContent(this.self.unwrapDomNode(s).filter((function(e){return"#text"!==e.nodeName.toLowerCase()}))[0])}},n.grabSlotContent=function(e){var t;if("textarea"===(null==(t=e.firstElementChild)?void 0:t.nodeName.toLowerCase())&&(!e.firstElementChild.hasAttribute("data-no-template")||"false"===e.firstElementChild.getAttribute("data-no-template"))){var r,n,i=e.firstElementChild.value;null==(r=e.classList)||r.remove("web-component-template");var s=e.cloneNode();return null==(n=e.classList)||n.add("web-component-template"),s.innerHTML="",s.template=i,s}return this.self.cloneSlots?e.cloneNode(!0):e},n.grabGivenSlots=function(){var e=this;this.slots={};for(var t=0,r=Array.from(this.querySelectorAll("[slot]"));t<r.length;t++){for(var n=r[t],i=n.parentNode,s=!0;i;){if(i.nodeName.includes("-")){i===this&&(s=!1);break}i=i.parentNode}s||(this.slots[n.getAttribute&&n.getAttribute("slot")&&n.getAttribute("slot").trim()?n.getAttribute("slot").trim():n.nodeName.toLowerCase()]=this.grabSlotContent(n))}this.slots.default?this.slots.default=[this.slots.default]:this.childNodes.length>0?this.slots.default=Array.from(this.childNodes).map((function(t){return e.grabSlotContent(t)})):this.slots.default=[]},n.isStateProperty=function(e){var t,r,n,i;return Boolean((null==(t=this.instance)||null==(r=t.current)?void 0:r.state)&&(Object.prototype.hasOwnProperty.call(null==(n=this.instance)||null==(i=n.current)?void 0:i.state,e)||this.instance.current.state.modelState&&Object.prototype.hasOwnProperty.call(this.instance.current.state.modelState,e)))},n.generateAliasIndex=function(){if(!this.self._propertyAliasIndex){this.self._propertyAliasIndex=o()({},this.self.propertyAliases);for(var e=0,t=Object.entries(this.self._propertyAliasIndex);e<t.length;e++){var r=t[e],n=r[0],i=r[1];Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,i)||(this.self._propertyAliasIndex[i]=n)}}},n.reflectExternalProperties=function(e){this.ignoreAttributeUpdateObservations=!0;for(var t=0,r=Object.entries(e);t<r.length;t++){var n=r[t],i=n[0],s=n[1];if(this.setExternalPropertyValue(i,s),this.isConnected){var o=A().stringCamelCaseToDelimited(i);if(this.self._propertiesToReflectAsAttributes.has(i))switch(this.self._propertiesToReflectAsAttributes.get(i)){case P.boolean:case"boolean":s?""!==this.getAttribute(o)&&this.setAttribute(o,""):this.hasAttribute(o)&&this.removeAttribute(o);break;case P.func:case"function":break;case"json":if(s){var a=JSON.stringify(s);if(a&&this.getAttribute(o)!==a){this.setAttribute(o,a);break}}this.hasAttribute(o)&&this.removeAttribute(o);break;case P.number:case"number":if("number"!=typeof s||isNaN(s))this.hasAttribute(o)&&this.removeAttribute(o);else{var l=""+s;this.getAttribute(o)!==l&&this.setAttribute(o,l)}break;case P.string:case"string":s?this.getAttribute(o)!==s&&this.setAttribute(o,s):this.hasAttribute(o)&&this.removeAttribute(o);break;case P.any:case P.array:case P.arrayOf:case P.element:case P.elementType:case P.instanceOf:case P.node:case P.object:case"object":case P.objectOf:case P.shape:case P.exact:case P.symbol:default:if(s){var p=A().represent(s);if(p&&this.getAttribute(o)!==p){this.setAttribute(o,p);break}}this.hasAttribute(o)&&this.removeAttribute(o)}}}this.ignoreAttributeUpdateObservations=!1},n.reflectProperties=function(e){var t,r,n,i;if(this.reflectExternalProperties(e),null!=(t=this.instance)&&null!=(r=t.current)&&r.state&&"object"==typeof this.instance.current.state)for(var s,o=w(Object.keys(this.instance.current.state).concat(this.instance.current.state.modelState?Object.keys(this.instance.current.state.modelState):[]));!(s=o()).done;){var a=s.value;Object.prototype.hasOwnProperty.call(this.internalProperties,a)&&this.setInternalPropertyValue(a,void 0)}null!=(n=this.internalProperties.model)&&n.state&&(null==(i=this.internalProperties.model)||delete i.state,this.setInternalPropertyValue("model",this.internalProperties.model));for(var l,p=w(this.self.controllableProperties);!(l=p()).done;){var u=l.value;Object.prototype.hasOwnProperty.call(e,u)&&this.setInternalPropertyValue(u,e[u])}},n.triggerRender=function(e){var t=this;this.batchUpdates?this.batchedUpdateRunning||(this.batchedUpdateRunning=!0,A().timeout((function(){t.batchedUpdateRunning=!1,t.render(e)}))):this.render(e)},n.reflectEventToProperties=function(e,t){var r=this.batchUpdates;this.batchUpdates=!1;var n=null;if(this.self.eventToPropertyMapping&&Object.prototype.hasOwnProperty.call(this.self.eventToPropertyMapping,e)&&A().isFunction(this.self.eventToPropertyMapping[e])){var i,s=(i=this.self.eventToPropertyMapping)[e].apply(i,t.concat([this]));Array.isArray(s)?(n=s[0],this.reflectProperties(n),A().extend(!0,this.internalProperties,s[1])):null!==s&&"object"==typeof s&&(n=s,this.reflectProperties(s))}else if(t.length>0&&null!==t[0]&&"object"==typeof t[0]){var a,l=t[0];if("persist"in t[0]&&A().isFunction(t[0].persist)){l={};for(var p=0,u=Object.keys(this.self.propertyTypes);p<u.length;p++)for(var c,h=u[p],d=w([h].concat(null!==(f=this.getPropertyAlias(h))&&void 0!==f?f:[]));!(c=d()).done;){var f,b=c.value,y=t[0].currentTarget&&Object.prototype.hasOwnProperty.call(t[0].currentTarget,b)?t[0].currentTarget[b]:this.getPropertyValue(b);y!==this.externalProperties[b]&&(l[b]=y)}}else[null,void 0].includes(null==(a=l.detail)?void 0:a.value)||(l=o()({},l.detail));n=l,this.reflectProperties(l)}return this.triggerRender("propertyReflected"),this.batchUpdates=r,n},n.evaluateStringOrNullAndSetAsProperty=function(e,t){var r=this,n=e.startsWith("-"),i=n?e.substring(1):e,s=A().stringDelimitedToCamelCase(i),o=this.getPropertyAlias(s);if(o&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,o)&&(s=o),Object.prototype.hasOwnProperty.call(this.self.propertyTypes,s)){var a=this.self.propertyTypes[s];if(n){if(t){var l=A().stringEvaluate(t,{Tools:A()},!1,this);l.error?(console.warn('Faild to process pre-evaluation attribute "'+e+'": '+l.error+'. Will be set to "undefined".'),this.setInternalPropertyValue(s,void 0)):(this.setInternalPropertyValue(s,l.result),this.setExternalPropertyValue(s,l.result))}}else switch(a){case P.boolean:case"boolean":var p=![null,"false"].includes(t);this.setInternalPropertyValue(s,p),this.setExternalPropertyValue(s,p);break;case P.func:case"function":var u,c=null,h=["data","event","firstArgument","firstParameter","options","scope","parameters","Tools"];if(t){var d=A().stringCompile(t,h);c=d.error,u=d.templateFunction,c&&console.warn('Failed to compile given handler "'+e+'": '+c+".")}this.setInternalPropertyValue(s,(function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];r.outputEventNames.has(s)&&r.reflectEventToProperties(s,i);var a=void 0;if(!c)try{a=u.call(r,i[0],i[0],i[0],i[0],i[0],i[0],i,A())}catch(r){console.warn('Failed to evaluate function "'+e+'" with expression "'+t+'" and scope variables "'+h.join('", "')+'" set to "'+A().represent(i)+'": '+r+'. Set property to "undedefined".')}return r.self.renderProperties.includes(s)||r.forwardEvent(s,i),a})),c||this.setExternalPropertyValue(s,u);break;case"json":if(t){var f;try{f=JSON.parse(t)}catch(c){console.warn('Error occurred during parsing given json attribute "'+e+'": '+A().represent(c));break}this.setInternalPropertyValue(s,f),this.setExternalPropertyValue(s,A().copy(f,1))}else this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null);break;case P.number:case"number":if(null===t){this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break}var b=parseFloat(t);isNaN(b)&&(b=void 0),this.setInternalPropertyValue(s,b),this.setExternalPropertyValue(s,b);break;case P.string:case"string":this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break;case P.any:case P.array:case P.arrayOf:case P.element:case P.elementType:case P.instanceOf:case P.node:case P.object:case"object":case P.objectOf:case P.oneOf:case P.oneOfType:case P.shape:case P.exact:case P.symbol:default:if(t){var y=A().stringEvaluate(t,{},!1,this);if(y.error){console.warn('Error occurred during processing given attribute configuration "'+e+'":'+y.error);break}this.setInternalPropertyValue(s,y.result),this.setExternalPropertyValue(s,A().copy(y.result,1))}else this.hasAttribute(e)?(this.setInternalPropertyValue(s,!0),this.setExternalPropertyValue(s,!0)):(this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null))}}},n.determineRenderScope=function(e){var t,r;void 0===e&&(e={}),this.scope=o()({},(null==(t=this.parent)?void 0:t.scope)||{},this.scope,this.internalProperties,((r={parent:this.parent,root:this.rootInstance,self:this})[A().stringLowerCase(this.self._name)||"instance"]=this,r),e),this.scope.scope=this.scope},n.applyShadowRootIfNotExisting=function(){this.self.shadowDOM&&this.root===this&&(this.root=(!("attachShadow"in this)&&"ShadyDOM"in window?window.ShadyDOM.wrap(this):this).attachShadow(null!==this.self.shadowDOM&&"object"==typeof this.self.shadowDOM?this.self.shadowDOM:{mode:"open"}))},n.render=function(e){if(void 0===e&&(e="unknown"),this.determineRenderScope(),this.dispatchEvent(new CustomEvent("render",{detail:{reason:e,scope:this.scope}}))){var t=A().stringEvaluate("`"+this.self.content+"`",this.scope);if(t.error)console.warn("Faild to process template: "+t.error);else{this.applyShadowRootIfNotExisting();var r=document.createElement("div");r.innerHTML=t.result,this.applySlots(r,o()({},this.scope,{parent:this})),this.root.innerHTML=r.innerHTML,this.applyBindings(this.root.firstChild,this.scope,this.self.renderSlots)}}},t}(y()(HTMLElement)),n.applyRootBinding=!0,n.content="<slot>Please provide a template to transclude.</slot>",n.determineRootBinding=!0,n.shadowDOM=null,n.observedAttributes=[],n.controllableProperties=[],n.eventToPropertyMapping={},n.propertyAliases={},n.propertyTypes={},n.propertiesToReflectAsAttributes=[],n.renderProperties=["children"],n.cloneSlots=!1,n.evaluateSlots=!1,n.renderSlots=!0,n.trimSlots=!0,n.renderUnsafe=!1,n._name="BaseWeb",n._propertyAliasIndex=void 0,n._propertiesToReflectAsAttributes=void 0,t=i,r=m()(t.prototype,"isRoot",[e],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),t),C={component:T,register:function(e){return void 0===e&&(e=A().stringCamelCaseToDelimited(T._name)),customElements.define(e,T)}};h.default=T}(),h}()}));
|