"use strict";(self.webpackChunkapp_container=self.webpackChunkapp_container||[]).push([[2333],{2333:(t,i,e)=>{e.a(t,(async(t,n)=>{try{e.r(i),e.d(i,{WithoutIOS:()=>v});const{useCallback:t,useEffect:o,useState:a}=await e.e(4914).then(e.t.bind(e,4914,23)).then((t=>({useEffect:t.useEffect,useCallback:t.useCallback,useState:t.useState}))),l=await e.e(4214).then(e.bind(e,4214)).then((t=>t.checkUserSubscribed)),d=await e.e(5906).then(e.bind(e,5906)).then((t=>t.requestNotificationPermission)),s=await e.e(8330).then(e.t.bind(e,8330,23)).then((t=>t.useSelector)),c=await e.e(1139).then(e.bind(e,1139)).then((t=>t.LinkUser)),u=await e.e(2097).then(e.bind(e,2097)).then((t=>t.SubscribeandLink)),r=await e.e(4914).then(e.t.bind(e,4914,23)).then((t=>t.default)),{SetLocalStorage:m,GetLocalStorage:p}=await e.e(4326).then(e.bind(e,4326)).then((t=>({SetLocalStorage:t.SetLocalStorage,GetLocalStorage:t.GetLocalStorage}))),{API:h}=await e.e(118).then(e.bind(e,118)).then((t=>t)),w=await e.e(5556).then(e.bind(e,3175)).then((t=>t.timeDifference)),v=i=>{let{browserOnClick:e}=i;const[n,v]=a(!1),f=s((t=>t.storeFrontContainer.notificationJWTToken)),[b,_]=a(null),[g,k]=a(null),S=window.UnoDuoComponent("NotificationCustomPrompt"),C=()=>{_(!1)},L=t((t=>{setTimeout((()=>{d(h,p,m,f)}),[null!=t?t:0])}),[f]);return o((()=>{f&&l(p).then((t=>{if(!t&&"Notification"in window&&"granted"!==Notification.permission&&"denied"!==Notification.permission){function l(t){if(null!=t&&t.is_push_enabled){if("default"===(null==t?void 0:t.prompt_type)&&!n){g||k(t);const i=()=>{var i,e,n;const o=p("FlitsCodeLoadTime"),a=1e3*(null!==(i=window.matchMedia("(max-width: 767px)"))&&void 0!==i&&i.matches?null!==(e=null==t?void 0:t.timing_gap_mobile)&&void 0!==e?e:0:null!==(n=null==t?void 0:t.timing_gap_desktop)&&void 0!==n?n:0)-1e3*w(o);p("FlitsFirstClick")||(L(a<0?0:a),m("FlitsFirstClick",(new Date).getTime())),v(!0)};e?window.addEventListener("FirstClickedOnBrowser",n?null:i):i()}var i,o,a;"custom"===(null==t?void 0:t.prompt_type)&&(g||k(t),setTimeout((()=>{_(!0),m("NotificationPrompt",(new Date).getTime())}),[1e3*(null!==(i=window.matchMedia("(max-width: 767px)"))&&void 0!==i&&i.matches?null!==(o=null==t?void 0:t.timing_gap_mobile)&&void 0!==o?o:0:null!==(a=null==t?void 0:t.timing_gap_desktop)&&void 0!==a?a:0)]))}}g?l(g):h.notification.promptData(f).then((t=>{l(t)})).catch((t=>{}))}else{var i,o;if(""!==(null===(i=window)||void 0===i||null===(i=i.flitsThemeAppExtensionObjects)||void 0===i||null===(i=i.customer)||void 0===i?void 0:i.customer_id)&&"-1"!==(null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o||null===(o=o.customer)||void 0===o?void 0:o.customer_id)){var a;const d=p("Notification"),s=d?null!==(a=d[""])&&void 0!==a?a:d[-1]:null;s&&c(m,d,h,s,f)}!t&&"Notification"in window&&"granted"===Notification.permission&&u(p,m,h,f)}})).catch((t=>{}))}),[f,e,n,L,g]),g?"ios_prompt"===(null==g?void 0:g.prompt_type)?null:b&&r.createElement(S,{openModal:b,closeModal:C,data:g,handleSubscribe:()=>{var t,i,e;C(),"custom"!==(null==g?void 0:g.prompt_type)?L(1e3*(null!==(t=window.matchMedia("(max-width: 767px)"))&&void 0!==t&&t.matches?null!==(i=null==g?void 0:g.timing_gap_mobile)&&void 0!==i?i:0:null!==(e=null==g?void 0:g.timing_gap_desktop)&&void 0!==e?e:0)):L(0)}}):null};n()}catch(t){n(t)}}),1)}}]);