@everymatrix/casino-engagement-suite-luckywheel 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.esm.js +1 -1
  2. package/dist/casino-engagement-suite-luckywheel/index.esm.js +1 -1
  3. package/dist/casino-engagement-suite-luckywheel/p-2afd9927.entry.js +1 -0
  4. package/dist/casino-engagement-suite-luckywheel/p-5da7530f.js +1 -0
  5. package/dist/casino-engagement-suite-luckywheel/p-fc393d1b.js +2 -0
  6. package/dist/cjs/{casino-engagement-suite-luckywheel-cc8d37c2.js → casino-engagement-suite-luckywheel-46532b7a.js} +19 -30
  7. package/dist/cjs/casino-engagement-suite-luckywheel.cjs.entry.js +2 -2
  8. package/dist/cjs/casino-engagement-suite-luckywheel.cjs.js +2 -2
  9. package/dist/cjs/{index-b46604f4.js → index-b8cc2368.js} +70 -173
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/collection/collection-manifest.json +1 -1
  13. package/dist/collection/components/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.js +19 -44
  14. package/dist/esm/{casino-engagement-suite-luckywheel-cf7e798a.js → casino-engagement-suite-luckywheel-b370bbfe.js} +19 -30
  15. package/dist/esm/casino-engagement-suite-luckywheel.entry.js +2 -2
  16. package/dist/esm/casino-engagement-suite-luckywheel.js +3 -3
  17. package/dist/esm/{index-8ce51859.js → index-0b3806b2.js} +70 -173
  18. package/dist/esm/index.js +2 -2
  19. package/dist/esm/loader.js +2 -2
  20. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.d.ts +2 -0
  21. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.dev.d.ts +2 -0
  22. package/package.json +1 -1
  23. package/dist/casino-engagement-suite-luckywheel/p-2a6e103b.entry.js +0 -1
  24. package/dist/casino-engagement-suite-luckywheel/p-781c5f2a.js +0 -1
  25. package/dist/casino-engagement-suite-luckywheel/p-eaad80fd.js +0 -2
  26. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.d.ts +0 -2
  27. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.dev.d.ts +0 -2
  28. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/storybook/main.d.ts +0 -0
  29. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/storybook/preview.d.ts +0 -0
  30. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/index.d.ts +0 -0
  31. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  32. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  33. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, g as getElement } from './index-8ce51859.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-0b3806b2.js';
2
2
 
3
3
  /******************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -556,35 +556,6 @@ const CasinoEngagementSuiteLuckywheelStyle0 = casinoEngagementSuiteLuckywheelCss
556
556
  const CasinoEngagementSuiteLuckywheel = class {
557
557
  constructor(hostRef) {
558
558
  registerInstance(this, hostRef);
559
- /**
560
- * Client custom styling via string
561
- */
562
- this.clientStyling = '';
563
- /**
564
- * Client custom styling via url
565
- */
566
- this.clientStylingUrl = '';
567
- /**
568
- * Language of the widget
569
- */
570
- this.language = 'en';
571
- /**
572
- * User's device type
573
- */
574
- this.device = 'Mobile';
575
- /**
576
- * Wheel size
577
- */
578
- this.size = '440';
579
- /**
580
- * Content Direction
581
- */
582
- this.contentdirection = 'anticlockwise';
583
- this.limitStylingAppends = false;
584
- this.isPartitionsCustomableReady = false;
585
- this.isSpinning = false;
586
- this.radius = 0.85 * Number(this.size) / 2;
587
- this.speed = 0;
588
559
  this.setClientStyling = () => {
589
560
  let sheet = document.createElement('style');
590
561
  sheet.innerHTML = this.clientStyling;
@@ -651,6 +622,24 @@ const CasinoEngagementSuiteLuckywheel = class {
651
622
  }
652
623
  this.eventSpin();
653
624
  };
625
+ this.clientStyling = '';
626
+ this.clientStylingUrl = '';
627
+ this.language = 'en';
628
+ this.device = 'Mobile';
629
+ this.luckywheel = undefined;
630
+ this.size = '440';
631
+ this.contentdirection = 'anticlockwise';
632
+ this.limitStylingAppends = false;
633
+ this.isPartitionsCustomableReady = false;
634
+ this.isSpinning = false;
635
+ this.options = undefined;
636
+ this.radius = 0.85 * Number(this.size) / 2;
637
+ this.speed = 0;
638
+ this.settings = undefined;
639
+ this.svg = undefined;
640
+ this.spinContainer = undefined;
641
+ this.spinable = undefined;
642
+ this.spinner = undefined;
654
643
  }
655
644
  handleEvent(e) {
656
645
  const _a = e === null || e === void 0 ? void 0 : e.data, { type } = _a, rest = __rest(_a, ["type"]);
@@ -1,2 +1,2 @@
1
- export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-cf7e798a.js';
2
- import './index-8ce51859.js';
1
+ export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-b370bbfe.js';
2
+ import './index-0b3806b2.js';
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-8ce51859.js';
2
- export { s as setNonce } from './index-8ce51859.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-0b3806b2.js';
2
+ export { s as setNonce } from './index-0b3806b2.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.26.0 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  var patchBrowser = () => {
9
9
  const importMeta = import.meta.url;
@@ -1,25 +1,17 @@
1
1
  const NAMESPACE = 'casino-engagement-suite-luckywheel';
2
- const BUILD = /* casino-engagement-suite-luckywheel */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: false };
2
+ const BUILD = /* casino-engagement-suite-luckywheel */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: false };
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.26.0 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.22.3 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
9
9
  for (var name in all)
