@everymatrix/temporary-consents 1.12.1

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 (47) hide show
  1. package/dist/cjs/index-51051de1.js +1163 -0
  2. package/dist/cjs/index.cjs.js +2 -0
  3. package/dist/cjs/loader.cjs.js +21 -0
  4. package/dist/cjs/temporary-consents.cjs.entry.js +180 -0
  5. package/dist/cjs/temporary-consents.cjs.js +19 -0
  6. package/dist/collection/collection-manifest.json +12 -0
  7. package/dist/collection/components/temporary-consents/temporary-consents.css +58 -0
  8. package/dist/collection/components/temporary-consents/temporary-consents.js +296 -0
  9. package/dist/collection/components/temporary-consents/temporary-consents.type.js +1 -0
  10. package/dist/collection/index.js +1 -0
  11. package/dist/collection/utils/locale.utils.js +36 -0
  12. package/dist/components/index.d.ts +26 -0
  13. package/dist/components/index.js +1 -0
  14. package/dist/components/temporary-consents.d.ts +11 -0
  15. package/dist/components/temporary-consents.js +204 -0
  16. package/dist/esm/index-0f95c245.js +1138 -0
  17. package/dist/esm/index.js +1 -0
  18. package/dist/esm/loader.js +17 -0
  19. package/dist/esm/polyfills/core-js.js +11 -0
  20. package/dist/esm/polyfills/css-shim.js +1 -0
  21. package/dist/esm/polyfills/dom.js +79 -0
  22. package/dist/esm/polyfills/es5-html-element.js +1 -0
  23. package/dist/esm/polyfills/index.js +34 -0
  24. package/dist/esm/polyfills/system.js +6 -0
  25. package/dist/esm/temporary-consents.entry.js +176 -0
  26. package/dist/esm/temporary-consents.js +17 -0
  27. package/dist/index.cjs.js +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/stencil.config.js +22 -0
  30. package/dist/temporary-consents/index.esm.js +0 -0
  31. package/dist/temporary-consents/p-c2ffe442.entry.js +1 -0
  32. package/dist/temporary-consents/p-c8fa79f6.js +1 -0
  33. package/dist/temporary-consents/temporary-consents.esm.js +1 -0
  34. package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/temporary-consents/.stencil/packages/temporary-consents/stencil.config.d.ts +2 -0
  35. package/dist/types/components/temporary-consents/temporary-consents.d.ts +48 -0
  36. package/dist/types/components/temporary-consents/temporary-consents.type.d.ts +6 -0
  37. package/dist/types/components.d.ts +101 -0
  38. package/dist/types/index.d.ts +1 -0
  39. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  40. package/dist/types/utils/locale.utils.d.ts +6 -0
  41. package/loader/cdn.js +3 -0
  42. package/loader/index.cjs.js +3 -0
  43. package/loader/index.d.ts +12 -0
  44. package/loader/index.es2017.js +3 -0
  45. package/loader/index.js +4 -0
  46. package/loader/package.json +10 -0
  47. package/package.json +19 -0
