@zcomponent/core 1.29.0 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +1 -0
  2. package/css/zcomponent.css +121 -122
  3. package/index.js +0 -3
  4. package/lib/actionbehavior.d.ts +3 -3
  5. package/lib/actionbehavior.js +20 -19
  6. package/lib/animation/animation.d.ts +13 -6
  7. package/lib/animation/animation.js +56 -43
  8. package/lib/animation/bezier.d.ts +6 -0
  9. package/lib/animation/bezier.js +8 -2
  10. package/lib/animation/clips/clip.d.ts +13 -1
  11. package/lib/animation/clips/clip.js +34 -14
  12. package/lib/animation/index.d.ts +4 -4
  13. package/lib/animation/index.js +4 -4
  14. package/lib/animation/layer.d.ts +9 -0
  15. package/lib/animation/layer.js +28 -12
  16. package/lib/animation/layerclip.d.ts +21 -0
  17. package/lib/animation/layerclip.js +82 -45
  18. package/lib/animation/tracks/cliptrack.d.ts +18 -0
  19. package/lib/animation/tracks/cliptrack.js +27 -6
  20. package/lib/animation/tracks/functiontrack.d.ts +9 -0
  21. package/lib/animation/tracks/functiontrack.js +16 -3
  22. package/lib/animation/tracks/propertytrack.d.ts +20 -1
  23. package/lib/animation/tracks/propertytrack.js +48 -11
  24. package/lib/animation/tracks/streamtrack.d.ts +18 -0
  25. package/lib/animation/tracks/streamtrack.js +32 -6
  26. package/lib/animation/tracks/track.d.ts +8 -2
  27. package/lib/animation/tracks/track.js +3 -2
  28. package/lib/behavior.js +13 -10
  29. package/lib/behaviors/ActivateState.d.ts +22 -24
  30. package/lib/behaviors/ActivateState.js +145 -35
  31. package/lib/behaviors/CallFunction.d.ts +2 -4
  32. package/lib/behaviors/CallFunction.js +69 -11
  33. package/lib/behaviors/ChangeRootScene.d.ts +35 -0
  34. package/lib/behaviors/ChangeRootScene.js +123 -0
  35. package/lib/behaviors/ConsoleLog.d.ts +6 -5
  36. package/lib/behaviors/ConsoleLog.js +95 -12
  37. package/lib/behaviors/DownloadSnapshot.d.ts +7 -12
  38. package/lib/behaviors/DownloadSnapshot.js +70 -19
  39. package/lib/behaviors/EmitComponentPropEvent.d.ts +1 -3
  40. package/lib/behaviors/EmitComponentPropEvent.js +80 -12
  41. package/lib/behaviors/LaunchURL.d.ts +5 -5
  42. package/lib/behaviors/LaunchURL.js +92 -10
  43. package/lib/behaviors/LogAnalyticsEvent.d.ts +10 -4
  44. package/lib/behaviors/LogAnalyticsEvent.js +88 -7
  45. package/lib/behaviors/PauseLayerClip.d.ts +7 -9
  46. package/lib/behaviors/PauseLayerClip.js +89 -21
  47. package/lib/behaviors/PlayLayerClip.d.ts +35 -32
  48. package/lib/behaviors/PlayLayerClip.js +202 -48
  49. package/lib/behaviors/PlaySound.d.ts +19 -25
  50. package/lib/behaviors/PlaySound.js +122 -28
  51. package/lib/behaviors/SetLayerOff.d.ts +7 -9
  52. package/lib/behaviors/SetLayerOff.js +88 -21
  53. package/lib/behaviors/ShareSnapshot.d.ts +5 -9
  54. package/lib/behaviors/ShareSnapshot.js +70 -17
  55. package/lib/behaviors/ShowTextAlert.d.ts +16 -29
  56. package/lib/behaviors/ShowTextAlert.js +116 -48
  57. package/lib/behaviors/TakeSnapshot.d.ts +22 -26
  58. package/lib/behaviors/TakeSnapshot.js +131 -56
  59. package/lib/behaviors/ToggleLayerClips.d.ts +45 -62
  60. package/lib/behaviors/ToggleLayerClips.js +233 -64
  61. package/lib/behaviors/stream/PauseStream.d.ts +5 -16
  62. package/lib/behaviors/stream/PauseStream.js +94 -34
  63. package/lib/behaviors/stream/PlayStream.d.ts +14 -27
  64. package/lib/behaviors/stream/PlayStream.js +123 -34
  65. package/lib/behaviors/stream/SeekStream.d.ts +8 -18
  66. package/lib/behaviors/stream/SeekStream.js +97 -31
  67. package/lib/behaviors/stream/StopStream.d.ts +6 -15
  68. package/lib/behaviors/stream/StopStream.js +89 -27
  69. package/lib/component.d.ts +36 -13
  70. package/lib/component.js +237 -151
  71. package/lib/components/AnimatedLoader.d.ts +51 -0
  72. package/lib/components/AnimatedLoader.js +159 -0
  73. package/lib/components/Audio.d.ts +35 -37
  74. package/lib/components/Audio.js +264 -151
  75. package/lib/components/AudioLayerSettings.d.ts +13 -11
  76. package/lib/components/AudioLayerSettings.js +76 -18
  77. package/lib/components/Children.d.ts +2 -1
  78. package/lib/components/Children.js +66 -13
  79. package/lib/components/ConditionalConstruct.d.ts +44 -0
  80. package/lib/components/ConditionalConstruct.js +142 -0
  81. package/lib/components/DefaultCookieConsent.d.ts +53 -73
  82. package/lib/components/DefaultCookieConsent.js +382 -264
  83. package/lib/components/DefaultLoader.d.ts +40 -28
  84. package/lib/components/DefaultLoader.js +198 -46
  85. package/lib/components/Gamepad.d.ts +5 -26
  86. package/lib/components/Gamepad.js +201 -65
  87. package/lib/components/LoaderScope.d.ts +15 -0
  88. package/lib/components/LoaderScope.js +71 -0
  89. package/lib/components/LongLoad.d.ts +11 -15
  90. package/lib/components/LongLoad.js +89 -34
  91. package/lib/components/SnapshotUI.d.ts +19 -24
  92. package/lib/components/SnapshotUI.js +202 -105
  93. package/lib/context.d.ts +23 -5
  94. package/lib/context.js +12 -6
  95. package/lib/contexts/analyticscontext.d.ts +12 -2
  96. package/lib/contexts/analyticscontext.js +68 -10
  97. package/lib/contexts/audiocontextcontext.d.ts +1 -1
  98. package/lib/contexts/audiocontextcontext.js +9 -8
  99. package/lib/contexts/canvascontext.d.ts +32 -18
  100. package/lib/contexts/canvascontext.js +195 -120
  101. package/lib/contexts/cookieconsentcontext.d.ts +38 -28
  102. package/lib/contexts/cookieconsentcontext.js +35 -32
  103. package/lib/contexts/documentflagmanager.js +15 -11
  104. package/lib/contexts/environmentcontext.d.ts +22 -6
  105. package/lib/contexts/environmentcontext.js +135 -21
  106. package/lib/contexts/gamepadcontext.d.ts +29 -26
  107. package/lib/contexts/gamepadcontext.js +46 -46
  108. package/lib/contexts/gesturecontext.d.ts +31 -6
  109. package/lib/contexts/gesturecontext.js +110 -85
  110. package/lib/contexts/globaltagcontext.d.ts +1 -1
  111. package/lib/contexts/globaltagcontext.js +8 -11
  112. package/lib/contexts/loadcontext.d.ts +45 -8
  113. package/lib/contexts/loadcontext.js +232 -82
  114. package/lib/contexts/orientationcontext.d.ts +13 -15
  115. package/lib/contexts/orientationcontext.js +150 -67
  116. package/lib/contexts/rootcomponentscontext.d.ts +16 -0
  117. package/lib/contexts/rootcomponentscontext.js +65 -0
  118. package/lib/contexts/snapshotContext.d.ts +0 -3
  119. package/lib/contexts/snapshotContext.js +78 -23
  120. package/lib/contexts/tagcontext.d.ts +5 -5
  121. package/lib/contexts/tagcontext.js +16 -16
  122. package/lib/contexts/textalertcontext.d.ts +1 -5
  123. package/lib/contexts/textalertcontext.js +1 -5
  124. package/lib/contexts/usereventcontext.d.ts +1 -1
  125. package/lib/contexts/usereventcontext.js +12 -12
  126. package/lib/data/animation.d.ts +10 -2
  127. package/lib/data/change.d.ts +1 -1
  128. package/lib/data/change.js +7 -0
  129. package/lib/data/core.d.ts +9 -1
  130. package/lib/data/index.d.ts +1 -1
  131. package/lib/data/index.js +1 -1
  132. package/lib/decorators.d.ts +348 -0
  133. package/lib/decorators.js +239 -0
  134. package/lib/decoratorutils.d.ts +3 -0
  135. package/lib/decoratorutils.js +8 -0
  136. package/lib/emitter.d.ts +15 -2
  137. package/lib/emitter.js +15 -6
  138. package/lib/entity.d.ts +43 -25
  139. package/lib/entity.js +104 -71
  140. package/lib/event.d.ts +2 -1
  141. package/lib/event.js +1 -4
  142. package/lib/groups.d.ts +18 -0
  143. package/lib/groups.js +19 -0
  144. package/lib/icons.d.ts +3372 -0
  145. package/lib/icons.js +1 -0
  146. package/lib/index.d.ts +18 -13
  147. package/lib/index.js +17 -13
  148. package/lib/inflate.d.ts +7 -7
  149. package/lib/inflate.js +5 -5
  150. package/lib/observable.d.ts +9 -2
  151. package/lib/observable.js +5 -4
  152. package/lib/observe.d.ts +18 -0
  153. package/lib/observe.js +177 -0
  154. package/lib/profile.d.ts +9 -5
  155. package/lib/profile.js +27 -17
  156. package/lib/selectors.d.ts +1 -1
  157. package/lib/selectors.js +5 -4
  158. package/lib/types.d.ts +161 -19
  159. package/lib/types.js +22 -1
  160. package/lib/values/values.d.ts +7 -8
  161. package/lib/values/values.js +1 -2
  162. package/lib/values/valuesmutator.d.ts +4 -1
  163. package/lib/values/valuesmutator.js +10 -8
  164. package/lib/zcomponent.d.ts +21 -10
  165. package/lib/zcomponent.js +717 -540
  166. package/package.json +22 -5
  167. package/lib/behaviors/ChangeCursor.d.ts +0 -39
  168. package/lib/behaviors/ChangeCursor.js +0 -44