10
10
  __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
-
13
- // src/utils/constants.ts
14
- var SVG_NS = "http://www.w3.org/2000/svg";
15
- var HTML_NS = "http://www.w3.org/1999/xhtml";
16
-
17
- // src/client/client-host-ref.ts
18
12
  var hostRefs = /* @__PURE__ */ new WeakMap();
19
13
  var getHostRef = (ref) => hostRefs.get(ref);
20
- var registerInstance = (lazyInstance, hostRef) => {
21
- hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
22
- };
14
+ var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
23
15
  var registerHost = (hostElement, cmpMeta) => {
24
16
  const hostRef = {
25
17
  $flags$: 0,
@@ -32,8 +24,7 @@ var registerHost = (hostElement, cmpMeta) => {
32
24
  hostElement["s-p"] = [];
33
25
  hostElement["s-rc"] = [];
34
26
  }
35
- const ref = hostRefs.set(hostElement, hostRef);
36
- return ref;
27
+ return hostRefs.set(hostElement, hostRef);
37
28
  };
38
29
  var isMemberInElement = (elm, memberName) => memberName in elm;
39
30
  var consoleError = (e, el) => (0, console.error)(e, el);
@@ -70,22 +61,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
70
61
  /* webpackExclude: /\.system\.entry\.js$/ */
71
62
  /* webpackMode: "lazy" */
72
63
  `./${bundleId}.entry.js${""}`
73
- ).then(
74
- (importedModule) => {
75
- {
76
- cmpModules.set(bundleId, importedModule);
77
- }
78
- return importedModule[exportName];
79
- },
80
- (e) => {
81
- consoleError(e, hostRef.$hostElement$);
64
+ ).then((importedModule) => {
65
+ {
66
+ cmpModules.set(bundleId, importedModule);
82
67
  }
83
- );
68
+ return importedModule[exportName];
69
+ }, consoleError);
84
70
  };
85
71
 
86
72
  // src/client/client-style.ts
87
73
  var styles = /* @__PURE__ */ new Map();
88
- var HYDRATED_STYLE_ID = "sty-id";
89
74
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
90
75
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
91
76
  var XLINK_NS = "http://www.w3.org/1999/xlink";
@@ -160,6 +145,14 @@ var flush = () => {
160
145
  };
161
146
  var nextTick = (cb) => promiseResolve().then(cb);
162
147
  var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
148
+
149
+ // src/utils/constants.ts
150
+ var EMPTY_OBJ = {};
151
+ var SVG_NS = "http://www.w3.org/2000/svg";
152
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
153
+
154
+ // src/utils/helpers.ts
155
+ var isDef = (v) => v != null;
163
156
  var isComplexType = (o) => {
164
157
  o = typeof o;
165
158
  return o === "object" || o === "function";
@@ -342,7 +335,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
342
335
  }
343
336
  if (!appliedStyles.has(scopeId2)) {
344
337
  {
345
- styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
338
+ styleElm = doc.createElement("style");
346
339
  styleElm.innerHTML = style;
347
340
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
348
341
  if (nonce != null) {
@@ -352,10 +345,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
352
345
  if (styleContainerNode.nodeName === "HEAD") {
353
346
  const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
354
347
  const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
355
- styleContainerNode.insertBefore(
356
- styleElm,
357
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
358
- );
348
+ styleContainerNode.insertBefore(styleElm, referenceNode2);
359
349
  } else if ("host" in styleContainerNode) {
360
350
  if (supportsConstructableStylesheets) {
361
351
  const stylesheet = new CSSStyleSheet();
@@ -373,7 +363,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
373
363
  styleContainerNode.append(styleElm);
374
364
  }
375
365
  }
376
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
366
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
377
367
  styleContainerNode.insertBefore(styleElm, null);
378
368
  }
379
369
  }
@@ -398,25 +388,23 @@ var attachStyles = (hostRef) => {
398
388
  const scopeId2 = addStyle(
399
389
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
400
390
  cmpMeta);
401
- if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
391
+ if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
402
392
  elm["s-sc"] = scopeId2;
403
393
  elm.classList.add(scopeId2 + "-h");
404
394
  }
405
395
  endAttachStyles();
406
396
  };
407
397
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
408
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
398
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
409
399
  if (oldValue !== newValue) {
410
400
  let isProp = isMemberInElement(elm, memberName);
411
401
  let ln = memberName.toLowerCase();
412
402
  if (memberName === "class") {
413
403
  const classList = elm.classList;
414
404
  const oldClasses = parseClassList(oldValue);
415
- let newClasses = parseClassList(newValue);
416
- {
417
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
418
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
419
- }
405
+ const newClasses = parseClassList(newValue);
406
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
407
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
420
408
  } else if (memberName === "style") {
421
409
  {
422
410
  for (const prop in oldValue) {
@@ -475,7 +463,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
475
463
  elm.setAttribute(memberName, n);
476
464
  }
477
465
  }
478
- } else if (elm[memberName] !== newValue) {
466
+ } else {
479
467
  elm[memberName] = newValue;
480
468
  }
481
469
  } catch (e) {
@@ -508,44 +496,24 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
508
496
  }
509
497
  };
510
498
  var parseClassListRegex = /\s/;
