!function(){var t=Object.create,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=((o,r,c)=>(c=null!=o?t(s(o)):{},((t,s,o,r)=>{if(s&&"object"==typeof s||"function"==typeof s)for(var c,l=n(s),u=0,d=l.length;us[t]).bind(null,c),enumerable:!(r=i(s,c))||r.enumerable});return t})(e(c,"default",{value:o,enumerable:!0}),o)))(((t,e)=>()=>(e||(t((e={exports:{}}).exports,e,e.exports),t=null),e.exports))((t,e)=>{e.exports=function(t,e,s){"function"==typeof e&&(s=e,e={}),e||(e={});var a,o,r=e.prefix||"__jp",c=e.name||r+i++,l=e.param||"callback",u=null!=e.timeout?e.timeout:6e4,d=encodeURIComponent,h=document.getElementsByTagName("script")[0]||document.head;function g(){a.parentNode&&a.parentNode.removeChild(a),window[c]=n,o&&clearTimeout(o)}return u&&(o=setTimeout(function(){g(),s&&s(new Error("Timeout"))},u)),window[c]=function(t){g(),s&&s(null,t)},t=(t+=(~t.indexOf("?")?"&":"?")+l+"="+d(c)).replace("?&","?"),(a=document.createElement("script")).src=t,h.parentNode.insertBefore(a,h),function(){window[c]&&g()}};var i=0;function n(){}})()),r="Push",c="ChromePush",l="Email",u="SafariPush",d="SafariLegacyPush",h="FirefoxPush",g="chrome",p="edge",f="safari",w="firefox",m=[{t:"Opera",i:/(?:opera|opr|opios)/i,o:/(?:opera|opr|opios)[ /](\d+(?:\.\d+)?)/i},{t:"Facebook",i:/FBAN\//i,o:/FBAV\/(\d+(?:\.\d+)?)/i},{t:"Samsung Browser",i:/samsungbrowser/i,o:/samsungbrowser[ /](\d+(?:\.\d+)?)/i},{t:"Yandex Browser",i:/yabrowser/i,o:/yabrowser[ /](\d+(?:\.\d+)?)/i},{t:"Vivaldi",i:/vivaldi/i,o:/vivaldi[ /](\d+(?:\.\d+)?)/i},{t:"UC Browser",i:/ucbrowser/i,o:/ucbrowser[ /](\d+(?:\.\d+)?)/i},{t:"Microsoft Edge",i:/edg/i,o:/edg[ /](\d+(?:\.\d+)?)/i},{t:"Firefox",i:/firefox|iceweasel|fxios/i,o:/(?:firefox|iceweasel|fxios)[ /](\d+(?:\.\d+)?)/i},{t:"Chromium",i:/chromium/i,o:/chromium[ /](\d+(?:\.\d+)?)/i},{t:"Chrome",i:/chrome|crios|crmo/i,o:/(?:chrome|crios|crmo)[ /](\d+(?:\.\d+)?)/i},{t:"Safari",i:/safari|applewebkit/i,o:/version[ /](\d+(?:\.\d+)?)/i}];function b(t){for(const e of m)if(e.i.test(t)){const i=t.match(e.o)?.[1]??"";return{name:e.t,version:i}}return{name:"Unknown",version:""}}var _=t=>!/like android/i.test(t)&&/android/i.test(t),y=t=>t.match(/(iphone|ipod|ipad)/i)?.[1]?.toLowerCase()||"";function S(t=navigator.userAgent){const e=y(t);return/tablet/i.test(t)&&!/tablet pc/i.test(t)||"ipad"===e||_(t)&&!/[^-]mobi/i.test(t)||!/nexus\s*[0-6]\s*/i.test(t)&&/nexus\s*\d+/i.test(t)}function v(t=navigator.userAgent){if(S(t))return!1;const e=y(t);return/[^-]mobi/i.test(t)||"iphone"===e||"ipod"===e||_(t)}var O={Chrome:g,Chromium:g,Firefox:w,"Microsoft Edge":p,Safari:f};function I(){return O[b(navigator.userAgent).name]||"other"}var k=()=>{const t=b(navigator.userAgent).version;if(!t)return-1;const[e,i="0"]=t.split(".");return+`${e}.${i}`};function x(){const t=I(),e=k();return t===w&&e>=72||t===f&&e>=12.1}var C="160700",E=()=>"undefined"!=typeof window,P=()=>E()&&void 0!==window.safari,$=()=>"undefined"!=typeof navigator&&"serviceWorker"in navigator,T="Browser",A=()=>{if(!E()||null==window.safari?.pushNotification)return!1;const t=OneSignal?.config?.safariWebId;if(!t)return!1;if("undefined"==typeof PushSubscriptionOptions||!PushSubscriptionOptions.prototype.hasOwnProperty("applicationServerKey"))return!0;const{permission:e,deviceToken:i}=window.safari.pushNotification.permission(t);return"granted"===e&&null!=i},N="undefined"!=typeof PushSubscriptionOptions&&PushSubscriptionOptions.prototype.hasOwnProperty("applicationServerKey"),M=({action:t,legacy:e=!1}={})=>new URL(e?"https://onesignal.com/api/v1/":"https://api.onesignal.com/"),U=()=>I()===w?h:I()===f&&N&&!A()?u:A()?d:c;function D(){return String(k())}function L(){return navigator.platform}var F="set-alias",R="delete-alias",W="set-property",B="refresh-user",j="login-user",z="create-subscription",K="update-subscription",V="delete-subscription",q="transfer-subscription",H="custom-event",J="external_id",G="onesignal_id",Y=class extends Error{status;statusText;constructor(t,e){super("Registration of a Service Worker failed."),this.status=t,this.statusText=e}},Q=class extends Error{reason;constructor(t){let e;switch(t){case 1:e="Invalid email";break;case 0:e="Invalid sms";break;case 2:e="Invalid email & sms"}super(e),this.reason=t}},Z=new Error("Missing app ID"),X=new Error("Retry limit reached"),tt=new Error("Permission blocked"),et=new Error("AppID doesn't match existing apps"),it=new Error("Safari web platform must be enabled"),nt=t=>new Error(`Channel '${t}' already exists`),st=t=>new Error(`"${t}" is empty`),at=t=>new Error(`"${t}" is malformed`),ot=t=>new Error(`"${t}" is the wrong type`);function rt(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function ct(t,e){if(e&&e.allowNull&&null===t)return!0;if(e&&e.allowEmpty&&null==t)return!0;try{const i=new URL(t);return!e||!e.requireHttps||"https:"===i.protocol}catch{return!1}}function lt(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(t)}function ut(t){return new Promise(e=>setTimeout(e,t))}function dt(){return location.origin}var ht=()=>{const t=(navigator.language||"en").toLowerCase().replace(/-[a-z0-9]-.*/,"").split("-");return"zh"==t[0]?t.includes("hans")?"zh-Hans":t.includes("hant")||t.includes("hk")||t.includes("mo")||t.includes("tw")?"zh-Hant":"zh-Hans":t[0].substring(0,2)},gt=class t{static l(){try{return"trace"===window.localStorage.getItem("loglevel")?.toLowerCase()}catch{return!1}}static u(t){try{window.localStorage.setItem("loglevel",t)}catch(e){console.error(e)}}static h(t){return(...e)=>{(this.l()||"error"===t)&&console[t](...e)}}static p=t.h("debug");static m=t.h("info");static _=t.h("warn");static S=t.h("error")};function pt(t){return encodeURIComponent(t).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function ft(t,e,i){return _t("GET",t,e,i)}function wt(t,e,i){return _t("POST",t,e,i)}function mt(t,e,i){return _t("DELETE",t,e,i)}function bt(t,e,i){return _t("PATCH",t,e,i)}function _t(t,e,i,n){if(a=i,!((s=e).startsWith("apps/")||s.startsWith("sync/")?lt(s.split("/")[1]):a&&"string"==typeof a.app_id&<(a.app_id)))return Promise.reject(Z);var s,a;const o=new Headers;if(o.append("Origin",window.location.origin),o.append("SDK-Version",`onesignal/web/${C}`),o.append("Content-Type","application/json;charset=UTF-8"),o.append("Accept","application/vnd.onesignal.v1+json"),n)for(const l of Object.keys(n))o.append(l,n[l]);const r={method:t||"NO_METHOD_SPECIFIED",headers:o,cache:"no-cache"};i&&(r.body=JSON.stringify(i));const c=e.split("/").map(pt).join("/");return yt(`${M({action:e}).toString()}${c}`,r)}async function yt(t,e,i=5){if(0===i)return Promise.reject(X);try{const i=await fetch(t,e),{status:n,headers:s}=i,a=await i.json(),o=s?.get("Retry-After");return{ok:i.ok,result:a,status:n,retryAfterSeconds:o?parseInt(o):void 0}}catch(n){if(n instanceof Error&&"TypeError"===n.name)return await ut(i>3?1e4*(6-i):3e4),gt.S(`Fetch timeout ${t}, retrying...`),yt(t,e,i-1);throw new Error(`Failed to execute HTTP call: ${String(n)}`)}}async function St(t,e,i){const{appId:n,subscriptionId:s}=t;if(!lt(n))throw et;const a=s?{"OneSignal-Subscription-Id":s}:void 0;let o={};return a&&(o={...o,...a}),t.jwtHeader&&(o={...o,...t.jwtHeader}),bt(`apps/${n}/users/by/${e.label}/${e.id}`,i,o)}function vt(t){let e="";const i=Object.keys(t);for(const n of i){const i=t[n];e+=`${encodeURIComponent(n)}=${encodeURIComponent(i)}`}return e}async function Ot(t){gt.m("Outcome payload:",t);try{await wt("outcomes/measure",t)}catch(e){gt.S("sendOutcome",e)}}async function It(t){return await new Promise((e,i)=>{var n,s;n=`${M().toString()}sync/${t}/web`,s=(t,n)=>{t?i(t):n.success?e(n):i(n)},(0,o.default)(n,{prefix:"__jp",name:void 0,param:"callback",timeout:6e4},s)})}var kt={scope:"/"},xt="OneSignalSDKWorker.js",Ct="native",Et="push",Pt="category",$t="sms",Tt="email",At="smsAndEmail",Nt={pageViews:1,timeDelay:0},Mt="We'd like to show you notifications for the latest news and updates.",Ut="Allow",Dt="Cancel",Lt="Try Again",Ft="Update your push notification subscription preferences.",Rt="Save Preferences",Wt="Cancel",Bt={type:Et,text:{actionMessage:Mt,acceptButton:Ut,cancelButton:Dt},autoPrompt:!1,delay:Nt},jt="custom";function zt(t){const e=t.config.staticPrompts,i=e.native?{enabled:e.native.enabled,autoPrompt:e.native.enabled&&!1!==e.native.autoPrompt,pageViews:e.native.pageViews??Nt.pageViews,timeDelay:e.native.timeDelay??Nt.timeDelay}:{enabled:!1,autoPrompt:!1,pageViews:Nt.pageViews,timeDelay:Nt.timeDelay},{prompts:n}=e.slidedown;return{autoPrompt:i.autoPrompt||Kt(n),native:i,slidedown:{prompts:n},fullscreen:{enabled:e.fullscreen.enabled,actionMessage:e.fullscreen.actionMessage,acceptButton:e.fullscreen.acceptButton,cancelButton:e.fullscreen.cancelButton,title:e.fullscreen.title,message:e.fullscreen.message,caption:e.fullscreen.caption,autoAcceptTitle:e.fullscreen.autoAcceptTitle},customlink:Vt(t)}}function Kt(t){if(!t)return!1;for(let e=0;e{if(t.type=t.type??Et,t.type===Pt&&(t.text={...t.text,positiveUpdateButton:t.text?.positiveUpdateButton??Rt,negativeUpdateButton:t.text?.negativeUpdateButton??Wt,updateMessage:t.text?.updateMessage??Ft}),t.text={...t.text,actionMessage:t.text?.actionMessage??Mt,acceptButton:t.text?.acceptButton??Ut,cancelButton:t.text?.cancelButton??Dt,confirmMessage:t.text?.confirmMessage??"Thank You!"},t.autoPrompt=t.autoPrompt??!0,t.delay={pageViews:t.delay?.pageViews??Nt.pageViews,timeDelay:t.delay?.timeDelay??Nt.timeDelay},t.categories){const{categories:e}=t;t.categories=structuredClone(e).slice(0,10)}return t}):(a.slidedown={prompts:[]},a.slidedown.prompts=[Bt]),a.native){const t=Object.prototype.hasOwnProperty.call(a.native,"autoPrompt");a.native.autoPrompt=t?!!a.native.enabled&&!!a.native.autoPrompt:!!a.native.enabled,a.native.enabled=!!a.native.enabled,a.native.pageViews=a.native.pageViews??Nt.pageViews,a.native.timeDelay=a.native.timeDelay??Nt.timeDelay}else a.native={enabled:!1,autoPrompt:!1,pageViews:Nt.pageViews,timeDelay:Nt.timeDelay};return!0===i.autoRegister&&(a.native.enabled=!0,a.native.autoPrompt=!0),a.autoPrompt=a.native.autoPrompt||Kt(a.slidedown.prompts),a}async function Jt(t){return async function(t,e){try{if(!t||!t.appId||!lt(t.appId))throw et;const i=await e(t.appId);!function(t){var e;(e=t.promptOptions)&&["acceptButtonText","cancelButtonText","actionMessage"].some(t=>Object.prototype.hasOwnProperty.call(e,t))&&(t.promptOptions=function(t){t.slidedown||(t.slidedown={});const{slidedown:e}=t;return e.acceptButtonText=e.acceptButtonText??t.acceptButtonText??t.acceptButton,e.cancelButtonText=e.cancelButtonText??t.cancelButtonText??t.cancelButton,e.actionMessage=e.actionMessage??t.actionMessage,t}(t.promptOptions)),function(t){return!!t&&["enabled","autoPrompt","pageViews","timeDelay","acceptButton","acceptButtonText","cancelButton","cancelButtonText","actionMessage","customizeTextEnabled","categories"].some(e=>Object.prototype.hasOwnProperty.call(t,e))}(t.promptOptions?.slidedown)&&t.promptOptions?.slidedown&&(t.promptOptions.slidedown=function(t){const e=(a=t,(a?.categories?.tags?.length||0)>0),i=e?Pt:Et,{categories:n,prompts:s=[]}=t;var a;return{prompts:[...s,{type:i,autoPrompt:t.autoPrompt,text:{actionMessage:t.actionMessage,acceptButton:t.acceptButton??t.acceptButtonText,cancelButton:t.cancelButton??t.cancelButtonText,...e&&{positiveUpdateButton:n?.positiveUpdateButton,negativeUpdateButton:n?.negativeUpdateButton,updateMessage:n?.updateMessage}},delay:{pageViews:t.pageViews,timeDelay:t.timeDelay},categories:n?.tags}]}}(t.promptOptions?.slidedown))}(t);const n=function(t,e){const i=function(t){return t.config.integration?.kind??jt}(e),n=function(t,e,i){switch(qt(t).configuration){case 0:return i.config.siteInfo.proxyOriginEnabled;case 1:return!!e.subdomainName}}(i,t,e),s=function(t,e,i){switch(qt(t).configuration){case 0:{const{path:t,serviceWorkerPath:n,serviceWorkerParam:s}=function(t,e){const{serviceWorker:i}=e.config,n=t.serviceWorkerOverrideForTypical;return{path:n?t.path??i.path:i.path,serviceWorkerParam:n?t.serviceWorkerParam??{scope:i.registrationScope}:{scope:i.registrationScope},serviceWorkerPath:n?t.serviceWorkerPath??i.workerName:i.workerName}}(e,i);return{appId:i.app_id,autoRegister:!1,autoResubscribe:i.config.autoResubscribe,path:t,serviceWorkerPath:n,serviceWorkerParam:s,subdomainName:i.config.siteInfo.proxyOrigin,promptOptions:zt(i),welcomeNotification:{disable:!i.config.welcomeNotification.enable,title:i.config.welcomeNotification.title,message:i.config.welcomeNotification.message,url:i.config.welcomeNotification.url},notifyButton:{enable:i.config.staticPrompts.bell.enabled,displayPredicate:i.config.staticPrompts.bell.hideWhenSubscribed?()=>!OneSignal.User.PushSubscription.optedIn:null,size:i.config.staticPrompts.bell.size,position:i.config.staticPrompts.bell.location,showCredit:!1,offset:{bottom:`${i.config.staticPrompts.bell.offset.bottom}px`,left:`${i.config.staticPrompts.bell.offset.left}px`,right:`${i.config.staticPrompts.bell.offset.right}px`},colors:{"circle.background":i.config.staticPrompts.bell.color.main,"circle.foreground":i.config.staticPrompts.bell.color.accent,"badge.background":"black","badge.foreground":"white","badge.bordercolor":"black","pulse.color":i.config.staticPrompts.bell.color.accent,"dialog.button.background.hovering":i.config.staticPrompts.bell.color.main,"dialog.button.background.active":i.config.staticPrompts.bell.color.main,"dialog.button.background":i.config.staticPrompts.bell.color.main,"dialog.button.foreground":"white"},text:{"tip.state.unsubscribed":i.config.staticPrompts.bell.tooltip.unsubscribed,"tip.state.subscribed":i.config.staticPrompts.bell.tooltip.subscribed,"tip.state.blocked":i.config.staticPrompts.bell.tooltip.blocked,"message.prenotify":i.config.staticPrompts.bell.tooltip.unsubscribed,"message.action.subscribing":i.config.staticPrompts.bell.message.subscribing,"message.action.subscribed":i.config.staticPrompts.bell.message.subscribing,"message.action.resubscribed":i.config.staticPrompts.bell.message.subscribing,"message.action.unsubscribed":i.config.staticPrompts.bell.message.unsubscribing,"dialog.main.title":i.config.staticPrompts.bell.dialog.main.title,"dialog.main.button.subscribe":i.config.staticPrompts.bell.dialog.main.subscribeButton,"dialog.main.button.unsubscribe":i.config.staticPrompts.bell.dialog.main.unsubscribeButton,"dialog.blocked.title":i.config.staticPrompts.bell.dialog.blocked.title,"dialog.blocked.message":i.config.staticPrompts.bell.dialog.blocked.message}},persistNotification:i.config.notificationBehavior?i.config.notificationBehavior.display.persist:void 0,webhooks:{cors:i.config.webhooks.corsEnable,"notification.willDisplay":i.config.webhooks.notificationDisplayedHook,"notification.clicked":i.config.webhooks.notificationClickedHook,"notification.dismissed":i.config.webhooks.notificationDismissedHook},notificationClickHandlerMatch:i.config.notificationBehavior?i.config.notificationBehavior.click.match:void 0,notificationClickHandlerAction:i.config.notificationBehavior?i.config.notificationBehavior.click.action:void 0,outcomes:{direct:i.config.outcomes.direct,indirect:{enabled:i.config.outcomes.indirect.enabled,influencedTimePeriodMin:i.config.outcomes.indirect.notification_attribution.minutes_since_displayed,influencedNotificationsLimit:i.config.outcomes.indirect.notification_attribution.limit},unattributed:i.config.outcomes.unattributed}}}case 1:{const t={...e,promptOptions:Ht(e.promptOptions,i.config.staticPrompts,e),serviceWorkerParam:e.serviceWorkerParam?e.serviceWorkerParam:kt,serviceWorkerPath:e.serviceWorkerPath?e.serviceWorkerPath:xt,path:e.path?e.path:"/",outcomes:{direct:i.config.outcomes.direct,indirect:{enabled:i.config.outcomes.indirect.enabled,influencedTimePeriodMin:i.config.outcomes.indirect.notification_attribution.minutes_since_displayed,influencedNotificationsLimit:i.config.outcomes.indirect.notification_attribution.limit},unattributed:i.config.outcomes.unattributed}};return Object.prototype.hasOwnProperty.call(e,"autoResubscribe")?t.autoResubscribe=!!e.autoResubscribe:Object.prototype.hasOwnProperty.call(e,"autoRegister")?t.autoResubscribe=!!e.autoRegister:t.autoResubscribe=!!i.config.autoResubscribe,t}}}(i,t,e);return{appId:e.app_id,hasUnsupportedSubdomain:n,siteName:e.config.siteInfo.name,defaultIconUrl:e.config.siteInfo.defaultIconUrl,origin:e.config.origin,restrictedOriginEnabled:e.features.restrict_origin&&e.features.restrict_origin.enable,safariWebId:e.config.safari_web_id,vapidPublicKey:e.config.vapid_public_key,onesignalVapidPublicKey:e.config.onesignal_vapid_public_key,userConfig:s,enableOnSession:e.features.enable_on_session??false,sessionThreshold:e.features.session_threshold??30,enableSessionDuration:e.features.web_on_focus_enabled??true}}(t,i);return function(t){const e=!self.isSecureContext;if(t.hasUnsupportedSubdomain||e)throw e?new Error("OneSignalSDK: HTTP sites are no longer supported starting with version 16 (User Model), your public site must start with https://."):new Error('OneSignalSDK: The "My site is not fully HTTPS" option is no longer supported starting with version 16 (User Model) of the OneSignal SDK.')}(n),function(t){if(t.restrictedOriginEnabled&&!function(t){try{return location.origin===new URL(t).origin}catch{return!1}}(t.origin))throw new Error(`Can only be used on: ${new URL(t.origin).origin}`)}(n),n}catch(i){if(i instanceof Object&&"code"in i){if(1===i.code)throw et;if(2===i.code)throw new Error("App not configured for web push")}throw i}}(t,It)}function Gt(t){return new Promise((e,i)=>{t.onsuccess=()=>e(t.result),t.onerror=()=>i(t.error)})}var Yt=!1,Qt=async(t=7)=>{const e=await function(t,e,i){return new Promise((t,n)=>{const s=indexedDB.open("ONE_SIGNAL_SDK_DB",e);s.onupgradeneeded=t=>i?.upgrade?.(s.result,t.oldVersion,t.newVersion,s.transaction),s.onsuccess=()=>{i?.terminated&&(s.result.onclose=i.terminated),t(s.result)},s.onerror=()=>n(s.error),s.onblocked=()=>i?.blocked?.()})}(0,t,{upgrade(e,i,n,s){const a=n||t;a>=1&&i<1&&(e.createObjectStore("Ids",{keyPath:"type"}),e.createObjectStore("NotificationOpened",{keyPath:"url"}),e.createObjectStore("Options",{keyPath:"key"})),a>=2&&i<2&&(e.createObjectStore("Sessions",{keyPath:"sessionKey"}),e.createObjectStore("NotificationReceived",{keyPath:"notificationId"}),e.createObjectStore("NotificationClicked",{keyPath:"notificationId"})),a>=3&&i<3&&e.createObjectStore("SentUniqueOutcome",{keyPath:"outcomeName"}),a>=4&&i<4&&(e.createObjectStore("identity",{keyPath:"modelId"}),e.createObjectStore("properties",{keyPath:"modelId"}),e.createObjectStore("pushSubscriptions",{keyPath:"modelId"}),e.createObjectStore("smsSubscriptions",{keyPath:"modelId"}),e.createObjectStore("emailSubscriptions",{keyPath:"modelId"})),a>=5&&i<5&&(async function(t,e){const i="NotificationClicked",n="Outcomes.NotificationClicked";t.createObjectStore(n,{keyPath:"notificationId"});const s=await Gt(e.objectStore(i).getAll()),a=e.objectStore(n);for(const o of s)a.put({notificationId:o.notificationId||o.notification.id,appId:o.appId,timestamp:o.timestamp});t.deleteObjectStore(i)}(e,s),async function(t,e){const i="NotificationReceived",n="Outcomes.NotificationReceived";t.createObjectStore(n,{keyPath:"notificationId"});const s=await Gt(e.objectStore(i).getAll()),a=e.objectStore(n);for(const o of s)a.put(o);t.deleteObjectStore(i)}(e,s)),a>=6&&i<6&&async function(t,e){const i="subscriptions";let n;t.createObjectStore(i,{keyPath:"modelId"});const s=await Gt(e.objectStore("identity").getAll());s.length>0&&(n=s[0].externalId);for(const a of["emailSubscriptions","pushSubscriptions","smsSubscriptions"]){const s=await Gt(e.objectStore(a).getAll()),o=e.objectStore(i);for(const t of s)o.put({...t,modelName:"subscriptions",externalId:n});t.deleteObjectStore(a)}}(e,s),a>=7&&i<7&&e.createObjectStore("operations",{keyPath:"modelId"}),Yt=!1,"undefined"!=typeof OneSignal&&(OneSignal.v=!0)},blocked(){gt.p("IndexedDB: Blocked event")},terminated(){Yt||(Yt=!0,Xt())}});return function(t){const e=(e,i)=>t.transaction(e,i).objectStore(e);return{get:async(t,i)=>Gt(e(t).get(i)),getAll:async t=>Gt(e(t).getAll()),put:async(t,i)=>Gt(e(t,"readwrite").put(i)),delete:async(t,i)=>Gt(e(t,"readwrite").delete(i)),clear:async t=>Gt(e(t,"readwrite").clear()),close:()=>t.close(),get objectStoreNames(){return t.objectStoreNames}}}(e)},Zt=Qt(),Xt=(t=7)=>Zt=Qt(t),te=!1;function ee(t,e,i){if(te)return Promise.resolve(i);let n;const s=new Promise(e=>{n=setTimeout(()=>{te=!0,gt._(`db.${t} timed out`),e(i)},1500)});return Promise.race([e(),s]).finally(()=>clearTimeout(n))}var ie={async get(t,e){const i=await Zt;return ee(`get(${t})`,()=>i.get(t,e),void 0)},async getAll(t){const e=await Zt;return ee(`getAll(${t})`,()=>e.getAll(t),[])},async put(t,e){const i=await Zt;return ee(`put(${t})`,()=>i.put(t,e),void 0)},async delete(t,e){const i=await Zt;return ee(`delete(${t}/${e})`,()=>i.delete(t,e),void 0)}},ne=async t=>{const e=await ie.get("Options",t);return e&&"value"in e?e.value:null},se=async t=>{const e=await ie.get("Ids",t);return e&&"id"in e?e.id:null},ae=async()=>await ie.get("Sessions","oneSignalSession")??null,oe="os_feature_flags",re="os_pageViews",ce="requiresPrivacyConsent",le="userConsent";function ue(){const t=OneSignal.config?.userConfig.requiresUserPrivacyConsent??!1;return"true"===localStorage.getItem(ce)||t}function de(t){localStorage.setItem(le,t.toString())}function he(){return Number(localStorage.getItem(re))}var ge=async()=>{const t={};return t.appId=await se("appId"),t.vapidPublicKey=await ne("vapidPublicKey"),t},pe=async()=>{const t=await ne("defaultUrl"),e=await ne("defaultTitle"),i=await ne("isPushEnabled"),n=await ne("lastOptedIn");return{defaultNotificationUrl:t,defaultNotificationTitle:e,lastKnownPushEnabled:i,lastKnownPushId:await ne("lastPushId")??void 0,lastKnownPushToken:await ne("lastPushToken")??void 0,lastKnownOptedIn:n}},fe=async t=>{t.defaultNotificationUrl&&await ie.put("Options",{key:"defaultUrl",value:t.defaultNotificationUrl}),(t.defaultNotificationTitle||""===t.defaultNotificationTitle)&&await ie.put("Options",{key:"defaultTitle",value:t.defaultNotificationTitle}),null!=t.lastKnownPushEnabled&&await ie.put("Options",{key:"isPushEnabled",value:t.lastKnownPushEnabled}),null!=t.lastKnownPushId&&await ie.put("Options",{key:"lastPushId",value:t.lastKnownPushId}),null!=t.lastKnownPushToken&&await ie.put("Options",{key:"lastPushToken",value:t.lastKnownPushToken}),null!=t.lastKnownOptedIn&&await ie.put("Options",{key:"lastOptedIn",value:t.lastKnownOptedIn})},we=()=>{const t=ue(),e=OneSignal.O,i=t&&!e;return i&>._("Consent required but not given"),i},me=class t{deviceId;subscriptionToken;optedOut;createdAt;expirationTime;I(){return{deviceId:this.deviceId,subscriptionToken:this.subscriptionToken,optedOut:this.optedOut,createdAt:this.createdAt,expirationTime:this.expirationTime}}static k(e){const i=new t;return i.deviceId=e.deviceId,i.subscriptionToken=e.subscriptionToken,i.optedOut=e.optedOut,i.createdAt=e.createdAt,i.expirationTime=e.expirationTime,i}},be=async()=>{const t=new me;t.deviceId=(await ie.get("Ids","userId"))?.id,t.subscriptionToken=(await ie.get("Ids","registrationId"))?.id;const e=await ne("optedOut"),i=await ne("subscription"),n=await ne("subscriptionCreatedAt"),s=await ne("subscriptionExpirationTime");return t.optedOut=null!=e?e:null!=i&&!i,t.createdAt=n??null,t.expirationTime=s??null,t},_e=async t=>{t.deviceId&&await ie.put("Ids",{type:"userId",id:t.deviceId}),void 0!==t.subscriptionToken&&await ie.put("Ids",{type:"registrationId",id:t.subscriptionToken}),null!=t.optedOut&&await ie.put("Options",{key:"optedOut",value:t.optedOut}),null!=t.createdAt&&await ie.put("Options",{key:"subscriptionCreatedAt",value:t.createdAt}),null!=t.expirationTime?await ie.put("Options",{key:"subscriptionExpirationTime",value:t.expirationTime}):await ie.delete("Options","subscriptionExpirationTime")};async function ye(t){try{const e=(localStorage.getItem("os_feature_overrides")??"").split(",").map(t=>t.trim()).filter(Boolean);e.length&&console.warn("OneSignal: feature flag overrides are active:",e);const i=await ft(`apps/${t}/sdk/features/web/${C}`).catch(()=>{}),n=i?.ok&&i.result?.features,s=Array.isArray(n)?n.filter(t=>"string"==typeof t):function(t){try{const e=JSON.parse(t||"[]");return Array.isArray(e)?e:[]}catch{return[]}}(localStorage.getItem(oe));void 0!==await ie.put("Options",{key:"featureFlags",value:JSON.stringify([...e,...s])})&&function(t){localStorage.setItem(oe,JSON.stringify(t))}(s)}catch{}}function Se(t){if("string"==typeof t){const e=document.querySelector(t);if(!e)throw new Error(`Cannot find element with selector "${t}"`);return e}return t}function ve(t,e,i){Se(t).insertAdjacentHTML(e,i)}function Oe(t){for(const e of document.querySelectorAll(t))e.remove()}function Ie(t){return document.querySelector(t)??document.createElement("div")}function ke(t,e){Se(t).classList.add(e)}function xe(t,e){Se(t).classList.remove(e)}function Ce(t){return"undefined"==typeof DOMParser?t:(new DOMParser).parseFromString(t,"text/html").documentElement.textContent||""}function Ee(){try{return"undefined"!=typeof localStorage&&(localStorage.getItem("test"),!0)}catch{return!1}}function Pe(t){if(!Ee())return null;const e=localStorage.getItem(t);let i;try{i=JSON.parse(e)}catch{return null}if(null===i)return null;if(i.timestamp&&(new Date).getTime()>=i.timestamp)return localStorage.removeItem(t),null;let n=i.value;try{n=JSON.parse(i.value)}catch{return n}return n}var $e=0,Te=1,Ae="onesignal-notification-prompt",Ne="onesignal-non-push-prompt",Me={[$e]:"promptDismissCount",[Te]:"nonPushPromptsDismissCount"},Ue={[$e]:Ae,[Te]:Ne};async function De(t){const e=Me[t],i=Ue[t];let n=await ne(e);n||(n=0),n+=1;let s=3;return 2==n?s=7:n>2&&(s=30),gt.p(`Prompt dismissed (${t}), reprompt in ${s}d`),await ie.put("Options",{key:e,value:n}),function(t,e,i){if(!Ee())return;const n=void 0!==i?60*i*1e3:0,s={value:JSON.stringify("dismissed"),timestamp:void 0!==i?(new Date).getTime()+n:void 0};localStorage.setItem(t,JSON.stringify(s))}(i,0,24*s*60)}function Le(t){switch(t){case 0:return"dismissed"===Pe(Ae);case 1:return"dismissed"===Pe(Ne)}return!1}async function Fe(){return new Promise(t=>{OneSignal.C?t():OneSignal.P.once(OneSignal.EVENTS.SDK_INITIALIZED,t)})}function Re(t,...e){return gt.p(`${t}(${e.map(t=>JSON.stringify(t)).join(", ")})`)}function We(t,e,i,n=!1){if(e||gt.S("on() missing event:",e),i||gt.S("on() missing task:",i),"string"==typeof t){const n=document.querySelectorAll(t);if(n.length>0)for(let t=0;t{let t;return t="https://onesignal.com",new URL("https://onesignal.com/sdks/web/v16")})();return this.D(0,new URL(`${t}/OneSignalSDK.page.styles.css?v=${C}`))}async D(e,i){return this.N[i.toString()]||(this.N[i.toString()]=t.L(e,i)),this.N[i.toString()]}static async L(t,e){try{let i;return await new Promise((n,s)=>{switch(t){case 1:i=document.createElement("script"),i.setAttribute("type","text/javascript"),i.setAttribute("async","async"),i.setAttribute("src",e.toString());break;case 0:i=document.createElement("link"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",e.toString())}i.onerror=s,i.onload=n,document.querySelector("head")?.appendChild(i)}),0}catch{return 1}}},He=class{F=".onesignal-bell-launcher-badge";get R(){return document.querySelector(this.F)}get W(){return this.R?.textContent??""}set W(t){const e=this.R;e&&(e.textContent=t)}get B(){return this.R?.classList.contains("onesignal-bell-launcher-badge-opened")??!1}j(){const t=this.R;t&&!this.B&&t.classList.add("onesignal-bell-launcher-badge-opened")}K(){const t=this.R;t&&this.B&&t.classList.remove("onesignal-bell-launcher-badge-opened")}V(t){const e=(Number(this.W)||0)+t;this.W=e>0?e.toString():""}q(){this.V(1)}H(){this.V(-1)}},Je={};function Ge(t,e){return void 0===Je[t]&&(Je[t]=[null,null]),Je[t].push(e),3===Je[t].length&&Je[t].shift(),Je[t]}var Ye=0,Qe=1,Ze=2,Xe=3,ti="message",ei=2500,ii=class{J;F=".onesignal-bell-launcher-button";constructor(t){this.J=t,this.R?.addEventListener("click",()=>this.G())}get R(){return document.querySelector(this.F)}G(){const t=this.R;t&&(t.classList.remove("pulsing"),t.offsetWidth,t.classList.add("pulsing"));const e=function(t){return void 0===Je[t]&&(Je[t]=[null,null]),Je[t]}("subscription.optedOut")[1];this.J.Y&&!e&&(Wn(),this.J.Z=!0,OneSignal.P.once(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,async()=>{this.J.X=!0,await this.J.et.tt(ti,this.J.it.text["message.action.subscribed"],ei),this.J.Z=!1,this.J.X=!1}))}},ni="subscribe-button",si="unsubscribe-button",ai={[g]:"/bell/chrome-unblock.jpg",[w]:"/bell/firefox-unblock.jpg",[f]:"/bell/safari-unblock.jpg",[p]:"/bell/edge-unblock.png"},oi=class{J;nt=null;F=".onesignal-bell-launcher-dialog";constructor(t){this.J=t}get R(){return document.querySelector(this.F)}get B(){return this.R?.matches(":popover-open")??!1}get st(){return this.R?.querySelector(`#${ni}`)??null}get ot(){return this.R?.querySelector(`#${si}`)??null}K(){const t=this.R;t&&this.B&&t.hidePopover()}async rt(){const t=await OneSignal.A.lt.ct(),e=function(){const t=Se(".onesignal-bell-launcher-dialog-body");return t.replaceChildren(),t}(),i=this.J.it.text,n=this.J.ut;1===n&&t||2===n&&!t?this.dt(e,i):3===n&&this.ht(e,i),this.J.it.showCredit&&ve(e,"beforeend",'
Powered by OneSignal
'),this.st?.addEventListener("click",()=>{OneSignal.gt=!1,this.J.ft()}),this.ot?.addEventListener("click",()=>this.J.wt())}dt(t,e){const i=je(this.nt),n="default-icon"!==i?'
':'
',s=1===this.J.ut,a=s?si:ni,o=s?e["dialog.main.button.unsubscribe"]:e["dialog.main.button.subscribe"];ve(t,"beforeend",`

${n}
`),t.querySelector("h1").textContent=Ce(e["dialog.main.title"]),t.querySelector(`#${a}`).textContent=Ce(o),"default-icon"!==i&&t.querySelector(".push-notification-icon img").setAttribute("src",i)}ht(t,e){const i=I();let n="";if((v()||S())&&i===g)n="
  1. Access Settings by tapping the three menu dots ⋮
  2. Click Site settings under Advanced.
  3. Click Notifications.
  4. Find and click this entry for this website.
  5. Click Notifications and set it to Allow.
";else{const t=ai[i];if(t){const e="https://media.onesignal.com/web-sdk"+t;n=`Unblock notifications`}}ve(t,"beforeend",`

${n}
`),t.querySelector("h1").textContent=Ce(e["dialog.blocked.title"]),t.querySelector(".instructions p").textContent=Ce(e["dialog.blocked.message"])}},ri={small:32,medium:48,large:64},ci=class{J;F=".onesignal-bell-launcher";constructor(t){this.J=t}get R(){return document.querySelector(this.F)}get B(){return this.R?.classList.contains("onesignal-bell-launcher-active")??!1}j(){const t=this.R;t&&!this.B&&t.classList.add("onesignal-bell-launcher-active")}K(){const t=this.R;t&&this.B&&(this.J.bt.K(),t.classList.remove("onesignal-bell-launcher-active"))}_t(t){const e=this.R;if(!e)throw new Error("Missing DOM element");const i=ri[t];if(!i)throw new Error("Invalid OneSignal bell size "+t);e.style.setProperty("--bell-size",`${i}px`),e.style.setProperty("--bell-resting-scale",""+32/i),e.style.setProperty("--badge-font-size",i<=32?"8px":"12px")}},li={[Ze]:"tip.state.unsubscribed",[Qe]:"tip.state.subscribed",[Xe]:"tip.state.blocked",[Ye]:""},ui=class{J;yt="";F=".onesignal-bell-launcher-message";constructor(t){this.J=t}get R(){return document.querySelector(this.F)}get W(){return this.R?.querySelector(".onesignal-bell-launcher-message-body")?.textContent??""}set W(t){const e=this.R?.querySelector(".onesignal-bell-launcher-message-body");e&&(e.textContent=t)}get B(){return this.R?.classList.contains("onesignal-bell-launcher-message-opened")??!1}j(){const t=this.R;t&&!this.B&&t.classList.add("onesignal-bell-launcher-message-opened")}K(){const t=this.R;t&&this.B&&t.classList.remove("onesignal-bell-launcher-message-opened")}async tt(t,e,i=0){gt.p("display:",t,e,i),this.B&&this.K(),this.W=Ce(e),this.yt=t,this.j(),await ut(i),this.K(),this.W=this.St(),this.yt="tip"}St(){const t=li[this.J.ut];return t?this.J.it.text[t]??"":""}},di="medium",hi=["small","medium","large"],gi=["bottom-left","bottom-right"],pi=["default","inverse"],fi="Manage notifications",wi={"launcher.button.aria-label":fi,"tip.state.unsubscribed":"Subscribe to notifications","tip.state.subscribed":"You're subscribed to notifications","tip.state.blocked":"You've blocked notifications","message.prenotify":"Click to subscribe to notifications","message.action.subscribed":"Thanks for subscribing!","message.action.resubscribed":"You're subscribed to notifications","message.action.subscribing":"Click {{prompt.native.grant}} to receive notifications","message.action.unsubscribed":"You won't receive notifications again","dialog.main.title":"Manage Site Notifications","dialog.main.button.subscribe":"SUBSCRIBE","dialog.main.button.unsubscribe":"UNSUBSCRIBE","dialog.blocked.title":"Unblock Notifications","dialog.blocked.message":"Follow these instructions to allow notifications:"},mi=class{it;ut=0;Z=!1;X=!1;C=!1;vt;Ot;It;kt;xt;constructor(t,e){this.it={enable:t.enable||!1,size:t.size||di,position:t.position||"bottom-right",theme:t.theme||"default",showLauncherAfter:t.showLauncherAfter||10,showBadgeAfter:t.showBadgeAfter||300,text:{...wi,...t.text},prenotify:t.prenotify,showCredit:t.showCredit,colors:t.colors,offset:t.offset},e&&(this.vt=e),this.it.enable&&(this.Ct(this.it),this.Et())}Ct(t){const e=(t,e,i)=>{if(!t||!e.includes(t))throw new Error(`Invalid ${i} '${t}'. Choose: ${e.join(", ")}`)},i=(t,e)=>{if(!t||t<0)throw new Error(`Invalid ${e}. Must be above 0.`)};e(t.size,hi,"size"),e(t.position,gi,"position"),e(t.theme,pi,"theme"),i(t.showLauncherAfter,"showLauncherAfter"),i(t.showBadgeAfter,"showBadgeAfter")}Et(){OneSignal.P.on(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,async t=>{t.current.optedIn&&(this.Pt.B&&this.it.prenotify&&this.Pt.K(),null===this.bt.nt&&(this.bt.nt=await ze()),this.X||this.bt.K());const e=await OneSignal.A.Tt.$t(),i=t.current.optedIn?1:"denied"===e?3:2;this.At(i,this.Z)}),OneSignal.P.on(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_STRING,()=>this.Nt())}async ft(){const t=this.bt.st;t&&(t.disabled=!0),this.Z=!0,this.X=!0,await OneSignal.User.PushSubscription.optIn(),t&&(t.disabled=!1),this.bt.K(),await this.et.tt(ti,this.it.text["message.action.resubscribed"],ei),this.Z=!1,this.X=!1,this.Nt()}async wt(){const t=this.bt.ot;t&&(t.disabled=!0),this.X=!0,await OneSignal.User.PushSubscription.optOut(),t&&(t.disabled=!1),this.bt.K(),await this.et.tt(ti,this.it.text["message.action.unsubscribed"],ei),this.X=!1,this.Nt()}Mt(){const{position:t,theme:e}=this.it,i=this.Ut;i&&ke(i,`onesignal-bell-container-${t}`),ke(this.Dt.F,`onesignal-bell-launcher-${t}`),ke(this.Dt.F,`onesignal-bell-launcher-theme-${e}`)}async Lt(){if(!this.it.enable)return;if(!CSS.supports("anchor-name: --a"))return void gt.S("Bell requires CSS Anchor Positioning");if(0!==await OneSignal.A.Ft.U())return void gt.p("Bell styles failed to load");this.Ut&&Oe("#onesignal-bell-container"),ve("body","beforeend",'
'),this.Ut&&ve(this.Ut,"beforeend",'
'),ve(this.Dt.F,"beforeend",''),this.Rt.R?.setAttribute("aria-label",this.it.text["launcher.button.aria-label"]||fi),ve(this.Dt.F,"beforeend",'
'),ve(this.Dt.F,"beforeend",'
'),ve(this.et.F,"beforeend",'
'),ve(this.Dt.F,"beforeend",'
'),ve(this.bt.F,"beforeend",'
'),ve(this.Rt.F,"beforeend",''),this.Dt.R?.addEventListener("mouseleave",()=>{this.Rt.R?.blur()});const t=this.bt.R;t&&(t.addEventListener("toggle",t=>{"open"===t.newState&&(this.bt.rt(),this.et.K())}),t.addEventListener("beforetoggle",t=>{"open"===t.newState&&this.et.B&&this.et.yt===ti&&t.preventDefault()}));const e=await OneSignal.A.lt.ct();Le(0),this.Dt._t(this.it.size||di),this.Mt(),this.Wt(),this.Bt(),gt.m("Showing bell"),e&&null===this.bt.nt&&(this.bt.nt=await ze()),await ut(this.it.showLauncherAfter||0),this.Dt.j(),await this.Nt(),await ut(this.it.showBadgeAfter||0),this.it.prenotify&&!e&&!this.jt&&OneSignal.v&&(this.et.W=Ce(this.it.text["message.prenotify"]),this.Pt.q(),this.Pt.j()),this.C=!0}Wt(){const t=this.it.offset;if(!t)return;const e=this.Dt.R;if(!e)return void gt.S("Bell element not found");t.bottom&&(e.style.bottom=t.bottom);const i="bottom-right"===this.it.position?t.right:t.left;i&&(e.style["bottom-right"===this.it.position?"right":"left"]=i)}Bt(){const t=this.it.colors;if(!t)return;const e=this.Dt.R;if(!e)return;const i=(t,i)=>{i&&e.style.setProperty(t,i)};i("--bell-bg",t["circle.background"]),i("--bell-fg",t["circle.foreground"]),i("--badge-bg",t["badge.background"]),i("--badge-border",t["badge.bordercolor"]),i("--badge-fg",t["badge.foreground"]),i("--btn-bg",t["dialog.button.background"]),i("--btn-fg",t["dialog.button.foreground"]),i("--btn-hover-bg",t["dialog.button.background.hovering"]),i("--btn-active-bg",t["dialog.button.background.active"]),i("--pulse-color",t["pulse.color"])}async Nt(){try{const[t,e]=await Promise.all([OneSignal.A.lt.ct(),OneSignal.A.Tt.$t()]),i="denied"===e?3:t?1:2;this.At(i)}catch(t){gt.S(t)}}At(t,e=!1){const i=this.ut;this.ut=t,i===t||e||this.Dt.R&&(this.et.W=Ce(this.et.St()))}get Ut(){return document.querySelector("#onesignal-bell-container")}get Dt(){return this.vt||(this.vt=new ci(this)),this.vt}get Rt(){return this.Ot||(this.Ot=new ii(this)),this.Ot}get Pt(){return this.It||(this.It=new He),this.It}get et(){return this.kt||(this.kt=new ui(this)),this.kt}get bt(){return this.xt||(this.xt=new oi(this)),this.xt}get zt(){return 1===this.ut}get Y(){return 2===this.ut}get jt(){return 3===this.ut}},bi="onesignal-button-indicator-holder",_i="onesignal-slidedown-container",yi="onesignal-slidedown-dialog",Si="onesignal-reset",vi="onesignal-saving-state-button",Oi="slide-up",Ii="slide-down",ki="close-slidedown",xi="default-icon",Ci="clearfix",Ei="onesignal-slidedown-allow-button",Pi="slidedown-body",$i="onesignal-button-indicator-holder",Ti="onesignal-slidedown-cancel-button",Ai="onesignal-slidedown-container",Ni="onesignal-slidedown-dialog",Mi="slidedown-footer",Ui="onesignal-loading-container",Di="align-right",Li="slidedown-button",Fi="tagging-container",Ri="tagging-container-col",Wi="channel-capture-container",Bi="onesignal-error-input",ji="onesignal-validation-element-hidden",zi="sms-input-with-validation-element",Ki="email-input-with-validation-element",Vi="iti-onesignal-sms-input",qi="onesignal-email-input",Hi="onesignal-sms-validation-element",Ji="onesignal-email-validation-element",Gi="onesignal-customlink-subscribe",Yi="onesignal-customlink-explanation",Qi="onesignal-reset",Zi="state-subscribed",Xi="state-unsubscribed",tn={Kt:".onesignal-customlink-container",Vt:`.${Gi}`,qt:`.${Yi}`},en=class{Ht;constructor(t){this.Ht=t}async Jt(){if(!this.Ht?.enabled)return;if(!(await this.Gt()))return;gt.m("Initializing customlink");const t=await OneSignal.A.lt.ct();if(this.Ht?.unsubscribeEnabled||!t)for(let e=0;e{gt.m("CustomLink: clicked"),await this.ne(e)}),e.setAttribute("type","button"),t.appendChild(e)}}else gt.S("CustomLink: missing 'text' config")}async Gt(){return 0===await OneSignal.A.Ft.U()||(gt.p("CustomLink: styles failed to load"),!1)}se(t){ke(t,"hide")}Zt(){this.Yt.forEach(t=>{this.se(t)})}async ne(t){if(!OneSignal.User.PushSubscription.optedIn)return await OneSignal.User.PushSubscription.optIn(),void(this.Ht?.unsubscribeEnabled||this.Zt());await OneSignal.User.PushSubscription.optOut(),await this.ie(t)}async ie(t){this.Ht?.text?.subscribe&&(await OneSignal.A.lt.ct()||(t.textContent=this.Ht.text.subscribe)),this.Ht?.text?.unsubscribe&&await OneSignal.A.lt.ct()&&(t.textContent=this.Ht.text.unsubscribe)}ee(t){this.Ht?.color&&this.Ht.color.text&&("button"===this.Ht?.style&&this.Ht?.color.button?(t.style.backgroundColor=this.Ht?.color.button,t.style.color=this.Ht?.color.text):"link"===this.Ht?.style&&(t.style.color=this.Ht?.color.text))}get Yt(){const t=document.querySelectorAll(tn.Kt);return Array.prototype.slice.call(t)}},nn={ae:0,oe:1},sn=class{static re(t,e,i){if(e||!1===e?gt.p(`(${T}) » ${t}:`,e):gt.p(`(${T}) » ${t}`),t===OneSignal.EVENTS.SDK_INITIALIZED){if(OneSignal.C)return;OneSignal.C=!0}i?i.ce(t,e):OneSignal.P.ce(t,e)}},an="onesignal-pageview-count",on=!1;function rn(){try{const t=sessionStorage.getItem(an),e=t?parseInt(t):0;return isNaN(e)?0:e}catch{return 0}}function cn(){if(on)return;const t=rn()+1,e=he()+1;var i;!function(t){try{sessionStorage.setItem(an,t.toString())}catch{}}(t),i=e,localStorage.setItem(re,i.toString()),on=!0,gt.p(`Page views: tab=${t}, total=${e}`)}function ln(){return 1===rn()}var un=class{},dn=class{le;constructor(){this.le={}}on(t,e){return this.le[t]=this.le[t]||[],this.le[t].push(e),this}once(t,e){const i=this;function n(...s){i.off(t,n),e.apply(this,s)}return n.listener=e,this.on(t,n),this}off(t,e){const i=this.le[t];if(void 0!==i){for(let t=0;t{gn(t)&&(this.fe=t.id)}).catch(t=>{gt.S(t)}),OneSignal.P.on(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,t=>{this.fe=t?.current.id,this.we=t?.current.token}),OneSignal.P.on(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_STRING,t=>{this.be=t})):gt._(`PushSubscriptionNamespace: skipping initialization. One or more required params are falsy: initialize: ${t}, subscription: ${JSON.stringify(e)}`)}get id(){return hn.pe(this.fe)?void 0:this.fe}get token(){return this.we}get optedIn(){return!!this.me&&"granted"===this.be}async optIn(){Re("optIn"),await Fe(),this.me=!0,"granted"===await OneSignal.A.Tt.$t()?await this.Se(!0):await OneSignal.Notifications.requestPermission()}async optOut(){Re("optOut"),await Fe(),this.me=!1,await this.Se(!1)}addEventListener(t,e){OneSignal.P.on(t,e)}removeEventListener(t,e){OneSignal.P.off(t,e)}async Se(t){await Fe();const e=await ge(),i=await be();if(!e.appId)throw Z;if("boolean"!=typeof t)throw at("enabled");i.optedOut=!t,await _e(i),Ge("subscription.optedOut",i.optedOut),An().catch(t=>{gt.S(t)})}},fn=class{ve=[];get Oe(){return this.ve.length>0}Ie(t){this.ve.push(t)}ke(t){const e=this.ve.indexOf(t);-1!==e&&this.ve.splice(e,1)}xe(t){for(const e of this.ve)t(e)}},wn=class{Ce;Ee=new Map;Pe=new fn;constructor(){this.Ce=Math.random().toString(36).substring(2)}$e(t){const{modelId:e,modelName:i,...n}=t;this.Ee.clear(),this.Ee=new Map(Object.entries(n)),e&&(this.Ce=e)}Te(t,e){const i=new Map;e.Ee.forEach((t,e)=>{i.set(e,t)}),null!==t&&(this.Ce=t),this.Ee.clear(),this.Ee=i}Ae(t,e,i=0,n=!1){const s=this.Ee.get(t);(s!==e||n)&&(void 0!==e?this.Ee.set(t,e):this.Ee.has(t)&&this.Ee.delete(t),this.Ne(t,i,s,e))}Me(t){return this.Ee.has(t)}Ue(t,e){return this.Ee.get(t)??e}Ne(t,e,i,n){const s={model:this,property:t,oldValue:i,newValue:n};this.Pe.xe(t=>t.De(s,e))}toJSON(){return Object.fromEntries(this.Ee.entries())}Ie(t){return this.Pe.Ie(t)}ke(t){this.Pe.ke(t)}get Oe(){return this.Pe.Oe}Le(t){for(const[e,i]of Object.entries(t))this.Ee.set(e,i)}},mn=class extends wn{constructor(){super(),this.sdk=C,this.device_model=L(),this.device_os=D()}get Fe(){return this.Ue("onesignalId")}set Fe(t){this.Ae("onesignalId",t)}get id(){return this.Ue("id")}set id(t){this.Ae("id",t)}get enabled(){return this.Ue("enabled")}set enabled(t){this.Ae("enabled",t)}get type(){return this.Ue("type")}set type(t){this.Ae("type",t)}get token(){return this.Ue("token")}set token(t){this.Ae("token",t)}get Re(){return this.Ue("notification_types")}set Re(t){this.Ae("notification_types",t)}get sdk(){return this.Ue("sdk")}set sdk(t){this.Ae("sdk",t)}get device_model(){return this.Ue("device_model")}set device_model(t){this.Ae("device_model",t)}get device_os(){return this.Ue("device_os")}set device_os(t){this.Ae("device_os",t)}get web_auth(){return this.Ue("web_auth")}set web_auth(t){this.Ae("web_auth",t)}get web_p256(){return this.Ue("web_p256")}set web_p256(t){this.Ae("web_p256",t)}},bn=class extends wn{constructor(t,e,i){super(),this.t=t,e&&(this.We=e),i&&(this.Fe=i)}get t(){return this.Ue("name")}set t(t){this.Ae("name",t)}get We(){return this.Ue("appId")}set We(t){this.Ae("appId",t)}get Fe(){return this.Ue("onesignalId")}set Fe(t){this.Ae("onesignalId",t)}get Be(){return this.Fe}get je(){return""}get ze(){return 1}get Ke(){return!hn.pe(this.Fe)}Ve(t){t[this.Fe]&&(this.Fe=t[this.Fe])}},_n=class extends bn{constructor(t,e,i,n){super(j,t,e),i&&(this.qe=i),n&&(this.He=n)}get qe(){return this.Ue("externalId")}set qe(t){this.Ae("externalId",t)}get He(){return this.Ue("existingOnesignalId")}set He(t){this.Ae("existingOnesignalId",t)}get je(){return`${this.We}.User.${this.Fe}`}get Je(){return""}get ze(){return 0}get Ke(){return!this.He||!hn.pe(this.He)}get Be(){return this.He??this.Fe}Ve(t){this.He&&t[this.He]&&(this.He=t[this.He])}};function yn(t,e){return"string"==typeof t&&t?!!t.includes("\0")&&(gt.S(`${e} contains a null byte`),!0):(gt.S(`${e} is required`),!0)}var Sn=class t{static Ge;static Ye(){if(!t.Ge){t.Ge=new t;const e=OneSignal.ye.Qe(),i=OneSignal.ye.Ze(),n=e.Fe??hn.ge();e.Fe||e.Ae(G,n,1),i.Fe||i.Ae("onesignalId",n,1)}return t.Ge}Xe(t){const e=OneSignal.ye.Qe();Object.keys(t).forEach(i=>{e.Ae(i,t[i])})}get onesignalId(){const t=OneSignal.ye.Qe().Fe;return hn.pe(t)?void 0:t}get externalId(){return OneSignal.ye.Qe()?.qe}addAlias(t,e){Re("addAlias",{label:t,id:e}),we()||Cn(t,"label","addAlias: label",!0)&&Cn(e,"id","addAlias: id")&&this.Xe({[t]:e})}addAliases(t){if(Re("addAliases",{aliases:t}),!we()){!function(t,e){if(!rt(t))throw ot(e);if(!t||0===Object.keys(t).length)throw st(e)}(t,"aliases");for(const e in t){const i=`key: ${e}`;if(!Cn(t[e],i,"addAliases: value")||!Cn(e,i,"addAliases: key",!0))return}this.Xe(t)}}removeAlias(t){Re("removeAlias",{label:t}),we()||this.removeAliases([t])}removeAliases(t){if(Re("removeAliases",{aliases:t}),we())return;kn(t,"aliases","label");for(const i of t)if(!Cn(i,"label","removeAliases: label",!0))return;const e=Object.fromEntries(t.map(t=>[t,void 0]));this.Xe(e)}addEmail(t){if(Re("addEmail",{email:t}),!we()&&(In(t,"email"),!yn(t,"addEmail: email"))){if(!function(t){return!!t&&!!t.match(/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/)}(t))throw at("email");On({type:l,token:t})}}addSms(t){Re("addSms",{sms:t}),we()||(In(t,"sms"),yn(t,"addSms: sms")||On({type:"SMS",token:t}))}removeEmail(t){Re("removeEmail",{email:t}),we()||(In(t,"email"),yn(t,"removeEmail: email")||OneSignal.ye.ti().forEach(e=>{e.token===t&&OneSignal.ye.ei(e.Ce)}))}removeSms(t){Re("removeSms",{smsNumber:t}),we()||(In(t,"smsNumber"),yn(t,"removeSms: smsNumber")||OneSignal.ye.ii().forEach(e=>{e.token===t&&OneSignal.ye.ei(e.Ce)}))}addTag(t,e){Re("addTag",{key:t,value:e}),we()||(In(t,"key"),In(e,"value"),this.addTags({[t]:e}))}addTags(t){if(we())return;if(function(t,e,i=!1){return rt(t)?Object.entries(t).some(([t,n])=>!!yn(t,`${e}: key`)||(i?null==n&&yn(n,`${e}: value`):yn(n,`${e}: value`))):(gt.S(`${e}: argument must be an object`),!0)}(t,"addTags",!0))return;const e=OneSignal.ye.Ze();e.ni={...e.ni,...t}}removeTag(t){Re("removeTag",{tagKey:t}),we()||this.removeTags([t])}removeTags(t){if(Re("removeTags",{tagKeys:t}),we())return;if(kn(t,"tagKeys","tagKey"),e=t,i="removeTags",Array.isArray(e)?e.some(t=>yn(t,`${i}: key`)):(gt.S(`${i}: keys must be an array of strings`),1))return;var e,i;const n=OneSignal.ye.Ze(),s={...n.ni};t.forEach(t=>{s[t]=""}),n.ni=s}getTags(){return Re("getTags"),OneSignal.ye.Ze().ni}setLanguage(t){Re("setLanguage",{language:t}),we()||(In(t,"language"),t&&yn(t,"setLanguage: language")||(OneSignal.ye.Ze().si=t||ht()))}getLanguage(){return Re("getLanguage"),OneSignal.ye.Ze().si}trackEvent(t,e={}){if(we())return;if(In(t,"name"),yn(t,"trackEvent: name"))return;const i=OneSignal.ye.Qe().Fe;!hn.pe(i)||vn(i)?function(t){if(!rt(t))return!1;try{return JSON.stringify(t),!0}catch{return!1}}(e)?(Re("trackEvent",{name:t,properties:e}),OneSignal.ye.oi.ai({name:t,properties:e})):gt.S("Properties not serializable"):gt.S("User not logged in")}};function vn(t){return OneSignal.ye.ci.ri.find(e=>e.operation instanceof _n&&e.operation.Fe===t)}function On({type:t,token:e}){if(OneSignal.ye.ui.li().find(i=>i.token===e&&i.type===t))return;const i=OneSignal.ye.Qe(),n=i.Fe;if(hn.pe(n)){const t=Ke();vn(n)||OneSignal.ye.ci.di(new _n(t,n,i.qe))}const s={id:hn.ge(),enabled:!0,notification_types:1,onesignalId:n,token:e,type:t},a=new mn;a.Le(s),OneSignal.ye.hi(a)}function In(t,e){if("string"!=typeof t)throw ot(e)}function kn(t,e,i){if(!Array.isArray(t))throw ot(e);if(0===t.length)throw st(e);for(const n of t)In(n,i)}var xn=/[/?#&=\s\x00-\x1F\x7F]|\.\./;function Cn(t,e,i,n=!1){if(In(t,e),yn(t,i))return!1;if(t.length>128||xn.test(t))throw at(e);if(n&&("external_id"===t||"onesignal_id"===t))throw new Error(`"${t}" is reserved`);return!0}var En=class t extends un{gi;PushSubscription=new pn(!1);static P=new dn;constructor(t,e,i){super(),t&&(this.gi=Sn.Ye(),this.PushSubscription=new pn(!0,e,i))}get onesignalId(){return this.gi?.onesignalId}get externalId(){return this.gi?.externalId}addAlias(t,e){this.gi?.addAlias(t,e)}addAliases(t){this.gi?.addAliases(t)}removeAlias(t){this.gi?.removeAlias(t)}removeAliases(t){this.gi?.removeAliases(t)}addEmail(t){this.gi?.addEmail(t)}removeEmail(t){this.gi?.removeEmail(t)}addSms(t){this.gi?.addSms(t)}removeSms(t){this.gi?.removeSms(t)}addTag(t,e){this.gi?.addTag(t,e)}addTags(t){this.gi?.addTags(t)}removeTag(t){this.gi?.removeTag(t)}removeTags(t){this.gi?.removeTags(t)}getTags(){return this.gi?.getTags()||{}}setLanguage(t){this.gi?.setLanguage(t)}getLanguage(){return this.gi?.getLanguage()||""}trackEvent(t,e){return this.gi?.trackEvent(t,e)}addEventListener(e,i){t.P.on(e,i)}removeEventListener(e,i){t.P.off(e,i)}},Pn=class{previousOneSignalId;previousExternalId};function $n(t,e){return t?t.filter(t=>t.type===e)[0]:void 0}function Tn(t){return t===Et||t===Pt}async function An(){Re("checkAndTriggerSubscriptionChanged");const t=OneSignal.A,e=await OneSignal.A.lt.ct(),i=await OneSignal.A.lt.pi(),n=await pe(),{lastKnownPushEnabled:s,lastKnownPushId:a,lastKnownPushToken:o,lastKnownOptedIn:r}=n,c=await Ve(),l=(await OneSignal.ye._e())?.id;if(e===s&&c===o&&l===a)return;await t.lt.fi(),n.lastKnownPushEnabled=e,n.lastKnownPushToken=c,n.lastKnownPushId=l,n.lastKnownOptedIn=i,await fe(n);const u={previous:{id:a,token:o,optedIn:r??!0},current:{id:l,token:c,optedIn:i}};gt.m("Push sub changed:",u),function(t){sn.re(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,t)}(u)}function Nn(t){(function(t,e){if(OneSignal.gt)return void gt.p("Skipping welcome notif: already subscribed");const i=OneSignal.config?.userConfig.welcomeNotification;if(void 0!==i&&!0===i.disable)return;if(!0!==t)return;if(!e)return;let n=void 0!==i&&void 0!==i.title&&null!==i.title?i.title:"",s=void 0!==i&&void 0!==i.message&&null!==i.message&&i.message.length>0?i.message:"Thanks for subscribing!";const a=new URL(location.href).origin+"?_osp=do_not_open",o=i&&i.url&&i.url.length>0?i.url:a;n=Ce(n),s=Ce(s),gt.p("Sending welcome notif"),async function(t,e,i,n,s){if(Re("MainHelper:showLocalNotification: ",t,e,i,n,s,void 0),!(await ge()).appId)throw Z;if(!OneSignal.Notifications.permission)throw new Error("User is not subscribed");if(!ct(i))throw at("url");if(!ct(n,{allowEmpty:!0,requireHttps:!0}))throw at("icon");if(!n){const t=await ze();n=je(t)}const a={data:s,launchURL:i,buttons:void 0};OneSignal.A.T.$().then(async i=>{if(!i)return void gt.S("SW registration unavailable");const s={body:e,data:a,icon:n,actions:[]};await i.showNotification(t,s)})}(n,s,o,void 0,{wi:!0}),sn.re(OneSignal.EVENTS.WELCOME_NOTIFICATION_SENT,{title:n,message:s,url:o})})(t?.current?.optedIn,t?.current?.id),function(t){if(!0!==t)return;const e=OneSignal.A.mi.userConfig.promptOptions?.slidedown?.prompts;(function(t){if(!t)return!1;const e=$n(t,Pt);return!!e&&!!e.categories&&e.categories.length>0})(e)&&OneSignal.A._i.bi()}(t?.current?.optedIn),function(){if(!OneSignal.config?.userConfig.notifyButton)return;const t=OneSignal.config.userConfig.notifyButton.displayPredicate;t&&"function"==typeof t&&OneSignal.yi&&(!1!==t()?(gt.p("Showing notify button: predicate true"),OneSignal.yi.Dt.j()):(gt.p("Hiding notify button: predicate false"),OneSignal.yi.Dt.K()))}(),OneSignal.config?.userConfig.promptOptions&&new en(OneSignal.config?.userConfig.promptOptions.customlink).Jt()}var Mn=Promise.resolve(),Un=(t=!1)=>{const e=Mn.then(()=>Dn(t));return Mn=e.catch(()=>{}),e},Dn=async t=>{const e=await OneSignal.A.Tt.$t(),i=e!==await ne("notificationPermission");(t||i||e!==OneSignal.Notifications.permissionNative)&&(i&&await ie.put("Options",{key:"notificationPermission",value:e}),sn.re(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_STRING,e),sn.re(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_BOOLEAN,"granted"===e),(t||i)&&await An().catch(gt.S))};async function Ln(){const t=OneSignal.A;let e=null;try{const i=await t.lt.Ie(nn.ae);e=await t.lt.Si(i),cn(),await Un(),await An()}catch(i){gt.S(i)}return e}function Fn(t){switch(t){case c:case u:case d:case h:return!0;default:return!1}}async function Rn(){if(gt.p("sessionInit()"),OneSignal.Oi)return void gt.p("sessionInit already running");OneSignal.Oi=!0;try{await async function(){const t=[];t.push(async function(){const t=await OneSignal.A.lt.ct(),e=await OneSignal.A.Tt.$t();Ge("subscription.optedOut",await OneSignal.A.lt.Ii()),await ie.put("Options",{key:"isPushEnabled",value:t}),await ie.put("Options",{key:"notificationPermission",value:e})}()),t.push(async function(){try{navigator.permissions&&((await navigator.permissions.query({name:"notifications"})).onchange=function(){Un()})}catch(t){gt._(`Permission change hook failed: ${String(t)}`)}}()),t.push(("granted"===OneSignal.A.Tt.ki(OneSignal.A.mi.safariWebId)&&(OneSignal.gt=!0),Promise.resolve())),t.push(function(){if(navigator.serviceWorker&&window.isSecureContext)try{OneSignal.A.T.xi()}catch(t){gt.S(t)}return Promise.resolve()}()),function(){if(!OneSignal.yi){OneSignal.config.userConfig.notifyButton=OneSignal.config.userConfig.notifyButton||{},OneSignal.config.userConfig.bell&&(OneSignal.config.userConfig.bell={...OneSignal.config.userConfig.bell,...OneSignal.config.userConfig.notifyButton},OneSignal.config.userConfig.notifyButton={...OneSignal.config.userConfig.notifyButton,...OneSignal.config.userConfig.bell});const t=OneSignal.config.userConfig.notifyButton.displayPredicate;t&&"function"==typeof t?OneSignal.P.once(OneSignal.EVENTS.SDK_INITIALIZED,async()=>{!1!==await Promise.resolve(OneSignal.config.userConfig.notifyButton.displayPredicate?.())?(OneSignal.yi=new mi(OneSignal.config.userConfig.notifyButton),OneSignal.yi.Lt()):gt.p("Notify button predicate returned false")}):(OneSignal.yi=new mi(OneSignal.config.userConfig.notifyButton),OneSignal.yi.Lt())}}(),t.push(async function(){const t=OneSignal.config;t.userConfig.promptOptions&&await new en(t.userConfig.promptOptions.customlink).Jt()}());try{await Promise.all(t)}catch(e){throw gt.S(e),new Error("Unknown init error")}}()}catch(n){if(n instanceof Error)return;throw n}const t=await OneSignal.A.lt.Ii()??!1,e=await be();e.optedOut=t,await _e(e),await async function(t){gt.m("handleAutoResubscribe",{autoResubscribe:OneSignal.config?.userConfig.autoResubscribe,isOptedOut:t}),OneSignal.config?.userConfig.autoResubscribe&&!t&&"granted"==OneSignal.A.Tt.ki(OneSignal.A.mi.safariWebId)&&await Ln()}(t);const i=await OneSignal.A.lt.ct();await ie.put("Options",{key:"isPushEnabled",value:!!i}),OneSignal.config?.userConfig.promptOptions?.autoPrompt&&!t&&OneSignal.A.Ei.Ci(),OneSignal.Oi=!1,sn.re(OneSignal.EVENTS.SDK_INITIALIZED)}async function Wn(){return!!(await Ln())}async function Bn(){const t=await async function(){const t=OneSignal.A;if(gt.p("Checking sub expiration"),!(await t.lt.Pi()))return gt.p("Sub not expired"),!1;gt.p("Sub expiring");const e=await t.lt.Ie(nn.oe);return await t.lt.Si(e),!0}();await OneSignal.A.lt.$i()?(OneSignal.A.Ai.Ti(),t||await OneSignal.A.Mi.Ni()):OneSignal.config?.userConfig.promptOptions?.autoPrompt||OneSignal.config?.userConfig.autoResubscribe||await OneSignal.A.Mi.Ni(),sn.re(OneSignal.EVENTS.SDK_INITIALIZED_PUBLIC)}var jn=class extends bn{constructor(t){super(H,t?.appId,t?.onesignalId),t?.externalId&&(this.qe=t.externalId),t?.timestamp&&(this.Ui=t.timestamp),t?.event&&(this.Di=t.event)}get qe(){return this.Ue("externalId")}set qe(t){this.Ae("externalId",t)}get Ui(){return this.Ue("timestamp")}set Ui(t){this.Ae("timestamp",t)}get Di(){return this.Ue("event")}set Di(t){this.Ae("event",t)}get key(){return`${this.We}.User.${this.Fe}.CustomEvent.${this.Di.name}`}get je(){return this.key}get Je(){return this.key}get ze(){return 2}get Ke(){return!hn.pe(this.Fe)}get Be(){return this.Fe}Ve(t){t[this.Fe]&&(this.Fe=t[this.Fe])}},zn=class{Li;Fi;constructor(t,e){this.Li=t,this.Fi=e}ai(t){const e=Ke(),i=this.Li.Ri,n=new jn({appId:e,onesignalId:i.Fe,externalId:i.qe,timestamp:(new Date).toISOString(),event:t});this.Fi.di(n)}};function Kn(t){switch(t){case 400:case 402:return 0;case 401:case 403:return 2;case 404:case 410:return 3;case 409:return 4;default:return 1}}var Vn=class{get Wi(){return[H]}get Bi(){return{sdk:C,device_model:L(),device_os:D(),type:U()}}async ji(t){gt.p(`CustomEventOpExec(${JSON.stringify(t)})`);const e=t[0];if(!(e instanceof jn))throw new Error(`Unrecognized operation! Expected TrackEventOperation, got: ${e.constructor.name}`);const{ok:i,status:n}=await async function(t,e){const{appId:i}=t;return wt(`apps/${i}/custom_events`,{events:[e]},t.jwtHeader)}({appId:e.We},{name:e.Di.name,onesignal_id:e.Fe,external_id:e.qe,timestamp:e.Ui,payload:{...e.Di.properties,os_sdk:this.Bi}}),s=Kn(n);return i?{zi:0}:1===s?{zi:2}:{zi:3}}},qn=class extends bn{constructor(t,e,i,n){super(t,e,i),n&&(this.label=n)}get label(){return this.Ue("label")}set label(t){this.Ae("label",t)}},Hn=class extends qn{constructor(t,e,i){super(R,t,e,i)}get Je(){return`${this.We}.User.${this.Fe}.Alias.${this.label}`}get ze(){return 2}},Jn=class extends qn{constructor(t,e,i,n){super(F,t,e,i),n&&(this.value=n)}get value(){return this.Ue("value")}set value(t){this.Ae("value",t)}get Je(){return`${this.We}.User.${this.Fe}.Identity.${this.label}`}},Gn=class{Li;Ki;Vi;constructor(t,e,i){this.Li=t,this.Ki=e,this.Vi=i}get Wi(){return[F,R]}async ji(t){if(gt.p(`IdentityOpExec(${JSON.stringify(t)})`),t.filter(t=>!(t instanceof Jn||t instanceof Hn)).length>0)throw new Error(`Unrecognized operation(s)! Attempted operations:\n${JSON.stringify(t)}`);const e=t.some(t=>t instanceof Jn),i=t.some(t=>t instanceof Hn);if(e&&i)throw new Error("Can't process SetAliasOperation and DeleteAliasOperation at the same time.");const n=t[t.length-1],s=n instanceof Jn,{ok:a,status:o,retryAfterSeconds:r}=await(s?async function(t,e,i){const{appId:n}=t;return bt(`apps/${n}/users/by/${e.label}/${e.id}/identity`,{identity:i},t.jwtHeader)}({appId:n.We},{label:G,id:n.Fe},{[n.label]:n.value}):async function(t,e,i){const{appId:n}=t;return mt(`apps/${n}/users/by/${e.label}/${e.id}/identity/${i}`,t.jwtHeader)}({appId:n.We},{label:G,id:n.Fe},n.label));if(a)return this.Li.Ri.Fe===n.Fe&&this.Li.Ri.Ae(n.label,s?n.value:void 0,2),{zi:0};switch(Kn(o)){case 1:return{zi:2,qi:r};case 0:return{zi:3};case 4:return s?{zi:5,qi:r}:{zi:0};case 2:return{zi:4,qi:r};case 3:if(404===o&&this.Vi.Hi(n.Fe))return{zi:2,qi:r};if(s){const t=await this.Ki.Ji(n.We,n.Fe);return null==t?{zi:3}:{zi:2,qi:r,Wi:t}}return{zi:0}}}},Yn=class extends bn{constructor(t,e,i,n){super(t,e,i),n&&(this.Gi=n)}get Gi(){return this.Ue("subscriptionId")}set Gi(t){this.Ae("subscriptionId",t)}get je(){return`${this.We}.User.${this.Fe}`}get Je(){return`${this.We}.User.${this.Fe}.Subscription.${this.Gi}`}get Ke(){return!hn.pe(this.Fe)&&!hn.pe(this.Gi)}get Be(){return this.Gi}Ve(t){super.Ve(t),t[this.Gi]&&(this.Gi=t[this.Gi])}},Qn=class extends Yn{constructor(t,e,i,n){super(t,e,i),n&&(this.sdk=C,this.device_model=L(),this.device_os=D(),this.enabled=n.enabled,this.notification_types=n.notification_types,this.Gi=n.subscriptionId,this.token=n.token,this.type=n.type,this.web_auth=n.web_auth,this.web_p256=n.web_p256)}get type(){return this.Ue("type")}set type(t){this.Ae("type",t)}get token(){return this.Ue("token")}set token(t){this.Ae("token",t)}get enabled(){return this.Ue("enabled")}set enabled(t){this.Ae("enabled",t)}get notification_types(){return this.Ue("notification_types")}set notification_types(t){this.Ae("notification_types",t)}get sdk(){return this.Ue("sdk")}set sdk(t){this.Ae("sdk",t)}get device_model(){return this.Ue("device_model")}set device_model(t){this.Ae("device_model",t)}get device_os(){return this.Ue("device_os")}set device_os(t){this.Ae("device_os",t)}get web_auth(){return this.Ue("web_auth")}set web_auth(t){this.Ae("web_auth",t)}get web_p256(){return this.Ue("web_p256")}set web_p256(t){this.Ae("web_p256",t)}},Zn=class extends Qn{constructor(t){super(z,t?.appId,t?.onesignalId,t)}get Ke(){return!hn.pe(this.Fe)}get Be(){return this.Fe}Ve(t){t[this.Fe]&&(this.Fe=t[this.Fe])}},Xn=class extends Yn{constructor(t,e,i){super(V,t,e),i&&(this.Gi=i)}get ze(){return 2}},ts=class extends bn{constructor(t,e){super(B,t,e)}get je(){return`${this.We}.User.${this.Fe}.Refresh`}get Je(){return`${this.We}.User.${this.Fe}.Refresh`}get ze(){return 0}},es=class extends Yn{constructor(t,e,i){super(q,t,e),i&&(this.Gi=i)}get ze(){return 2}get Je(){return`${this.We}.Subscription.${this.Gi}.Transfer`}},is=class extends Qn{constructor(t){super(K,t?.appId,t?.onesignalId,t)}},ns=class{Yi;Li;Qi;Zi;constructor(t,e,i,n){this.Yi=t,this.Li=e,this.Qi=i,this.Zi=n}get Wi(){return[j]}async ji(t){gt.p(`LoginUserOpExec(${JSON.stringify(t)})`);const e=t[0];if(e instanceof _n)return this.Xi(e,t.slice(1));throw new Error(`Unrecognized operation: ${e.t}`)}async Xi(t,e){if(!t.He||!t.qe)return this.tn(t,e);const i=await this.Yi.ji([new Jn(t.We,t.He,J,t.qe)]);switch(i.zi){case 0:{const e=t.He,i=t.Fe;return this.Li.Ri.Fe===i&&this.Li.Ri.Ae(G,e,2),this.Qi.Ri.Fe===i&&this.Qi.Ri.Ae("onesignalId",e,2),{zi:1,en:{[t.Fe]:e}}}case 5:return gt.p(`409 conflict: ${t.qe}`),this.tn(t,e);case 3:return gt.S(`SetAlias failed: ${t.qe}`),this.tn(t,e);default:return{zi:i.zi}}}async tn(t,e){const i={};let n={};const s={timezone_id:ss(),language:ht()};t.qe&&(i[J]=t.qe);for(const l of e){if(!(l instanceof Zn||l instanceof es||l instanceof is||l instanceof Xn))throw new Error(`Unrecognized operation: ${l.t}`);n=this.nn(l,n)}const a=Object.entries(n);if(0===Object.keys(i).length&&0===a.length)return gt.p("CreateUser: skipped, no identity and no subscriptions"),{zi:3};const o=await async function(t,e){const{appId:i,subscriptionId:n}=t,s=n?{"OneSignal-Subscription-Id":n}:void 0;let a={};return s&&(a={...a,...s}),t.jwtHeader&&(a={...a,...t.jwtHeader}),e.refresh_device_metadata=!0,wt(`apps/${i}/users`,e,a)}({appId:t.We},{identity:i,subscriptions:a.map(([,t])=>t),properties:s});if(o.ok){const e=o.result.identity.onesignal_id,n=t.Fe,s={[t.Fe]:e},r=this.Li.Ri.Fe===n;if(r){this.Li.Ri.Ae(G,e,2),this.Qi.Ri.Ae("onesignalId",e,2);const t=o.result.properties;if(t)for(const[e,i]of Object.entries(t))this.Qi.Ri.Ae(e,i,2)}for(let t=0;t{const t=new Pn;return t.previousOneSignalId="",t.previousExternalId="",t.previousOneSignalId=await ne("previousOneSignalId"),t.previousExternalId=await ne("previousExternalId"),t})(),{previousOneSignalId:e,previousExternalId:i}=t,n=OneSignal.ye.Qe(),s=n?.Fe,a=n?.qe;if(s===e&&a===i)return;t.previousOneSignalId=s,t.previousExternalId=a,await(async t=>{await ie.put("Options",{key:"previousOneSignalId",value:t.previousOneSignalId}),await ie.put("Options",{key:"previousExternalId",value:t.previousExternalId})})(t);const o={current:{onesignalId:s,externalId:a}};gt.m("User changed:",o),function(t){sn.re(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,t,En.P)}(o)}();return{zi:0,Wi:Object.keys(i).length>0?[new ts(t.We,e)]:void 0,en:s}}const{status:r,retryAfterSeconds:c}=o;switch(Kn(r)){case 1:return{zi:2,qi:c};case 2:return{zi:4,qi:c};default:return{zi:6}}}nn(t,e){switch(!0){case t instanceof Zn:{const i=t.Gi;return{...e,[i]:{enabled:t.enabled,device_model:t.device_model,device_os:t.device_os,notification_types:t.notification_types,sdk:t.sdk,token:t.token,type:t.type,web_auth:t.web_auth,web_p256:t.web_p256}}}case t instanceof is:{const i=t.Gi;return e[i]?{...e,[i]:{...e[i],enabled:t.enabled,notification_types:t.notification_types,token:t.token}}:e}case t instanceof es:{const i=t.Gi;if(hn.pe(i)){if(e[i])return e;const t=this.Zi.sn(i);return t?.token?{...e,[i]:{enabled:t.enabled,device_model:t.device_model,device_os:t.device_os,notification_types:t.Re,sdk:t.sdk,token:t.token,type:t.type,web_auth:t.web_auth,web_p256:t.web_p256}}:e}return{...e,[i]:{...e[i],id:i}}}case t instanceof Xn:{const i={...e};return delete i[t.Gi],i}default:return e}}},ss=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,as=class extends wn{get Fe(){return this.Ue(G)}set Fe(t){this.Ae(G,t)}get qe(){return this.Ue(J)}set qe(t){this.Ae(J,t)}},os=class extends wn{constructor(){super()}get Fe(){return this.Ue("onesignalId")}set Fe(t){this.Ae("onesignalId",t)}get an(){return this.Ue("ip")}set an(t){this.Ae("ip",t)}get rn(){return this.Ue("country")}set rn(t){this.Ae("country",t)}get si(){return this.Ue("language")}set si(t){this.Ae("language",t)}get cn(){return this.Ue("timezone_id")}set cn(t){this.Ae("timezone_id",t)}get ni(){return this.Ue("tags")??{}}set ni(t){this.Ae("tags",t)}},rs=class{Li;Qi;Zi;Ki;Vi;constructor(t,e,i,n,s){this.Li=t,this.Qi=e,this.Zi=i,this.Ki=n,this.Vi=s}get Wi(){return[B]}async ji(t){if(gt.p(`RefreshUserOpExec(${JSON.stringify(t)})`),t.some(t=>!(t instanceof ts)))throw new Error(`Unrecognized operation(s)! Attempted operations:\n${JSON.stringify(t)}`);const e=t[0];return this.ln(e)}async ln(t){const{ok:e,result:i,retryAfterSeconds:n,status:s}=await async function(t,e){const{appId:i}=t;return ft(`apps/${i}/users/by/${e.label}/${e.id}`,t.jwtHeader)}({appId:t.We},{label:G,id:t.Fe});if(e){if(t.Fe!==this.Li.Ri.Fe)return{zi:0};const e=new as;for(const[t,c]of Object.entries(i.identity))e.Ae(t,c);const n=new os;n.Fe=t.Fe;const{properties:s={},subscriptions:a=[]}=i;Object.entries(s).forEach(([t,e])=>{n.Ae(t,e)});const o=[];for(const i of a){const e=new mn;e.id=i.id,e.token=i.token??"",e.Re=i.notification_types??1,e.type=i.type,e.enabled=-2!==e.Re,e.sdk=i.sdk,e.device_os=i.device_os,e.device_model=i.device_model,e.Fe=t.Fe,Fn(e.type)||o.push(e)}const r=await OneSignal.ye._e();return r&&(r.Fe=t.Fe,o.push(r)),this.Li.un(e,2),this.Qi.un(n,2),this.Zi.dn(o,2),{zi:0}}switch(Kn(s)){case 1:return{zi:2,qi:n};case 2:return{zi:4,qi:n};case 3:{if(404===s&&this.Vi.Hi(t.Fe))return{zi:2,qi:n};const e=await this.Ki.Ji(t.We,t.Fe);return e?{zi:2,qi:n,Wi:e}:{zi:3}}default:return{zi:3}}}},cs=class{ui;Ki;Vi;constructor(t,e,i){this.ui=t,this.Ki=e,this.Vi=i}get Wi(){return[z,K,V,q]}async ji(t){gt.p(`SubOpExec(${JSON.stringify(t)})`);const e=t[0];if(e instanceof Zn)return this.hn(e,t);if(t.some(t=>t instanceof Xn)){if(t.length>1)throw new Error(`Only supports one operation! Attempted operations:\n${JSON.stringify(t)}`);return this.gn(t[0])}if(e instanceof is)return this.pn(t);if(e instanceof es){if(t.length>1)throw new Error(`TransferSubscriptionOperation only supports one operation! Attempted operations:\n${JSON.stringify(t)}`);return this.fn(e)}throw new Error(`Unrecognized operation: ${JSON.stringify(e)}`)}async hn(t,e){if(e.some(t=>t instanceof Xn))return{zi:0};const i=[...e].reverse().find(t=>t instanceof is),n=i?.enabled??t.enabled,s=i?.token??t.token,a=i?.notification_types??t.notification_types,o={sdk:t.sdk,type:t.type,enabled:n,token:s,notification_types:a},r=await async function(t,e,i){const{appId:n}=t;return wt(`apps/${n}/users/by/${e.label}/${e.id}/subscriptions`,i,t.jwtHeader)}({appId:t.We},{label:G,id:t.Fe},{subscription:o});if(r.ok){const{subscription:e}=r.result,i=this.ui.sn(t.Gi),n=e?.id;return n&&(i?.Ae("id",n,2),i?.Ae("onesignalId",t.Fe,2)),{zi:0,Wi:n?void 0:[new ts(t.We,t.Fe)],en:n?{[t.Gi]:n}:void 0}}const{retryAfterSeconds:c,status:l}=r;switch(Kn(l)){case 1:return{zi:2,qi:c};case 2:return{zi:4,qi:c};case 4:case 0:return{zi:3};case 3:{if(404===l&&this.Vi.Hi(t.Fe))return{zi:2,qi:c};const e=await this.Ki.Ji(t.We,t.Fe);return e?{zi:2,qi:c,Wi:e}:{zi:3}}}}async pn(t){const e=t[t.length-1],i={type:e.type,enabled:e.enabled,token:e.token,notification_types:e.notification_types,web_auth:e.web_auth,web_p256:e.web_p256},n=await async function(t,e,i){const{appId:n}=t;return bt(`apps/${n}/subscriptions/${e}`,{subscription:i})}({appId:e.We},e.Gi,i);if(n.ok)return{zi:0};const{retryAfterSeconds:s,status:a}=n;switch(Kn(a)){case 1:return{zi:2,qi:s};case 3:return 404===a&&[e.Fe,e.Gi].some(t=>this.Vi.Hi(t))?{zi:2,qi:s}:{zi:3,Wi:[new Zn({appId:e.We,enabled:e.enabled,notification_types:e.notification_types,onesignalId:e.Fe,subscriptionId:e.Gi,token:e.token,type:e.type})]};default:return{zi:3}}}async fn(t){const e=await async function(t,e,i){const{appId:n}=t;return bt(`apps/${n}/subscriptions/${e}/owner`,{identity:{...i}},t.jwtHeader)}({appId:t.We},t.Gi,{onesignal_id:t.Fe});if(e.ok)return{zi:0};const{retryAfterSeconds:i,status:n}=e;return 1===Kn(n)?{zi:2,qi:i}:{zi:3}}async gn(t){const e=await async function(t,e){const{appId:i}=t;return mt(`apps/${i}/subscriptions/${e}`)}({appId:t.We},t.Gi);if(e.ok)return this.ui.wn(t.Gi,2),{zi:0};const{retryAfterSeconds:i,status:n}=e;switch(Kn(n)){case 3:return[t.Fe,t.Gi].some(t=>this.Vi.Hi(t))?{zi:2,qi:i}:{zi:0};case 1:return{zi:2,qi:i};default:return{zi:3}}}},ls=class extends bn{constructor(t,e,i,n){super(W,t,e),i&&n&&(this.mn=i,this.value=n)}get mn(){return this.Ue("property")}set mn(t){this.Ae("property",t)}get value(){return this.Ue("value")}set value(t){this.Ae("value",t)}get Je(){return`${this.We}.User.${this.Fe}`}},us=class{Li;Qi;Ki;Vi;constructor(t,e,i,n){this.Li=t,this.Qi=e,this.Ki=i,this.Vi=n}get Wi(){return[W]}bn(t){let e=null,i=null,n={};for(const s of t){if(!(s instanceof ls))throw new Error(`Unrecognized operation: ${JSON.stringify(s)}`);e||(e=s.We,i=s.Fe),n=ds(s,n)}return{appId:e,onesignalId:i,propertiesObject:n,refreshDeviceMetadata:!1}}async ji(t){gt.p(`UpdateUserOpExec(${JSON.stringify(t)})`);const{appId:e,onesignalId:i,propertiesObject:n,refreshDeviceMetadata:s}=this.bn(t);if(!e||!i)return{zi:0};const{ok:a,retryAfterSeconds:o,status:r}=await St({appId:e},{label:G,id:i},{properties:n,refresh_device_metadata:s}),c=t=>"tags"===t.mn;if(a){if(this.Li.Ri.Fe===i)for(const e of t)if(e instanceof ls){let t=e.value;if(c(e)){t={...e.value};for(const e in t)""===t[e]&&delete t[e]}this.Qi.Ri.Ae(e.mn,t,2)}return{zi:0}}switch(Kn(r)){case 1:return{zi:2,qi:o};case 2:return{zi:4,qi:o};case 3:{if(404===r&&this.Vi.Hi(i))return{zi:2,qi:o};const t=await this.Ki.Ji(e,i);return t?{zi:2,qi:o,Wi:t}:{zi:3}}default:return{zi:3}}}};function ds(t,e){if(t instanceof ls){const i=t.mn;return["ip","tags","language","timezone_id","country"].includes(i)?{...e,[i]:t.value}:{...e}}throw new Error(`Unsupported operation type: ${t.t}`)}var hs=class{_n;Fi;constructor(t,e){this._n=t,this.Fi=e,this._n.Ie(this)}yn(t,e){if(0!==e)return;const i=this.Sn(t);null!=i&&this.Fi.di(i)}vn(t,e){if(0!==e)return;const i=this.On(t.model,t.property,t.oldValue,t.newValue);null!=i&&this.Fi.di(i)}},gs=class extends hs{constructor(t,e){super(t,e)}Sn(t){return null}On(t,e,i,n){const s=Ke();return null!=n&&"string"==typeof n?new Jn(s,t.Fe,e,n):new Hn(s,t.Fe,e)}},ps=class extends hs{constructor(t,e){super(t,e)}Sn(t){return null}On(t,e,i,n){const s=Ke();return new ls(s,t.Fe,e,n)}},fs=class{_n;Fi;constructor(t,e){this._n=t,this.Fi=e,this._n.Ie(this)}In(){this._n.ke(this)}kn(t,e){if(0!==e)return;const i=this.xn(t);null!=i&&this.Fi.di(i)}vn(t,e){if(0!==e)return;const i=this.On(t.model,t.property,t.oldValue,t.newValue);null!=i&&this.Fi.di(i)}Cn(t,e){if(0!==e)return;const i=this.En(t);null!=i&&this.Fi.di(i)}},ws=class t extends fs{Li;constructor(t,e,i){super(t,e),this.Li=i}xn(e){const{enabled:i,notification_types:n}=t.Pn(e),s=Ke();return new Zn({appId:s,onesignalId:this.Li.Ri.Fe,subscriptionId:e.id,type:e.type,enabled:i,token:e.token,notification_types:n})}En(t){const e=Ke();return new Xn(e,this.Li.Ri.Fe,t.id)}On(e){const{enabled:i,notification_types:n}=t.Pn(e),s=Ke();return new is({appId:s,onesignalId:this.Li.Ri.Fe,subscriptionId:e.id,type:e.type,enabled:i,token:e.token,notification_types:n,web_auth:e.web_auth,web_p256:e.web_p256})}static Pn(t){let e,i;return t.enabled&&1===t.Re&&t.token?(e=!0,i=1):(e=!1,i=t.enabled?t.Re:-2),{enabled:e,notification_types:i}}},ms=class{$n;Tn=new fn;An=[];Nn=!1;constructor(t){this.$n=t}Mn(t,e=0){const i=this.An.find(e=>e.Ce===t.Ce);i&&this.Un(i,e),this.Dn(t,e)}Ln(t,e,i=0){const n=this.An.find(t=>t.Ce===e.Ce);n&&this.Un(n,i),this.Dn(e,i,t)}li(){return this.An}Fn(t){return this.An.find(e=>e.Ce===t)}wn(t,e=0){const i=this.An.find(e=>e.Ce===t);i&&this.Un(i,e)}De(t,e){this.Rn(),this.Tn.xe(i=>i.vn(t,e))}dn(t,e=0){this.Wn(e);for(const i of t)this.Mn(i,e)}Wn(t=0){for(const e of this.An)e.ke(this),this.Tn.xe(i=>i.Cn(e,t)),ie.delete(this.$n,e.Ce);this.An=[]}Dn(t,e,i){void 0!==i?this.An.splice(i,0,t):this.An.push(t),t.Ie(this),this.Rn(),this.Tn.xe(i=>i.kn(t,e))}async Un(t,e){const i=this.An.findIndex(e=>e.Ce===t.Ce);-1!==i&&this.An.splice(i,1),t.ke(this),await ie.delete(this.$n,t.Ce),this.Rn(),this.Tn.xe(i=>i.Cn(t,e))}async L(){if(!this.$n)return;const t=await ie.getAll(this.$n),e=this.An.length>0;for(let i=t.length-1;i>=0;i--){const e=this.Lt(t[i]);e&&(this.An.unshift(e),e.Ie(this))}this.Nn=!0,e&&this.Rn()}async Rn(){if(this.$n&&this.Nn)for(const t of this.An)await ie.put(this.$n,{modelId:t.Ce,modelName:this.$n,...t.toJSON()})}Ie(t){this.Tn.Ie(t)}ke(t){this.Tn.ke(t)}get Oe(){return this.Tn.Oe}},bs=class extends ms{constructor(){super("operations")}async Bn(){return this.L()}Lt(t){if(null===t)return gt.S("null jsonObject in OpModelStore.create"),null;if(!this.jn(t))return null;const e=t.name;let i;switch(e){case F:i=new Jn;break;case R:i=new Hn;break;case z:i=new Zn;break;case K:i=new is;break;case V:i=new Xn;break;case q:i=new es;break;case j:i=new _n;break;case B:i=new ts;break;case W:i=new ls;break;case H:i=new jn;break;default:throw new Error(`Unrecognized operation: ${e}`)}return i.$e(t),i}jn(t){const e=t?.name;if(!e)return gt.S("Missing 'name' attribute"),!1;const i=new Set([j]);return!(!t.onesignalId&&!i.has(e)&&(gt.S(`${e} jsonObject must have 'onesignalId' attribute`),1))}},_s=class{Li;Qi;Zi;constructor(t,e,i){this.Li=t,this.Qi=e,this.Zi=i}async Ji(t,e){const i=new as;i.Te(null,this.Li.Ri),(new os).Te(null,this.Qi.Ri);const n=[];for(const o of this.Zi.li()){const t=new mn;t.Te(null,o),n.push(t)}if(i.Fe!==e)return null;const s=[];s.push(new _n(t,e,i.qe));const a=await OneSignal.ye._e();return a&&s.push(new Zn({appId:t,onesignalId:e,subscriptionId:a.id,type:a.type,enabled:a.enabled,token:a.token,notification_types:a.Re})),s.push(new ts(t,e)),s}},ys=class extends ms{zn;constructor(t,e){super(e),this.zn=t,this.L()}Lt(t){const e=this.zn();return null!=t&&e.$e(t),e}},Ss=class{store;changeSubscription=new fn;constructor(t){this.store=t,t.Ie(this)}get Ri(){const t=this.store.li()[0];if(t)return t;const e=this.store.Lt();if(!e)throw new Error(`Unable to initialize model from store ${this.store.$n}`);return this.store.Mn(e),e}un(t,e){const i=this.Ri;i.Te(i.Ce,t),this.store.Rn(),this.changeSubscription.xe(t=>t.yn(i,e))}Ie(t){this.changeSubscription.Ie(t)}ke(t){this.changeSubscription.ke(t)}get Oe(){return this.changeSubscription.Oe}kn(){}vn(t,e){this.changeSubscription.xe(i=>i.vn(t,e))}Cn(){}},vs=class extends Ss{constructor(){super(new ys(()=>new as,"identity"))}},Os=class extends Ss{constructor(){super(new ys(()=>new os,"properties"))}},Is=class extends ys{constructor(){super(()=>new mn,"subscriptions")}sn(t){return super.li().find(e=>e.id===t)}dn(t,e){if(2!==e)return super.dn(t,e);for(const i of t)if(Fn(i.type)){const t=this.Fn(i.Ce);t&&(i.sdk=t.sdk,i.device_os=t.device_os);break}super.dn(t,e)}},ks=class{Kn=new Map;get Vn(){return this.Kn}Mn(t){this.Kn.set(t,Date.now())}qn(t){if(!t)return!0;const e=this.Kn.get(t);return!e||Date.now()-e>=500}Hi(t){const e=this.Kn.get(t);return!!e&&Date.now()-e<=15e3}},xs=t=>{ie.delete("operations",t.Ce)},Cs=class{Hn;ri=[];Jn=void 0;Gn=0;Yn;Vi;constructor(t,e,i){this.Yn=e,this.Vi=i,this.Hn=new Map;for(const n of t)for(const t of n.Wi)this.Hn.set(t,n)}Wn(){this.ri=[]}get Vn(){return this.Vi.Vn}get Qn(){return 0===this.Gn?0:this.Gn-1}Zn(t){return this.ri.some(e=>e.operation instanceof t)}async Xn(){await this.ts(),this.es()}ns(){clearInterval(this.Jn),this.Jn=void 0,gt.p("OpRepo: Paused")}di(t){gt.p(`OpRepo.enqueue: ${JSON.stringify(t)}`),this.ss({operation:t,bucket:this.Gn,retries:0},!0)}async rs(t){gt.p(`OpRepo.enqueueAndWait: ${JSON.stringify(t)}`),await new Promise((e,i)=>{this.ss({operation:t,bucket:this.Gn,retries:0,resolver:t=>t?e():i()},!0)})}ss(t,e,i){this.ri.some(e=>e.operation.Ce===t.operation.Ce)?gt.p(`OpRepo: duplicate modelId: ${t.operation.Ce}`):(void 0!==i?this.ri.splice(i,0,t):this.ri.push(t),e&&this.Yn.Mn(t.operation))}es(){this.Gn++;let t=!1;this.Jn=setInterval(async()=>{if(t)return gt.p("Ops in progress");const e=this.cs(this.Qn);e?(t=!0,await this.ls(e),t=!1):this.Gn++},500)}async ls(t){try{const e=t[0],i=this.Hn.get(e.operation.t);if(!i)throw new Error(`Could not find executor for operation ${e.operation.t}`);const n=t.map(t=>t.operation),s=await i.ji(n),a=s.en;gt.p(`OpRepo: result = ${s.zi}`),a&&(t.forEach(t=>t.operation.Ve(a)),this.ri.forEach(t=>t.operation.Ve(a)),Object.values(a).forEach(t=>this.Vi.Mn(t)));let o=0;switch(s.zi){case 0:t.forEach(t=>{this.Yn.wn(t.operation.Ce)}),t.forEach(t=>t.resolver?.(!0));break;case 4:case 3:case 5:gt.S(`Op failed (no retry): ${JSON.stringify(n)}`),t.forEach(t=>{this.Yn.wn(t.operation.Ce)}),t.forEach(t=>t.resolver?.(!1));break;case 1:this.Yn.wn(e.operation.Ce),e.resolver?.(!0),t.filter(t=>t!==e).reverse().forEach(t=>this.ri.unshift(t));break;case 2:gt.S(`Op failed, retrying: ${JSON.stringify(n)}`),[...t].reverse().forEach(t=>{xs(t.operation),t.retries++,t.retries>o&&(o=t.retries),this.ri.unshift(t)});break;case 6:gt.S(`Op failed, pausing: ${JSON.stringify(n)}`),this.ns(),t.forEach(t=>t.resolver?.(!1)),[...t].reverse().forEach(t=>{xs(t.operation),this.ri.unshift(t)})}if(s.Wi)for(const t of[...s.Wi].reverse()){const e={operation:t,bucket:0,retries:0};this.ri.unshift(e),this.Yn.Ln(0,e.operation)}await this.us(o,s.qi),s.en&&await ut(500)}catch(e){gt.S(`Op execute error: ${JSON.stringify(t)}`,e),t.forEach(t=>{this.Yn.wn(t.operation.Ce)}),t.forEach(t=>t.resolver?.(!1))}}async us(t,e){gt.p(`retryAfterSeconds: ${e}`);const i=1e3*(e||0),n=1e3*t,s=Math.max(n,i);s<1||(gt.S(`Ops delayed: ${s}ms`),await ut(s))}cs(t){const e=this.ri.findIndex(e=>e.operation.Ke&&this.Vi.qn(e.operation.Be)&&e.bucket<=t);if(-1!==e){const t=this.ri[e];return this.ri.splice(e,1),this.ds(t)}return null}ds(t){const e=[t];if(2===t.operation.ze)return e;const i=0===t.operation.ze?t.operation.je:t.operation.Je,n=[...this.ri];for(const s of n){const n=0===t.operation.ze?s.operation.je:s.operation.Je;if(""===n&&""===i)throw new Error("Both comparison keys cannot be blank!");if(this.Vi.qn(s.operation.Be)&&n===i){const t=this.ri.indexOf(s);-1!==t&&(this.ri.splice(t,1),e.push(s))}}return e}async ts(){await this.Yn.Bn();const t=[...this.Yn.li()].reverse();for(const e of t)this.ss({operation:e,bucket:this.Gn,retries:0},!1,0)}},Es=class{Yn;ci;hs;ui;Li;Qi;oi;gs;ps;fs;constructor(){this.hs=new ks,this.Yn=new bs,this.Li=new vs,this.Qi=new Os,this.ui=new Is,this.ps=new _s(this.Li,this.Qi,this.ui),this.fs=this.ws(),this.ci=new Cs(this.fs,this.Yn,this.hs),this.oi=new zn(this.Li,this.ci),this.bs(),this.gs=this.ci.Xn()}async _s(){return Re("CoreModule.init"),this.gs}bs(){return this.ci?[new gs(this.Li,this.ci),new ps(this.Qi,this.ci),new ws(this.ui,this.ci,this.Li)]:[]}ws(){const t=new Gn(this.Li,this.ps,this.hs);return[t,new ns(t,this.Li,this.Qi,this.ui),new rs(this.Li,this.Qi,this.ui,this.ps,this.hs),new cs(this.ui,this.ps,this.hs),new us(this.Li,this.Qi,this.ps,this.hs),new Vn]}},Ps=class{type;token;enabled;notificationTypes;sdk;deviceModel;deviceOs;webAuth;webp256;constructor(t){this.token=this.ys(t),this.type=U(),this.enabled=!0,this.notificationTypes=1,this.sdk=C,this.deviceModel=L(),this.deviceOs=D(),this.webAuth=t.w3cAuth,this.webp256=t.w3cP256dh}ys(t){return t.w3cEndpoint?t.w3cEndpoint.toString():t.safariDeviceToken}I(){return{type:this.type,token:this.token,enabled:this.enabled,notification_types:this.notificationTypes,sdk:this.sdk,device_model:this.deviceModel,device_os:this.deviceOs,web_auth:this.webAuth,web_p256:this.webp256}}},$s=class{Ss;constructor(t){this.Ss=t}get ci(){return this.Ss.ci}get Li(){return this.Ss.Li}get Qi(){return this.Ss.Qi}get ui(){return this.Ss.ui}get hs(){return this.Ss.hs}get oi(){return this.Ss.oi}vs(t){Re("CoreModuleDirector.generatePushSubscriptionModel",{rawPushSubscription:t});const e=new mn;return e.$e(new Ps(t).I()),e.id=hn.ge(),this.Ss.ui.Mn(e,2),e}hi(t){this.Ss.ui.Mn(t)}ei(t){this.Ss.ui.wn(t)}ti(){return Re("CoreModuleDirector.getEmailSubscriptionModels"),this.Ss.ui.li().filter(t=>t.type===l)}Os(){const t=this.ti();return Object.keys(t).length>0}ii(){return Re("CoreModuleDirector.getSmsSubscriptionModels"),this.Ss.ui.li().filter(t=>"SMS"===t.type)}Is(){const t=this.ii();return Object.keys(t).length>0}ks(){return Re("CoreModuleDirector.getAllPushSubscriptionModels"),this.Ss.ui.li().filter(t=>Fn(t.type))}async xs(){Re("CoreModuleDirector.getPushSubscriptionModelByCurrentToken");const t=await Ve();if(t)return this.Cs(r,t)}async Es(){Re("CoreModuleDirector.getPushSubscriptionModelByLastKnownToken");const t=await(async()=>await ne("lastPushToken"))()??"";if(null!==t)return this.Cs(r,t)}async _e(){Re("CoreModuleDirector.getPushSubscriptionModel");const t=await this.Es();return await this.xs()||t}Qe(){return Re("CoreModuleDirector.getIdentityModel"),this.Ss.Li.Ri}Ze(){return Re("CoreModuleDirector.getPropertiesModel"),this.Ss.Qi.Ri}async Ps(){Re("CoreModuleDirector.getAllSubscriptionsModels");const t=this.ti(),e=this.ii(),i=await this._e();return[...t,...e,...i?[i]:[]]}Cs(t,e){let i;switch(Re("CoreModuleDirector.getSubscriptionOfTypeWithToken",{type:t,token:e}),t){case"Email":i=this.ti();break;case"SMS":i=this.ii();break;case r:i=this.ks();break;default:return}return i.find(t=>t.token===e)}},Ts=class t{static $s=Promise.resolve();static async login(e,i){await(this.$s=t.Ts(e,i))}static async Ts(e,i){i&&ie.put("Ids",{id:i,type:"jwtToken"});const n=OneSignal.ye.Qe(),s=hn.pe(n.Fe)?void 0:n.Fe,a=n.qe;if(a===e)return void gt.p("Login: externalId already set");const o=t.As();o.Ae(J,e,2),await t.Ns(o.Fe,e,a?void 0:s,!0)}static async logout(){await(this.$s=t.Ms())}static async Ms(){if(!OneSignal.ye.Qe().qe)return gt.p("Logout: not logged in");const e=t.As();await t.Ns(e.Fe)}static As(){const t=new as,e=new os,i=hn.ge();return t.Fe=i,e.Fe=i,OneSignal.ye.Li.un(t),OneSignal.ye.Qi.un(e),OneSignal.ye.Qe()}static async Ns(t,e,i,n=!1){const s=Ke();await Promise.all([OneSignal.ye._e().then(e=>{if(e)OneSignal.ye.ci.di(new es(s,t,e.id));else if(n){const e=new mn;e.Le({enabled:!0,id:hn.ge(),onesignalId:t,type:U(),token:""}),OneSignal.ye.ui.Mn(e)}}),OneSignal.ye.ci.rs(new _n(s,t,e,i))])}};function As(t){const e=t.active||t.installing||t.waiting;return e||gt._("No available SW instance"),e}var Ns=class{Us;constructor(){this.Us={}}Ds(t,e,i){const n={callback:e,onceListenerOnly:i},s=this.Us[t.toString()];s?s.push(n):this.Us[t.toString()]=[n]}Ls(t){return this.Us[t.toString()]||[]}Fs(t){this.Us[t.toString()]=null}Rs(){this.Us={}}Ws(t,e){const i=this.Us[t.toString()];if(null!=i)for(let n=i.length-1;n>=0;n--)i[n]===e&&i.splice(n,1)}},Ms=class{A;Us;constructor(t,e=new Ns){this.A=t,this.Us=e}Bs(t,e){this.Us.Ds(t,e,!1)}js(t,e){this.Us.Ds(t,e,!0)}zs(t){t?this.Us.Fs(t):this.Us.Rs()}},Us=class extends Ms{Ks(){$()&&this.Vs()}Vs(){navigator.serviceWorker.addEventListener("message",this.qs.bind(this)),gt.p(`[WM] Page listening (${location.origin})`)}qs(t){const e=t.data;if(!e||!e.command)return;const i=this.Us.Ls(e.command),n=[],s=[];gt.p("[WM] Page received:",t.data);for(const a of i)a.onceListenerOnly&&n.push(a),s.push(a);for(let a=n.length-1;a>=0;a--){const t=n[a];this.Us.Ws(e.command,t)}for(const a of s)a.callback.apply(null,[e.payload])}Hs(t,e){gt.p(`[WM] Page->SW unicast '${t}'`),this.Js(t,e)}async Js(t,e){gt.p(`[WM] Page->SW direct '${t}'`);const i=await(this.A?.T.Gs());if(!i)return void gt.S("[WM] No SW registration for postMessage");const n=As(i);n?n.postMessage({command:t,payload:e}):gt.S("[WM] No SW for postMessage")}},Ds=class{Ys;Ht;We;Qs;constructor(t,e,i,n){this.Ys=i,this.Ht=e,this.We=t,this.Qs=n}async Zs(){return await async function(t){if(t.direct&&t.direct.enabled){const t=await(async()=>(await ie.getAll("Outcomes.NotificationClicked")).map(t=>{return{appId:(e=t).appId,notificationId:e.notificationId,timestamp:e.timestamp};var e}))();if(t.length>0)return{type:1,notificationIds:[t[0].notificationId]}}if(t.indirect&&t.indirect.enabled){const e=60*t.indirect.influencedTimePeriodMin*1e3,i=new Date((new Date).getTime()-e).getTime(),n=await(async()=>(await ie.getAll("Outcomes.NotificationReceived")).map(t=>{return{appId:(e=t).appId,notificationId:e.notificationId,timestamp:e.timestamp};var e}))();if(gt.p(`${n.length} received notifs found`),n.length>0){const e=t.indirect.influencedNotificationsLimit,s=n.slice().sort((t,e)=>e.timestamp-t.timestamp),a=s.filter(t=>t.timestamp>=i).slice(0,e).map(t=>t.notificationId);gt.p(`${a.length} notifs in reporting window`);const o=s.filter(t=>-1===a.indexOf(t.notificationId)).map(t=>t.notificationId);if(o.forEach(t=>ie.delete("Outcomes.NotificationReceived",t)),gt.p(`${o.length} notifs to delete`),a.length>0)return{type:2,notificationIds:a}}}return t.unattributed&&t.unattributed.enabled?{type:3,notificationIds:[]}:{type:4,notificationIds:[]}}(this.Ht)}async Xs(){return Re(this.Qs?"sendUniqueOutcome":"sendOutcome",this.Ys),this.Ht?this.Ys?(await Fe(),!!(await OneSignal.A.lt.ct())||(gt._("Outcomes require subscription"),!1)):(gt.S("Outcome name is required"),!1):(gt.p("Outcomes not supported yet"),!1)}async ta(){return(await ie.getAll("SentUniqueOutcome")).filter(t=>t.outcomeName===this.Ys).reduce((t,e)=>[...t,...e.notificationIds||[]],[])}async ea(t){const e=await this.ta();return t.filter(t=>-1===e.indexOf(t))}ia(t,e){return 3===t.type||e.length>0}async na(t){const e=this.Ys,i=await ie.get("SentUniqueOutcome",e),n=await ae(),s=[...i?i.notificationIds:[],...t],a=n?n.startTimestamp:null;await ie.put("SentUniqueOutcome",{outcomeName:e,notificationIds:s,sentDuringSession:a})}async sa(){const t=await ie.get("SentUniqueOutcome",this.Ys);if(!t)return!1;const e=await ae(),i=e&&t.sentDuringSession===e.startTimestamp,n=!e&&!!t.sentDuringSession;return i||n}async aa(t){const{type:e,notificationIds:i,weight:n}=t;switch(e){case 1:return this.Qs&&await this.na(i),void(await OneSignal.A.Mi.oa(this.We,i,this.Ys,n));case 2:return this.Qs&&await this.na(i),void(await OneSignal.A.Mi.ra(this.We,i,this.Ys,n));case 3:if(this.Qs){if(await this.sa())return void gt._("Unattributed unique outcome already sent this session");await this.na([])}return void(await OneSignal.A.Mi.ca(this.We,this.Ys,n));default:return void gt._("Upgrade required for this functionality")}}};function Ls(t,e,i){return function(t,e,i){return`${new URL(t,dt()).href}?${vt({appId:e})}&${vt({sdkVersion:i})}`}(t.workerPath.la(),e,i)}var Fs="OneSignal Worker",Rs="3rd Party",Ws="None",Bs="GetWorkerVersion",js="os.session.deactivate",zs=class{ua;constructor(t){if(!t)throw st("path");this.ua=t.trim()}da(){return this.ua.split("?")[0]}ha(){return this.da().split("\\").pop()?.split("/").pop()}la(){return this.ua}},Ks=class t{A;Ht;constructor(t,e){this.A=t,this.Ht=e}async $(){return async function(t){try{const e=location.origin+t;return await navigator.serviceWorker.getRegistration(e)}catch(e){return void gt._("SW registration check error",t,e)}}(this.Ht.registrationOptions.scope)}async Gs(){if(await this.ga()===Fs)return this.$()}async ga(){const e=await this.$();if(!e)return Ws;const i=t.pa(e);return this.fa(i)}static pa(t){const e=As(t);if(!e)return null;const i=new URL(e.scriptURL).pathname,n=new zs(i).ha();if("akam-sw.js"==n){const t=new URLSearchParams(new URL(e.scriptURL).search).get("othersw");if(t)return gt.p("Found SW under akam-sw.js?othersw=",t),new zs(new URL(t).pathname).ha()}return n}fa(t){return t?t==this.Ht.workerPath.ha()?Fs:Rs:Ws}async wa(){return new Promise(t=>{this.A.ma.js(Bs,e=>{t(e)}),this.A.ma.Hs(Bs)})}async ba(){if(!$())return!1;if(!OneSignal.config)return!1;const t=await this.ga();if(gt.p("shouldInstallWorker state:",t),t===Ws||t===Rs){const t="granted"===OneSignal.A.Tt.ki(OneSignal.config.safariWebId);return t&>.m("Permissions enabled, installing SW"),t}return!!(await this._a())||this.ya()}async _a(){const t=await this.$();if(!t)return gt.m("SW registration not found at scope",this.Ht.registrationOptions.scope),!0;const e=new URL(t.scope).pathname,i=this.Ht.registrationOptions.scope;if(e!=i)return gt.m("SW scope changing",{a_old:e,b_new:i}),!0;const n=As(t),s=Ls(this.Ht,this.A.mi.appId,C);return!n?.scriptURL||s!==n.scriptURL&&(gt.m("SW href changing:",{a_old:n?.scriptURL,b_new:s}),!0)}async ya(){let t;gt.m("Checking SW version...");try{t=await function(t){const e=new Promise((t,e)=>{setTimeout(()=>{e(new Error("Async operation timed out"))},2e3)});return Promise.race([t,e])}(this.wa())}catch{return gt.m("SW did not reply to version query, updating"),!0}return"160700"!==t?(gt.m(`Updating SW ${t} -> ${C}`),!0):(gt.m(`SW version current: ${t}`),!1)}xi(){gt.p("establishSWChannel");const t=this.A.ma;t.zs(),t.Bs("notification.willDisplay",e=>{gt.p(location.origin,"Notif display event from SW");let i=!1;const n=e.notification.notificationId,s={notification:{...e.notification,display:()=>{gt.p(`display() called: ${n}`),t.Hs("notification.display",{notification:e.notification})}},preventDefault:function(){gt.p(`preventDefault() called: ${n}`),i=!0}};sn.re(OneSignal.EVENTS.NOTIFICATION_WILL_DISPLAY,s),gt.p(`preventDefault response: ${i} for: ${n}`),t.Hs("notification.willDisplay.response",{notificationId:n,preventDefault:i})}),t.Bs("notification.clicked",t=>{0===OneSignal.P.he(OneSignal.EVENTS.NOTIFICATION_CLICKED)?gt.p("Click event with no listeners, storing for later"):function(t){const e={notification:t.notification,result:t.result};sn.re(OneSignal.EVENTS.NOTIFICATION_CLICKED,e)}(t)}),t.Bs("notification.dismissed",t=>{sn.re(OneSignal.EVENTS.NOTIFICATION_DISMISSED,t)});const e=P();t.Bs("os.page_focused_request",async i=>{if(e){const e={timestamp:i.timestamp,focused:document.hasFocus()};await t.Js("os.page_focused_response",e)}})}async Sa(){if(!(await this.ba()))return this.Gs();gt.m("Installing worker..."),await this.ga()===Rs&>.m("3rd party SW detected");const t=Ls(this.Ht,this.A.mi.appId,C),e=`${dt()}${this.Ht.registrationOptions.scope}`;gt.m(`Installing SW ${t} ${e}`);const i=await navigator.serviceWorker.register(t,{scope:e,type:void 0});return gt.p("SW installed, waiting for activation"),await function(t){return new Promise(e=>{const i=t.installing||t.waiting;i&&i.addEventListener("statechange",()=>{gt.p("SW state:",i.state),t.active&&e()}),t.active&&e()})}(i),gt.p("SW active"),this.xi(),i}},Vs=class t{w3cEndpoint;w3cP256dh;w3cAuth;safariDeviceToken;static va(e){const i=new t;if(e&&(i.w3cEndpoint=new URL(e.endpoint),e.getKey)){let t=null;try{t=e.getKey("p256dh")}catch{}let n=null;try{n=e.getKey("auth")}catch{}t&&(i.w3cP256dh=btoa(String.fromCharCode(...new Uint8Array(t)))),n&&(i.w3cAuth=btoa(String.fromCharCode(...new Uint8Array(n))))}return i}Oa(t){t&&(this.safariDeviceToken=t)}I(){return{w3cEndpoint:this.w3cEndpoint?this.w3cEndpoint.toString():null,w3cP256dh:this.w3cP256dh,w3cAuth:this.w3cAuth,safariDeviceToken:this.safariDeviceToken}}static k(e){const i=new t;if(!e)return i;try{i.w3cEndpoint=new URL(e.w3cEndpoint)}catch{}return i.w3cP256dh=e.w3cP256dh,i.w3cAuth=e.w3cAuth,i.safariDeviceToken=e.safariDeviceToken,i}},qs=class t{A;Ht;constructor(t,e){this.A=t,this.Ht=e}async Si(t,e){t&&(t=Vs.k(t)),await this.$i()?"Mi"in this.A&&await this.A.Mi.Ia():"Ai"in this.A&&this.A.Ai.ka(1);const i=await be();return i.deviceId="99999999-9999-9999-9999-999999999999",i.optedOut=!1,t?A()?i.subscriptionToken=t.safariDeviceToken:i.subscriptionToken=t.w3cEndpoint?t.w3cEndpoint.toString():null:i.subscriptionToken=null,await _e(i),sn.re(OneSignal.EVENTS.REGISTERED),"undefined"!=typeof OneSignal&&(OneSignal.Oi=!1),i}async $i(){const{deviceId:t}=await be();return!!t}async xa(e,i){const n=await e.getSubscription();switch(i){case nn.ae:if(!n)break;n.options?gt.p("Existing push sub options present"):(gt.p("Existing push sub options null, unsubscribing first"),await t.Ca(n));break;case nn.oe:n&&await t.Ca(n)}const[s,a]=await t.Ea(e,this.Pa());return await t.$a(a,s.expirationTime),Vs.va(s)}Pa(){let t;return t=I()===w?this.Ht.onesignalVapidPublicKey:this.Ht.vapidPublicKey,t?function(t){const e=(t+"=".repeat((4-t.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),i=atob(e),n=new Uint8Array(i.length);for(let s=0;s{await Ts.$s;let e=await OneSignal.ye._e();if(!e)return e=OneSignal.ye.vs(t),Js(e);if(hn.pe(e.id))return Js(e);const i=new Ps(t).I();for(const n in i){const t=n;e.Ae(t,i[t])}},Ys=class t extends qs{Ta=!1;async ct(){const t=await this.Aa();return t.subscribed&&!t.optedOut}async fi(){const t=await this.Na();await this.Ma(t)}async Ma(t){const e=await OneSignal.ye._e();e?(e.Re=t,e.enabled=1===t):gt.m("No push sub to update notification_types")}async Na(){const{optedOut:t}=await be();return t?-2:"granted"===await OneSignal.A.Tt.$t()?1:0}async pi(){const t=await this.Aa();return"granted"===await OneSignal.A.Tt.$t()&&!t.optedOut}async Ii(t){Re("isOptedOut",t);const{optedOut:e}=await be();return function(t,...e){t&&t.apply(null,e)}(t,e),e}ke(t){throw Hs}async Aa(){const{optedOut:t,subscriptionToken:e}=await be(),i=gn(await OneSignal.ye._e());if(A()){const n=window.safari?.pushNotification?.permission(this.Ht.safariWebId);return{subscribed:!!(i&&e&&"granted"===n?.permission&&n?.deviceToken),optedOut:!!t}}const n=await this.A.T.Gs(),s=this.A.Tt.ki(this.A.mi.safariWebId);return n?{subscribed:!(!i||!e||"granted"!==s),optedOut:!!t}:{subscribed:!1,optedOut:!!t}}async Ie(t){let e;if("denied"===await OneSignal.A.Tt.$t())throw tt;if(A()){e=await this.Ua(),await Gs(e),gt.m("Installing SW on Safari");try{await this.A.T.Sa(),gt.m("Safari SW installed")}catch{gt.S("Safari SW install failed")}}else e=await this.Da(t),await Gs(e);return e}async Ua(){const t=new Vs;if(!this.Ht.safariWebId)throw it;const{deviceToken:e}=window.safari?.pushNotification?.permission(this.Ht.safariWebId)||{};if(e)return t.Oa(e.toLowerCase()),t;sn.re(OneSignal.EVENTS.PERMISSION_PROMPT_DISPLAYED);const i=await this.La();if(Un(),!i)throw this.Ta=!0,new Error("Safari url/icon/certificate invalid or in private mode");return t.Oa(i),t}async La(){const t=t=>new Promise(e=>{window.safari?.pushNotification?.requestPermission(t,this.Ht.safariWebId,{app_id:this.Ht.appId},t=>{t&&t.deviceToken?e(t.deviceToken.toLowerCase()):e(null)})});return this.Ta?t(`${M({legacy:!0}).toString()}safari`):t(`${M({legacy:!0}).toString()}safari/apps/${this.Ht.appId}`)}async Da(e){if("default"===Notification.permission){sn.re(OneSignal.EVENTS.PERMISSION_PROMPT_DISPLAYED);const e=await t.Fa();switch(await Un("default"===e),e){case"default":throw gt.p("Permission dismissed, exiting subscription"),OneSignal.Oi=!1,new Error("Permission dismissed");case"denied":throw gt.p("Permission blocked, exiting subscription"),OneSignal.Oi=!1,tt}}let i;try{i=await this.A.T.Sa()}catch(n){throw n instanceof Y&&(403===n.status?this.A.lt.Ra(-23):404===n.status&&this.A.lt.Ra(-24)),n}if(!i)throw new Error("OneSignal service worker not found!");return gt.p("SW ready, continuing subscription"),await this.xa(i.pushManager,e)}Ra(t){ln()&&(this.A.lt.Si(new Vs,t),cn())}static async Fa(){return await t.Wa()}static async Wa(){return await window.Notification.requestPermission()}async Pi(){if(await this.A.T.ga()!==Fs)return!1;const t=await this.A.T.Gs();if(!t)return!1;if(!t.pushManager)return!1;const e=await t.pushManager.getSubscription();if(!e)return!1;if(!e.expirationTime)return!1;let{createdAt:i}=await be();i||(i=(new Date).getTime()+31536e6);const n=i+(e.expirationTime-i)/2;return!!e.expirationTime&&((new Date).getTime()>=e.expirationTime||(new Date).getTime()>=n)}},Qs=class t{$t(){return OneSignal.A?Promise.resolve(OneSignal.A.Tt.ki(OneSignal.config.safariWebId)):Promise.reject(new Error("OneSignal.context is undefined. Call init first"))}ki(e){return A()?t.Ba(e):this.ja()}static Ba(t){if(t)return window.safari?.pushNotification?.permission(t).permission;throw st("safariWebId")}ja(){return Notification.permission}},Zs=class{A;za=!1;constructor(t){this.A=t}Ka(t,e,i){const n={onesignalId:t,subscriptionId:e,appId:this.A.mi.appId,sessionThreshold:this.A.mi.sessionThreshold||0,enableSessionDuration:!!this.A.mi.enableSessionDuration,sessionOrigin:i,isSafari:P(),outcomesConfig:this.A.mi.userConfig.outcomes};return $()?(gt.p("SW upsert session"),this.A.ma.Hs("os.session.upsert",n)):gt.p("Upsert: no-op"),Promise.resolve()}Va(t,e,i){const n={appId:this.A.mi.appId,subscriptionId:e,onesignalId:t,sessionThreshold:this.A.mi.sessionThreshold,enableSessionDuration:this.A.mi.enableSessionDuration,sessionOrigin:i,isSafari:P(),outcomesConfig:this.A.mi.userConfig.outcomes};return $()?(gt.p("SW deactivate session"),this.A.ma.Hs(js,n)):gt.p("Deactivate: no-op"),Promise.resolve()}async qa(){const t=OneSignal.ye.Qe(),e=await OneSignal.ye._e();if(!t||!t.Fe)throw new Error("No identity");if(!e||!gn(e))throw new Error("No subscription");const{Fe:i}=t,{id:n}=e;return{onesignalId:i,subscriptionId:n}}async Ha(){if(await Ts.$s,Sn.Ge?.onesignalId)try{const t=document.visibilityState,{onesignalId:e,subscriptionId:i}=await this.qa();if("visible"===t)return this.Ja(),gt.p("handleVisibilityChange","visible",`hasFocus: ${document.hasFocus()}`),void(document.hasFocus()&&await this.Ka(e,i,3));if("hidden"===t)return gt.p("handleVisibilityChange","hidden"),OneSignal.N.focusHandler&&OneSignal.N.isFocusEventSetup&&(window.removeEventListener("focus",OneSignal.N.focusHandler,!0),OneSignal.N.isFocusEventSetup=!1),OneSignal.N.blurHandler&&OneSignal.N.isBlurEventSetup&&(window.removeEventListener("blur",OneSignal.N.blurHandler,!0),OneSignal.N.isBlurEventSetup=!1),void(await this.Va(e,i,4));gt._("Unhandled visibility state",t)}catch(t){gt.S("Visibility change error:",t)}}async Ga(){if(await Ts.$s,Sn.Ge?.onesignalId)try{const{onesignalId:t,subscriptionId:e}=await this.qa(),i={appId:this.A.mi.appId,onesignalId:t,subscriptionId:e,sessionThreshold:this.A.mi.sessionThreshold,enableSessionDuration:this.A.mi.enableSessionDuration,sessionOrigin:5,isSafari:P(),outcomesConfig:this.A.mi.userConfig.outcomes};gt.p("SW deactivate (beforeunload)"),this.A.ma.Js(js,i)}catch(t){gt.S("beforeunload error:",t)}}async Ya(t){if(await Ts.$s,gt.p("handleOnFocus",t),Sn.Ge?.onesignalId)try{if(t.target!==window)return;const{onesignalId:e,subscriptionId:i}=await this.qa();await this.Ka(e,i,7)}catch(t){gt.S("Focus error:",t)}}async Qa(t){if(await Ts.$s,gt.p("handleOnBlur",t),Sn.Ge?.onesignalId)try{if(t.target!==window)return;const{onesignalId:e,subscriptionId:i}=await this.qa();await this.Va(e,i,8)}catch(t){gt.S("Blur error:",t)}}async ka(t){if(await Ts.$s,Sn.Ge?.onesignalId){const{onesignalId:e,subscriptionId:i}=await this.qa();await this.Ka(e,i,t)}$()?this.Ti():OneSignal.P.ce(OneSignal.EVENTS.SESSION_STARTED)}Ti(){$()?(this.Ja(),OneSignal.N.isVisibilityChangeEventSetup||(document.addEventListener("visibilitychange",this.Ha.bind(this),!0),OneSignal.N.isVisibilityChangeEventSetup=!0),OneSignal.N.isBeforeUnloadEventSetup||(window.addEventListener("beforeunload",t=>{this.Ga(),delete t.returnValue},!0),OneSignal.N.isBeforeUnloadEventSetup=!0)):gt.p("No SW support, skipping session listeners")}Ja(){gt.p("setupOnFocusAndOnBlurForSession"),OneSignal.N.focusHandler||(OneSignal.N.focusHandler=this.Ya.bind(this)),OneSignal.N.isFocusEventSetup||(window.addEventListener("focus",OneSignal.N.focusHandler,!0),OneSignal.N.isFocusEventSetup=!0),OneSignal.N.blurHandler||(OneSignal.N.blurHandler=this.Qa.bind(this)),OneSignal.N.isBlurEventSetup||(window.addEventListener("blur",OneSignal.N.blurHandler,!0),OneSignal.N.isBlurEventSetup=!0)}async Za(){if(this.za||!ln())return;const t=OneSignal.ye.Qe().Fe;if(!t)return void gt.p("No onesignal id, skipping on_session");const e=await OneSignal.ye._e();if(1!==e?.Re&&!0!==OneSignal.config?.enableOnSession)return;let i;gn(e)&&(i=e?.id);try{const e={label:G,id:t},s={refresh_device_metadata:!0,deltas:{session_count:1}},a=Ke();(function(t){if(!t)throw new Error("App id cannot be empty")})(a),function(t){if(!t.label)throw new Error("Alias label cannot be empty");if(!t.id)throw new Error("Alias id cannot be empty")}(e);try{await St({appId:a,subscriptionId:i},e,s),this.za=!0}catch(n){gt.p("Session update error:",n)}}catch(n){n instanceof Error&>.S(`Session update failed: "${n.message}" ${n.stack}`)}}},Xs=class{A;za;constructor(t){this.A=t,this.za=rn()>1}async Ia(){Sn.Ge?.onesignalId?this.za||await this.Ni():gt.p("Update skipped: no onesignal_id")}async Ni(){if(!this.za&&ln())if(await this.A.lt.$i()){if(1===(await OneSignal.ye._e())?.Re||!0===OneSignal.config?.enableOnSession)try{this.A.Ai.ka(2),this.za=!0}catch(t){t instanceof Error&>.S(`Session update failed: ${t.message}`,t.stack)}}else gt.p("On session skipped: no device id")}async oa(t,e,i,n){Re("sendOutcomeDirect");const s=await OneSignal.ye._e();if(s&&gn(s)){const a={id:i,app_id:t,notification_ids:e,direct:!0,subscription:{id:s.id,type:U()}};return void 0!==n&&(a.weight=n),void(await Ot(a))}gt._("Outcome aborted: no push sub model")}async ra(t,e,i,n){Re("sendOutcomeInfluenced");const s=await OneSignal.ye._e();if(s&&gn(s)){const a={id:i,app_id:t,notification_ids:e,direct:!1,subscription:{id:s.id,type:U()}};return void 0!==n&&(a.weight=n),void(await Ot(a))}gt._("Outcome aborted: no push sub model")}async ca(t,e,i){Re("sendOutcomeUnattributed");const n=await OneSignal.ye._e();if(n&&gn(n)){const s={id:e,app_id:t,subscription:{id:n.id,type:U()}};return void 0!==i&&(s.weight=i),void(await Ot(s))}gt._("Outcome aborted: no push sub model")}},ta=class t{Xa=!0;eo=!0;io;no;constructor(t){this.io=t}so(){const t=document.createElement("div");let e,i,n;switch(ke(t,Wi),t.id=Wi,this.io.type){case $t:e=this.io.text.smsLabel||"Phone Number",i=this.ao($t,e),t.appendChild(i);break;case Tt:e=this.io.text.emailLabel||"Email",n=this.ao(Tt,e),t.appendChild(n);break;case At:e=this.io.text.emailLabel||"Email",n=this.ao(Tt,e),t.appendChild(n),e=this.io.text.smsLabel||"Phone Number",i=this.ao($t,e),t.appendChild(i)}return t}oo(t){const e=document.createElement("div"),i=document.createElement("img"),n=document.createElement("p");return n.innerText=t,i.setAttribute("src","data:image/svg+xml;charset=UTF-8,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.98775 -0.00114406C5.85015 0.0338508 3.81219 0.908665 2.31442 2.43419C1.565 3.18031 0.973715 4.06987 0.575897 5.04969C0.17808 6.02952 -0.0180997 7.07949 -0.000914196 8.13686C-0.00214385 9.17005 0.200528 10.1933 0.595487 11.148C0.990446 12.1028 1.56993 12.9702 2.30072 13.7005C3.03151 14.4309 3.89925 15.0098 4.85421 15.4042C5.80916 15.7986 6.83256 16.0007 7.86575 15.9989H8.00842C10.1467 15.9769 12.1889 15.1075 13.6869 13.5816C15.185 12.0557 16.0165 9.99781 15.9991 7.85952C16.0015 6.8138 15.7949 5.77814 15.3913 4.81345C14.9876 3.84876 14.3952 2.97451 13.6488 2.24213C12.9023 1.50974 12.017 0.933994 11.0448 0.548751C10.0726 0.163508 9.03324 -0.0234551 7.98775 -0.00114406ZM6.99909 11.0269C6.99428 10.8961 7.01558 10.7658 7.06175 10.6434C7.10792 10.521 7.17803 10.4091 7.26797 10.3141C7.35792 10.2191 7.4659 10.143 7.58559 10.0903C7.70529 10.0375 7.8343 10.0092 7.96509 10.0069H7.98309C8.24616 10.0074 8.49882 10.1097 8.6881 10.2924C8.87739 10.4751 8.9886 10.724 8.99842 10.9869C9.00331 11.1176 8.98207 11.248 8.93594 11.3704C8.8898 11.4928 8.8197 11.6048 8.72974 11.6998C8.63978 11.7948 8.53176 11.8709 8.41202 11.9236C8.29229 11.9763 8.16323 12.0046 8.03242 12.0069H8.01442C7.75145 12.006 7.49897 11.9036 7.30976 11.721C7.12054 11.5383 7.00923 11.2896 6.99909 11.0269ZM7.33242 8.33219V4.33219C7.33242 4.15538 7.40266 3.98581 7.52768 3.86079C7.65271 3.73576 7.82227 3.66552 7.99909 3.66552C8.1759 3.66552 8.34547 3.73576 8.47049 3.86079C8.59551 3.98581 8.66575 4.15538 8.66575 4.33219V8.33219C8.66575 8.509 8.59551 8.67857 8.47049 8.80359C8.34547 8.92862 8.1759 8.99886 7.99909 8.99886C7.82227 8.99886 7.65271 8.92862 7.52768 8.80359C7.40266 8.67857 7.33242 8.509 7.33242 8.33219Z' fill='%23E54B4D'/%3e%3c/svg%3e"),e.appendChild(i),e.appendChild(n),e}ao(t,e){const i=this.ro(t),n=document.createElement("label"),s=document.createElement("input"),a=document.createElement("div"),o=document.createElement("div"),r=this.oo(i.message),c=document.createElement("div");return a.setAttribute("style","clear:both"),o.setAttribute("style","clear:both"),ke(r,ji),ke(r,"onesignal-validation-element"),r.id=i.validationElementId,n.title=e,n.innerText=e,n.htmlFor=i.inputElementId,s.type=i.domElementType,s.id=i.inputElementId,s.tabIndex=i.tabIndex,ke(s,i.inputClass),ke(c,"input-with-validation-element"),c.id=i.wrappingDivId,c.appendChild(n),c.appendChild(a),c.appendChild(s),c.appendChild(o),c.appendChild(r),c}ro(t){if(t===Tt)return{message:"Please enter a valid email",domElementType:"email",validationElementId:Ji,inputElementId:qi,inputClass:"onesignal-email-input",wrappingDivId:Ki,tabIndex:1};if(t===$t)return{message:"Please enter a valid phone number",domElementType:"tel",validationElementId:Hi,inputElementId:Vi,inputClass:"iti-onesignal-sms-input",wrappingDivId:zi,tabIndex:2};throw new Error("invalid channel type for input validation")}co(){const t=Ie(`#${Vi}`);t&&window.intlTelInput?this.no=window.intlTelInput(t,{autoPlaceholder:"off",separateDialCode:!0}):gt.S("Failed to init phone input library")}lo(){const t=Ie(`#${Vi}`);t.addEventListener("keyup",e=>{this.Xa=this.no?.isValidNumber()||""===t?.value,"Enter"===e.key&&document.getElementById(Ei)?.click(),this.uo()}),t.addEventListener("blur",()=>{this.Xa=this.no?.isValidNumber()||""===t?.value,this.uo()})}do(){const e=Ie(`#${qi}`);e.addEventListener("keyup",i=>{const n=e?.value;this.eo=t.ho(n),"Enter"===i.key&&document.getElementById(Ei)?.click(),this.po()})}uo(){const t=Ie(`#${zi}`),e=Ie(`#${Hi}`);xe(t,Bi),ke(e,ji)}po(){const t=Ie(`#${Ki}`),e=Ie(`#${Ji}`);xe(t,Bi),ke(e,ji)}async fo(){if(OneSignal.wo)return;const t=document.createElement("script"),e=document.createElement("script"),i=document.createElement("link");t.src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.12/js/intlTelInput.min.js",e.src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.12/js/utils.js",i.href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.12/css/intlTelInput.min.css",i.rel="stylesheet",t.integrity="sha512-OnkjbJ4TwPpgSmjXACCb5J4cJwi880VRe+vWpPDlr8M38/L3slN5uUAeOeWU2jN+4vN0gImCXFGdJmc0wO4Mig==",e.integrity="sha512-bUcJxlqkiGA3cmoYPuZaLRsyc5ChG9APG4ajom2AXKSlBtOmx4kLV3c8uv/6uSz43FMjI4Q2QI21+D223rT76w==",i.integrity="sha512-yye/u0ehQsrVrfSd6biT17t39Rg9kNc+vENcCXZuMz2a+LWFGvXUnYuWUW6pbfYj1jcBb/C39UZw2ciQvwDDvg==",t.crossOrigin="anonymous",e.crossOrigin="anonymous",i.crossOrigin="anonymous",document.head.appendChild(t),document.head.appendChild(e),document.head.appendChild(i);const n=new Promise(e=>{t.onload=()=>{e()}}),s=new Promise(t=>{e.onload=()=>{t()}});await Promise.all([n,s]),OneSignal.wo=!0}async mo(){const e=t.bo(this.io.type),i=t._o(this.io.type);e&&await this.fo();const n=this.so();Ie(`#${Pi}`).appendChild(n),e&&(this.co(),this.lo()),i&&this.do()}yo(){return""===this.So()}vo(){return""===this.Oo()}So(){return Ie(`#${qi}`)?.value||""}Oo(){return this.no?.getNumber(window.intlTelInputUtils?.numberFormat.E164)||""}static Io(t){const e=document.querySelector(`#${Hi}`),i=document.querySelector(`#${zi}`);e&&i?t?(e.classList.remove(ji),i.classList.add(Bi)):(e.classList.add(ji),i.classList.remove(Bi)):gt.S("Missing validation element")}static ko(t){const e=document.querySelector(`#${Ji}`),i=document.querySelector(`#${Ki}`);e&&i?t?(e.classList.remove(ji),i.classList.add(Bi)):(e.classList.add(ji),i.classList.remove(Bi)):gt.S("Missing validation element")}static xo(e){switch(e){case $t:t.Io(!1);break;case Tt:t.ko(!1);break;case At:t.Io(!1),t.ko(!1)}}static ho(t){return/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(t||"")||""===t}static bo(t){return t===$t||t===At}static _o(t){return t===Tt||t===At}};function ea(t){return` `}var ia=class t{it;nt;Co;Eo;Po;$o="Saving...";To=Lt;Ao;No;Mo;constructor(t){switch(this.it=t,this.it.text.actionMessage=t.text.actionMessage.substring(0,90),this.it.text.acceptButton=t.text.acceptButton.substring(0,16),this.it.text.cancelButton=t.text.cancelButton.substring(0,16),this.nt=null,this.Co=null,this.Eo=!1,t.type){case Pt:this.Mo=this.it.text.negativeUpdateButton?.substring(0,16),this.No=this.it.text.positiveUpdateButton?.substring(0,16),this.Ao=this.it.text.updateMessage?.substring(0,90),this.Po=t.categories,this.To=this.it.text.positiveUpdateButton??Lt;break;case $t:case Tt:case At:this.To=this.it.text.acceptButton??Lt}}async Lt(t){if(null===this.nt){const e=await ze();this.nt=e,this.Ut.className.includes(_i)&&Oe(`#${Ai}`);const i=t&&this.Po?this.No:this.it.text.acceptButton,n=t&&this.Po?this.Mo:this.it.text.cancelButton,s=function(t){const{icon:e,messageText:i,positiveButtonText:n,negativeButtonText:s}=t,a=e===xi?"data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M33.232 28.434a2.5 2.5 0 001.768.733 1.667 1.667 0 010 3.333H5a1.667 1.667 0 110-3.333 2.5 2.5 0 002.5-2.5v-8.104A13.262 13.262 0 0118.333 5.122V1.667a1.666 1.666 0 113.334 0v3.455A13.262 13.262 0 0132.5 18.563v8.104a2.5 2.5 0 00.732 1.767zM16.273 35h7.454a.413.413 0 01.413.37 4.167 4.167 0 11-8.28 0 .417.417 0 01.413-.37z' fill='%23BDC4CB'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' d='M0 0h40v40H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E":e,o=e===xi?xi:"",r=document.createElement("div"),c=document.createElement("div"),l=document.createElement("div"),u=document.createElement("div"),d=document.createElement("div"),h=document.createElement("div"),g=document.createElement("button"),p=document.createElement("button"),f=document.createElement("div"),w=document.createElement("div"),m=document.createElement("img");return ke(c,"slidedown-body"),ke(u,"slidedown-body-icon"),ke(l,"slidedown-body-message"),ke(h,"slidedown-footer"),ke(f,Ci),ke(w,Ci),ke(g,Di),ke(g,"primary"),ke(g,Li),ke(p,Di),ke(p,"secondary"),ke(p,Li),r.id="normal-slidedown",c.id=Pi,d.id=Ui,g.id=Ei,p.id=Ti,h.id=Mi,o&&ke(m,o),m.setAttribute("alt","notification icon"),m.setAttribute("src",a||""),l.innerText=i||"",g.innerText=n||"",p.innerText=s||"",u.appendChild(m),c.appendChild(u),c.appendChild(l),c.appendChild(f),c.appendChild(d),h.appendChild(g),h.appendChild(p),h.appendChild(w),r.appendChild(c),r.appendChild(h),r}({messageText:t&&this.Po?this.Ao:this.it.text.actionMessage,icon:this.it.icon||this.Uo(),positiveButtonText:i,negativeButtonText:n}),a=document.createElement("div"),o=document.createElement("div");a.id=Ai,ke(a,_i),ke(a,Si),Ie("body").appendChild(a),o.id=Ni,ke(o,yi),o.appendChild(s),this.Ut.appendChild(o),ke(this.Ut,v()?Oi:Ii),this.Do.addEventListener("click",this.Lo.bind(this)),this.Fo.addEventListener("click",this.Ro.bind(this))}}static Wo(t){sn.re(t)}Lo(e){t.Wo(t.EVENTS.ALLOW_CLICK)}Ro(e){t.Wo(t.EVENTS.CANCEL_CLICK),this.In(),t.Wo(t.EVENTS.CLOSED)}In(){ke(this.Ut,ki),We(this.bt,"animationend",(t,e)=>{t.target!==this.bt||"slideDownExit"!==t.animationName&&"slideUpExit"!==t.animationName||(Oe(`#${Ai}`),e())},!0)}Bo(){this.Do.disabled=!0,this.Do.textContent=null,this.Do.insertAdjacentElement("beforeend",this.jo(this.$o)),this.Do.insertAdjacentElement("beforeend",this.zo()),ve(this.Ko,"beforeend",ea("#FFFFFF")),ke(this.Do,"disabled"),ke(this.Do,vi)}Vo(){this.Do.textContent=this.No??"",Oe(`#${bi}`),this.Do.disabled=!1,xe(this.Do,"disabled"),xe(this.Do,vi)}qo(){this.Do.textContent=null,this.Do.insertAdjacentElement("beforeend",this.jo(this.To)),this.it.type===Pt&&(this.Do.insertAdjacentElement("beforeend",this.zo()),ve(this.Ko,"beforeend",function(t="#FFFFFF"){return``}()),ke(this.Do,"onesignal-error-state-button")),this.Eo=!0}Ho(t){switch(t){case 0:ta.Io(!0);break;case 1:ta.ko(!0);break;case 2:ta.Io(!0),ta.ko(!0)}}Jo(){Oe("#onesignal-button-indicator-holder"),xe(this.Do,"onesignal-error-state-button"),Tn(this.it.type)||ta.xo(this.it.type),this.Eo=!1}Uo(){return je(this.nt)}zo(){const t=document.createElement("div");return t.id=$i,ke(t,bi),t}jo(t){const e=document.createElement("span");return e.textContent=t,e}get Ut(){return Ie(`#${Ai}`)}get bt(){return Ie(`#${Ni}`)}get Do(){return Ie(`#${Ei}`)}get Fo(){return Ie(`#${Ti}`)}get Ko(){return Ie(`#${$i}`)}get Go(){return Ie(`#${Mi}`)}static get EVENTS(){return{ALLOW_CLICK:"slidedownAllowClick",CANCEL_CLICK:"slidedownCancelClick",SHOWN:"slidedownShown",CLOSED:"slidedownClosed",QUEUED:"slidedownQueued"}}},na=class{Yo;A;Qo;constructor(t){this.Yo=!1,this.A=t,this.Qo=!1}Zo(){const t=k();return I()===g&&t>=63&&(S()||v())||x()}Ci(){const t=OneSignal.config?.userConfig.promptOptions,e=this.Zo(),i=this.Xo(t,Ct),n=this.tr(i),s=i.enabled&&n,a=e&&s;if(s&&!a)return void this.er(Ct,i.timeDelay||0);const o=!!$n(t?.slidedown?.prompts,Et);a&&!o&&this.er(Et,i.timeDelay||0);const r=t?.slidedown?.prompts;if(r&&r?.length>0)for(let c=0;c0&&await ut(1e3*e),t){case Ct:await this.ir();break;case Et:await this.nr(i);break;case Pt:await this.sr(i);break;case $t:await this.ar(i);break;case Tt:await this.rr(i);break;case At:await this.cr(i);break;default:gt.S("Invalid Delayed Prompt type")}else gt.S("timeDelay not a number")}async ir(){if(Re("internalShowNativePrompt"),this.Yo)return gt.p("Autoprompt already showing"),!1;this.Yo=!0;const t=await Wn();return this.Yo=!1,De(0),t}async nr(t={force:!1}){Re("internalShowSlidedownPrompt"),t.slidedownPromptOptions||(t.slidedownPromptOptions=Bt),0===await this.A.Ft.U()?(this.Qo||this.lr(),await this.A.dr.ur(t)):gt.p("Slidedown styles failed to load")}async sr(t){Re("internalShowCategorySlidedown"),await this.hr(Pt,t)}async ar(t){Re("internalShowSmsSlidedown"),await this.hr($t,t)}async rr(t){Re("internalShowEmailSlidedown"),await this.hr(Tt,t)}async cr(t){Re("internalShowSmsAndEmailSlidedown"),await this.hr(At,t)}async hr(t,e){const i=this.A.mi.userConfig.promptOptions?.slidedown?.prompts,n=e?.slidedownPromptOptions||$n(i,t);if(!n){if(t!==Et)return void gt.S(`Slidedown type '${t}' not configured`);gt._("Push slidedown shown with default text")}await this.nr({...e,slidedownPromptOptions:n})}lr(){this.Qo=!0,OneSignal.P.on(ia.EVENTS.SHOWN,()=>{this.A.dr.gr(!0)}),OneSignal.P.on(ia.EVENTS.CLOSED,()=>{this.A.dr.gr(!1),this.A.dr.pr()}),OneSignal.P.on(ia.EVENTS.ALLOW_CLICK,async()=>{await this.A.dr.wr(),sn.re(OneSignal.EVENTS.TEST_FINISHED_ALLOW_CLICK_HANDLING)}),OneSignal.P.on(ia.EVENTS.CANCEL_CLICK,()=>{if(this.A.dr.mr)switch(this.A.dr.mr?.it.type){case Et:case Pt:gt.p("Marking slidedown dismissed"),De(0);break;default:gt.p("Marking slidedown dismissed"),De(1)}})}tr(t){return!(!t||void 0===t.pageViews)&&!(!t.autoPrompt||!t.enabled)&&he()>=t.pageViews}Xo(t,e){const i={enabled:!1,autoPrompt:!1,timeDelay:Nt.timeDelay,pageViews:Nt.pageViews};if(!t||!t.native||!t.slidedown)return i;switch(e){case Ct:{const e=t.native;return{enabled:e?.enabled,autoPrompt:e?.autoPrompt,timeDelay:e?.timeDelay,pageViews:e?.pageViews}}case Et:case Pt:case Tt:case $t:case At:{const{userConfig:t}=this.A.mi,i=$n(t.promptOptions?.slidedown?.prompts||[],e);return{enabled:!!i,autoPrompt:!!i?.autoPrompt,timeDelay:i?.delay?.timeDelay,pageViews:i?.delay?.pageViews}}default:return i}}};function sa(t,e){t.forEach(t=>{t.checked=e})}function aa(t){return 0===Object.keys(t).length}var oa=class t{et;constructor(t){this.et=t}j(){const e=document.createElement("div"),i=document.createElement("p");i.innerText=this.et,e.appendChild(i);const n=document.createElement("div"),s=document.createElement("div");n.id=Ai,e.id="onesignal-toast-text",ke(e,"onesignal-toast-text"),ke(n,_i),ke(n,Si),Ie("body").appendChild(n),s.id=Ni,ke(s,yi),s.appendChild(e),this.Ut.appendChild(s),ke(this.Ut,v()?Oi:Ii),t.Wo(t.EVENTS.SHOWN)}static Wo(t){sn.re(t)}In(){ke(this.Ut,ki),We(this.bt,"animationend",(t,e)=>{t.target!==this.bt||"slideDownExit"!==t.animationName&&"slideUpExit"!==t.animationName||(Oe(`#${Ai}`),e())},!0)}get Ut(){return Ie(`#${Ai}`)}get bt(){return Ie(`#${Ni}`)}static get EVENTS(){return{SHOWN:"toastShown",CLOSED:"toastClosed"}}},ra=class{mo(t,e){const i=this.so(t,e);Ie(`#${Pi}`).appendChild(i),this.br&&this.br.addEventListener("change",this._r.bind(this));const n=Ie(`#${Ei}`);n.disabled=!1,xe(n,"disabled"),Oe(`#${Ui}`)}L(){const t=Ie(`#${Ui}`),e=Ie(`#${Ei}`),i=document.createElement("div");ke(t,"onesignal-loading-container"),ke(i,"onesignal-loading-message"),ke(e,"disabled"),ve(t,"beforeend",ea("#95A1AC")),i.innerText="Fetching your preferences",t.appendChild(i),e.disabled=!0}so(t,e){const i=function(t,e){if(!e)return t;if(aa(e)){const e=structuredClone(t);return sa(e,!0),e}return structuredClone(t).map(t=>{const i=e[t.tag];var n;return t.checked=void 0===(n=i)||n,t})}(t,e),n=i.filter(t=>i.indexOf(t)%2==0),s=i.filter(t=>i.indexOf(t)%2),a=document.createElement("div"),o=document.createElement("div"),r=document.createElement("div");return ke(a,Ri),ke(o,Ri),ke(r,Fi),r.id="tagging-container",n.forEach(t=>{a.appendChild(this.yr(t))}),s.forEach(t=>{o.appendChild(this.yr(t))}),r.appendChild(a),r.appendChild(o),r}yr(t){const{label:e}=t,i=document.createElement("label"),n=document.createElement("span"),s=document.createElement("input"),a=document.createElement("span"),o=document.createElement("div"),r=document.createElement("div");return ke(i,"onesignal-category-label"),ke(n,"onesignal-category-label-text"),ke(s,"onesignal-category-label-input"),ke(a,"onesignal-checkmark"),i.title=e,n.innerText=e,s.type="checkbox",s.value=t.tag,s.checked=!!t.checked,i.appendChild(n),i.appendChild(s),i.appendChild(a),o.setAttribute("style","clear:both"),r.appendChild(i),r.appendChild(o),r}get br(){return Ie(`#${Pi} > div.${Fi}`)}_r(t){const e=t.target;if(e&&"checkbox"===e.getAttribute("type")){const t=e.checked;e.setAttribute("checked",t.toString())}}static Sr(){const t=`#${Pi} > div.${Fi}> div > div > label > input[type=checkbox]`,e=document.querySelectorAll(t),i={};return e.forEach(t=>{i[t.value]=t.checked}),i}},ca=class{A;vr;Or;mr;constructor(t){this.A=t,this.vr=[],this.Or=!1}async Ir(t){const e="denied"===await OneSignal.A.Tt.$t();let i;const{subscribed:n,optedOut:s}=await OneSignal.A.lt.Aa(),a=t.slidedownPromptOptions?.type;let o=!1;if(a&&(o=Tn(a)),o){if(n)return!!t.isInUpdateMode||(gt.m(new Error("Already subscribed")),!1);if(i=Le(0),s)throw new Error("User is opted out");if(e)return gt.m(tt),!1}else{if(!t.force){const t=OneSignal.ye.Is(),e=OneSignal.ye.Os(),i=t&&e;if(t&&a===$t)return gt.m(nt($t)),!1;if(e&&a===Tt)return gt.m(nt(Tt)),!1;if(i&&a===At)return gt.m(nt(At)),!1}i=Le(1)}return!(i&&!t.force&&!t.isInUpdateMode&&(gt.m(new Error(`${a||"unknown"} previously dismissed`)),1))}kr(){if(!this.mr)throw la;const t=ra.Sr();this.A._i.Cr(t),Wn(),this.A._i.bi(!0)}Er(){if(!this.mr)throw la;const t=this.mr.Co?.eo,e=this.mr.Co?.yo();if(!t||e)throw new Q(1);const i=this.mr.Co?.So();this.Pr(i)}$r(){if(!this.mr)throw la;const t=this.mr.Co?.Xa,e=this.mr.Co?.vo();if(!t||e)throw new Q(0);const i=this.mr.Co?.Oo();this.Tr(i)}Ar(){if(!this.mr)throw la;const t=this.mr.Co?.Xa,e=this.mr.Co?.eo,i=this.mr.Co?.yo(),n=this.mr.Co?.vo();if(!t&&!e||i&&n)throw new Q(2);const s=this.mr.Co?.So(),a=this.mr.Co?.Oo();if(!e)throw new Q(1);if(i||this.Pr(s),!t)throw new Q(0);n||this.Tr(a)}Pr(t){t&&OneSignal.User.addEmail(t)}Tr(t){t&&OneSignal.User.addSms(t)}async Nr(){if(!this.mr)throw la;const t=this.mr.it.text.confirmMessage;if(!t)return;await ut(1e3);const e=new oa(t);e.j(),await ut(5e3),e.In(),oa.Wo(oa.EVENTS.CLOSED)}Mr(t){switch(t.slidedownPromptOptions?.type){case Pt:this.Ur(t);break;case Tt:case $t:case At:this.Dr(t)}}Ur(t){Re("mountTaggingContainer");try{let e={};const i=new ra,n=t.slidedownPromptOptions?.categories;if(!n)throw new Error("Categories not defined");const s=OneSignal.ye.Ze().ni;t.isInUpdateMode&&s?(this.A._i.Lr(s),e=function(t){const e={};return Object.keys(t).forEach(i=>{e[i]="1"===t[i]}),e}(s)):sa(n,!0),i.mo(n,e)}catch(e){gt.S("Failed to create tagging container",e)}}Dr(t){Re("mountChannelCaptureContainer");try{if(t.slidedownPromptOptions){const e=new ta(t.slidedownPromptOptions);e.mo(),this.mr&&(this.mr.Co=e)}}catch(e){gt.S("Failed to create channel capture container",e)}}async wr(){if(!this.mr)throw la;const t=this.mr.it.type;this.mr.Eo&&this.mr.Jo();try{switch(t){case Et:Wn();break;case Pt:this.kr();break;case Tt:this.Er();break;case $t:this.$r();break;case At:this.Ar()}}catch(e){return gt._("Slidedown failed to update:",e),this.mr.Vo(),this.mr.qo(),void(e instanceof Q&&this.mr.Ho(e.reason))}switch(this.mr&&(this.mr.In(),Tn(t)||await this.Nr(),await ut(1e3),ia.Wo(ia.EVENTS.CLOSED)),t){case Et:case Pt:gt.p("Marking slidedown dismissed"),De(0);break;default:gt.p("Marking slidedown dismissed"),De(1)}}gr(t){this.Or=t}async pr(){if(this.vr.length>0){const t=this.Fr();t&&await this.ur(t)}}di(t){this.vr.push(t),ia.Wo(ia.EVENTS.QUEUED)}Fr(){return this.vr.shift()}async ur(t){if(Re("createSlidedown"),!we()){try{if(!(await this.Ir(t)))return}catch(e){return void gt._("Slidedown check error",e)}if(function(){const t=OneSignal.yi;t?.it?.enable&&(t.Dt.K(),OneSignal.P.once(ia.EVENTS.CLOSED,()=>{t.Dt.j()}))}(),this.Or)this.di(t);else try{this.gr(!0);const e=t.slidedownPromptOptions||Bt;this.mr=new ia(e),await this.mr.Lt(t.isInUpdateMode),this.Mr(t),gt.p("Showing Slidedown"),ia.Wo(ia.EVENTS.SHOWN)}catch(e){gt.S("Error showing Slidedown:",e),this.gr(!1),this.mr?.In()}}}},la=new Error("Slidedown is missing"),ua=class{Rr={};A;Wr={};constructor(t){this.A=t}bi(){gt.m("Local tags:",this.Rr);const t=function(t,e){const i={};return Object.keys(t).forEach(n=>{e[n]!==t[n]&&(i[n]=t[n])}),i}(function(t){const e={};return Object.keys(t).forEach(i=>{e[i]=!0===t[i]?"1":"0"}),e}(this.Rr),this.Wr);return aa(t)?(gt._("No tag change detected"),t):(OneSignal.User.addTags(t),t)}Cr(t){this.Rr=t}Lr(t){this.A._i.Wr=t}},da=class{mi;Ft;lt;T;ma;Tt;Mi;Ei;Ai;_i;dr;constructor(t){var e;this.mi=t,this.lt=new Ys(this,{safariWebId:(e=this.mi).safariWebId,appId:e.appId,vapidPublicKey:e.vapidPublicKey,onesignalVapidPublicKey:e.onesignalVapidPublicKey}),this.T=function(t){const e=t.mi,i={workerPath:new zs(xt),registrationOptions:kt};if(e.userConfig){if(e.userConfig.path){const t=e.userConfig.path.replace(/\/+$/,""),n=(e.userConfig.serviceWorkerPath??"").replace(/^\/+/,"");i.workerPath=new zs(`${t}/${n}`)}e.userConfig.serviceWorkerParam&&(i.registrationOptions=e.userConfig.serviceWorkerParam)}return new Ks(t,i)}(this),this.Tt=new Qs,this.ma=new Us(this),this.Mi=new Xs(this),this.Ai=new Zs(this),this._i=new ua(this),this.dr=new ca(this),this.Ei=new na(this),this.Ft=new qe}},ha=class{setLogLevel(t){gt.u(t)}},ga=class extends un{be;Br;constructor(t){super(),this.Br=t,this.be="granted"===t,"undefined"!=typeof OneSignal&&OneSignal.P.on(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_STRING,t=>{this.Br=t,this.be="granted"===t})}get permissionNative(){return this.Br}get permission(){return this.be}async setDefaultUrl(t){if(Re("setDefaultUrl",t),void 0===t)throw st("url");if("string"!=typeof t)throw ot("url");if(!ct(t,{allowNull:!0}))throw at("url");await Fe(),Re("setDefaultNotificationUrl",t);const e=await pe();e.defaultNotificationUrl=t,await fe(e)}async setDefaultTitle(t){if(Re("setDefaultTitle",t),void 0===t)throw st("title");if("string"!=typeof t)throw ot("title");await Fe();const e=await pe();e.defaultNotificationTitle=t,await fe(e)}isPushSupported(){return Re("isPushNotificationsSupported"),!0}async requestPermission(){return!we()&&(await Fe(),await OneSignal.A.Ei.ir())}addEventListener(t,e){OneSignal.P.on(t,e)}removeEventListener(t,e){OneSignal.P.off(t,e)}},pa={NOTIFICATION_PERMISSION_CHANGED_AS_STRING:"permissionChangeAsString",NOTIFICATION_PERMISSION_CHANGED_AS_BOOLEAN:"permissionChange",SUBSCRIPTION_CHANGED:"change",WELCOME_NOTIFICATION_SENT:"sendWelcomeNotification",NOTIFICATION_WILL_DISPLAY:"foregroundWillDisplay",NOTIFICATION_DISMISSED:"dismiss",NOTIFICATION_CLICKED:"click",SDK_INITIALIZED:"initializeInternal",SDK_INITIALIZED_PUBLIC:"initialize",REGISTERED:"register",PERMISSION_PROMPT_DISPLAYED:"permissionPromptDisplay",TEST_FINISHED_ALLOW_CLICK_HANDLING:"testFinishedAllowClickHandling",SESSION_STARTED:"os.sessionStarted"},fa=class{async sendOutcome(t,e){const i=OneSignal.config?.userConfig.outcomes;if(!i)return void gt.S(`No outcomes config for ${t}`);const n=new Ds(OneSignal.config.appId,i,t,!1);if(void 0!==e&&"number"!=typeof e)return void gt.S("Outcome weight must be a number");if(!(await n.Xs()))return;const s=await n.Zs();await n.aa({type:s.type,notificationIds:s.notificationIds,weight:e})}async sendUniqueOutcome(t){const e=OneSignal.config?.userConfig.outcomes;if(!e)return void gt.S(`No outcomes config for ${t}`);const i=new Ds(OneSignal.config.appId,e,t,!0);if(!(await i.Xs()))return;const n=await i.Zs();if(4===n.type)return void gt._("Upgrade required for this feature");const{notificationIds:s}=n,a=await i.ea(s);i.ia(n,a)?await i.aa({type:n.type,notificationIds:a}):gt._(`'${t}' already reported`)}},wa=class extends un{constructor(){super()}async promptPush(t){we()||(await Fe(),await OneSignal.A.Ei.hr(Et,t))}async promptPushCategories(t){if(we())return;await Fe();const e=await OneSignal.A.lt.ct();await OneSignal.A.Ei.sr({...t,isInUpdateMode:e})}async promptSms(t){we()||(await Fe(),await OneSignal.A.Ei.ar({...t}))}async promptEmail(t){we()||(await Fe(),await OneSignal.A.Ei.rr({...t}))}async promptSmsAndEmail(t){we()||(await Fe(),await OneSignal.A.Ei.cr({...t}))}addEventListener(t,e){OneSignal.P.on(t,e)}removeEventListener(t,e){OneSignal.P.off(t,e)}},ma=class t{static EVENTS=pa;static O=!1;static async jr(){const e=new Es;await e._s(),t.ye=new $s(e);const i=await be(),n=await t.A.Tt.$t();t.User=new En(!0,i,n),this.Notifications=new ga(n)}static async zr(e){const i=await Jt(e);gt.p("Final web app config:",i),t.config=i,t.A=new da(i),t.config=t.A.mi}static async login(t,e){if(Re("login",{externalId:t,jwtToken:e}),!we()){if(void 0===t)throw st("externalId");if("string"!=typeof t)throw ot("externalId");if(void 0!==e&&"string"!=typeof e)throw ot("jwtToken");yn(t,"login: externalId")||await Ts.login(t,e)}}static async logout(){Re("logout"),we()||await Ts.logout()}static async init(e){if(Re("init"),gt.p(`Browser Environment: ${I()} ${k()}`),localStorage.removeItem("isOptedOut"),localStorage.removeItem("isPushNotificationsEnabled"),function(){if(OneSignal.Kr)throw new Error("SDK already initialized");OneSignal.Kr=!0}(),await t.zr(e),!t.config)throw new Error("OneSignal config not initialized!");I()!==f||t.config.safariWebId?await Zt.catch(t=>{gt.S("IndexedDB unavailable, close & reopen the page to retry init",t)})&&(await t.jr(),ye(t.config.appId),t.O=await(async()=>{const t=function(){const t=localStorage.getItem(le);return null===t?null:"true"===t}();if(null!==t)return t;const e=await ne("userConsent")??!1;return de(e),e})(),!ue()||t.O?await t.Vr():t.qr=!0):gt._(it)}static async Vr(){async function e(){t.Hr||(t.Hr=!0,t.P.on(t.EVENTS.SUBSCRIPTION_CHANGED,Nn),t.P.on(t.EVENTS.SDK_INITIALIZED,Bn),window.addEventListener("focus",()=>{Un()}),await async function(t){const e=Ke(),i=OneSignal.config,n=await se("appId");if(n&&n!==e){if(gt.m(`App ID changed ${n} -> ${e}, clearing state`),await ie.put("Options",{key:"isPushEnabled",value:null}),await ie.put("Options",{key:"lastPushId",value:null}),await ie.put("Options",{key:"lastPushToken",value:null}),await ie.put("Options",{key:"lastOptedIn",value:null}),te)return;await ie.put("Ids",{type:"registrationId",id:null}),await ie.put("Ids",{type:"userId",id:null}),OneSignal.ye.ui.Wn(2)}await ie.put("Ids",{type:"appId",id:e});const s=t||i.siteName||document.title||"Notification";await ie.put("Options",{key:"pageTitle",value:s}),gt.m(`Set pageTitle to be '${s}'.`),await ie.put("Options",{key:"defaultIcon",value:i.defaultIconUrl??null})}(),await async function(){const t=[],e=OneSignal.config?.userConfig.persistNotification;t.push(ie.put("Options",{key:"persistNotification",value:null==e||e}));const i=OneSignal.config?.userConfig.webhooks;return["notification.willDisplay","notification.clicked","notification.dismissed"].forEach(e=>{i&&i[e]?t.push(ie.put("Options",{key:`webhooks.${e}`,value:i[e]})):t.push(ie.put("Options",{key:`webhooks.${e}`,value:!1}))}),i&&i.cors?t.push(ie.put("Options",{key:"webhooks.cors",value:!0})):t.push(ie.put("Options",{key:"webhooks.cors",value:!1})),OneSignal.config?.userConfig.notificationClickHandlerMatch?t.push(ie.put("Options",{key:"notificationClickHandlerMatch",value:OneSignal.config.userConfig.notificationClickHandlerMatch})):t.push(ie.put("Options",{key:"notificationClickHandlerMatch",value:"exact"})),OneSignal.config?.userConfig.notificationClickHandlerAction?t.push(ie.put("Options",{key:"notificationClickHandlerAction",value:OneSignal.config.userConfig.notificationClickHandlerAction})):t.push(ie.put("Options",{key:"notificationClickHandlerAction",value:"navigate"})),Promise.all(t)}(),await async function(){gt.p("internalInit()"),await OneSignal.A.T.Sa();const t=OneSignal.A.Ai;OneSignal.P.on(OneSignal.EVENTS.SESSION_STARTED,t.Za.bind(t)),cn(),"visible"===document.visibilityState?await Rn():We(document,"visibilitychange",(t,e)=>{"visible"===document.visibilityState&&(e(),Rn())},!0)}())}t.qr=!1,t.A.ma.Ks(),"complete"===document.readyState||"interactive"===document.readyState?await e():(window.addEventListener("DOMContentLoaded",()=>{e()}),document.onreadystatechange=()=>{"complete"!==document.readyState&&"interactive"!==document.readyState||e()})}static async setConsentGiven(e){if(Re("setConsentGiven",{consent:e}),void 0===e)throw st("consent");if("boolean"!=typeof e)throw ot("consent");t.O=e,de(e),e&&t.qr&&await t.Vr()}static async setConsentRequired(t){if(Re("setConsentRequired",{requiresConsent:t}),void 0===t)throw st("requiresConsent");if("boolean"!=typeof t)throw ot("requiresConsent");var e;e=t,localStorage.setItem(ce,e.toString())}static push(e){return function(t,e){if("function"==typeof e)return e(t);throw new Error("Callback is not a function")}(t,e)}static gt;static config=null;static Oi=!1;static v=!1;static C=!1;static wo=!1;static yi=null;static qr=!0;static P=new dn;static N={};static Kr=!1;static Hr=!1;static A;static ye;static Notifications=new ga;static Slidedown=new wa;static Session=new fa;static User=new En(!1);static Debug=new ha};gt.m(`Web SDK loaded (version ${C}, ${T} environment).`),gt.p(`Current Page URL: ${"undefined"==typeof location?"NodeJS":location.href}`),function(){if(window.__oneSignalSdkLoadCount=Be()+1,Be()>1)return gt._("SDK included more than once"),void gt.p(`Skipping duplicate init (${Be()})`);window.OneSignal=ma,window.OneSignalDeferred=window.OneSignalDeferred??[];const t=async function(t){for(const i of t)try{await ma.push(i)}catch(e){gt.S(e)}}(window.OneSignalDeferred);Object.defineProperty(window.OneSignalDeferred,"push",{value:async function(e){return await t,ma.push(e)}})}()}(); //# sourceMappingURL=OneSignalSDK.page.es6.js.map