@@ -0,0 +1,176 @@
1
+ import { r as registerInstance, h } from './index-0f95c245.js';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const SUPPORTED_LANGUAGES = ['en'];
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
+ };
14
+ const getTranslations = (url) => {
15
+ return new Promise((resolve) => {
16
+ fetch(url)
17
+ .then((res) => res.json())
18
+ .then((data) => {
19
+ Object.keys(data).forEach((item) => {
20
+ for (let key in data[item]) {
21
+ TRANSLATIONS[item][key] = data[item][key];
22
+ }
23
+ });
24
+ resolve(true);
25
+ });
26
+ });
27
+ };
28
+ const translate = (key, customLang, values) => {
29
+ const lang = customLang;
30
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
31
+ if (values !== undefined) {
32
+ for (const [key, value] of Object.entries(values.values)) {
33
+ const regex = new RegExp(`{${key}}`, 'g');
34
+ translation = translation.replace(regex, value);
35
+ }
36
+ }
37
+ return translation;
38
+ };
39
+
40
+ 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}";
41
+
42
+ const TemporaryConsents = class {
43
+ constructor(hostRef) {
44
+ registerInstance(this, hostRef);
45
+ /**
46
+ * Client custom styling via inline styles
47
+ */
48
+ this.clientStyling = '';
49
+ /**
50
+ * Client custom styling via url
51
+ */
52
+ this.clientStylingUrl = '';
53
+ /**
54
+ * Translation via url
55
+ */
56
+ this.translationUrl = '';
57
+ this.stylingAppends = false;
58
+ this.isLoading = false;
59
+ this.setClientStyling = () => {
60
+ let sheet = document.createElement('style');
61
+ sheet.innerHTML = this.clientStyling;
62
+ this.stylingContainer.prepend(sheet);
63
+ };
64
+ this.setClientStylingURL = () => {
65
+ let url = new URL(this.clientStylingUrl);
66
+ let cssFile = document.createElement('style');
67
+ fetch(url.href)
68
+ .then((res) => res.text())
69
+ .then((data) => {
70
+ cssFile.innerHTML = data;
71
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
72
+ })
73
+ .catch((err) => {
74
+ console.log('error ', err);
75
+ });
76
+ };
77
+ }
78
+ componentWillLoad() {
79
+ const promises = [];
80
+ if (this.endpoint && this.userId) {
81
+ const consentsPromise = this.getConsents().then((consents) => {
82
+ this.temporaryAccountConsent = consents.consents.some((consent) => consent.tagCode == 'temporaryaccountconsent');
83
+ });
84
+ promises.push(consentsPromise);
85
+ }
86
+ if (this.translationUrl) {
87
+ const translationPromise = getTranslations(this.translationUrl);
88
+ promises.push(translationPromise);
89
+ }
90
+ return Promise.all(promises);
91
+ }
92
+ componentDidRender() {
93
+ // start custom styling area
94
+ if (!this.stylingAppends && this.stylingContainer) {
95
+ if (this.clientStyling)
96
+ this.setClientStyling();
97
+ if (this.clientStylingUrl)
98
+ this.setClientStylingURL();
99
+ this.stylingAppends = true;
100
+ }
101
+ // end custom styling area
102
+ }
103
+ getConsents() {
104
+ const url = new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);
105
+ const headers = new Headers();
106
+ headers.append('X-SessionId', this.sessionId);
107
+ headers.append('Accept', 'application/json');
108
+ const options = {
109
+ method: 'GET',
110
+ headers
111
+ };
112
+ return new Promise((resolve, reject) => {
113
+ this.isLoading = true;
114
+ fetch(url.href, options)
115
+ .then((res) => res.json())
116
+ .then((consents) => {
117
+ resolve(consents);
118
+ }).catch((err) => {
119
+ console.error(err);
120
+ reject(err);
121
+ }).finally(() => {
122
+ this.isLoading = false;
123
+ });
124
+ });
125
+ }
126
+ setConsents() {
127
+ const url = new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);
128
+ const headers = new Headers();
129
+ headers.append('X-SessionId', this.sessionId);
130
+ headers.append('Accept', 'application/json');
131
+ headers.append('Content-Type', 'application/json');
132
+ const body = {
133
+ consents: [{
134
+ tagCode: 'temporaryaccountconsent',
135
+ note: '',
136
+ status: 1
137
+ }]
138
+ };
139
+ const options = {
140
+ method: 'POST',
141
+ headers,
142
+ body: JSON.stringify(body)
143
+ };
144
+ return new Promise((resolve, reject) => {
145
+ this.isLoading = true;
146
+ fetch(url.href, options)
147
+ .then((res) => res.json())
148
+ .then((res) => {
149
+ resolve(res);
150
+ }).catch((err) => {
151
+ console.error(err);
152
+ reject(err);
153
+ }).finally(() => {
154
+ this.isLoading = false;
155
+ });
156
+ });
157
+ }
158
+ handleDecline() {
159
+ window.postMessage({ type: 'TemporaryConsentsDeclined' }, window.location.href);
160
+ }
161
+ handleAccept() {
162
+ this.setConsents();
163
+ window.postMessage({ type: 'TemporaryConsentsAccepted' }, window.location.href);
164
+ }
165
+ render() {
166
+ if (this.temporaryAccountConsent) {
167
+ if (this.isLoading) {
168
+ return h("p", null, translate('loading', this.lang));
169
+ }
170
+ 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))));
171
+ }
172
+ }
173
+ };
174
+ TemporaryConsents.style = temporaryConsentsCss;
175
+
176
+ export { TemporaryConsents as temporary_consents };
@@ -0,0 +1,17 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-0f95c245.js';
2
+
3
+ /*
4
+ Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
5
+ */
6
+ const patchBrowser = () => {
7
+ const importMeta = import.meta.url;
8
+ const opts = {};
9
+ if (importMeta !== '') {
10
+ opts.resourcesUrl = new URL('.', importMeta).href;
11
+ }
12
+ return promiseResolve(opts);
13
+ };
14
+
15
+ patchBrowser().then(options => {
16
+ 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);
17
+ });
@@ -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,22 @@
1
+ import { sass } from '@stencil/sass';
2
+ export const config = {
3
+ namespace: 'temporary-consents',
4
+ taskQueue: 'async',
5
+ plugins: [sass()],
6
+ outputTargets: [
7
+ {
8
+ type: 'dist',
9
+ esmLoaderPath: '../loader',
10
+ },
11
+ {
12
+ type: 'dist-custom-elements',
13
+ },
14
+ {
15
+ type: 'docs-readme',
16
+ },
17
+ {
18
+ type: 'www',
19
+ serviceWorker: null, // disable service workers
20
+ },
21
+ ],
22
+ };
File without changes
@@ -0,0 +1 @@
1
+ import{r as t,h as e}from"./p-c8fa79f6.js";const o=["en"];let n={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..."}};const s=(t,e,s)=>{const i=e;let r=n[void 0!==i&&o.includes(i)?i:"en"][t];if(void 0!==s)for(const[t,e]of Object.entries(s.values)){const o=new RegExp(`{${t}}`,"g");r=r.replace(o,e)}return r},i=class{constructor(e){t(this,e),this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.stylingAppends=!1,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)}))}}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])n[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,n)=>{this.isLoading=!0,fetch(t.href,o).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{console.error(t),n(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,n)=>{this.isLoading=!0,fetch(t.href,o).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{console.error(t),n(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,s("loading",this.lang)):e("div",{class:"TemporaryConsents",ref:t=>this.stylingContainer=t},e("h2",{class:"TemporaryConsentsTitle"}," ",s("title",this.lang)," "),e("p",{class:"TemporaryConsentsText"}," ",s("description",this.lang,{values:{daysUntilLockout:this.daysUntilLockout}})," "),e("div",{class:"TemporaryConsentsButtonsWrapper"},e("button",{class:"TemporaryConsentsButton TemporaryConsentsButtonDecline",onClick:()=>this.handleDecline()},s("declineButton",this.lang)),e("button",{class:"TemporaryConsentsButton TemporaryConsentsButtonAccept",onClick:this.handleAccept},s("acceptButton",this.lang))))}};i.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{i as temporary_consents}
@@ -0,0 +1 @@
1
+ let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),c=new WeakMap,u=e=>"sc-"+e.o,a={},f=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?h(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=h(e,null);return c.u=t,r.length>0&&(c.$=r),c},h=(e,t)=>({t:0,h:e,i:t,m:null,$:null,u:null}),y={},d=(e,t,n,s,r,i)=>{if(n!==s){let c=H(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=p(n),o=p(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("ref"===t)s&&s(e);else if(c||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((c||l&&null!==s)&&!r)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?c=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||r)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):H(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},m=/\s/,p=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.u||a,r=t.u||a;for(l in o)l in r||d(s,l,o[l],void 0,n,t.t);for(l in r)d(s,l,o[l],r[l],n,t.t)},w=(t,n,l)=>{let o,r,i=n.$[l],c=0;if(null!==i.i)o=i.m=s.createTextNode(i.i);else if(o=i.m=s.createElement(i.h),b(null,i,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),i.$)for(c=0;c<i.$.length;++c)r=w(t,i,c),r&&o.appendChild(r);return o},S=(e,n,l,s,o,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=r;++o)s[o]&&(i=w(null,l,o),i&&(s[o].m=i,c.insertBefore(i,n)))},g=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,v(l),s.remove())},j=(e,t)=>e.h===t.h,M=(e,t)=>{const n=t.m=e.m,l=e.$,s=t.$,o=t.i;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,i=t.length-1,c=t[0],u=t[i],a=l.length-1,f=l[0],$=l[a];for(;o<=i&&r<=a;)null==c?c=t[++o]:null==u?u=t[--i]:null==f?f=l[++r]:null==$?$=l[--a]:j(c,f)?(M(c,f),c=t[++o],f=l[++r]):j(u,$)?(M(u,$),u=t[--i],$=l[--a]):j(c,$)?(M(c,$),e.insertBefore(c.m,u.m.nextSibling),c=t[++o],$=l[--a]):j(u,f)?(M(u,f),e.insertBefore(u.m,c.m),u=t[--i],f=l[++r]):(s=w(t&&t[r],n,r),f=l[++r],s&&c.m.parentNode.insertBefore(s,c.m));o>i?S(e,null==l[a+1]?null:l[a+1].m,n,l,r,a):r>a&&g(t,o,i)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},v=e=>{e.u&&e.u.ref&&e.u.ref(null),e.$&&e.$.map(v)},k=(e,t)=>{t&&!e.p&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.p=t)))},C=(e,t)=>{if(e.t|=16,!(4&e.t))return k(e,e.S),Y((()=>O(e,t)));e.t|=512},O=(e,t)=>{const n=e.g;let l;return t&&(l=N(n,"componentWillLoad")),R(l,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.j,l=t.t,o=((e,t)=>{let n=u(t),l=B.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=c.get(e=e.head||e);o||c.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);x(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>E(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},x=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.M,r=n.v||h(null,null),i=(e=>e&&e.h===y)(l)?l:$(null,null,l);t=s.tagName,o.k&&(i.u=i.u||{},o.k.map((([e,t])=>i.u[t]=s[e]))),i.h=null,i.t|=4,n.v=i,i.m=r.m=s.shadowRoot||s,e=s["s-sc"],M(r,i)})(n,l)}catch(e){V(e,n.j)}return null},E=e=>{const t=e.j,n=e.S;N(e.g,"componentDidRender"),64&e.t||(e.t|=64,T(t),e.C(t),n||L()),e.p&&(e.p(),e.p=void 0),512&e.t&&X((()=>C(e,!1))),e.t&=-517},L=()=>{T(s.documentElement),X((()=>(e=>{const t=o.ce("appload",{detail:{namespace:"temporary-consents"}});return e.dispatchEvent(t),t})(l)))},N=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){V(e)}},R=(e,t)=>e&&e.then?e.then(t):t(),T=e=>e.classList.add("hydrated"),W=(e,t,n)=>{if(t.O){const l=Object.entries(t.O),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>q(this).P.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=q(e),o=s.P.get(t),r=s.t,i=s.g;n=((e,t)=>null==e||f(e)?e:1&t?e+"":e)(n,l.O[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.P.set(t,n),i&&2==(18&r)&&C(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.k.push([e,s]),s}))}}return e},A=(e,t={})=>{const n=[],r=t.exclude||[],c=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),$=s.createElement("style"),h=[];let y,d=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],O:t[2],L:t[3]};l.O=t[2],l.k=[];const s=l.o,a=class extends HTMLElement{constructor(e){super(e),F(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),d?h.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=q(e),n=t.M,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){k(t,t.S=n);break}}n.O&&Object.entries(n.O).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=z(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(W(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){V(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=u(n);if(!B.has(t)){const l=()=>{};((e,t,n)=>{let l=B.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,B.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.S,r=()=>C(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>{}))}componentOnReady(){return q(this).N}};l.R=e[0],r.includes(s)||c.get(s)||(n.push(s),c.define(s,W(a,l,1)))}))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),a.insertBefore($,f?f.nextSibling:a.firstChild),d=!1,h.length?h.map((e=>e.connectedCallback())):o.jmp((()=>y=setTimeout(L,30)))},U=new WeakMap,q=e=>U.get(e),D=(e,t)=>U.set(t.g=e,t),F=(e,t)=>{const n={t:0,j:e,M:t,P:new Map};return n.N=new Promise((e=>n.C=e)),e["s-p"]=[],e["s-rc"]=[],U.set(e,n)},H=(e,t)=>t in e,V=(e,t)=>(0,console.error)(e,t),_=new Map,z=e=>{const t=e.o.replace(/-/g,"_"),n=e.R,l=_.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(_.set(n,e),e[t])),V)},B=new Map,G=[],I=[],J=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?X(Q):o.raf(Q))},K=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){V(e)}e.length=0},Q=()=>{K(G),K(I),(n=G.length>0)&&o.raf(Q)},X=e=>r().then(e),Y=J(I,!0);export{A as b,$ as h,r as p,D as r}
@@ -0,0 +1 @@
1
+ import{p as n,b as t}from"./p-c8fa79f6.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),n(s)})().then((n=>t([["p-c2ffe442",[[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]}]]]],n)));
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -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';