511
- var parseClassList = (value) => {
512
- if (typeof value === "object" && value && "baseVal" in value) {
513
- value = value.baseVal;
514
- }
515
- if (!value || typeof value !== "string") {
516
- return [];
517
- }
518
- return value.split(parseClassListRegex);
519
- };
499
+ var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
520
500
  var CAPTURE_EVENT_SUFFIX = "Capture";
521
501
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
522
502
 
523
503
  // src/runtime/vdom/update-element.ts
524
- var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
504
+ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
525
505
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
526
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
527
- const newVnodeAttrs = newVnode.$attrs$ || {};
506
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
507
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
528
508
  {
529
509
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
530
510
  if (!(memberName in newVnodeAttrs)) {
531
- setAccessor(
532
- elm,
533
- memberName,
534
- oldVnodeAttrs[memberName],
535
- void 0,
536
- isSvgMode2,
537
- newVnode.$flags$);
511
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
538
512
  }
539
513
  }
540
514
  }
541
515
  for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
542
- setAccessor(
543
- elm,
544
- memberName,
545
- oldVnodeAttrs[memberName],
546
- newVnodeAttrs[memberName],
547
- isSvgMode2,
548
- newVnode.$flags$);
516
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
549
517
  }
550
518
  };
551
519
  function sortedAttrNames(attrNames) {
@@ -557,10 +525,13 @@ function sortedAttrNames(attrNames) {
557
525
  attrNames
558
526
  );
559
527
  }
528
+
529
+ // src/runtime/vdom/vdom-render.ts
530
+ var scopeId;
560
531
  var hostTagName;
561
532
  var useNativeShadowDom = false;
562
533
  var isSvgMode = false;
563
- var createElm = (oldParentVNode, newParentVNode, childIndex) => {
534
+ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
564
535
  const newVNode2 = newParentVNode.$children$[childIndex];
565
536
  let i2 = 0;
566
537
  let elm;
@@ -581,6 +552,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
581
552
  {
582
553
  updateElement(null, newVNode2, isSvgMode);
583
554
  }
555
+ const rootNode = elm.getRootNode();
556
+ const isElementWithinShadowRoot = !rootNode.querySelector("body");
557
+ if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
558
+ elm.classList.add(elm["s-si"] = scopeId);
559
+ }
584
560
  if (newVNode2.$children$) {
585
561
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
586
562
  childNode = createElm(oldParentVNode, newVNode2, i2);
@@ -717,9 +693,6 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
717
693
  if (!isInitialRender) {
718
694
  return leftVNode.$key$ === rightVNode.$key$;
719
695
  }
720
- if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
721
- leftVNode.$key$ = rightVNode.$key$;
722
- }
723
696
  return true;
724
697
  }
725
698
  return false;
@@ -766,9 +739,8 @@ var nullifyVNodeRefs = (vNode) => {
766
739
  }
767
740
  };
768
741
  var insertBefore = (parent, newNode, reference) => {
769
- {
770
- return parent == null ? void 0 : parent.insertBefore(newNode, reference);
771
- }
742
+ const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
743
+ return inserted;
772
744
  };
773
745
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
774
746
  const hostElm = hostRef.$hostElement$;
@@ -793,21 +765,17 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
793
765
  rootVnode.$flags$ |= 4 /* isHost */;
794
766
  hostRef.$vnode$ = rootVnode;
795
767
  rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
796
- useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
768
+ {
769
+ scopeId = hostElm["s-sc"];
770
+ }
771
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
797
772
  patch(oldVNode, rootVnode, isInitialLoad);
798
773
  };
799
774
 
800
775
  // src/runtime/update-component.ts
801
776
  var attachToAncestor = (hostRef, ancestorComponent) => {
802
777
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
803
- const index = ancestorComponent["s-p"].push(
804
- new Promise(
805
- (r) => hostRef.$onRenderResolve$ = () => {
806
- ancestorComponent["s-p"].splice(index - 1, 1);
807
- r();
808
- }
809
- )
810
- );
778
+ ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
811
779
  }
812
780
  };
813
781
  var scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -836,12 +804,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
836
804
  {
837
805
  hostRef.$flags$ |= 256 /* isListenReady */;
838
806
  if (hostRef.$queuedListeners$) {
839
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
807
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
840
808
  hostRef.$queuedListeners$ = void 0;
841
809
  }
842
810
  }
843
811
  {
844
- maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
812
+ maybePromise = safeCall(instance, "componentWillLoad");
845
813
  }
846
814
  }
847
815
  endSchedule();
@@ -910,7 +878,7 @@ var postUpdateComponent = (hostRef) => {
910
878
  const instance = hostRef.$lazyInstance$ ;
911
879
  const ancestorComponent = hostRef.$ancestorComponent$;
912
880
  {
913
- safeCall(instance, "componentDidRender", void 0, elm);
881
+ safeCall(instance, "componentDidRender");
914
882
  }
915
883
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
916
884
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
@@ -939,14 +907,17 @@ var postUpdateComponent = (hostRef) => {
939
907
  }
940
908
  };
941
909
  var appDidLoad = (who) => {
910
+ {
911
+ addHydratedFlag(doc.documentElement);
912
+ }
942
913
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
943
914
  };