@@ -1,8 +1,42 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
1
35
  import { Component } from '../component';
2
36
  import { ConsentStatus, CookieConsentContext, CookieType, Status, useCookieConsentFunctional, useCookieConsentMarketing, useCookieConsentPerformance, useMarketingVendors, usePerformanceVendors, } from '../contexts/cookieconsentcontext';
3
37
  import { isDesignTime } from '../contexts/environmentcontext';
4
38
  import { constructed, started } from '../contexts/loadcontext';
5
- import { Observable } from '../observable';
39
+ import { zComponent, zUI } from '../decorators';
6
40
  const html = `
7
41
  <div id='zcomponent-cookieconsent-panel'>
8
42
  <h1 id='zcomponent-cookieconsent-title'></h1>
@@ -17,326 +51,410 @@ const html = `
17
51
  * The component handles the logic for displaying the banner, receiving the user's consent, and storing this consent.
18
52
  * It also provides methods to check if the user has already given their consent.
19
53
  * @zcomponent
20
- * @zgroup Cookie Consent
21
54
  * @zicon cookie
55
+ * @zgroup Cookie Consent
22
56
  */
23
- export class DefaultCookieConsent extends Component {
24
- /**
25
- * Creates an instance of DefaultCookieConsent.
26
- * @param contextManager - The current ContextManager
27
- * @param constructorProps - The properties of the component
28
- */
29
- constructor(contextManager, constructorProps) {
30
- super(contextManager, constructorProps);
31
- this.constructorProps = constructorProps;
57
+ let DefaultCookieConsent = (() => {
58
+ let _classDecorators = [zComponent({ icon: 'cookie', group: 'Cookie Consent' })];
59
+ let _classDescriptor;
60
+ let _classExtraInitializers = [];
61
+ let _classThis;
62
+ let _classSuper = Component;
63
+ let _title_decorators;
64
+ let _title_initializers = [];
65
+ let _title_extraInitializers = [];
66
+ let _description_decorators;
67
+ let _description_initializers = [];
68
+ let _description_extraInitializers = [];
69
+ let _privacyPolicyText_decorators;
70
+ let _privacyPolicyText_initializers = [];
71
+ let _privacyPolicyText_extraInitializers = [];
72
+ let _privacyPolicyURL_decorators;
73
+ let _privacyPolicyURL_initializers = [];
74
+ let _privacyPolicyURL_extraInitializers = [];
75
+ let _acceptButton_decorators;
76
+ let _acceptButton_initializers = [];
77
+ let _acceptButton_extraInitializers = [];
78
+ let _settingsButton_decorators;
79
+ let _settingsButton_initializers = [];
80
+ let _settingsButton_extraInitializers = [];
81
+ let _saveButton_decorators;
82
+ let _saveButton_initializers = [];
83
+ let _saveButton_extraInitializers = [];
84
+ let _essentialTitle_decorators;
85
+ let _essentialTitle_initializers = [];
86
+ let _essentialTitle_extraInitializers = [];
87
+ let _essentialDescription_decorators;
88
+ let _essentialDescription_initializers = [];
89
+ let _essentialDescription_extraInitializers = [];
90
+ let _functionalTitle_decorators;
91
+ let _functionalTitle_initializers = [];
92
+ let _functionalTitle_extraInitializers = [];
93
+ let _functionalDescription_decorators;
94
+ let _functionalDescription_initializers = [];
95
+ let _functionalDescription_extraInitializers = [];
96
+ let _performanceTitle_decorators;
97
+ let _performanceTitle_initializers = [];
98
+ let _performanceTitle_extraInitializers = [];
99
+ let _performanceDescription_decorators;
100
+ let _performanceDescription_initializers = [];
101
+ let _performanceDescription_extraInitializers = [];
102
+ let _marketingTitle_decorators;
103
+ let _marketingTitle_initializers = [];
104
+ let _marketingTitle_extraInitializers = [];
105
+ let _marketingDescription_decorators;
106
+ let _marketingDescription_initializers = [];
107
+ let _marketingDescription_extraInitializers = [];
108
+ let _required_decorators;
109
+ let _required_initializers = [];
110
+ let _required_extraInitializers = [];
111
+ var DefaultCookieConsent = class extends _classSuper {
112
+ static { _classThis = this; }
113
+ static {
114
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
115
+ _title_decorators = [zUI({ group: 'Consent Screen', priority: 20 })];
116
+ _description_decorators = [zUI({ group: 'Consent Screen', priority: 20 })];
117
+ _privacyPolicyText_decorators = [zUI({ group: 'Settings', priority: 10 })];
118
+ _privacyPolicyURL_decorators = [zUI({ group: 'Settings', priority: 10 })];
119
+ _acceptButton_decorators = [zUI({ group: 'Consent Screen', priority: 20 })];
120
+ _settingsButton_decorators = [zUI({ group: 'Consent Screen', priority: 20 })];
121
+ _saveButton_decorators = [zUI({ group: 'Settings', priority: 10 })];
122
+ _essentialTitle_decorators = [zUI({ group: 'Settings', priority: 10 })];
123
+ _essentialDescription_decorators = [zUI({ group: 'Settings', priority: 10 })];
124
+ _functionalTitle_decorators = [zUI({ group: 'Settings', priority: 10 })];
125
+ _functionalDescription_decorators = [zUI({ group: 'Settings', priority: 10 })];
126
+ _performanceTitle_decorators = [zUI({ group: 'Settings', priority: 10 })];
127
+ _performanceDescription_decorators = [zUI({ group: 'Settings', priority: 10 })];
128
+ _marketingTitle_decorators = [zUI({ group: 'Settings', priority: 10 })];
129
+ _marketingDescription_decorators = [zUI({ group: 'Settings', priority: 10 })];
130
+ _required_decorators = [zUI({ group: 'Settings', priority: 10 })];
131
+ __esDecorate(null, null, _title_decorators, { kind: "field", name: "title", static: false, private: false, access: { has: obj => "title" in obj, get: obj => obj.title, set: (obj, value) => { obj.title = value; } }, metadata: _metadata }, _title_initializers, _title_extraInitializers);
132
+ __esDecorate(null, null, _description_decorators, { kind: "field", name: "description", static: false, private: false, access: { has: obj => "description" in obj, get: obj => obj.description, set: (obj, value) => { obj.description = value; } }, metadata: _metadata }, _description_initializers, _description_extraInitializers);
133
+ __esDecorate(null, null, _privacyPolicyText_decorators, { kind: "field", name: "privacyPolicyText", static: false, private: false, access: { has: obj => "privacyPolicyText" in obj, get: obj => obj.privacyPolicyText, set: (obj, value) => { obj.privacyPolicyText = value; } }, metadata: _metadata }, _privacyPolicyText_initializers, _privacyPolicyText_extraInitializers);
134
+ __esDecorate(null, null, _privacyPolicyURL_decorators, { kind: "field", name: "privacyPolicyURL", static: false, private: false, access: { has: obj => "privacyPolicyURL" in obj, get: obj => obj.privacyPolicyURL, set: (obj, value) => { obj.privacyPolicyURL = value; } }, metadata: _metadata }, _privacyPolicyURL_initializers, _privacyPolicyURL_extraInitializers);
135
+ __esDecorate(null, null, _acceptButton_decorators, { kind: "field", name: "acceptButton", static: false, private: false, access: { has: obj => "acceptButton" in obj, get: obj => obj.acceptButton, set: (obj, value) => { obj.acceptButton = value; } }, metadata: _metadata }, _acceptButton_initializers, _acceptButton_extraInitializers);
136
+ __esDecorate(null, null, _settingsButton_decorators, { kind: "field", name: "settingsButton", static: false, private: false, access: { has: obj => "settingsButton" in obj, get: obj => obj.settingsButton, set: (obj, value) => { obj.settingsButton = value; } }, metadata: _metadata }, _settingsButton_initializers, _settingsButton_extraInitializers);
137
+ __esDecorate(null, null, _saveButton_decorators, { kind: "field", name: "saveButton", static: false, private: false, access: { has: obj => "saveButton" in obj, get: obj => obj.saveButton, set: (obj, value) => { obj.saveButton = value; } }, metadata: _metadata }, _saveButton_initializers, _saveButton_extraInitializers);
138
+ __esDecorate(null, null, _essentialTitle_decorators, { kind: "field", name: "essentialTitle", static: false, private: false, access: { has: obj => "essentialTitle" in obj, get: obj => obj.essentialTitle, set: (obj, value) => { obj.essentialTitle = value; } }, metadata: _metadata }, _essentialTitle_initializers, _essentialTitle_extraInitializers);
139
+ __esDecorate(null, null, _essentialDescription_decorators, { kind: "field", name: "essentialDescription", static: false, private: false, access: { has: obj => "essentialDescription" in obj, get: obj => obj.essentialDescription, set: (obj, value) => { obj.essentialDescription = value; } }, metadata: _metadata }, _essentialDescription_initializers, _essentialDescription_extraInitializers);
140
+ __esDecorate(null, null, _functionalTitle_decorators, { kind: "field", name: "functionalTitle", static: false, private: false, access: { has: obj => "functionalTitle" in obj, get: obj => obj.functionalTitle, set: (obj, value) => { obj.functionalTitle = value; } }, metadata: _metadata }, _functionalTitle_initializers, _functionalTitle_extraInitializers);
141
+ __esDecorate(null, null, _functionalDescription_decorators, { kind: "field", name: "functionalDescription", static: false, private: false, access: { has: obj => "functionalDescription" in obj, get: obj => obj.functionalDescription, set: (obj, value) => { obj.functionalDescription = value; } }, metadata: _metadata }, _functionalDescription_initializers, _functionalDescription_extraInitializers);
142
+ __esDecorate(null, null, _performanceTitle_decorators, { kind: "field", name: "performanceTitle", static: false, private: false, access: { has: obj => "performanceTitle" in obj, get: obj => obj.performanceTitle, set: (obj, value) => { obj.performanceTitle = value; } }, metadata: _metadata }, _performanceTitle_initializers, _performanceTitle_extraInitializers);
143
+ __esDecorate(null, null, _performanceDescription_decorators, { kind: "field", name: "performanceDescription", static: false, private: false, access: { has: obj => "performanceDescription" in obj, get: obj => obj.performanceDescription, set: (obj, value) => { obj.performanceDescription = value; } }, metadata: _metadata }, _performanceDescription_initializers, _performanceDescription_extraInitializers);
144
+ __esDecorate(null, null, _marketingTitle_decorators, { kind: "field", name: "marketingTitle", static: false, private: false, access: { has: obj => "marketingTitle" in obj, get: obj => obj.marketingTitle, set: (obj, value) => { obj.marketingTitle = value; } }, metadata: _metadata }, _marketingTitle_initializers, _marketingTitle_extraInitializers);
145
+ __esDecorate(null, null, _marketingDescription_decorators, { kind: "field", name: "marketingDescription", static: false, private: false, access: { has: obj => "marketingDescription" in obj, get: obj => obj.marketingDescription, set: (obj, value) => { obj.marketingDescription = value; } }, metadata: _metadata }, _marketingDescription_initializers, _marketingDescription_extraInitializers);
146
+ __esDecorate(null, null, _required_decorators, { kind: "field", name: "required", static: false, private: false, access: { has: obj => "required" in obj, get: obj => obj.required, set: (obj, value) => { obj.required = value; } }, metadata: _metadata }, _required_initializers, _required_extraInitializers);
147
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
148
+ DefaultCookieConsent = _classThis = _classDescriptor.value;
149
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
150
+ __runInitializers(_classThis, _classExtraInitializers);
151
+ }
152
+ constructorProps;
32
153
  /**
33
- * @zprop
154
+ * @default "This website uses cookies to store information on your computer."
155
+ * @zui
34
156
  * @zgroup Consent Screen
35
- * @zgrouppriority 20
36
- * @zdefault "This website uses cookies to store information on your computer."
37
157
  */
38
- this.title = new Observable('This website uses cookies to store information on your computer.');
158
+ title = __runInitializers(this, _title_initializers, 'This website uses cookies to store information on your computer.');
39
159
  /**
40
- * @zprop
160
+ * @default "Some of these cookies are essential, while others help us to improve your experience by providing insights into how the site is being used."
161
+ * @zui
41
162
  * @zgroup Consent Screen
42
- * @zgrouppriority 20
43
- * @zdefault "Some of these cookies are essential, while others help us to improve your experience by providing insights into how the site is being used."
44
163
  */
45
- this.description = new Observable('Some of these cookies are essential, while others help us to improve your experience by providing insights into how the site is being used.');
164
+ description = (__runInitializers(this, _title_extraInitializers), __runInitializers(this, _description_initializers, 'Some of these cookies are essential, while others help us to improve your experience by providing insights into how the site is being used.'));
46
165
  /**
47
- * @zprop
166
+ * @default "Privacy Policy"
167
+ * @zui
48
168
  * @zgroup Settings
49
- * @zgrouppriority 10
50
- * @zdefault "Privacy Policy"
51
169
  */
52
- this.privacyPolicyText = new Observable('Privacy Policy');
170
+ privacyPolicyText = (__runInitializers(this, _description_extraInitializers), __runInitializers(this, _privacyPolicyText_initializers, 'Privacy Policy'));
53
171
  /**
54
- * @zprop
172
+ * @default ""
173
+ * @zui
55
174
  * @zgroup Settings
56
- * @zgrouppriority 10
57
- * @zdefault ""
58
175
  */
59
- this.privacyPolicyURL = new Observable('');
176
+ privacyPolicyURL = (__runInitializers(this, _privacyPolicyText_extraInitializers), __runInitializers(this, _privacyPolicyURL_initializers, ''));
60
177
  /**
61
- * @zprop
178
+ * @default "I Accept Cookies"
179
+ * @zui
62
180
  * @zgroup Consent Screen
63
- * @zgrouppriority 20
64
- * @zdefault "I Accept Cookies"
65
181
  */
66
- this.acceptButton = new Observable('I Accept Cookies');
182
+ acceptButton = (__runInitializers(this, _privacyPolicyURL_extraInitializers), __runInitializers(this, _acceptButton_initializers, 'I Accept Cookies'));
67
183
  /**
68
- * @zprop
184
+ * @default "Settings"
185
+ * @zui
69
186
  * @zgroup Consent Screen
70
- * @zgrouppriority 20
71
- * @zdefault "Settings"
72
187
  */
73
- this.settingsButton = new Observable('Settings');
188
+ settingsButton = (__runInitializers(this, _acceptButton_extraInitializers), __runInitializers(this, _settingsButton_initializers, 'Settings'));
74
189
  /**
75
- * @zprop
76
- * @zgroup Consent Screen
77
- * @zgrouppriority 20
78
- * @zdefault "Save"
190
+ * @default "Save"
191
+ * @zui
192
+ * @zgroup Settings
79
193
  */
80
- this.saveButton = new Observable('Save');
194
+ saveButton = (__runInitializers(this, _settingsButton_extraInitializers), __runInitializers(this, _saveButton_initializers, 'Save'));
81
195
  /**
82
- * @zprop
196
+ * @default "Essential"
197
+ * @zui
83
198
  * @zgroup Settings
84
- * @zgrouppriority 10
85
- * @zdefault "Essential"
86
199
  */
87
- this.essentialTitle = new Observable('Essential');
200
+ essentialTitle = (__runInitializers(this, _saveButton_extraInitializers), __runInitializers(this, _essentialTitle_initializers, 'Essential'));
88
201
  /**
89
- * @zprop
202
+ * @default "Cookies that are necessary to provide the service."
203
+ * @zui
90
204
  * @zgroup Settings
91
- * @zgrouppriority 10
92
- * @zdefault "Cookies that are necessary to provide the service."
93
205
  */
94
- this.essentialDescription = new Observable('Cookies that are necessary to provide the service.');
206
+ essentialDescription = (__runInitializers(this, _essentialTitle_extraInitializers), __runInitializers(this, _essentialDescription_initializers, 'Cookies that are necessary to provide the service.'));
95
207
  /**
96
- * @zprop
208
+ * @default "Functional"
209
+ * @zui
97
210
  * @zgroup Settings
98
- * @zgrouppriority 10
99
- * @zdefault "Functional"
100
211
  */
101
- this.functionalTitle = new Observable('Functional');
212
+ functionalTitle = (__runInitializers(this, _essentialDescription_extraInitializers), __runInitializers(this, _functionalTitle_initializers, 'Functional'));
102
213
  /**
103
- * @zprop
214
+ * @default "Cookies that provide you with useful functionality, such as saving your preferences."
215
+ * @zui
104
216
  * @zgroup Settings
105
- * @zgrouppriority 10
106
- * @zdefault "Cookies that provide you with useful functionality, such as saving your preferences."
107
217
  */
108
- this.functionalDescription = new Observable('Cookies that provide you with useful functionality, such as saving your preferences.');
218
+ functionalDescription = (__runInitializers(this, _functionalTitle_extraInitializers), __runInitializers(this, _functionalDescription_initializers, 'Cookies that provide you with useful functionality, such as saving your preferences.'));
109
219
  /**
110
- * @zprop
220
+ * @default "Performance"
221
+ * @zui
111
222
  * @zgroup Settings
112
- * @zgrouppriority 10
113
- * @zdefault "Performance"
114
223
  */
115
- this.performanceTitle = new Observable('Performance');
224
+ performanceTitle = (__runInitializers(this, _functionalDescription_extraInitializers), __runInitializers(this, _performanceTitle_initializers, 'Performance'));
116
225
  /**
117
- * @zprop
226
+ * @default "Cookies that help us measure and understand how the site is being used."
227
+ * @zui
118
228
  * @zgroup Settings
119
- * @zgrouppriority 10
120
- * @zdefault "Cookies that help us measure and understand how the site is being used."
121
229
  */
122
- this.performanceDescription = new Observable('Cookies that help us measure and understand how the site is being used.');
230
+ performanceDescription = (__runInitializers(this, _performanceTitle_extraInitializers), __runInitializers(this, _performanceDescription_initializers, 'Cookies that help us measure and understand how the site is being used.'));
123
231
  /**
124
- * @zprop
232
+ * @default "Marketing"
233
+ * @zui
125
234
  * @zgroup Settings
126
- * @zgrouppriority 10
127
- * @zdefault "Marketing"
128
235
  */
129
- this.marketingTitle = new Observable('Marketing');
236
+ marketingTitle = (__runInitializers(this, _performanceDescription_extraInitializers), __runInitializers(this, _marketingTitle_initializers, 'Marketing'));
130
237
  /**
131
- * @zprop
238
+ * @default "Cookies that help us market our site and services."
239
+ * @zui
132
240
  * @zgroup Settings
133
- * @zgrouppriority 10
134
- * @zdefault "Cookies that help us market our site and services."
135
241
  */
136
- this.marketingDescription = new Observable('Cookies that help us market our site and services.');
242
+ marketingDescription = (__runInitializers(this, _marketingTitle_extraInitializers), __runInitializers(this, _marketingDescription_initializers, 'Cookies that help us market our site and services.'));
137
243
  /**
138
- * @zprop
244
+ * @default "Required"
245
+ * @zui
139
246
  * @zgroup Settings
140
- * @zgrouppriority 10
141
- * @zdefault "Required"
142
247
  */
143
- this.required = new Observable('Required');
144
- this._dom = document.createElement('div');
145
- this._functional = document.createElement('input');
146
- this._performance = document.createElement('input');
147
- this._marketing = document.createElement('input');
148
- const context = contextManager.get(CookieConsentContext);
149
- context.functionalCookies.value = this._getConsentStatus(CookieType.functional);
150
- context.performanceCookies.value = this._getConsentStatus(CookieType.performance);
151
- context.marketingCookies.value = this._getConsentStatus(CookieType.marketing);
152
- context.status.value = Status.initialized;
153
- context.showSettings.value = () => this.show(true);
154
- this._dom.classList.add('zcomponent-cookieconsent');
155
- if (constructorProps.waitForStart)
156
- started(contextManager).then(() => this.show(false));
157
- else
158
- constructed(contextManager).then(() => this.show(false));
159
- }
160
- _loadDOM(isSettings) {
161
- this._dom.innerHTML = html;
162
- this._functional.type = 'checkbox';
163
- this._performance.type = 'checkbox';
164
- this._marketing.type = 'checkbox';
165
- const panel = this._dom.querySelector('#zcomponent-cookieconsent-panel');
166
- if (!panel)
167
- return;
168
- const title = this._dom.querySelector('#zcomponent-cookieconsent-title');
169
- this.title.addListener(v => {
170
- if (title)
171
- title.textContent = v;
172
- }, undefined, true);
173
- const description = this._dom.querySelector('#zcomponent-cookieconsent-description');
174
- this.description.addListener(v => {
175
- if (description)
176
- description.textContent = v;
177
- }, undefined, true);
178
- const privacyPolicy = this._dom.querySelector('#zcomponent-cookieconsent-privacypolicy');
179
- this.privacyPolicyText.addListener(val => {
180
- if (privacyPolicy && privacyPolicy instanceof HTMLAnchorElement)
181
- privacyPolicy.innerText = val;
182
- }, undefined, true);
183
- this.privacyPolicyURL.addListener(val => {
184
- if (!privacyPolicy || !(privacyPolicy instanceof HTMLAnchorElement))
248
+ required = (__runInitializers(this, _marketingDescription_extraInitializers), __runInitializers(this, _required_initializers, 'Required'));
249
+ _dom = (__runInitializers(this, _required_extraInitializers), document.createElement('div'));
250
+ _functional = document.createElement('input');
251
+ _performance = document.createElement('input');
252
+ _marketing = document.createElement('input');
253
+ /**
254
+ * Creates an instance of DefaultCookieConsent.
255
+ * @param contextManager - The current ContextManager
256
+ * @param constructorProps - The properties of the component
257
+ */
258
+ constructor(contextManager, constructorProps) {
259
+ super(contextManager, constructorProps);
260
+ this.constructorProps = constructorProps;
261
+ const context = contextManager.get(CookieConsentContext);
262
+ context.functionalCookies.value = this._getConsentStatus(CookieType.functional);
263
+ context.performanceCookies.value = this._getConsentStatus(CookieType.performance);
264
+ context.marketingCookies.value = this._getConsentStatus(CookieType.marketing);
265
+ context.status.value = Status.initialized;
266
+ context.showSettings.value = () => this.show(true);
267
+ this._dom.classList.add('zcomponent-cookieconsent');
268
+ if (constructorProps.waitForStart)
269
+ started(contextManager).then(() => this.show(false));
270
+ else
271
+ constructed(contextManager).then(() => this.show(false));
272
+ }
273
+ _loadDOM(isSettings) {
274
+ this._dom.innerHTML = html;
275
+ this._functional.type = 'checkbox';
276
+ this._performance.type = 'checkbox';
277
+ this._marketing.type = 'checkbox';
278
+ const panel = this._dom.querySelector('#zcomponent-cookieconsent-panel');
279
+ if (!panel)
185
280
  return;
186
- privacyPolicy.style.display = val.length === 0 ? 'none' : 'block';
187
- privacyPolicy.href = val;
188
- }, undefined, true);
189
- if (isSettings) {
190
- const requiredDOM = document.createElement('span');
191
- requiredDOM.innerText = 'Required';
192
- this.required.addListener(v => {
193
- if (requiredDOM)
194
- requiredDOM.textContent = v;
195
- }, undefined, true);
196
- requiredDOM.style.float = 'right';
197
- panel.appendChild(this._createEntry(this.essentialTitle, this.essentialDescription, [], requiredDOM));
198
- panel.appendChild(this._createEntry(this.functionalTitle, this.functionalDescription, [], this._functional));
199
- panel.appendChild(this._createEntry(this.performanceTitle, this.performanceDescription, usePerformanceVendors(this.contextManager), this._performance));
200
- panel.appendChild(this._createEntry(this.marketingTitle, this.marketingDescription, useMarketingVendors(this.contextManager), this._marketing));
201
- this._functional.checked = useCookieConsentFunctional(this.contextManager).value === ConsentStatus.granted;
202
- this._performance.checked = useCookieConsentPerformance(this.contextManager).value === ConsentStatus.granted;
203
- this._marketing.checked = useCookieConsentMarketing(this.contextManager).value === ConsentStatus.granted;
204
- const saveButton = document.createElement('button');
205
- saveButton.id = 'zcomponent-cookieconsent-save';
206
- this.saveButton.addListener(v => {
207
- if (saveButton)
208
- saveButton.textContent = v;
209
- }, undefined, true);
210
- panel.appendChild(saveButton);
281
+ const title = this._dom.querySelector('#zcomponent-cookieconsent-title');
282
+ this.observe(this, 'title', v => {
283
+ if (title)
284
+ title.textContent = v;
285
+ }, { callImmediately: true });
286
+ const description = this._dom.querySelector('#zcomponent-cookieconsent-description');
287
+ this.observe(this, 'description', v => {
288
+ if (description)
289
+ description.textContent = v;
290
+ }, { callImmediately: true });
291
+ const privacyPolicy = this._dom.querySelector('#zcomponent-cookieconsent-privacypolicy');
292
+ this.observe(this, 'privacyPolicyText', val => {
293
+ if (privacyPolicy && privacyPolicy instanceof HTMLAnchorElement)
294
+ privacyPolicy.innerText = val;
295
+ }, { callImmediately: true });
296
+ this.observe(this, 'privacyPolicyURL', val => {
297
+ if (!privacyPolicy || !(privacyPolicy instanceof HTMLAnchorElement))
298
+ return;
299
+ privacyPolicy.style.display = val.length === 0 ? 'none' : 'block';
300
+ privacyPolicy.href = val;
301
+ }, { callImmediately: true });
302
+ if (isSettings) {
303
+ const requiredDOM = document.createElement('span');
304
+ requiredDOM.innerText = 'Required';
305
+ this.observe(this, 'required', v => {
306
+ if (requiredDOM)
307
+ requiredDOM.textContent = v;
308
+ }, { callImmediately: true });
309
+ requiredDOM.style.float = 'right';
310
+ panel.appendChild(this._createEntry(this.essentialTitle, this.essentialDescription, [], requiredDOM));
311
+ panel.appendChild(this._createEntry(this.functionalTitle, this.functionalDescription, [], this._functional));
312
+ panel.appendChild(this._createEntry(this.performanceTitle, this.performanceDescription, usePerformanceVendors(this.contextManager), this._performance));
313
+ panel.appendChild(this._createEntry(this.marketingTitle, this.marketingDescription, useMarketingVendors(this.contextManager), this._marketing));
314
+ this._functional.checked = useCookieConsentFunctional(this.contextManager).value === ConsentStatus.granted;
315
+ this._performance.checked = useCookieConsentPerformance(this.contextManager).value === ConsentStatus.granted;
316
+ this._marketing.checked = useCookieConsentMarketing(this.contextManager).value === ConsentStatus.granted;
317
+ const saveButton = document.createElement('button');
318
+ saveButton.id = 'zcomponent-cookieconsent-save';
319
+ this.observe(this, 'saveButton', v => {
320
+ if (saveButton)
321
+ saveButton.textContent = v;
322
+ }, { callImmediately: true });
323
+ panel.appendChild(saveButton);
324
+ if (!isDesignTime(this.contextManager)) {
325
+ saveButton.addEventListener('click', () => this._save());
326
+ }
327
+ return;
328
+ }
329
+ const acceptButton = document.createElement('button');
330
+ acceptButton.id = 'zcomponent-cookieconsent-accept';
331
+ this.observe(this, 'acceptButton', v => {
332
+ if (acceptButton)
333
+ acceptButton.textContent = v;
334
+ }, { callImmediately: true });
335
+ panel.appendChild(acceptButton);
336
+ const settingsButton = document.createElement('button');
337
+ settingsButton.id = 'zcomponent-cookieconsent-settings';
338
+ this.observe(this, 'settingsButton', v => {
339
+ if (settingsButton)
340
+ settingsButton.textContent = v;
341
+ }, { callImmediately: true });
342
+ settingsButton.addEventListener('click', () => {
343
+ console.log('Settings click');
344
+ this._loadDOM(true);
345
+ });
346
+ panel.appendChild(settingsButton);
211
347
  if (!isDesignTime(this.contextManager)) {
212
- saveButton.addEventListener('click', () => this._save());
348
+ acceptButton.addEventListener('click', () => this.acceptAll());
213
349
  }
214
- return;
350
+ this._dom.addEventListener('click', () => { });
215
351
  }
216
- const acceptButton = document.createElement('button');
217
- acceptButton.id = 'zcomponent-cookieconsent-accept';
218
- this.acceptButton.addListener(v => {
219
- if (acceptButton)
220
- acceptButton.textContent = v;
221
- }, undefined, true);
222
- panel.appendChild(acceptButton);
223
- const settingsButton = document.createElement('button');
224
- settingsButton.id = 'zcomponent-cookieconsent-settings';
225
- this.settingsButton.addListener(v => {
226
- if (settingsButton)
227
- settingsButton.textContent = v;
228
- }, undefined, true);
229
- settingsButton.addEventListener('click', () => {
230
- console.log('Settings click');
231
- this._loadDOM(true);
232
- });
233
- panel.appendChild(settingsButton);
234
- if (!isDesignTime(this.contextManager)) {
235
- acceptButton.addEventListener('click', () => this.acceptAll());
352
+ _save() {
353
+ this._setConsentStatus(CookieType.essential, ConsentStatus.granted);
354
+ this._setConsentStatus(CookieType.functional, this._functional.checked ? ConsentStatus.granted : ConsentStatus.rejected);
355
+ this._setConsentStatus(CookieType.performance, this._performance.checked ? ConsentStatus.granted : ConsentStatus.rejected);
356
+ this._setConsentStatus(CookieType.marketing, this._marketing.checked ? ConsentStatus.granted : ConsentStatus.rejected);
357
+ this.hide();
236
358
  }
237
- this._dom.addEventListener('click', () => { });
238
- }
239
- _save() {
240
- this._setConsentStatus(CookieType.essential, ConsentStatus.granted);
241
- this._setConsentStatus(CookieType.functional, this._functional.checked ? ConsentStatus.granted : ConsentStatus.rejected);
242
- this._setConsentStatus(CookieType.performance, this._performance.checked ? ConsentStatus.granted : ConsentStatus.rejected);
243
- this._setConsentStatus(CookieType.marketing, this._marketing.checked ? ConsentStatus.granted : ConsentStatus.rejected);
244
- this.hide();
245
- }
246
- _createEntry(title, description, vendors, elm) {
247
- const container = document.createElement('div');
248
- container.classList.add('zcomponent-cookieconsent-type');
249
- container.appendChild(elm);
250
- const header = document.createElement('h3');
251
- title.addListener(val => (header.innerText = val), undefined, true);
252
- container.appendChild(header);
253
- const descriptionDom = document.createElement('div');
254
- description.addListener(val => (descriptionDom.innerText = val), undefined, true);
255
- container.appendChild(descriptionDom);
256
- if (vendors.length === 0)
257
- return container;
258
- const ul = document.createElement('ul');
259
- for (const vendor of vendors) {
260
- const li = document.createElement('li');
261
- ul.appendChild(li);
262
- const header = document.createElement('h5');
263
- header.innerText = vendor.name;
264
- li.appendChild(header);
265
- li.append(vendor.description);
266
- li.append(document.createElement('br'));
267
- if (vendor.privacyPolicyUrl?.length > 0) {
268
- const privacy = document.createElement('a');
269
- this.privacyPolicyText.addListener(val => (privacy.innerText = val), undefined, true);
270
- privacy.href = vendor.privacyPolicyUrl;
271
- privacy.rel = 'noreferrer noopener';
272
- privacy.target = '_blank';
273
- li.appendChild(privacy);
359
+ _createEntry(title, description, vendors, elm) {
360
+ const container = document.createElement('div');
361
+ container.classList.add('zcomponent-cookieconsent-type');
362
+ container.appendChild(elm);
363
+ const header = document.createElement('h3');
364
+ header.innerText = title;
365
+ container.appendChild(header);
366
+ const descriptionDom = document.createElement('div');
367
+ descriptionDom.innerText = description;
368
+ container.appendChild(descriptionDom);
369
+ if (vendors.length === 0)
370
+ return container;
371
+ const ul = document.createElement('ul');
372
+ for (const vendor of vendors) {
373
+ const li = document.createElement('li');
374
+ ul.appendChild(li);
375
+ const header = document.createElement('h5');
376
+ header.innerText = vendor.name;
377
+ li.appendChild(header);
378
+ li.append(vendor.description);
379
+ li.append(document.createElement('br'));
380
+ if (vendor.privacyPolicyUrl?.length > 0) {
381
+ const privacy = document.createElement('a');
382
+ this.observe(this, 'privacyPolicyText', val => {
383
+ privacy.innerText = val;
384
+ }, { callImmediately: true });
385
+ privacy.href = vendor.privacyPolicyUrl;
386
+ privacy.rel = 'noreferrer noopener';
387
+ privacy.target = '_blank';
388
+ li.appendChild(privacy);
389
+ }
274
390
  }
391
+ container.appendChild(ul);
392
+ return container;
275
393
  }
276
- container.appendChild(ul);
277
- return container;
278
- }
279
- _getConsentStatus(type) {
280
- const val = window.localStorage.getItem('zcomponent-cookieconsent-' + type);
281
- if (val === null)
282
- return ConsentStatus.unknown;
283
- if (val === '1')
284
- return ConsentStatus.granted;
285
- return ConsentStatus.rejected;
286
- }
287
- _setConsentStatus(type, status) {
288
- if (status === ConsentStatus.unknown)
289
- window.localStorage.removeItem('zcomponent-cookieconsent-' + type);
290
- else
291
- window.localStorage.setItem('zcomponent-cookieconsent-' + type, status === ConsentStatus.granted ? '1' : '0');
292
- if (type === CookieType.functional)
293
- useCookieConsentFunctional(this.contextManager).value = status;
294
- if (type === CookieType.performance)
295
- useCookieConsentPerformance(this.contextManager).value = status;
296
- if (type === CookieType.marketing)
297
- useCookieConsentMarketing(this.contextManager).value = status;
298
- }
299
- /**
300
- * Shows the cookie consent dialog.
301
- * @param isSettings - Determines if the settings screen should be shown
302
- * @param force - Forces the dialog to be shown, regardless of the current consent status. Defaults to false.
303
- */
304
- show(isSettings, force = false) {
305
- if (force) {
394
+ _getConsentStatus(type) {
395
+ const val = window.localStorage.getItem('zcomponent-cookieconsent-' + type);
396
+ if (val === null)
397
+ return ConsentStatus.unknown;
398
+ if (val === '1')
399
+ return ConsentStatus.granted;
400
+ return ConsentStatus.rejected;
401
+ }
402
+ _setConsentStatus(type, status) {
403
+ if (status === ConsentStatus.unknown)
404
+ window.localStorage.removeItem('zcomponent-cookieconsent-' + type);
405
+ else
406
+ window.localStorage.setItem('zcomponent-cookieconsent-' + type, status === ConsentStatus.granted ? '1' : '0');
407
+ if (type === CookieType.functional)
408
+ useCookieConsentFunctional(this.contextManager).value = status;
409
+ if (type === CookieType.performance)
410
+ useCookieConsentPerformance(this.contextManager).value = status;
411
+ if (type === CookieType.marketing)
412
+ useCookieConsentMarketing(this.contextManager).value = status;
413
+ }
414
+ /**
415
+ * Shows the cookie consent dialog.
416
+ * @param isSettings - Determines if the settings screen should be shown
417
+ * @param force - Forces the dialog to be shown, regardless of the current consent status. Defaults to false.
418
+ */
419
+ show(isSettings, force = false) {
420
+ if (force) {
421
+ this._loadDOM(isSettings);
422
+ document.body.appendChild(this._dom);
423
+ return;
424
+ }
425
+ const designTimeOverride = isDesignTime(this.contextManager) && (this.constructorProps.preview ?? false);
426
+ if (isDesignTime(this.contextManager) && !designTimeOverride)
427
+ return;
428
+ const context = this.contextManager.get(CookieConsentContext);
429
+ if (context.functionalCookies.value !== ConsentStatus.unknown && context.marketingCookies.value !== ConsentStatus.unknown && context.performanceCookies.value !== ConsentStatus.unknown && !designTimeOverride)
430
+ return;
306
431
  this._loadDOM(isSettings);
432
+ const acceptedEssential = window.localStorage.getItem('zcomponent-cookieconsent-essential');
433
+ if (acceptedEssential !== null && !designTimeOverride)
434
+ return;
435
+ if ((this.constructorProps.onlyShowIfVendors ?? true) && !designTimeOverride) {
436
+ const performanceVendors = usePerformanceVendors(this.contextManager);
437
+ const marketingVendors = useMarketingVendors(this.contextManager);
438
+ if (performanceVendors.length === 0 && marketingVendors.length === 0)
439
+ return;
440
+ }
307
441
  document.body.appendChild(this._dom);
308
- return;
309
442
  }
310
- const designTimeOverride = isDesignTime(this.contextManager) && (this.constructorProps.preview ?? false);
311
- if (isDesignTime(this.contextManager) && !designTimeOverride)
312
- return;
313
- const context = this.contextManager.get(CookieConsentContext);
314
- if (context.functionalCookies.value !== ConsentStatus.unknown && context.marketingCookies.value !== ConsentStatus.unknown && context.performanceCookies.value !== ConsentStatus.unknown && !designTimeOverride)
315
- return;
316
- this._loadDOM(isSettings);
317
- const acceptedEssential = window.localStorage.getItem('zcomponent-cookieconsent-essential');
318
- if (acceptedEssential !== null && !designTimeOverride)
319
- return;
320
- if ((this.constructorProps.onlyShowIfVendors ?? true) && !designTimeOverride) {
321
- const performanceVendors = usePerformanceVendors(this.contextManager);
322
- const marketingVendors = useMarketingVendors(this.contextManager);
323
- if (performanceVendors.length === 0 && marketingVendors.length === 0)
324
- return;
443
+ hide() {
444
+ this._dom.remove();
325
445
  }
326
- document.body.appendChild(this._dom);
327
- }
328
- hide() {
329
- this._dom.remove();
330
- }
331
- acceptAll() {
332
- this._setConsentStatus(CookieType.essential, ConsentStatus.granted);
333
- this._setConsentStatus(CookieType.functional, ConsentStatus.granted);
334
- this._setConsentStatus(CookieType.performance, ConsentStatus.granted);
335
- this._setConsentStatus(CookieType.marketing, ConsentStatus.granted);
336
- this.hide();
337
- }
338
- dispose() {
339
- this._dom.remove();
340
- return super.dispose();
341
- }
342
- }
446
+ acceptAll() {
447
+ this._setConsentStatus(CookieType.essential, ConsentStatus.granted);
448
+ this._setConsentStatus(CookieType.functional, ConsentStatus.granted);
449
+ this._setConsentStatus(CookieType.performance, ConsentStatus.granted);
450
+ this._setConsentStatus(CookieType.marketing, ConsentStatus.granted);
451
+ this.hide();
452
+ }
453
+ dispose() {
454
+ this._dom.remove();
455
+ return super.dispose();
456
+ }
457
+ };
458
+ return DefaultCookieConsent = _classThis;
459
+ })();
460
+ export { DefaultCookieConsent };