@everymatrix/temporary-consents 1.0.69

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 (46) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-73481e72.js +1148 -0
  3. package/dist/cjs/index.cjs.js +2 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/temporary-consents.cjs.entry.js +198 -0
  6. package/dist/cjs/temporary-consents.cjs.js +25 -0
  7. package/dist/collection/collection-manifest.json +12 -0
  8. package/dist/collection/components/temporary-consents/index.js +1 -0
  9. package/dist/collection/components/temporary-consents/temporary-consents.css +58 -0
  10. package/dist/collection/components/temporary-consents/temporary-consents.js +289 -0
  11. package/dist/collection/components/temporary-consents/temporary-consents.type.js +1 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/utils/locale.utils.js +57 -0
  14. package/dist/collection/utils/utils.js +3 -0
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/index-6b1e7208.js +1122 -0
  17. package/dist/esm/index.js +1 -0
  18. package/dist/esm/loader.js +11 -0
  19. package/dist/esm/temporary-consents.entry.js +194 -0
  20. package/dist/esm/temporary-consents.js +20 -0
  21. package/dist/index.cjs.js +1 -0
  22. package/dist/index.js +1 -0
  23. package/dist/stencil.config.dev.js +17 -0
  24. package/dist/stencil.config.js +17 -0
  25. package/dist/temporary-consents/index.esm.js +0 -0
  26. package/dist/temporary-consents/p-14388d71.entry.js +1 -0
  27. package/dist/temporary-consents/p-e0f94cfb.js +2 -0
  28. package/dist/temporary-consents/p-e1255160.js +1 -0
  29. package/dist/temporary-consents/temporary-consents.esm.js +1 -0
  30. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/temporary-consents/.stencil/packages/stencil/temporary-consents/stencil.config.d.ts +2 -0
  31. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/temporary-consents/.stencil/packages/stencil/temporary-consents/stencil.config.dev.d.ts +2 -0
  32. package/dist/types/components/temporary-consents/index.d.ts +1 -0
  33. package/dist/types/components/temporary-consents/temporary-consents.d.ts +48 -0
  34. package/dist/types/components/temporary-consents/temporary-consents.type.d.ts +6 -0
  35. package/dist/types/components.d.ts +101 -0
  36. package/dist/types/index.d.ts +1 -0
  37. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  38. package/dist/types/utils/locale.utils.d.ts +6 -0
  39. package/dist/types/utils/utils.d.ts +1 -0
  40. package/loader/cdn.js +1 -0
  41. package/loader/index.cjs.js +1 -0
  42. package/loader/index.d.ts +24 -0
  43. package/loader/index.es2017.js +1 -0
  44. package/loader/index.js +2 -0
  45. package/loader/package.json +11 -0
  46. package/package.json +26 -0
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,11 @@
1
+ import { b as bootstrapLazy } from './index-6b1e7208.js';
2
+ export { s as setNonce } from './index-6b1e7208.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ const defineCustomElements = async (win, options) => {
6
+ if (typeof window === 'undefined') return undefined;
7
+ await globalScripts();
8
+ return bootstrapLazy([["temporary-consents",[[1,"temporary-consents",{"endpoint":[513],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"daysUntilLockout":[513,"days-until-lockout"],"lang":[513],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"stylingAppends":[32]}]]]], options);
9
+ };
10
+
11
+ export { defineCustomElements };
@@ -0,0 +1,194 @@
1
+ import { r as registerInstance, h } from './index-6b1e7208.js';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const SUPPORTED_LANGUAGES = ['en', 'hr'];
5
+ let TRANSLATIONS = {
6
+ en: {
7
+ title: 'Participation conditions',
8
+ description: 'Important: Full verification is required in order to be able to use our entire offer. If verification is not completed, it is not possible to withdraw and the betting account will be locked in {daysUntilLockout} days.',
9
+ declineButton: 'Decline and log out',
10
+ acceptButton: 'Accept',
11
+ loading: 'Please wait, loading...'
12
+ },
13
+ hr: {
14
+ title: 'Uvjeti sudjelovanja',
15
+ description: 'Važno: Potrebna je potpuna verifikacija kako biste mogli koristiti našu cjelokupnu ponudu. Ako potvrda nije dovršena, nije moguće podići i račun za klađenje bit će zaključan za {daysUntilLockout} dana.',
16
+ declineButton: 'Odbijte i odjavite se',
17
+ acceptButton: 'Prihvatiti',
18
+ loading: 'Molimo pričekajte, učitavanje...'
19
+ },
20
+ 'es-mx': {
21
+ 'title': 'Condiciones de participación',
22
+ 'description': 'Importante: Una verificación completa es requerida para poder utilizar nuestra oferta. Si no se verifica, no será posible hacer retiros y la cuenta para realizar apuestas será bloqueada.',
23
+ 'declineButton': 'Declinar y salir',
24
+ 'acceptButton': 'Aceptar',
25
+ 'Loading': 'Espere por favor, Cargando...'
26
+ },
27
+ 'pt-br': {
28
+ 'title': 'Condições de participação',
29
+ 'description': 'Importante: É necessária uma verificação completa para poder utilizar a nossa oferta. Se não for verificado, os saques não serão possíveis e a conta de apostas será bloqueada.',
30
+ 'declineButton': 'Recusar e sair',
31
+ 'acceptButton': 'Aceitar',
32
+ 'Loading': 'Espere, por favor, Carregando...'
33
+ }
34
+ };
35
+ const getTranslations = (url) => {
36
+ return new Promise((resolve) => {
37
+ fetch(url)
38
+ .then((res) => res.json())
39
+ .then((data) => {
40
+ Object.keys(data).forEach((item) => {
41
+ for (let key in data[item]) {
42
+ TRANSLATIONS[item][key] = data[item][key];
43
+ }
44
+ });
45
+ resolve(true);
46
+ });
47
+ });
48
+ };
49
+ const translate = (key, customLang, values) => {
50
+ const lang = customLang;
51
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
52
+ if (values !== undefined) {
53
+ for (const [key, value] of Object.entries(values.values)) {
54
+ const regex = new RegExp(`{${key}}`, 'g');
55
+ translation = translation.replace(regex, value);
56
+ }
57
+ }
58
+ return translation;
59
+ };
60
+
61
+ const temporaryConsentsCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0}:host{display:block}.TemporaryConsents{max-width:500px;display:flex;gap:35px;flex-direction:column;box-shadow:0px 1px 5px 1px rgba(0, 0, 0, 0.1);padding:20px;font-family:sans-serif}.TemporaryConsentsTitle{text-align:left;font-family:inherit;color:#000;font-weight:400;font-size:18px;display:block;border-bottom:1px solid #000;padding-bottom:10px}.TemporaryConsentsText{font-family:inherit;font-weight:300;font-size:16px}.TemporaryConsentsButtonsWrapper{display:flex;justify-content:space-evenly;gap:50px}.TemporaryConsentsButton{font-family:inherit;font-weight:300;font-size:14px;border:none;padding:10px;min-width:150px;border-radius:4px}.TemporaryConsentsButtonDecline{background-color:transparent;border:1px solid #000}.TemporaryConsentsButtonAccept{color:white;background-color:#000}";
62
+ const TemporaryConsentsStyle0 = temporaryConsentsCss;
63
+
64
+ const TemporaryConsents = class {
65
+ constructor(hostRef) {
66
+ registerInstance(this, hostRef);
67
+ this.isLoading = false;
68
+ this.setClientStyling = () => {
69
+ let sheet = document.createElement('style');
70
+ sheet.innerHTML = this.clientStyling;
71
+ this.stylingContainer.prepend(sheet);
72
+ };
73
+ this.setClientStylingURL = () => {
74
+ let url = new URL(this.clientStylingUrl);
75
+ let cssFile = document.createElement('style');
76
+ fetch(url.href)
77
+ .then((res) => res.text())
78
+ .then((data) => {
79
+ cssFile.innerHTML = data;
80
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
81
+ })
82
+ .catch((err) => {
83
+ console.log('error ', err);
84
+ });
85
+ };
86
+ this.endpoint = undefined;
87
+ this.userId = undefined;
88
+ this.sessionId = undefined;
89
+ this.daysUntilLockout = undefined;
90
+ this.lang = undefined;
91
+ this.clientStyling = '';
92
+ this.clientStylingUrl = '';
93
+ this.translationUrl = '';
94
+ this.stylingAppends = false;
95
+ }
96
+ componentWillLoad() {
97
+ const promises = [];
98
+ if (this.endpoint && this.userId) {
99
+ const consentsPromise = this.getConsents().then((consents) => {
100
+ this.temporaryAccountConsent = consents.consents.some((consent) => consent.tagCode == 'temporaryaccountconsent');
101
+ });
102
+ promises.push(consentsPromise);
103
+ }
104
+ if (this.translationUrl) {
105
+ const translationPromise = getTranslations(this.translationUrl);
106
+ promises.push(translationPromise);
107
+ }
108
+ return Promise.all(promises);
109
+ }
110
+ componentDidRender() {
111
+ // start custom styling area
112
+ if (!this.stylingAppends && this.stylingContainer) {
113
+ if (this.clientStyling)
114
+ this.setClientStyling();
115
+ if (this.clientStylingUrl)
116
+ this.setClientStylingURL();
117
+ this.stylingAppends = true;
118
+ }
119
+ // end custom styling area
120
+ }
121
+ getConsents() {
122
+ const url = new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);
123
+ const headers = new Headers();
124
+ headers.append('X-SessionId', this.sessionId);
125
+ headers.append('Accept', 'application/json');
126
+ const options = {
127
+ method: 'GET',
128
+ headers
129
+ };
130
+ return new Promise((resolve, reject) => {
131
+ this.isLoading = true;
132
+ fetch(url.href, options)
133
+ .then((res) => res.json())
134
+ .then((consents) => {
135
+ resolve(consents);
136
+ }).catch((err) => {
137
+ console.error(err);
138
+ reject(err);
139
+ }).finally(() => {
140
+ this.isLoading = false;
141
+ });
142
+ });
143
+ }
144
+ setConsents() {
145
+ const url = new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);
146
+ const headers = new Headers();
147
+ headers.append('X-SessionId', this.sessionId);
148
+ headers.append('Accept', 'application/json');
149
+ headers.append('Content-Type', 'application/json');
150
+ const body = {
151
+ consents: [{
152
+ tagCode: 'temporaryaccountconsent',
153
+ note: '',
154
+ status: 1
155
+ }]
156
+ };
157
+ const options = {
158
+ method: 'POST',
159
+ headers,
160
+ body: JSON.stringify(body)
161
+ };
162
+ return new Promise((resolve, reject) => {
163
+ this.isLoading = true;
164
+ fetch(url.href, options)
165
+ .then((res) => res.json())
166
+ .then((res) => {
167
+ resolve(res);
168
+ }).catch((err) => {
169
+ console.error(err);
170
+ reject(err);
171
+ }).finally(() => {
172
+ this.isLoading = false;
173
+ });
174
+ });
175
+ }
176
+ handleDecline() {
177
+ window.postMessage({ type: 'TemporaryConsentsDeclined' }, window.location.href);
178
+ }
179
+ handleAccept() {
180
+ this.setConsents();
181
+ window.postMessage({ type: 'TemporaryConsentsAccepted' }, window.location.href);
182
+ }
183
+ render() {
184
+ if (this.temporaryAccountConsent) {
185
+ if (this.isLoading) {
186
+ return h("p", null, translate('loading', this.lang));
187
+ }
188
+ return h("div", { class: 'TemporaryConsents', ref: el => this.stylingContainer = el }, h("h2", { class: 'TemporaryConsentsTitle' }, " ", translate('title', this.lang), " "), h("p", { class: 'TemporaryConsentsText' }, " ", translate('description', this.lang, { values: { daysUntilLockout: this.daysUntilLockout } }), " "), h("div", { class: 'TemporaryConsentsButtonsWrapper' }, h("button", { class: 'TemporaryConsentsButton TemporaryConsentsButtonDecline', onClick: () => this.handleDecline() }, translate('declineButton', this.lang)), h("button", { class: 'TemporaryConsentsButton TemporaryConsentsButtonAccept', onClick: this.handleAccept }, translate('acceptButton', this.lang))));
189
+ }
190
+ }
191
+ };
192
+ TemporaryConsents.style = TemporaryConsentsStyle0;
193
+
194
+ export { TemporaryConsents as temporary_consents };
@@ -0,0 +1,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-6b1e7208.js';
2
+ export { s as setNonce } from './index-6b1e7208.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["temporary-consents",[[1,"temporary-consents",{"endpoint":[513],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"daysUntilLockout":[513,"days-until-lockout"],"lang":[513],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"stylingAppends":[32]}]]]], options);
20
+ });
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm/index.js';
@@ -0,0 +1,17 @@
1
+ import { sass } from "@stencil/sass";
2
+ export const config = {
3
+ namespace: 'temporary-consents',
4
+ taskQueue: 'async',
5
+ sourceMap: true,
6
+ minifyJs: false,
7
+ extras: {
8
+ experimentalImportInjection: true
9
+ },
10
+ plugins: [sass()],
11
+ outputTargets: [
12
+ {
13
+ type: 'www',
14
+ serviceWorker: null // disable service workers
15
+ }
16
+ ]
17
+ };
@@ -0,0 +1,17 @@
1
+ import { sass } from "@stencil/sass";
2
+ export const config = {
3
+ namespace: 'temporary-consents',
4
+ taskQueue: 'async',
5
+ sourceMap: false,
6
+ minifyJs: true,
7
+ extras: {
8
+ experimentalImportInjection: true
9
+ },
10
+ plugins: [sass()],
11
+ outputTargets: [
12
+ {
13
+ type: 'dist',
14
+ esmLoaderPath: '../loader'
15
+ }
16
+ ]
17
+ };
File without changes
@@ -0,0 +1 @@
1
+ import{r as t,h as e}from"./p-e0f94cfb.js";const o=["en","hr"];let i={en:{title:"Participation conditions",description:"Important: Full verification is required in order to be able to use our entire offer. If verification is not completed, it is not possible to withdraw and the betting account will be locked in {daysUntilLockout} days.",declineButton:"Decline and log out",acceptButton:"Accept",loading:"Please wait, loading..."},hr:{title:"Uvjeti sudjelovanja",description:"Važno: Potrebna je potpuna verifikacija kako biste mogli koristiti našu cjelokupnu ponudu. Ako potvrda nije dovršena, nije moguće podići i račun za klađenje bit će zaključan za {daysUntilLockout} dana.",declineButton:"Odbijte i odjavite se",acceptButton:"Prihvatiti",loading:"Molimo pričekajte, učitavanje..."},"es-mx":{title:"Condiciones de participación",description:"Importante: Una verificación completa es requerida para poder utilizar nuestra oferta. Si no se verifica, no será posible hacer retiros y la cuenta para realizar apuestas será bloqueada.",declineButton:"Declinar y salir",acceptButton:"Aceptar",Loading:"Espere por favor, Cargando..."},"pt-br":{title:"Condições de participação",description:"Importante: É necessária uma verificação completa para poder utilizar a nossa oferta. Se não for verificado, os saques não serão possíveis e a conta de apostas será bloqueada.",declineButton:"Recusar e sair",acceptButton:"Aceitar",Loading:"Espere, por favor, Carregando..."}};const n=(t,e,n)=>{const s=e;let a=i[void 0!==s&&o.includes(s)?s:"en"][t];if(void 0!==n)for(const[t,e]of Object.entries(n.values)){const o=new RegExp(`{${t}}`,"g");a=a.replace(o,e)}return a},s=class{constructor(e){t(this,e),this.isLoading=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))},this.endpoint=void 0,this.userId=void 0,this.sessionId=void 0,this.daysUntilLockout=void 0,this.lang=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.stylingAppends=!1}componentWillLoad(){const t=[];if(this.endpoint&&this.userId){const e=this.getConsents().then((t=>{this.temporaryAccountConsent=t.consents.some((t=>"temporaryaccountconsent"==t.tagCode))}));t.push(e)}if(this.translationUrl){const o=(e=this.translationUrl,new Promise((t=>{fetch(e).then((t=>t.json())).then((e=>{Object.keys(e).forEach((t=>{for(let o in e[t])i[t][o]=e[t][o]})),t(!0)}))})));t.push(o)}var e;return Promise.all(t)}componentDidRender(){!this.stylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}getConsents(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;e.append("X-SessionId",this.sessionId),e.append("Accept","application/json");const o={method:"GET",headers:e};return new Promise(((e,i)=>{this.isLoading=!0,fetch(t.href,o).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{console.error(t),i(t)})).finally((()=>{this.isLoading=!1}))}))}setConsents(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;e.append("X-SessionId",this.sessionId),e.append("Accept","application/json"),e.append("Content-Type","application/json");const o={method:"POST",headers:e,body:JSON.stringify({consents:[{tagCode:"temporaryaccountconsent",note:"",status:1}]})};return new Promise(((e,i)=>{this.isLoading=!0,fetch(t.href,o).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{console.error(t),i(t)})).finally((()=>{this.isLoading=!1}))}))}handleDecline(){window.postMessage({type:"TemporaryConsentsDeclined"},window.location.href)}handleAccept(){this.setConsents(),window.postMessage({type:"TemporaryConsentsAccepted"},window.location.href)}render(){if(this.temporaryAccountConsent)return this.isLoading?e("p",null,n("loading",this.lang)):e("div",{class:"TemporaryConsents",ref:t=>this.stylingContainer=t},e("h2",{class:"TemporaryConsentsTitle"}," ",n("title",this.lang)," "),e("p",{class:"TemporaryConsentsText"}," ",n("description",this.lang,{values:{daysUntilLockout:this.daysUntilLockout}})," "),e("div",{class:"TemporaryConsentsButtonsWrapper"},e("button",{class:"TemporaryConsentsButton TemporaryConsentsButtonDecline",onClick:()=>this.handleDecline()},n("declineButton",this.lang)),e("button",{class:"TemporaryConsentsButton TemporaryConsentsButtonAccept",onClick:this.handleAccept},n("acceptButton",this.lang))))}};s.style="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0}:host{display:block}.TemporaryConsents{max-width:500px;display:flex;gap:35px;flex-direction:column;box-shadow:0px 1px 5px 1px rgba(0, 0, 0, 0.1);padding:20px;font-family:sans-serif}.TemporaryConsentsTitle{text-align:left;font-family:inherit;color:#000;font-weight:400;font-size:18px;display:block;border-bottom:1px solid #000;padding-bottom:10px}.TemporaryConsentsText{font-family:inherit;font-weight:300;font-size:16px}.TemporaryConsentsButtonsWrapper{display:flex;justify-content:space-evenly;gap:50px}.TemporaryConsentsButton{font-family:inherit;font-weight:300;font-size:14px;border:none;padding:10px;min-width:150px;border-radius:4px}.TemporaryConsentsButtonDecline{background-color:transparent;border:1px solid #000}.TemporaryConsentsButtonAccept{color:white;background-color:#000}";export{s as temporary_consents}
@@ -0,0 +1,2 @@
1
+ var t=Object.defineProperty,e=new WeakMap,n=t=>e.get(t),o=(t,n)=>e.set(n.t=t,n),l=(t,e)=>e in t,r=(t,e)=>(0,console.error)(t,e),s=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={o:0,l:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},h=t=>Promise.resolve(t),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),m=!1,d=[],y=[],$=(t,e)=>n=>{t.push(n),m||(m=!0,e&&4&f.o?v(b):f.raf(b))},w=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){r(t)}t.length=0},b=()=>{w(d),w(y),(m=d.length>0)&&f.raf(b)},v=t=>h().then(t),S=$(y,!0),g={},j=t=>"object"==(t=typeof t)||"function"===t;function E(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{err:()=>k,map:()=>C,ok:()=>O,unwrap:()=>x,unwrapErr:()=>P});var O=t=>({isOk:!0,isErr:!1,value:t}),k=t=>({isOk:!1,isErr:!0,value:t});function C(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>O(t))):O(n)}if(t.isErr)return k(t.value);throw"should never get here"}var M,x=t=>{if(t.isOk)return t.value;throw t.value},P=t=>{if(t.isErr)return t.value;throw t.value},R=(t,e,...n)=>{let o=null,l=!1,r=!1;const s=[],i=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?i(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!j(o))&&(o+=""),l&&r?s[s.length-1].i+=o:s.push(l?A(null,o):o),r=l)};if(i(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}const c=A(t,null);return c.u=e,s.length>0&&(c.h=s),c},A=(t,e)=>({o:0,p:t,i:e,m:null,h:null,u:null}),T={},D=new WeakMap,H=t=>"sc-"+t.$,L=(t,e,n,o,r,s)=>{if(n!==o){let i=l(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,l=U(n),r=U(o);e.remove(...l.filter((t=>t&&!r.includes(t)))),e.add(...r.filter((t=>t&&!l.includes(t))))}else if("ref"===e)o&&o(t);else if(i||"o"!==e[0]||"n"!==e[1]){const l=j(o);if((i||l&&null!==o)&&!r)try{if(t.tagName.includes("-"))t[e]=o;else{const l=null==o?"":o;"list"===e?i=!1:null!=n&&t[e]==l||(t[e]=l)}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!i||4&s||r)&&!l&&t.setAttribute(e,o=!0===o?"":o)}else if(e="-"===e[2]?e.slice(3):l(u,c)?c.slice(2):c[2]+e.slice(3),n||o){const l=e.endsWith(W);e=e.replace(F,""),n&&f.rel(t,e,n,l),o&&f.ael(t,e,o,l)}}},N=/\s/,U=t=>t?t.split(N):[],W="Capture",F=RegExp(W+"$"),q=(t,e,n)=>{const o=11===e.m.nodeType&&e.m.host?e.m.host:e.m,l=t&&t.u||g,r=e.u||g;for(const t of G(Object.keys(l)))t in r||L(o,t,l[t],void 0,n,e.o);for(const t of G(Object.keys(r)))L(o,t,l[t],r[t],n,e.o)};function G(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var V=!1,_=(t,e,n)=>{const o=e.h[n];let l,r,s=0;if(null!==o.i)l=o.m=a.createTextNode(o.i);else if(l=o.m=a.createElement(o.p),q(null,o,V),l.getRootNode().querySelector("body"),o.h)for(s=0;s<o.h.length;++s)r=_(t,o,s),r&&l.appendChild(r);return l["s-hn"]=M,l},z=(t,e,n,o,l,r)=>{let s,i=t;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);l<=r;++l)o[l]&&(s=_(null,n,l),s&&(o[l].m=s,Q(i,s,e)))},B=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.m;K(e),t&&t.remove()}}},I=(t,e)=>t.p===e.p,J=(t,e,n=!1)=>{const o=e.m=t.m,l=t.h,r=e.h,s=e.i;null===s?(q(t,e,V),null!==l&&null!==r?((t,e,n,o,l=!1)=>{let r,s=0,i=0,c=e.length-1,u=e[0],a=e[c],f=o.length-1,h=o[0],p=o[f];for(;s<=c&&i<=f;)null==u?u=e[++s]:null==a?a=e[--c]:null==h?h=o[++i]:null==p?p=o[--f]:I(u,h)?(J(u,h,l),u=e[++s],h=o[++i]):I(a,p)?(J(a,p,l),a=e[--c],p=o[--f]):I(u,p)?(J(u,p,l),Q(t,u.m,a.m.nextSibling),u=e[++s],p=o[--f]):I(a,h)?(J(a,h,l),Q(t,a.m,u.m),a=e[--c],h=o[++i]):(r=_(e&&e[i],n,i),h=o[++i],r&&Q(u.m.parentNode,r,u.m));s>c?z(t,null==o[f+1]?null:o[f+1].m,n,o,i,f):i>f&&B(e,s,c)})(o,l,e,r,n):null!==r?(null!==t.i&&(o.textContent=""),z(o,null,e,r,0,r.length-1)):!n&&null!==l&&B(l,0,l.length-1)):t.i!==s&&(o.data=s)},K=t=>{t.u&&t.u.ref&&t.u.ref(null),t.h&&t.h.map(K)},Q=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),X=(t,e)=>{e&&!t.v&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.v=e)))},Y=(t,e)=>{if(t.o|=16,!(4&t.o))return X(t,t.S),S((()=>Z(t,e)));t.o|=512},Z=(t,e)=>{const n=t.t;if(!n)throw Error(`Can't render component <${t.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return e&&(o=st(n,"componentWillLoad")),tt(o,(()=>nt(t,n,e)))},tt=(t,e)=>et(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),et=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,nt=async(t,e,n)=>{var o;const l=t.$hostElement$,r=l["s-rc"];n&&(t=>{const e=t.j,n=t.$hostElement$,o=e.o,l=((t,e)=>{var n;const o=H(e),l=i.get(o);if(t=11===t.nodeType?t:a,l)if("string"==typeof l){let r,s=D.get(t=t.head||t);if(s||D.set(t,s=new Set),!s.has(o)){{r=a.createElement("style"),r.innerHTML=l;const o=null!=(n=f.O)?n:E(a);null!=o&&r.setAttribute("nonce",o),(!(1&e.o)||1&e.o&&"HEAD"!==t.nodeName)&&t.insertBefore(r,t.querySelector("link"))}4&e.o&&(r.innerHTML+=c),s&&s.add(o)}}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&2&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);ot(t,e,l,n),r&&(r.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>lt(t);0===e.length?n():(Promise.all(e).then(n),t.o|=4,e.length=0)}},ot=(t,e,n,o)=>{try{e=e.render(),t.o&=-17,t.o|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.j,r=t.k||A(null,null),s=(t=>t&&t.p===T)(e)?e:R(null,null,e);if(M=o.tagName,l.C&&(s.u=s.u||{},l.C.map((([t,e])=>s.u[e]=o[t]))),n&&s.u)for(const t of Object.keys(s.u))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.u[t]=o[t]);s.p=null,s.o|=4,t.k=s,s.m=r.m=o.shadowRoot||o,J(r,s,n)})(t,e,o)}catch(e){r(e,t.$hostElement$)}return null},lt=t=>{const e=t.$hostElement$,n=t.S;st(t.t,"componentDidRender"),64&t.o||(t.o|=64,it(e),t.M(e),n||rt()),t.v&&(t.v(),t.v=void 0),512&t.o&&v((()=>Y(t,!1))),t.o&=-517},rt=()=>{it(a.documentElement),v((()=>(t=>{const e=f.ce("appload",{detail:{namespace:"temporary-consents"}});return t.dispatchEvent(e),e})(u)))},st=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){r(t)}},it=t=>t.classList.add("hydrated"),ct=(t,e,o)=>{var l,r;const s=t.prototype;if(e.P){const i=Object.entries(null!=(l=e.P)?l:{});if(i.map((([t,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(s,t,{get(){return((t,e)=>n(this).R.get(e))(0,t)},set(o){((t,e,o,l)=>{const r=n(t);if(!r)throw Error(`Couldn't find host element for "${l.$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const s=r.R.get(e),i=r.o,c=r.t;o=((t,e)=>null==t||j(t)?t:1&e?t+"":t)(o,l.P[e][0]),8&i&&void 0!==s||o===s||Number.isNaN(s)&&Number.isNaN(o)||(r.R.set(e,o),c&&2==(18&i)&&Y(r,!1))})(this,t,o,e)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;s.attributeChangedCallback=function(t,l,r){f.jmp((()=>{var i;const c=o.get(t);if(this.hasOwnProperty(c))r=this[c],delete this[c];else{if(s.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==r)return;if(null==c){const o=n(this),s=null==o?void 0:o.o;if(s&&!(8&s)&&128&s&&r!==l){const n=o.t,s=null==(i=e.A)?void 0:i[t];null==s||s.forEach((e=>{null!=n[e]&&n[e].call(n,r,l,t)}))}return}}this[c]=(null!==r||"boolean"!=typeof this[c])&&r}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=e.A)?r:{}),...i.filter((([t,e])=>15&e[0])).map((([t,n])=>{var l;const r=n[1]||t;return o.set(r,t),512&n[0]&&(null==(l=e.C)||l.push([t,r])),r}))]))}}return t},ut=(t,o={})=>{var l;const h=[],m=o.exclude||[],d=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),w=a.createElement("style"),b=[];let v,S=!0;Object.assign(f,o),f.l=new URL(o.resourcesUrl||"./",a.baseURI).href;let g=!1;if(t.map((t=>{t[1].map((o=>{const l={o:o[0],$:o[1],P:o[2],T:o[3]};4&l.o&&(g=!0),l.P=o[2],l.C=[];const c=l.$,u=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const o={o:0,$hostElement$:t,j:n,R:new Map};o.D=new Promise((t=>o.M=t)),t["s-p"]=[],t["s-rc"]=[],e.set(t,o)})(t=this,l),1&l.o)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${l.$}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),S?b.push(this):f.jmp((()=>(t=>{if(!(1&f.o)){const e=n(t),o=e.j,l=()=>{};if(1&e.o)(null==e?void 0:e.t)||(null==e?void 0:e.D)&&e.D.then((()=>{}));else{e.o|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){X(e,e.S=n);break}}o.P&&Object.entries(o.P).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.o)){if(e.o|=32,n.H){const t=(t=>{const e=t.$.replace(/-/g,"_"),n=t.H;if(!n)return;const o=s.get(n);return o?o[e]:import(`./${n}.entry.js`).then((t=>(s.set(n,t),t[e])),r)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(t&&"then"in t){const e=()=>{};o=await t,e()}else o=t;if(!o)throw Error(`Constructor for "${n.$}#${e.L}" was not found`);o.isProxied||(ct(o,n,2),o.isProxied=!0);const l=()=>{};e.o|=8;try{new o(e)}catch(t){r(t)}e.o&=-9,l()}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.o|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=H(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);p&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.o)),o()}}}const l=e.S,c=()=>Y(e,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()})(t,e,o)}l()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.o)){const t=n(this);(null==t?void 0:t.t)||(null==t?void 0:t.D)&&t.D.then((()=>{}))}})()))}componentOnReady(){return n(this).D}};l.H=t[0],m.includes(c)||d.get(c)||(h.push(c),d.define(c,ct(u,l,1)))}))})),h.length>0&&(g&&(w.textContent+=c),w.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",w.innerHTML.length)){w.setAttribute("data-styles","");const t=null!=(l=f.O)?l:E(a);null!=t&&w.setAttribute("nonce",t),y.insertBefore(w,$?$.nextSibling:y.firstChild)}S=!1,b.length?b.map((t=>t.connectedCallback())):f.jmp((()=>v=setTimeout(rt,30)))},at=t=>f.O=t;export{ut as b,R as h,h as p,o as r,at as s}
@@ -0,0 +1 @@
1
+ const o=()=>{};export{o as g}
@@ -0,0 +1 @@
1
+ import{p as t,b as n}from"./p-e0f94cfb.js";export{s as setNonce}from"./p-e0f94cfb.js";import{g as i}from"./p-e1255160.js";(()=>{const s=import.meta.url,n={};return""!==s&&(n.resourcesUrl=new URL(".",s).href),t(n)})().then((async s=>(await i(),n([["p-14388d71",[[1,"temporary-consents",{endpoint:[513],userId:[513,"user-id"],sessionId:[513,"session-id"],daysUntilLockout:[513,"days-until-lockout"],lang:[513],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],stylingAppends:[32]}]]]],s))));
@@ -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;
@@ -0,0 +1 @@
1
+ export { TemporaryConsents } from './temporary-consents';
@@ -0,0 +1,48 @@
1
+ import { Consent } from './temporary-consents.type';
2
+ export declare class TemporaryConsents {
3
+ /**
4
+ * The NWA endpoint
5
+ */
6
+ endpoint: string;
7
+ /**
8
+ * The NWA user id
9
+ */
10
+ userId: string;
11
+ /**
12
+ * The NWA session for the logged in user
13
+ */
14
+ sessionId: string;
15
+ /**
16
+ * The language of the integrator
17
+ */
18
+ daysUntilLockout: string;
19
+ /**
20
+ * The language of the integrator
21
+ */
22
+ lang: string;
23
+ /**
24
+ * Client custom styling via inline styles
25
+ */
26
+ clientStyling: string;
27
+ /**
28
+ * Client custom styling via url
29
+ */
30
+ clientStylingUrl: string;
31
+ /**
32
+ * Translation via url
33
+ */
34
+ translationUrl: string;
35
+ private stylingAppends;
36
+ isLoading: boolean;
37
+ temporaryAccountConsent: boolean;
38
+ private stylingContainer;
39
+ componentWillLoad(): Promise<any[]>;
40
+ componentDidRender(): void;
41
+ getConsents(): Promise<Consent>;
42
+ setConsents(): Promise<any>;
43
+ handleDecline(): void;
44
+ handleAccept(): void;
45
+ setClientStyling: () => void;
46
+ setClientStylingURL: () => void;
47
+ render(): any;
48
+ }
@@ -0,0 +1,6 @@
1
+ export interface Consent {
2
+ userID?: number;
3
+ tagCode: string;
4
+ consentTypeId?: number;
5
+ status: number;
6
+ }
@@ -0,0 +1,101 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /**
4
+ * This is an autogenerated file created by the Stencil compiler.
5
+ * It contains typing information for all components that exist in this project.
6
+ */
7
+ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ export namespace Components {
9
+ interface TemporaryConsents {
10
+ /**
11
+ * Client custom styling via inline styles
12
+ */
13
+ "clientStyling": string;
14
+ /**
15
+ * Client custom styling via url
16
+ */
17
+ "clientStylingUrl": string;
18
+ /**
19
+ * The language of the integrator
20
+ */
21
+ "daysUntilLockout": string;
22
+ /**
23
+ * The NWA endpoint
24
+ */
25
+ "endpoint": string;
26
+ /**
27
+ * The language of the integrator
28
+ */
29
+ "lang": string;
30
+ /**
31
+ * The NWA session for the logged in user
32
+ */
33
+ "sessionId": string;
34
+ /**
35
+ * Translation via url
36
+ */
37
+ "translationUrl": string;
38
+ /**
39
+ * The NWA user id
40
+ */
41
+ "userId": string;
42
+ }
43
+ }
44
+ declare global {
45
+ interface HTMLTemporaryConsentsElement extends Components.TemporaryConsents, HTMLStencilElement {
46
+ }
47
+ var HTMLTemporaryConsentsElement: {
48
+ prototype: HTMLTemporaryConsentsElement;
49
+ new (): HTMLTemporaryConsentsElement;
50
+ };
51
+ interface HTMLElementTagNameMap {
52
+ "temporary-consents": HTMLTemporaryConsentsElement;
53
+ }
54
+ }
55
+ declare namespace LocalJSX {
56
+ interface TemporaryConsents {
57
+ /**
58
+ * Client custom styling via inline styles
59
+ */
60
+ "clientStyling"?: string;
61
+ /**
62
+ * Client custom styling via url
63
+ */
64
+ "clientStylingUrl"?: string;
65
+ /**
66
+ * The language of the integrator
67
+ */
68
+ "daysUntilLockout"?: string;
69
+ /**
70
+ * The NWA endpoint
71
+ */
72
+ "endpoint": string;
73
+ /**
74
+ * The language of the integrator
75
+ */
76
+ "lang"?: string;
77
+ /**
78
+ * The NWA session for the logged in user
79
+ */
80
+ "sessionId": string;
81
+ /**
82
+ * Translation via url
83
+ */
84
+ "translationUrl"?: string;
85
+ /**
86
+ * The NWA user id
87
+ */
88
+ "userId": string;
89
+ }
90
+ interface IntrinsicElements {
91
+ "temporary-consents": TemporaryConsents;
92
+ }
93
+ }
94
+ export { LocalJSX as JSX };
95
+ declare module "@stencil/core" {
96
+ export namespace JSX {
97
+ interface IntrinsicElements {
98
+ "temporary-consents": LocalJSX.TemporaryConsents & JSXBase.HTMLAttributes<HTMLTemporaryConsentsElement>;
99
+ }
100
+ }
101
+ }
@@ -0,0 +1 @@
1
+ export * from './components';