944
- var safeCall = (instance, method, arg, elm) => {
915
+ var safeCall = (instance, method, arg) => {
945
916
  if (instance && instance[method]) {
946
917
  try {
947
918
  return instance[method](arg);
948
919
  } catch (e) {
949
- consoleError(e, elm);
920
+ consoleError(e);
950
921
  }
951
922
  }
952
923
  return void 0;
@@ -989,68 +960,15 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
989
960
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
990
961
  members.map(([memberName, [memberFlags]]) => {
991
962
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
992
- const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
993
- if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
994
- if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
995
- if (flags & 1 /* isElementConstructor */ || !origGetter) {
996
- Object.defineProperty(prototype, memberName, {
997
- get() {
998
- {
999
- if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
1000
- return getValue(this, memberName);
1001
- }
1002
- const ref = getHostRef(this);
1003
- const instance = ref ? ref.$lazyInstance$ : prototype;
1004
- if (!instance) return;
1005
- return instance[memberName];
1006
- }
1007
- },
1008
- configurable: true,
1009
- enumerable: true
1010
- });
1011
- }
1012
963
  Object.defineProperty(prototype, memberName, {
964
+ get() {
965
+ return getValue(this, memberName);
966
+ },
1013
967
  set(newValue) {
1014
- const ref = getHostRef(this);
1015
- if (origSetter) {
1016
- const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1017
- if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
1018
- newValue = ref.$instanceValues$.get(memberName);
1019
- } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
1020
- ref.$instanceValues$.set(memberName, currentValue);
1021
- }
1022
- origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
1023
- newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1024
- setValue(this, memberName, newValue, cmpMeta);
1025
- return;
1026
- }
1027
- {
1028
- if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1029
- setValue(this, memberName, newValue, cmpMeta);
1030
- if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1031
- ref.$onReadyPromise$.then(() => {
1032
- if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1033
- ref.$lazyInstance$[memberName] = newValue;
1034
- }
1035
- });
1036
- }
1037
- return;
1038
- }
1039
- const setterSetVal = () => {
1040
- const currentValue = ref.$lazyInstance$[memberName];
1041
- if (!ref.$instanceValues$.get(memberName) && currentValue) {
1042
- ref.$instanceValues$.set(memberName, currentValue);
1043
- }
1044
- ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
1045
- setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1046
- };
1047
- if (ref.$lazyInstance$) {
1048
- setterSetVal();
1049
- } else {
1050
- ref.$onReadyPromise$.then(() => setterSetVal());
1051
- }
1052
- }
1053
- }
968
+ setValue(this, memberName, newValue, cmpMeta);
969
+ },
970
+ configurable: true,
971
+ enumerable: true
1054
972
  });
1055
973
  }
1056
974
  });
@@ -1060,7 +978,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1060
978
  plt.jmp(() => {
1061
979
  var _a2;
1062
980
  const propName = attrNameToPropName.get(attrName);
1063
- if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
981
+ if (this.hasOwnProperty(propName)) {
1064
982
  newValue = this[propName];
1065
983
  delete this[propName];
1066
984
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -1080,11 +998,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1080
998
  }
1081
999
  return;
1082
1000
  }
1083
- const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1084
- newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1085
- if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
1086
- this[propName] = newValue;
1087
- }
1001
+ this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1088
1002
  });
1089
1003
  };
1090
1004
  Cstr.observedAttributes = Array.from(
@@ -1113,7 +1027,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1113
1027
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1114
1028
  const bundleId = cmpMeta.$lazyBundleId$;
1115
1029
  if (bundleId) {
1116
- const CstrImport = loadModule(cmpMeta, hostRef);
1030
+ const CstrImport = loadModule(cmpMeta);
1117
1031
  if (CstrImport && "then" in CstrImport) {
1118
1032
  const endLoad = uniqueTime();
1119
1033
  Cstr = await CstrImport;
@@ -1135,7 +1049,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1135
1049
  try {
1136
1050
  new Cstr(hostRef);
1137
1051
  } catch (e) {
1138
- consoleError(e, elm);
1052
+ consoleError(e);
1139
1053
  }
1140
1054
  {
1141
1055
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
@@ -1167,7 +1081,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1167
1081
  schedule();
1168
1082
  }
1169
1083
  };
1170
- var fireConnectedCallback = (instance, elm) => {
1084
+ var fireConnectedCallback = (instance) => {
1171
1085
  };
1172
1086
 
1173
1087
  // src/runtime/connected-callback.ts
@@ -1208,7 +1122,7 @@ var connectedCallback = (elm) => {
1208
1122
  endConnected();
1209
1123
  }
1210
1124
  };
1211
- var disconnectInstance = (instance, elm) => {
1125
+ var disconnectInstance = (instance) => {
1212
1126
  };
1213
1127
  var disconnectedCallback = async (elm) => {
1214
1128
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
@@ -1223,12 +1137,6 @@ var disconnectedCallback = async (elm) => {
1223
1137
  hostRef.$onReadyPromise$.then(() => disconnectInstance());
1224
1138
  }
1225
1139
  }
1226
- if (rootAppliedStyles.has(elm)) {
1227
- rootAppliedStyles.delete(elm);
1228
- }
1229
- if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1230
- rootAppliedStyles.delete(elm.shadowRoot);
1231
- }
1232
1140
  };
1233
1141
 
1234
1142
  // src/runtime/bootstrap-lazy.ts
@@ -1309,17 +1217,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1309
1217
  }
