starti.app 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export declare const App: IApp;
2
2
  declare type AppEvents = "appInForeground" | "navigatingPage";
3
3
  export interface IApp {
4
+ /** Request the user reviews the app. */
5
+ requestReview: () => void;
4
6
  /** Downloads the given file. */
5
7
  downloadFile: (url: string, fileName: string) => void;
6
8
  /** Are the site running inside starti.app? Returns false if the site is loaded in a normal browser. */
@@ -15,6 +17,14 @@ export interface IApp {
15
17
  deviceId(): Promise<string>;
16
18
  /** Opens the given URL in the default browser. */
17
19
  openExternalBrowser: (url: string) => void;
20
+ /** Show statusbar */
21
+ showStatusBar(): void;
22
+ /** Hide statusbar */
23
+ hideStatusBar(): void;
24
+ /** Disable screen rotation */
25
+ disableScreenRotation(): void;
26
+ /** Enable screen rotation */
27
+ enableScreenRotation(): void;
18
28
  /** Listen for events */
19
29
  addEventListener(type: AppEvents, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
20
30
  /** Remove event listener */
package/dist/app.js CHANGED
@@ -19,7 +19,7 @@ exports.App = new class extends EventTarget {
19
19
  this.dispatchEvent(new CustomEvent('appInForeground'));
20
20
  }
21
21
  openExternalBrowser(url) {
22
- AppIntegration.openExternalBrowser(url);
22
+ AppIntegration.openBrowser(url);
23
23
  }
24
24
  downloadFile(url, fileName) {
25
25
  AppIntegration.download(url, fileName);
@@ -30,8 +30,8 @@ exports.App = new class extends EventTarget {
30
30
  AppIntegration.brandId();
31
31
  });
32
32
  }
33
- brandIdResult(result) {
34
- this.resolveBrandId(result);
33
+ requestReview() {
34
+ AppIntegration.requestReview();
35
35
  }
36
36
  deviceId() {
37
37
  return new Promise((resolve, reject) => {
@@ -39,18 +39,33 @@ exports.App = new class extends EventTarget {
39
39
  AppIntegration.deviceId();
40
40
  });
41
41
  }
42
- deviceIdResult(result) {
43
- this.resolveDeviceId(result);
44
- }
45
42
  version() {
46
43
  return new Promise((resolve, reject) => {
47
44
  this.resolveVersion = resolve;
48
45
  AppIntegration.version();
49
46
  });
50
47
  }
48
+ showStatusBar() {
49
+ AppIntegration.showStatusBar();
50
+ }
51
+ hideStatusBar() {
52
+ AppIntegration.hideStatusBar();
53
+ }
54
+ disableScreenRotation() {
55
+ AppIntegration.disableScreenRotation();
56
+ }
57
+ enableScreenRotation() {
58
+ AppIntegration.enableScreenRotation();
59
+ }
60
+ brandIdResult(result) {
61
+ this.resolveBrandId(result);
62
+ }
51
63
  versionResult(result) {
52
64
  this.resolveVersion(result);
53
65
  }
66
+ deviceIdResult(result) {
67
+ this.resolveDeviceId(result);
68
+ }
54
69
  navigatingPageEvent(result) {
55
70
  this.dispatchEvent(new CustomEvent('navigatingPage', { detail: result }));
56
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starti.app",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Use this package for easy communication with the starti.app API.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/umd/main.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,(()=>(()=>{"use strict";var e={752:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.App=void 0,t.App=new class extends EventTarget{constructor(){super(...arguments),this.startiappIsLoaded=!1}setStartiappIsLoaded(){this.startiappIsLoaded=!0}isStartiappLoaded(){return this.startiappIsLoaded}setAppUrl(e){AppIntegration.setAppUrl(e)}appInForegroundEventRecievedEvent(){this.dispatchEvent(new CustomEvent("appInForeground"))}openExternalBrowser(e){AppIntegration.openExternalBrowser(e)}downloadFile(e,t){AppIntegration.download(e,t)}brandId(){return new Promise(((e,t)=>{this.resolveBrandId=e,AppIntegration.brandId()}))}brandIdResult(e){this.resolveBrandId(e)}deviceId(){return new Promise(((e,t)=>{this.resolveDeviceId=e,AppIntegration.deviceId()}))}deviceIdResult(e){this.resolveDeviceId(e)}version(){return new Promise(((e,t)=>{this.resolveVersion=e,AppIntegration.version()}))}versionResult(e){this.resolveVersion(e)}navigatingPageEvent(e){this.dispatchEvent(new CustomEvent("navigatingPage",{detail:e}))}}},1:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Biometrics=void 0,t.Biometrics=new class extends EventTarget{constructor(){super(...arguments),this.defaultScanTitle="Prove you have fingers!",this.defaultScanReason="Can't let you in if you don't."}scan(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((i,n)=>{this.resolveScan=i;try{if(!BiometricsIntegration)return void n("Biometrics virker kun i starti.app");BiometricsIntegration.startScanning(e,t)}catch(e){n(e)}}))}startScanningResult(e){this.resolveScan(e)}getAuthenticationType(){return new Promise(((e,t)=>{this.resolveAuthType=e;try{if(!BiometricsIntegration)return void t("Biometrics virker kun i starti.app");BiometricsIntegration.getAuthenticationType()}catch(e){t(e)}}))}getAuthenticationTypeResult(e){this.resolveAuthType(e)}setSecuredContent(e){if(!BiometricsIntegration)throw new Error("Biometrics virker kun i starti.app");BiometricsIntegration.setSecuredContent(JSON.stringify(e))}getSecuredContent(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((i,n)=>{this.resolveGetContent=i;try{if(!BiometricsIntegration)return void n("Biometrics virker kun i starti.app");BiometricsIntegration.getSecuredContent(e,t)}catch(e){n(e)}}))}getSecuredContentResult(e){this.resolveGetContent(JSON.parse(e))}hasSecureContent(){return new Promise(((e,t)=>{this.resolveHasSecureContent=e;try{if(!BiometricsIntegration)return void t("Biometrics virker kun i starti.app");BiometricsIntegration.hasSecuredContent()}catch(e){t(e)}}))}hasSecureContentResult(e){this.resolveHasSecureContent(e)}removeSecuredContent(){if(!BiometricsIntegration)throw new Error("Biometrics virker kun i starti.app");BiometricsIntegration.removeSecuredContent()}}},495:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientUser=void 0;const r=i(607),s=i(913);t.ClientUser=new class extends EventTarget{registerId(e){return n(this,void 0,void 0,(function*(){const t=yield r.default.App.brandId(),i=yield r.default.App.deviceId(),n={brandId:t,clientUserId:e,deviceId:i};(yield fetch(s.baseUrl+"/ClientUser-registerId",{body:JSON.stringify(n)})).ok||console.warn("Failed to register logged in client user",e,n)}))}}},913:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baseUrl=void 0,t.baseUrl="https://europe-west3-startiapp-test.cloudfunctions.net"},607:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=i(752),r=i(1),s=i(495),o=i(983),a=i(681),c=i(952),u=window;u.appIntegrationsAreReady=()=>{n.App.setStartiappIsLoaded(),d.dispatchEvent(new CustomEvent("integrationsAreReady"))},u.App=n.App,u.User=s.ClientUser,u.QrScanner=c.QrScanner,u.PushNotification=a.PushNotification,u.NFC=o.NFC,u.Biometrics=r.Biometrics,u.appErrorEvent=e=>{d.dispatchEvent(new CustomEvent("appError",{detail:e}))};const d=new class extends EventTarget{constructor(){super(...arguments),this.App=n.App,this.Biometrics=r.Biometrics,this.User=s.ClientUser,this.NfcScanner=o.NFC,this.PushNotification=a.PushNotification,this.QrScanner=c.QrScanner}initialize(){if(void 0===AppIntegration)throw new Error("The starti.app API integration is not available.");n.App.isStartiappLoaded()&&AppIntegration.webAppIsReady()}addEventListener(e,t,i){super.addEventListener(e,t,i)}removeEventListener(e,t,i){super.removeEventListener(e,t,i)}};t.default=d,u.startiapp=d},983:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NFC=void 0,t.NFC=new class extends EventTarget{isNFCSupported(){return new Promise(((e,t)=>{this.resolveNFCSupported=e;try{if(!NFCIntegration)return void t("NFC virker kun i starti.app");NFCIntegration.isNFCSupported()}catch(e){t(e)}}))}isNFCSupportedResult(e){this.resolveNFCSupported(e)}startNFCReader(){return new Promise(((e,t)=>{this.resolveStartNFCReader=e;try{if(!NFCIntegration)return void t("NFC virker kun i starti.app");NFCIntegration.initNFC()}catch(e){t(e)}}))}startNFCReaderResult(e){this.resolveStartNFCReader(e)}stopNFCReader(){return new Promise(((e,t)=>{this.resolveStopNFCReader=e;try{if(!NFCIntegration)return void t("NFC virker kun i starti.app");NFCIntegration.stopListening()}catch(e){t(e)}}))}stopListeningResult(e){this.resolveStopNFCReader(e)}nfcTagResultRecievedEvent(e){const t=new CustomEvent("nfcTagScanned",{detail:e});this.dispatchEvent(t)}}},681:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PushNotification=void 0;const r=i(913),s=i(607);t.PushNotification=new class extends EventTarget{requestAccess(){return n(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.resolveRequestAccess=e,PushNotificationIntegration.requestAccess()}))}))}requestAccessResult(e){this.resolveRequestAccess(e)}initialize(){if(!PushNotificationIntegration)throw new Error("PushNotificationIntegration is not available");return new Promise(((e,t)=>{this.resolveInitialize=e,PushNotificationIntegration.initialize()}))}initializeResult(e){this.resolveInitialize(e)}getLastPublishedToken(){return new Promise(((e,t)=>{this.resolveString=e,PushNotificationIntegration.getLastPublishedToken()}))}getFCMToken(){return new Promise(((e,t)=>{this.resolveFCMToken=e,PushNotificationIntegration.getFCMToken()}))}getFCMTokenResult(e){this.resolveFCMToken(e)}getLastPublishedTokenResult(e){this.resolveString(e)}tokenReceivedEvent(e){this.dispatchEvent(new CustomEvent("tokenReceived",{detail:e}))}notificationReceivedEvent(e){this.dispatchEvent(new CustomEvent("notificationReceived",{detail:e}))}subscribeToTopics(e){return n(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationSubscribeToTopics(e);const t=yield this.getLastPublishedToken(),i=yield s.default.App.brandId(),n=yield s.default.App.deviceId(),o=[];e.forEach((e=>{const s={brand:i,topic:e,token:t,deviceId:n},a=fetch(r.baseUrl+"/PushNotification-subscribeToTopic",{body:JSON.stringify(s)});o.push(a)})),(yield Promise.all(o)).forEach(((t,i)=>{t.ok||console.warn("Failed to sign up to topic",i,e[i])}))}))}unsubscribeFromTopics(e){return n(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationTopicsUnsubscribe(e);const t=yield this.getLastPublishedToken(),i=yield s.default.App.brandId(),n=yield s.default.App.deviceId(),o=[];e.forEach((e=>{const s={brand:i,topic:e,token:t,deviceId:n},a=fetch(r.baseUrl+"/PushNotification-unSubscribeFromTopic",{body:JSON.stringify(s)});o.push(a)})),(yield Promise.all(o)).forEach(((t,i)=>{t.ok||console.warn("Failed to unsubscribe from topic",i,e[i])}))}))}firebasePushNotificationTopicsUnsubscribeResult(e){}firebasePushNotificationSubscribeToTopicsResult(e){}}},952:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QrScanner=void 0,t.QrScanner=new class extends EventTarget{scan(){return new Promise(((e,t)=>{this.resolveScan=e;try{if(!QrScannerIntegration)return void e("Scanner virker kun i starti.app");QrScannerIntegration.startQrCodeScanner()}catch(e){t(e)}}))}qrResultRecievedEvent(e){this.resolveScan(e)}isCameraAccessGranted(){return new Promise(((e,t)=>{this.resolveCameraAccessGranted=e;try{if(!QrScannerIntegration)return void t("Scanner virker kun i starti.app");QrScannerIntegration.isCameraAccessGranted()}catch(e){t(e)}}))}isCameraAccessGrantedResult(e){this.resolveCameraAccessGranted(e)}requestCameraAccess(){return new Promise(((e,t)=>{this.resolveRequestCameraAccess=e;try{if(!QrScannerIntegration)return void t("Scanner virker kun i starti.app");QrScannerIntegration.requestCameraAccess()}catch(e){t(e)}}))}requestCameraAccessResult(e){this.resolveRequestCameraAccess(e)}}}},t={};return function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}(607)})()));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,(()=>(()=>{"use strict";var e={752:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.App=void 0,t.App=new class extends EventTarget{constructor(){super(...arguments),this.startiappIsLoaded=!1}setStartiappIsLoaded(){this.startiappIsLoaded=!0}isStartiappLoaded(){return this.startiappIsLoaded}setAppUrl(e){AppIntegration.setAppUrl(e)}appInForegroundEventRecievedEvent(){this.dispatchEvent(new CustomEvent("appInForeground"))}openExternalBrowser(e){AppIntegration.openBrowser(e)}downloadFile(e,t){AppIntegration.download(e,t)}brandId(){return new Promise(((e,t)=>{this.resolveBrandId=e,AppIntegration.brandId()}))}requestReview(){AppIntegration.requestReview()}deviceId(){return new Promise(((e,t)=>{this.resolveDeviceId=e,AppIntegration.deviceId()}))}version(){return new Promise(((e,t)=>{this.resolveVersion=e,AppIntegration.version()}))}showStatusBar(){AppIntegration.showStatusBar()}hideStatusBar(){AppIntegration.hideStatusBar()}disableScreenRotation(){AppIntegration.disableScreenRotation()}enableScreenRotation(){AppIntegration.enableScreenRotation()}brandIdResult(e){this.resolveBrandId(e)}versionResult(e){this.resolveVersion(e)}deviceIdResult(e){this.resolveDeviceId(e)}navigatingPageEvent(e){this.dispatchEvent(new CustomEvent("navigatingPage",{detail:e}))}}},1:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Biometrics=void 0,t.Biometrics=new class extends EventTarget{constructor(){super(...arguments),this.defaultScanTitle="Prove you have fingers!",this.defaultScanReason="Can't let you in if you don't."}scan(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((i,n)=>{this.resolveScan=i;try{if(!BiometricsIntegration)return void n("Biometrics virker kun i starti.app");BiometricsIntegration.startScanning(e,t)}catch(e){n(e)}}))}startScanningResult(e){this.resolveScan(e)}getAuthenticationType(){return new Promise(((e,t)=>{this.resolveAuthType=e;try{if(!BiometricsIntegration)return void t("Biometrics virker kun i starti.app");BiometricsIntegration.getAuthenticationType()}catch(e){t(e)}}))}getAuthenticationTypeResult(e){this.resolveAuthType(e)}setSecuredContent(e){if(!BiometricsIntegration)throw new Error("Biometrics virker kun i starti.app");BiometricsIntegration.setSecuredContent(JSON.stringify(e))}getSecuredContent(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((i,n)=>{this.resolveGetContent=i;try{if(!BiometricsIntegration)return void n("Biometrics virker kun i starti.app");BiometricsIntegration.getSecuredContent(e,t)}catch(e){n(e)}}))}getSecuredContentResult(e){this.resolveGetContent(JSON.parse(e))}hasSecureContent(){return new Promise(((e,t)=>{this.resolveHasSecureContent=e;try{if(!BiometricsIntegration)return void t("Biometrics virker kun i starti.app");BiometricsIntegration.hasSecuredContent()}catch(e){t(e)}}))}hasSecureContentResult(e){this.resolveHasSecureContent(e)}removeSecuredContent(){if(!BiometricsIntegration)throw new Error("Biometrics virker kun i starti.app");BiometricsIntegration.removeSecuredContent()}}},495:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientUser=void 0;const r=i(607),s=i(913);t.ClientUser=new class extends EventTarget{registerId(e){return n(this,void 0,void 0,(function*(){const t=yield r.default.App.brandId(),i=yield r.default.App.deviceId(),n={brandId:t,clientUserId:e,deviceId:i};(yield fetch(s.baseUrl+"/ClientUser-registerId",{body:JSON.stringify(n)})).ok||console.warn("Failed to register logged in client user",e,n)}))}}},913:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baseUrl=void 0,t.baseUrl="https://europe-west3-startiapp-test.cloudfunctions.net"},607:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=i(752),r=i(1),s=i(495),o=i(983),a=i(681),c=i(952),u=window;u.appIntegrationsAreReady=()=>{n.App.setStartiappIsLoaded(),d.dispatchEvent(new CustomEvent("integrationsAreReady"))},u.App=n.App,u.User=s.ClientUser,u.QrScanner=c.QrScanner,u.PushNotification=a.PushNotification,u.NFC=o.NFC,u.Biometrics=r.Biometrics,u.appErrorEvent=e=>{d.dispatchEvent(new CustomEvent("appError",{detail:e}))};const d=new class extends EventTarget{constructor(){super(...arguments),this.App=n.App,this.Biometrics=r.Biometrics,this.User=s.ClientUser,this.NfcScanner=o.NFC,this.PushNotification=a.PushNotification,this.QrScanner=c.QrScanner}initialize(){if(void 0===AppIntegration)throw new Error("The starti.app API integration is not available.");n.App.isStartiappLoaded()&&AppIntegration.webAppIsReady()}addEventListener(e,t,i){super.addEventListener(e,t,i)}removeEventListener(e,t,i){super.removeEventListener(e,t,i)}};t.default=d,u.startiapp=d},983:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NFC=void 0,t.NFC=new class extends EventTarget{isNFCSupported(){return new Promise(((e,t)=>{this.resolveNFCSupported=e;try{if(!NFCIntegration)return void t("NFC virker kun i starti.app");NFCIntegration.isNFCSupported()}catch(e){t(e)}}))}isNFCSupportedResult(e){this.resolveNFCSupported(e)}startNFCReader(){return new Promise(((e,t)=>{this.resolveStartNFCReader=e;try{if(!NFCIntegration)return void t("NFC virker kun i starti.app");NFCIntegration.initNFC()}catch(e){t(e)}}))}startNFCReaderResult(e){this.resolveStartNFCReader(e)}stopNFCReader(){return new Promise(((e,t)=>{this.resolveStopNFCReader=e;try{if(!NFCIntegration)return void t("NFC virker kun i starti.app");NFCIntegration.stopListening()}catch(e){t(e)}}))}stopListeningResult(e){this.resolveStopNFCReader(e)}nfcTagResultRecievedEvent(e){const t=new CustomEvent("nfcTagScanned",{detail:e});this.dispatchEvent(t)}}},681:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PushNotification=void 0;const r=i(913),s=i(607);t.PushNotification=new class extends EventTarget{requestAccess(){return n(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.resolveRequestAccess=e,PushNotificationIntegration.requestAccess()}))}))}requestAccessResult(e){this.resolveRequestAccess(e)}initialize(){if(!PushNotificationIntegration)throw new Error("PushNotificationIntegration is not available");return new Promise(((e,t)=>{this.resolveInitialize=e,PushNotificationIntegration.initialize()}))}initializeResult(e){this.resolveInitialize(e)}getLastPublishedToken(){return new Promise(((e,t)=>{this.resolveString=e,PushNotificationIntegration.getLastPublishedToken()}))}getFCMToken(){return new Promise(((e,t)=>{this.resolveFCMToken=e,PushNotificationIntegration.getFCMToken()}))}getFCMTokenResult(e){this.resolveFCMToken(e)}getLastPublishedTokenResult(e){this.resolveString(e)}tokenReceivedEvent(e){this.dispatchEvent(new CustomEvent("tokenReceived",{detail:e}))}notificationReceivedEvent(e){this.dispatchEvent(new CustomEvent("notificationReceived",{detail:e}))}subscribeToTopics(e){return n(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationSubscribeToTopics(e);const t=yield this.getLastPublishedToken(),i=yield s.default.App.brandId(),n=yield s.default.App.deviceId(),o=[];e.forEach((e=>{const s={brand:i,topic:e,token:t,deviceId:n},a=fetch(r.baseUrl+"/PushNotification-subscribeToTopic",{body:JSON.stringify(s)});o.push(a)})),(yield Promise.all(o)).forEach(((t,i)=>{t.ok||console.warn("Failed to sign up to topic",i,e[i])}))}))}unsubscribeFromTopics(e){return n(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationTopicsUnsubscribe(e);const t=yield this.getLastPublishedToken(),i=yield s.default.App.brandId(),n=yield s.default.App.deviceId(),o=[];e.forEach((e=>{const s={brand:i,topic:e,token:t,deviceId:n},a=fetch(r.baseUrl+"/PushNotification-unSubscribeFromTopic",{body:JSON.stringify(s)});o.push(a)})),(yield Promise.all(o)).forEach(((t,i)=>{t.ok||console.warn("Failed to unsubscribe from topic",i,e[i])}))}))}firebasePushNotificationTopicsUnsubscribeResult(e){}firebasePushNotificationSubscribeToTopicsResult(e){}}},952:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QrScanner=void 0,t.QrScanner=new class extends EventTarget{scan(){return new Promise(((e,t)=>{this.resolveScan=e;try{if(!QrScannerIntegration)return void e("Scanner virker kun i starti.app");QrScannerIntegration.startQrCodeScanner()}catch(e){t(e)}}))}qrResultRecievedEvent(e){this.resolveScan(e)}isCameraAccessGranted(){return new Promise(((e,t)=>{this.resolveCameraAccessGranted=e;try{if(!QrScannerIntegration)return void t("Scanner virker kun i starti.app");QrScannerIntegration.isCameraAccessGranted()}catch(e){t(e)}}))}isCameraAccessGrantedResult(e){this.resolveCameraAccessGranted(e)}requestCameraAccess(){return new Promise(((e,t)=>{this.resolveRequestCameraAccess=e;try{if(!QrScannerIntegration)return void t("Scanner virker kun i starti.app");QrScannerIntegration.requestCameraAccess()}catch(e){t(e)}}))}requestCameraAccessResult(e){this.resolveRequestCameraAccess(e)}}}},t={};return function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}(607)})()));