/* Copyright © 2024 Melbet - All Rights Reserved */ import{requiredArgs as N,toDate as $,toInteger as I,d as O,themeType as A,t as W,useAppStorage as V,AppStorageKey as B,b as z,l$1 as M,useSiteConfig as P,iconColoredSvg as E,sizeType as H,iconName as R,ICON_LOGOS_PATH as F,_export_sfc as Q,m as G,n as Y,__nuxt_component_3 as K}from"./entry-D8aWJ4es.js";import{defineComponent as L,resolveComponent as _,openBlock as r,createBlock as u,withCtx as i,createElementVNode as t,createElementBlock as q,renderSlot as D,createCommentVNode as f,ref as j,computed as J,unref as X,resolveDirective as Z,createVNode as l,createTextVNode as v,toDisplayString as g,withDirectives as x,withModifiers as ee,mergeProps as U}from"../../../../shared-assets/__shared_vue_deps_4ZTCVFCX.js";import{QrcodeVue as oe}from"./DNHKxZ3XE6EC.js";import{useDownloadAppAnalytics as te,useDownloadAppWidgetTabs as ne}from"./CcOBMx9MSP0g.js";import{l as ie}from"./BE3Ht04sG6M4.js";import"../../../../shared-assets/__shared_sweetalert2_X3CQ7PJQ.js";import"../../../../shared-assets/__shared_vue_final_modal_FECSVAVQ.js";import"../../../../shared-assets/__shared_accept_language_parser_QKZ6ULEV.js";import"../../../../shared-assets/__shared_popper_js_MO5RLEN3.js";import"../../../../shared-assets/__shared_localforage_PLMWICWN.js";function ae(e,n){N(2,arguments);var o=$(e),p=I(n);if(isNaN(p))return new Date(NaN);if(!p)return o;var c=o.getDate(),a=new Date(o.getTime());a.setMonth(o.getMonth()+p+1,0);var d=a.getDate();return c>=d?a:(o.setFullYear(a.getFullYear(),a.getMonth(),c),o)}var de=L({name:"UiStoreLink_F",components:{UiButton:O},props:{theme:{type:String,default:A.primary},link:{type:String,default:void 0}}});const se={class:"ui-store-link__container"},le={key:0,class:"ui-store-link__icon"},re={class:"ui-store-link__text ui-store-link-text"},pe={class:"ui-store-link-text__label"},ce={class:"ui-store-link-text__title"};var ue=W(de,[["render",function(e,n,o,p,c,a){const d=_("UiButton");return r(),u(d,{tag:"a",theme:e.theme,href:e.link,uppercase:!1,target:"_blank",rel:"nofollow noopener",class:"ui-store-link"},{container:i(()=>[t("div",se,[e.$slots.ico?(r(),q("span",le,[D(e.$slots,"ico",{},void 0,!0)])):f("",!0),t("div",re,[t("div",pe,[D(e.$slots,"label",{},void 0,!0)]),t("div",ce,[D(e.$slots,"title",{},void 0,!0)])])])]),_:3},8,["theme","href"])}],["__scopeId","data-v-79b681c0"]]);const _e=()=>{const e=V(),{trackCloseStoreLinks:n}=te(),o=j(!0);return{isVisible:o,handleCloseWidget:()=>{const c=ae(new Date,1);e.setItem(B.DOWNLOAD_APP_WIDGET_SHOWED,!1,{expireDate:c}),n(),o.value=!1}}},we={UiButton:A.primary},ge={level:"L",size:70,renderAs:"svg"},me=L({name:"DownloadAppWidget",components:{UiColumnBox:ie,UiTabs:z,UiStoreLink:ue,UiColoredSvg:M,QrcodeVue:oe},props:{closable:{type:Boolean,default:!0}},setup(){const{isHeaderLogoDark:e}=P(),{tabSelected:n,selectTab:o,clickOnDownload:p,qrCodeTitle:c,currentUrlToApp:a,storeIcoForTab:d,instructionLink:w,showInstruction:C,storeName:b,openDownloadAppWidget:m,tabs:h,descriptionLink:k}=ne(),{handleCloseWidget:T,isVisible:y}=_e(),S=e?"header_logo_dark":"header_logo_light",s=J(()=>`${window.location.origin}${X(w)}`);return{isVisible:y,openDownloadAppWidget:m,showInstruction:C,handleCloseWidget:T,clickOnDownload:p,tabSelected:n,qrCodeInstructionLink:s,tabs:h,selectTab:o,qrCodeTitle:c,currentUrlToApp:a,storeIcoForTab:d,iconColoredSvg:E,storeName:b,themeType:A,sizeType:H,iconName:R,downloadAppWidgetColorScheme:we,ICON_LOGOS_PATH:F,descriptionLink:k,qrCodeAttrs:ge,headerLogo:S,instructionLink:w}}}),he={class:"download-app-widget__header"},ke={class:"download-app-widget-tabs__item"},ve={class:"download-app-widget__body download-app-widget-body"},fe={class:"download-app-widget-qr__image"},Ce={class:"download-app-widget-qr__image download-app-widget-qr-image"},be={class:"download-app-widget-body__description download-app-widget-description"},Te=["href"],ye=["alt","src"],Se={class:"download-app-widget-description__title"};function De(e,n,o,p,c,a){const d=G,w=Y,C=_("UiTabs"),b=O,m=_("UiColoredSvg"),h=_("QrcodeVue"),k=K,T=_("UiStoreLink"),y=_("UiColumnBox"),S=Z("tooltip");return e.isVisible?(r(),u(y,{key:0,class:"download-app-widget"},{default:i(()=>[t("div",he,[l(C,{"onUpdate:modelValue":e.selectTab,modelValue:e.tabSelected,options:e.tabs,rounded:!1,theme:e.themeType.primary_20,class:"download-app-widget__tabs download-app-widget-tabs",name:"download-app-widget-tabs",equal:""},{default:i(({item:s})=>[t("div",ke,[s.ico?(r(),u(d,{key:0,ico:s.ico,path:e.ICON_LOGOS_PATH,class:"download-app-widget-tabs__ico"},null,8,["ico","path"])):f("",!0),l(w,{size:e.sizeType.s},{default:i(()=>[v(g(s.value),1)]),_:2},1032,["size"])])]),_:1},8,["onUpdate:modelValue","modelValue","options","theme"]),e.closable?x((r(),u(b,{key:0,onClick:ee(e.handleCloseWidget,["prevent"]),theme:e.downloadAppWidgetColorScheme.UiButton,size:e.sizeType.s,"aria-label":e.$T("close"),rounded:!1,class:"download-app-widget__close download-app-widget-close"},{default:i(()=>[l(d,{ico:e.iconName.ERROR_CROSS,size:e.sizeType.xxs,class:"download-app-widget-close__icon"},null,8,["ico","size"])]),_:1},8,["onClick","theme","size","aria-label"])),[[S,e.$T("close")]]):f("",!0)]),t("div",ve,[e.showInstruction?(r(),u(k,{key:0,to:e.instructionLink,class:"download-app-widget-body__qr download-app-widget-qr"},{default:i(()=>[l(m,{name:e.iconColoredSvg.PHONE_QR,cover:"",class:"download-app-widget-qr__svg"},null,8,["name"]),t("div",fe,[l(h,U({value:e.qrCodeInstructionLink},e.qrCodeAttrs,{title:e.qrCodeTitle}),null,16,["value","title"])])]),_:1},8,["to"])):(r(),q("button",{key:1,onClick:n[0]||(n[0]=(...s)=>e.openDownloadAppWidget&&e.openDownloadAppWidget(...s)),class:"download-app-widget-body__qr download-app-widget-qr",type:"button"},[l(m,{name:e.iconColoredSvg.PHONE_QR,cover:"",class:"download-app-widget-qr__svg"},null,8,["name"]),t("span",Ce,[l(h,U({value:e.currentUrlToApp},e.qrCodeAttrs,{title:e.qrCodeTitle}),null,16,["value","title"])])])),t("div",be,[t("a",{onClick:n[1]||(n[1]=(...s)=>e.clickOnDownload&&e.clickOnDownload(...s)),href:e.descriptionLink,class:"download-app-widget-description__download",target:"_blank"},[t("img",{alt:e.$T("download_app_name"),src:e.$mediaUrl(e.headerLogo),class:"download-app-widget-description__logo"},null,8,ye),t("h3",Se,g(e.$T("download_app_title")),1)],8,Te),e.showInstruction?(r(),u(k,{key:0,to:e.instructionLink,class:"download-app-widget-description__instruction download-app-widget-description-instruction"},{default:i(()=>[l(w,{uppercase:""},{default:i(()=>[v(g(e.$T("download_app_instruction")),1)]),_:1})]),_:1},8,["to"])):(r(),u(T,{key:1,onClick:e.clickOnDownload,theme:e.themeType.accent,link:e.currentUrlToApp,class:"download-app-widget-description__link"},{ico:i(()=>[l(d,{ico:e.storeIcoForTab,path:e.ICON_LOGOS_PATH},null,8,["ico","path"])]),title:i(()=>[v(g(e.storeName),1)]),label:i(()=>[v(g(e.$T("download_app_free")),1)]),_:1},8,["onClick","theme","link"]))])])]),_:1})):f("",!0)}const Be=Q(me,[["render",De],["__scopeId","data-v-ab127c0a"]]);export{Be as default};