1310
1218
  disconnectedCallback() {
1311
1219
  plt.jmp(() => disconnectedCallback(this));
1312
- plt.raf(() => {
1313
- var _a3;
1314
- const hostRef = getHostRef(this);
1315
- const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
1316
- if (i2 > -1) {
1317
- deferredConnectedCallbacks.splice(i2, 1);
1318
- }
1319
- if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1320
- delete hostRef.$vnode$.$elm$;
1321
- }
1322
- });
1323
1220
  }
1324
1221
  componentOnReady() {
1325
1222
  return getHostRef(this).$onReadyPromise$;
@@ -1383,7 +1280,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
1383
1280
  }
1384
1281
  }
1385
1282
  } catch (e) {
1386
- consoleError(e, hostRef.$hostElement$);
1283
+ consoleError(e);
1387
1284
  }
1388
1285
  };
1389
1286
  var getHostListenerTarget = (elm, flags) => {
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-cf7e798a.js';
2
- import './index-8ce51859.js';
1
+ export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-b370bbfe.js';
2
+ import './index-0b3806b2.js';
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-8ce51859.js';
2
- export { s as setNonce } from './index-8ce51859.js';
1
+ import { b as bootstrapLazy } from './index-0b3806b2.js';
2
+ export { s as setNonce } from './index-0b3806b2.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-engagement-suite-luckywheel",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- export{C as casino_engagement_suite_luckywheel}from"./p-781c5f2a.js";import"./p-eaad80fd.js";
@@ -1 +0,0 @@
1
- import{r as t,h as i,g as e}from"./p-eaad80fd.js";var s,r,n,a,o,h;"function"==typeof SuppressedError&&SuppressedError,function(t){t.Arrow="Arrow",t.Partition="Partition"}(s||(s={})),function(t){t.DownFromTop="DownFromTop",t.UpFromCenter="UpFromCenter",t.DownFromCenter="DownFromCenter",t.UpFromBottom="UpFromBottom"}(r||(r={})),function(t){t.en="en",t.fr="fr",t.de="de",t.tr="tr"}(n||(n={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(a||(a={})),function(t){t.launch="launch",t.loop="loop",t.halt="halt"}(o||(o={})),function(t){t.quad="quad",t.cubic="cubic",t.quart="quart",t.quint="quint",t.expo="expo",t.sine="sine",t.circ="circ"}(h||(h={}));const c=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),d=(t,i)=>{Object.keys(i).map((e=>{t.setAttribute(e.split(/(?=[A-Z])/).map((t=>t.toLocaleLowerCase())).join("-"),i[e])}))},l=t=>new Promise((i=>{let e=document.createElementNS("http://www.w3.org/2000/svg","image");e.onload=()=>i(e),e.onerror=()=>i(e),e.href.baseVal=t})),u=t=>({x:t,y:t}),g=(t,i)=>({x:t.x+i.x,y:t.y+i.y}),b={image:"",name:"Thank you",prizeText:"",prizeImage:""},f=async(t,i)=>{const{partitions:e}=t.program.wheelOfFortune;let s=((t,i)=>{const e=t.map((t=>{const e={};return Object.keys(t).map((s=>{"object"==typeof t[s]&&t[s].hasOwnProperty("*")&&(e["image1"===s?"image":s]=t[s][i]||t[s]["*"])})),e}));return(t=>{let i=0;return t.map((t=>{i+=Number(t.probability)})),i})(t)<1&&e.push(b),e})(e,i);return s=c()?s.map((t=>{if(t.image){const i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.href.baseVal=t.image,Object.assign(Object.assign({},t),{image:i})}return t})):await Promise.all(s.map((async t=>Object.assign(Object.assign({},t),await(async t=>t?{image:await l(t)}:{})(t.image))))),s},p={in:{quad:t=>Math.pow(t,2),cubic:t=>Math.pow(t,3),quart:t=>Math.pow(t,4),quint:t=>Math.pow(t,5),sine:t=>1-Math.cos(t*Math.PI/2),expo:t=>0===t?0:Math.pow(2,10*t-10),circ:t=>1-Math.sqrt(1-Math.pow(t,2))},out:{quad:t=>1-Math.pow(1-t,2),cubic:t=>1-Math.pow(1-t,3),quart:t=>1-Math.pow(1-t,4),quint:t=>1-Math.pow(1-t,5),sine:t=>Math.sin(t*Math.PI/2),expo:t=>1===t?1:1-Math.pow(2,-10*t),circ:t=>Math.sqrt(1-Math.pow(t-1,2))}},m={quad:2,cubic:3,quart:4,quint:5,sine:Math.PI/2,expo:Math.LN2,circ:1/0},y={in:{quad:t=>2*t,cubic:t=>3*t**2,quart:t=>4*t**3,quint:t=>5*t**4,sine:t=>Math.PI/2*Math.sin(Math.PI/2*t),expo:t=>10*Math.LN2*2**(10*t-10),circ:t=>-.5*(1-t**2)**-.5},out:{cubic:t=>3*t**2-6*t+3}},v=[{launchTurns:5,launchSpeed:.2,loopSpeed:15,haltTurns:2,haltSpeed:.16},{launchTurns:2,launchSpeed:.5,loopSpeed:20,haltTurns:2,haltSpeed:.22},{launchTurns:6,launchSpeed:1.38,loopSpeed:45,haltTurns:6,haltSpeed:.5}],x=t=>Object.keys(t).map((i=>t[i]));var w;!function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise"}(w||(w={}));class k{constructor({size:t,radius:i,options:e,themeIndex:s,contentdirection:n}){this.arrowmode=r.DownFromTop,this.convertDegToArc=t=>t*Math.PI/180,this.convertArcToDeg=t=>180*t/Math.PI%360,this.getArcDelta=t=>2*Math.PI/t,this.findDeg=(t,i)=>t*this.convertArcToDeg(this.getArcDelta(i)),this.angleTransform=t=>{switch(t){case r.DownFromTop:case r.UpFromCenter:return-Math.PI/2;case r.DownFromCenter:case r.UpFromBottom:return Math.PI/2}},this.contentdirection=n||"anticlockwise",this.center=t/2,this.ratio=t/375,this.options=e,this.length=e.length,this.themeIndex=s,this.radius=i}get sizeImage(){const t=t=>48*this.ratio*5/t;if(this.length<=3)return t(4);switch(this.length){case 8:case 7:return 24*this.ratio;case 6:return 36*this.ratio;case 5:return 48*this.ratio;case 4:return 56*this.ratio;default:return t(this.length)}}getSizeImageByPartition(t){return this.options[t].name?this.sizeImage/2:this.sizeImage}getSvgImageProps(t,i=1.25){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].name?this.radius-e/2-3*this.ratio:(this.radius-e/2)/Number(i)-3*this.ratio,Object.assign(Object.assign({},this.getPropsForPartitionInfo(t,this.getOffsetImage(e),s,a.outward)),{width:e,height:e})}getSvgTextProps(t){const i=this.getSizeImageByPartition(t);let e;return e=this.options[t].image?this.radius-i-6*this.ratio:this.radius-6*this.ratio,Object.assign({},this.getPropsForPartitionInfo(t,this.offsetText,e))}getSvgTextPropsAdjustedByImage(t){const i=this.getSvgTextProps(t),e=this.options[t].image?80:100,s={width:e,height:e};return Object.assign(Object.assign(Object.assign({},i),s),{x:"clockwise"===this.contentdirection?i.x:i.x-s.width,y:i.y-s.height/2})}get offsetText(){return{center:0,position:{x:0,y:0},transform:{x:0,y:0}}}getOffsetImage(t){return{center:0,position:{x:-1*t/2,y:-1*t/2},transform:{x:0,y:0}}}get direction(){return w.clockwise}getAngleSelf(t,i){return 360*t/this.length*this.direction+90*(void 0!==i?i:a[this.contentdirection])}getPartitionPositions(t,i,e){const s=this.angleTransform(this.arrowmode)+this.direction*t*2*Math.PI/this.length,r=((t,i,e)=>{const s=u(e);return{x:s.x+t*Math.cos(i),y:s.y+t*Math.sin(i)}})(i||this.radius-9*this.ratio,s,this.center+e.center);return{transformOrigin:g(r,e.transform),point:g(r,e.position)}}getPropsForPartitionInfo(t,i,e,s){const{point:r,transformOrigin:n}=this.getPartitionPositions(t,e,i);return Object.assign(Object.assign({},r),{style:{"font-size":13*this.ratio+"px",transform:`rotate(${this.getAngleSelf(t,s)}deg)`,"transform-origin":`${a=n,Object.keys(a).map((t=>`${a[t]}px`)).join(" ")}`}});var a}getPartitionDraw(t){const i=u(this.center),e=u(this.radius),{point:s,pointNext:r}=((t,i,e,s)=>{const r=t=>((t,i,e,s)=>{const r=Math.PI/180*(360/i*(t-.5)-90),n=u(s),a=u(e);return{x:n.x+a.x*Math.cos(r),y:n.y+a.y*Math.sin(r)}})(t,i,e,s);return{point:r(t),pointNext:r(t+1)}})(t,this.length,this.radius,this.center);return{d:["M",...x(i),"L",...x(s),"A",...x(e),"0 0 1",...x(r),"Z"].join(" ")}}getDeg(t){return this.findDeg(length-(t||this.length-1),length)}getSpinnerProps(){const t=u(this.center);return{"transform-origin":`${t.x} ${t.y}`}}}class P{constructor(t){this.deg=0,this.degTarget=void 0,this.step=void 0,this.easingType=h.cubic,this.param=v[2],this.halt=(t,i=(()=>{}))=>{this.shouldHalt=()=>{this.step=o.halt,this.cb=()=>{i(),this.setDeg(t,0)},this.degTarget=t+360*this.param.haltTurns,this.continueRepeat()}},this.continueRepeat=()=>setTimeout((()=>this.ticker()),30),this.ticker=()=>{const t=this.param.loopSpeed,i=t=>33*m[this.easingType]*t/this.param.loopSpeed,e=()=>{const t=360*this.param.launchTurns-this.deg,e=i(t);this.animateF(e,this.deg,t,p.in[this.easingType],y.in[this.easingType])},s=()=>{const t=i(this.degTarget);this.animateF(t,0,this.degTarget,p.out[this.easingType],y.out[this.easingType])},r=()=>{this.setDeg((this.deg+t)%360,m[this.easingType]),this.continueRepeat()};({[o.launch]:()=>{this.cb=()=>{this.step=o.loop,this.setDeg(t,m[this.easingType]),this.continueRepeat()},e()},[o.loop]:()=>{this.shouldHalt&&0===this.deg?this.shouldHalt():r()},[o.halt]:()=>{this.deg===360-t?s():r()}})[this.step]()},this.setDeg=(t,i)=>{this.deg=t,this.tick(t,i)},this.animateF=(t,i,e,s,r)=>{let n=null;const a=()=>{let o=(new Date).getTime();n||(n=o);const h=o-n,c=e*s(h/t)+i,d=Math.abs(r(h/t));this.setDeg(c,d),h<t?setTimeout((()=>a()),30):this.cb()};a()},this.animate=(t,i,e,s,r)=>{let n=null;window.cancelAnimationFrame(n);let a=null;const o=h=>{a||(a=h);const c=h-a,d=e*s(c/t)+i,l=Math.abs(r(c/t));this.setDeg(d,l),c<t?n=window.requestAnimationFrame(o):this.cb()};n=window.requestAnimationFrame(o)},this.tick=t.tick}launch(){this.shouldHalt=void 0,this.step=o.launch,this.ticker()}}const j=class{constructor(i){t(this,i),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.size="440",this.contentdirection="anticlockwise",this.limitStylingAppends=!1,this.isPartitionsCustomableReady=!1,this.isSpinning=!1,this.radius=.85*Number(this.size)/2,this.speed=0,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.host.prepend(i)}),1)})).catch((t=>{console.log("Error ",t)}))},this.renderImage=(t,i)=>{const e=this.options[i].image;d(e,this.settings.getSvgImageProps(i)),t.innerHTML=null,t.appendChild(e)},this.updateSpinable=()=>{if(this.luckywheel.current){if(Number(this.luckywheel.current.remainingTimes)>0)return void(this.spinable=!0);window.postMessage({type:"ShowNoSpinLeftModal"})}this.spinable=!1},this.eventSpin=()=>{this.updateSpinable(),this.spinable&&!this.isSpinning&&(this.isSpinning=!0,this.spinContainer=this.svg.querySelector("g.PartitionsContainer"),this.spinner.launch(),window.postMessage({type:"SpinLuckyWheel",lotteryProgramID:this.luckywheel.program.id}),setTimeout((()=>{window.postMessage({type:"SpinLuckyWheelRes",data:{item:{result:{wheelOfFortunePartitionIndex:1}},success:!1}})}),2500))},this.handleSpinClick=()=>{c()||this.eventSpin()}}handleEvent(t){const i=null==t?void 0:t.data,{type:e}=i,s=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)i.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(e[s[r]]=t[s[r]])}return e}(i,["type"]);"SpinLuckyWheelRes"===e&&this.spinner.halt(this.settings.getDeg(s.data.item.result.wheelOfFortunePartitionIndex),(()=>{this.isSpinning=!1,this.updateSpinable();const t=this.luckywheel.program.wheelOfFortune.partitions[s.data.item.result.wheelOfFortunePartitionIndex].prizeText;window.postMessage({type:"ShowLuckywheelRewardModal",data:{PrizeMessage:t.en||t["*"],HasError:s.data.success}})}))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}async componentWillLoad(){this.options=await f(this.luckywheel,n.en),this.settings=new k({size:this.size,radius:this.radius,options:this.options,themeIndex:1,contentdirection:this.contentdirection}),this.spinner=new P({tick:(t,i)=>{d(this.spinContainer,{style:[`transform: rotate(${t}deg)`,`height: ${this.size}px`,`width: ${this.size}px`].join(";")}),this.speed=.5*i}})}defineGeneralVariables(){return{"--length":`${this.options.length}`,"--radius":`${this.radius}`,"--ratio":""+Number(this.size)/480,"--size":`${this.size}`}}render(){const t={height:this.size,width:this.size},e={height:`${this.size}px`,width:`${this.size}px`};return i("div",{key:"8d964d9a81690d2a22240cb1355abb3c7cf6f665",class:`WheelContainer ${this.device}`,style:this.defineGeneralVariables()},i("svg",{key:"92f44f4659874e1fedaffa32813c57d1c9c04440",width:this.size,height:this.size,ref:t=>{this.svg=t}},i("foreignObject",Object.assign({key:"f042214f1516c688035f650a92ff1437c5d06a36"},t,{class:"Bottom Customable"}),i("div",{key:"6c80c40dfdb80159d75af8f70a75604257039c53",style:e})),i("g",Object.assign({key:"46c01589f440c19727c8364d5e1bdb3a90082cac",class:"PartitionsContainer"},this.settings.getSpinnerProps()),i("g",{key:"fd0e9a65b7ba25db742ff12bb26e389b8d72e4c7",class:"PartitionsBackgrounds"},this.options.map(((t,s)=>i("foreignObject",{"clip-path":`url(#clip${s})`,class:"PartitionBackground Customable",style:{"--index":s.toString()},width:this.size,height:this.size},i("div",{style:e}))))),i("g",{key:"8c116aa611b92b87b98f23aa344025953a27e90d",class:"PartitionsBackgroundStrokes"},this.options.map(((t,e)=>i("path",Object.assign({class:"PartitionBackgroundStroke"},this.settings.getPartitionDraw(e),{width:this.size,height:this.size}))))),i("g",{key:"8907e6529e660e6452328aaa684995719b528ec6",class:"Partitions",style:{filter:this.speed>.3?`blur(${this.speed}px)`:""}},this.options.map(((t,e)=>[t.image&&i("g",{class:`PartitionImage PartitionImage${e}`,ref:t=>this.renderImage(t,e)}),t.name&&i("foreignObject",Object.assign({class:"PartitionText"},this.settings.getSvgTextPropsAdjustedByImage(e)),i("div",{class:"PartitionTextEntityContainer"},i("p",{class:"PartitionTextEntity"+("clockwise"===this.settings.contentdirection?"":" Anticlockwise"),innerHTML:t.name})))])))),i("g",{key:"62cf4e41e77374dd8f8c1af0833a4143e5d45403",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable1:!0}},this.options.map(((s,r)=>i("foreignObject",Object.assign({class:"Partition1 Customable",style:{"--index":r.toString()}},t),i("div",{style:e}))))),i("g",{key:"6b0538da5d4f52e4b543205fb64dedda084f81b2",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable2:!0}},this.options.map(((s,r)=>i("foreignObject",Object.assign({class:"Partition2 Customable",style:{"--index":r.toString()}},t),i("div",{style:e}))))),i("foreignObject",Object.assign({key:"907db579094a7a192999510ade3150fdadbb94b6",class:"Middle Customable"},t),i("div",{key:"fa66cb96da2f285015fb8afeea5db05313ed832c",style:e})),i("foreignObject",Object.assign({key:"688c0d33ad480ea331847286335a88fd74dbbb26",class:"Top Customable"},t),i("div",{key:"292f6ea3549322a605fc8c3c61a93addcba00890",style:e})),i("g",{key:"22368be98007a7fa820cee96c666c363f85cd32a",class:{spinning:this.isSpinning,Center:!0},onClick:this.handleSpinClick},i("foreignObject",{key:"efffd7edb9ed21d5bd93896a4bead8931d91ff1f",x:Number(this.size)/2-50,y:Number(this.size)/2-50,width:100,height:100})),i("g",{key:"7d8b741cc21d6d07f5736336f147cef2bfdf90ca"},this.options.map(((t,e)=>i("clipPath",{id:`clip${e}`},i("path",Object.assign({},this.settings.getPartitionDraw(e)))))))))}get host(){return e(this)}};j.style=':host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.LotteryProgramWof{background:var(--emw--color-contrast, #07072A);display:flex;align-items:center;flex-direction:column;padding:20px 0}main{max-width:600px;width:100%;display:flex;justify-content:space-around;min-height:200px}svg{transition:opacity 0.3s}.WheelContainer{text-align:center}.FortuneContainer{width:100%;display:flex;align-items:center;flex-direction:column}.Center{cursor:pointer;transition:filter;transition-duration:1s}.Center.disabled{filter:grayscale(80%)}.Center .CenterCircle{fill:#3CE4BB;stroke:rgb(150, 54, 88);stroke-width:2px;cursor:pointer;transition:fill;transition-duration:1s}.Center .CenterText{fill:#FFFFFF}.PointerPartition{opacity:0.3;fill:lightgoldenrodyellow;stroke:red;stroke-width:6px;stroke-dasharray:12}.Current{color:#FFFFFF}.PartitionText{color:#FFFFFF;font-style:normal;font-weight:700;text-anchor:end;text-shadow:0px 3px #000;dominant-baseline:central}.PartitionsShadow{background-blend-mode:multiply;mix-blend-mode:multiply}.PartitionTextEntityContainer{height:100%;display:flex;align-items:center}.PartitionTextEntity{width:100%}.PartitionTextEntity.Anticlockwise{text-align:end}foreignObject.Bottom div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-bg.svg");background-size:calc(var(--radius) * 2px + var(--ratio) * 20px);background-position:center}foreignObject.Middle div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-spin.svg"), url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-pointer.svg");background-position:center, center 5px}foreignObject.Top{mix-blend-mode:multiply}foreignObject.Top div{background-image:var(--img-theme-shadow);background-position:center;background-size:calc(var(--radius) * 2px)}foreignObject.Partition1 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc(var(--index) * 360deg / var(--length)))}foreignObject.Partition2 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc((var(--index) + 0.5) * 360deg / var(--length)))}foreignObject.PointerArea{mix-blend-mode:screen}foreignObject.PointerArea div{background-image:var(--img-theme-pointer-area);background-position:center -3px;background-size:51%}foreignObject.Partition1 div,foreignObject.Partition2 div{transform-origin:center}.PartitionsCustomable1 div,.PartitionsCustomable2 div{visibility:hidden}.PartitionsCustomable1 div.active,.PartitionsCustomable2 div.active{visibility:visible}foreignObject.Customable{overflow:visible}foreignObject.Customable div{background-repeat:no-repeat}.PartitionBackground div{background-size:calc(var(--radius) * 2 / var(--size) * 100%) calc(var(--radius) * 2 / var(--size) * 100%);background-position:center}.PartitionBackground:nth-child(2n) div{background:var(--emw--color-primary, #3F2E75)}.PartitionBackground:nth-child(2n+1) div{background:var(--emw--color-secondary, #9482CE)}.PartitionBackground div{transform-origin:center}.PartitionBackgroundStroke{fill:transparent;stroke:var(--emw--color-background-secondary, #251D3E);stroke-width:3px;stroke-dasharray:none}.PointerPartitionFrame{stroke:#FFDD64;fill:transparent;stroke-dasharray:var(--radius) calc(6.2831853072 / var(--length) * var(--radius));stroke-width:0px}.PointerPartitionFrame.active{stroke-width:3px}.WheelContainer.Mobile foreignObject.Middle div{background-size:95px, 38px}.PartitionText .PartitionTextEntityContainer .PartitionTextEntity{text-align:center;text-transform:uppercase;text-shadow:none;font-size:var(--emw--font-size-small, 14px);font-weight:900}';export{j as C}