(function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m.PWAPrompt={},m.Vue))})(this,function(m,e){"use strict";var C;var u=document.createElement("style");u.textContent=`._overlay_pqjif_2{background-color:#0a0a0a80;height:100%;left:0;min-height:100vh;min-width:100vw;opacity:0;pointer-events:none;position:fixed;top:0;touch-action:none;transition:opacity .2s ease-in;width:100%}._visible_pqjif_17{display:block;opacity:1;pointer-events:all;touch-action:auto;z-index:999999}@media (prefers-color-scheme: light){._overlay_pqjif_2{background-color:#0a0a0a33}}._panel_1s2dx_2{background-color:#222;border-radius:10px;bottom:0;box-sizing:border-box;left:0;overflow:hidden;position:fixed;transform:translateY(calc(100% + 10px));transition:transform .4s cubic-bezier(.4,.24,.3,1);width:100%;box-shadow:0 0 100px #0000003b,0 0 100px #0000003b;z-index:999999;margin:0 8px 10px;width:calc(100vw - 16px)}._visible_1s2dx_19{display:block;transform:translateY(0)}@media (prefers-color-scheme: light){._panel_1s2dx_2{background-color:#f6f6f6}}._icon_14toq_2{height:100%;border:0}._circle_14toq_7{fill:#363739}._cross_14toq_11{fill:#a3a4a9}@media (prefers-color-scheme: light){._circle_14toq_7{fill:#dedede}._cross_14toq_11{fill:#807f84}}._closeButton_1s0ra_2{align-items:center;background:none;border-radius:30px;border:0;display:flex;height:30px;justify-content:center;width:30px}._header_1jdc4_2{display:flex;justify-content:space-between;padding:15px}._header_1jdc4_2 *{margin:0;padding:0}._appInfo_1jdc4_13{display:flex;flex-flow:row nowrap}._appIcon_1jdc4_18{border-radius:7.5px;height:60px;min-height:60px;min-width:60px;overflow:hidden;width:60px}._appTitleContainer_1jdc4_27{align-items:flex-start;display:flex;flex-flow:column nowrap;gap:4px;justify-content:flex-start;padding:4px 15px;text-align:left}._appTitle_1jdc4_27{color:#fff;font-size:16px;font-weight:600;line-height:20px}._appSubtitle_1jdc4_44{color:#ebebf599;font-size:14px;font-weight:300;line-height:20px}@media (prefers-color-scheme: light){._appTitle_1jdc4_27{color:#000}._appSubtitle_1jdc4_44{color:#3c3c4399}}._divider_6s2zv_2{background-color:#545458a6;height:1px;transform:scaleY(.2);width:100%}@media (prefers-color-scheme: light){._divider_6s2zv_2{background-color:#3c3c435c}}._description_ec7qs_2{color:#ebebf599;font-size:14px;font-weight:300;line-height:20px;padding:20px 30px;text-align:left}@media (prefers-color-scheme: light){._description_ec7qs_2{color:#3c3c4399}}._stepItem_16klv_2{align-items:center;display:flex;font-size:14px;font-weight:300;justify-content:flex-start;line-height:20px;margin:15px 0;width:100%}._stepItem_16klv_2:first-of-type{margin-top:0}._stepItem_16klv_2:last-of-type{margin-bottom:0}._copy_16klv_21{margin:0 0 0 30px;text-align:left;color:#ebebf599}@media (prefers-color-scheme: light){._copy_16klv_21{color:#3c3c4399}}._icon_151rv_2{color:#0a84ff;fill:#0a84ff;width:20px}@media (prefers-color-scheme: light){._icon_151rv_2{color:#007aff;fill:#007aff}}._list_zv6ac_2{list-style-type:none;list-style:inside decimal;margin:0;padding:20px 30px}._container_1adyk_2 *{font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-smooth:antialiased;-moz-osx-font-smoothing:antialiased;-webkit-font-smoothing:antialiased}._noScroll_1adyk_10{overflow:hidden} `,document.head.appendChild(u);function y(){const t=e.ref(void 0),s=e.ref(void 0),o=e.ref(void 0),l=e.ref(void 0);return e.onMounted(()=>{const n=window.navigator.userAgent.toLowerCase(),c=/(iphone|ipad|ipod|macintosh)/g,p=/os (\d+)/g,d=c.exec(n),i=d?d[1]:null,_=i==="macintosh"&&window.navigator.maxTouchPoints>1,r=p.exec(n),f=r?r[1]:null,b="standalone"in window.navigator&&!!window.navigator.standalone;o.value=b,l.value=_||!!i&&i!=="macintosh",t.value=_?"ipad":i??null,s.value=i||_?f??null:null}),{platform:t,version:s,isStandalone:o,isValidOS:l}}function g(){return{get:l=>{const n=localStorage.getItem(l);return n?JSON.parse(n):null},set:(l,n)=>{localStorage.setItem(l,JSON.stringify(n))},remove:l=>{localStorage.removeItem(l)}}}function h(){const{get:t,set:s}=g(),{isValidOS:o}=y(),l=e.ref(void 0);return e.onMounted(()=>{var p;const c=((p=t("iosPwaPrompt"))==null?void 0:p.visits)??0;l.value=c}),{numberOfVisits:l,incrementNumberOfVisits:()=>{s("iosPwaPrompt",{isValidOS:o.value,visits:(l.value??0)+1})}}}function w({promptOnVisit:t,timesToShow:s,isShown:o}){const{isValidOS:l,isStandalone:n}=y(),{numberOfVisits:c}=h();return{shouldShowPrompt:e.computed(()=>{if((o==null?void 0:o.value)!==void 0)return o.value;if(l.value!==void 0&&c.value!==void 0&&n.value===!1){const d=c.value+1>=t.value,i=c.value+1(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.$style.overlay,{[n.$style.visible]:o.isOpen},"iOSPWA-overlay"]),"aria-label":"Close",role:"button",onClick:c[0]||(c[0]=p=>l("close"))},null,2))}}),x={overlay:"_overlay_pqjif_2",visible:"_visible_pqjif_17"},a=(t,s)=>{const o=t.__vccOpts||t;for(const[l,n]of s)o[l]=n;return o},L=a(M,[["__cssModules",{$style:x}]]),k=a(e.defineComponent({__name:"Panel",props:{isOpen:{type:Boolean}},setup(t){const s=t;return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([o.$style.panel,{[o.$style.visible]:s.isOpen},"iOSPWA-panel"]),"aria-describedby":"pwa-prompt-description","aria-labelledby":"pwa-prompt-title",role:"dialog"},[e.renderSlot(o.$slots,"default")],2))}}),[["__cssModules",{$style:{panel:"_panel_1s2dx_2",visible:"_visible_1s2dx_19"}}]]),T={icon:"_icon_14toq_2",circle:"_circle_14toq_7",cross:"_cross_14toq_11"},V={};function B(t,s){return e.openBlock(),e.createElementBlock("svg",{viewBox:"0 0 30.249 29.8975",class:e.normalizeClass(t.$style.icon)},[e.createElementVNode("path",{class:e.normalizeClass(t.$style.circle),d:"M14.9414 29.8828C23.1885 29.8828 29.8828 23.1738 29.8828 14.9414C29.8828 6.69434 23.1885 0 14.9414 0C6.70898 0 0 6.69434 0 14.9414C0 23.1738 6.70898 29.8828 14.9414 29.8828Z"},null,2),e.createElementVNode("path",{class:e.normalizeClass(t.$style.cross),d:"M10.0195 21.0938C9.3457 21.0938 8.81836 20.5518 8.81836 19.8779C8.81836 19.5557 8.93555 19.248 9.16992 19.0283L13.2275 14.9561L9.16992 10.8984C8.93555 10.6641 8.81836 10.3711 8.81836 10.0488C8.81836 9.36035 9.3457 8.84766 10.0195 8.84766C10.3564 8.84766 10.6201 8.96484 10.8545 9.18457L14.9414 13.2568L19.0576 9.16992C19.3066 8.9209 19.5703 8.81836 19.8926 8.81836C20.5664 8.81836 21.1084 9.3457 21.1084 10.0195C21.1084 10.3564 21.0059 10.6201 20.7422 10.8838L16.6699 14.9561L20.7275 19.0137C20.9766 19.2334 21.0938 19.541 21.0938 19.8779C21.0938 20.5518 20.5518 21.0938 19.8633 21.0938C19.5264 21.0938 19.2188 20.9766 18.999 20.7422L14.9414 16.6699L10.8984 20.7422C10.6641 20.9766 10.3564 21.0938 10.0195 21.0938Z"},null,2)],2)}const I=a(V,[["render",B],["__cssModules",{$style:T}]]),P=a(e.defineComponent({__name:"CloseButton",emits:["close"],setup(t,{emit:s}){const o=s;return(l,n)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass([l.$style.closeButton,"iOSPWA-closeButton"]),onClick:n[0]||(n[0]=c=>o("close")),"aria-label":"Close"},[e.createVNode(I)],2))}}),[["__cssModules",{$style:{closeButton:"_closeButton_1s0ra_2"}}]]),O=["src"],z=a(e.defineComponent({__name:"Header",props:{appIconPath:{},copySubtitle:{},copyTitle:{}},emits:["close"],setup(t,{emit:s}){const o=t,l=s;return(n,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.$style.header,"iOSPWA-header"])},[e.createElementVNode("div",{class:e.normalizeClass(n.$style.appInfo)},[e.createElementVNode("img",{class:e.normalizeClass(n.$style.appIcon),src:o.appIconPath,alt:"App Icon"},null,10,O),e.createElementVNode("div",{class:e.normalizeClass(n.$style.appTitleContainer)},[e.createElementVNode("span",{class:e.normalizeClass(n.$style.appTitle)},e.toDisplayString(o.copyTitle),3),e.createElementVNode("span",{class:e.normalizeClass(n.$style.appSubtitle)},e.toDisplayString(o.copySubtitle),3)],2)],2),e.createVNode(P,{onClose:c[0]||(c[0]=p=>l("close"))})],2))}}),[["__cssModules",{$style:{header:"_header_1jdc4_2",appInfo:"_appInfo_1jdc4_13",appIcon:"_appIcon_1jdc4_18",appTitleContainer:"_appTitleContainer_1jdc4_27",appTitle:"_appTitle_1jdc4_27",appSubtitle:"_appSubtitle_1jdc4_44"}}]]),N={divider:"_divider_6s2zv_2"},v={};function A(t,s){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.$style.divider,"iOSPWA-divider"])},null,2)}const S=a(v,[["render",A],["__cssModules",{$style:N}]]),j=a(e.defineComponent({__name:"Description",props:{copyDescription:{}},setup(t){const s=t;return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([o.$style.description,"iOSPWA-description"])},e.toDisplayString(s.copyDescription),3))}}),[["__cssModules",{$style:{description:"_description_ec7qs_2"}}]]),$=a(e.defineComponent({__name:"StepItem",props:{copy:{}},setup(t){const s=t;return(o,l)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([o.$style.stepItem,"iOSPWA-stepItem"])},[e.renderSlot(o.$slots,"icon"),e.createElementVNode("p",{class:e.normalizeClass(o.$style.copy)},e.toDisplayString(s.copy),3)],2))}}),[["__cssModules",{$style:{stepItem:"_stepItem_16klv_2",copy:"_copy_16klv_21"}}]]),E={icon:"_icon_151rv_2"},D={};function q(t,s){return e.openBlock(),e.createElementBlock("svg",{viewBox:"0 0 17.6953 26.0059",class:e.normalizeClass(t.$style.icon)},s[0]||(s[0]=[e.createElementVNode("path",{d:"M17.334 10.8105L17.334 20.4395C17.334 22.4512 16.3086 23.4668 14.2676 23.4668L3.06641 23.4668C1.02539 23.4668 0 22.4609 0 20.4395L0 10.8105C0 8.78906 1.02539 7.7832 3.06641 7.7832L6.05469 7.7832L6.05469 9.35547L3.08594 9.35547C2.10938 9.35547 1.57227 9.87305 1.57227 10.8887L1.57227 20.3613C1.57227 21.377 2.10938 21.8945 3.08594 21.8945L14.2383 21.8945C15.2051 21.8945 15.7617 21.377 15.7617 20.3613L15.7617 10.8887C15.7617 9.87305 15.2051 9.35547 14.2383 9.35547L11.2695 9.35547L11.2695 7.7832L14.2676 7.7832C16.3086 7.7832 17.334 8.79883 17.334 10.8105Z"},null,-1),e.createElementVNode("path",{d:"M8.66211 15.8203C9.08203 15.8203 9.44336 15.4785 9.44336 15.0684L9.44336 5.13672L9.38477 3.68164L9.93164 4.25781L11.4355 5.86914C11.5723 6.02539 11.7773 6.10352 11.9629 6.10352C12.373 6.10352 12.6758 5.81055 12.6758 5.41992C12.6758 5.20508 12.5977 5.04883 12.4512 4.90234L9.22852 1.79688C9.0332 1.60156 8.86719 1.54297 8.66211 1.54297C8.4668 1.54297 8.30078 1.60156 8.0957 1.79688L4.88281 4.90234C4.73633 5.04883 4.64844 5.20508 4.64844 5.41992C4.64844 5.81055 4.94141 6.10352 5.35156 6.10352C5.53711 6.10352 5.75195 6.02539 5.88867 5.86914L7.40234 4.25781L7.94922 3.68164L7.89062 5.13672L7.89062 15.0684C7.89062 15.4785 8.24219 15.8203 8.66211 15.8203Z"},null,-1)]),2)}const H=a(D,[["render",q],["__cssModules",{$style:E}]]),W={icon:"_icon_151rv_2"},R={};function Z(t,s){return e.openBlock(),e.createElementBlock("svg",{viewBox:"0 0 18.3398 17.9785",class:e.normalizeClass(t.$style.icon)},s[0]||(s[0]=[e.createElementVNode("path",{d:"M3.06641 17.9785L14.9121 17.9785C16.9629 17.9785 17.9785 16.9727 17.9785 14.9609L17.9785 3.02734C17.9785 1.01562 16.9629 0 14.9121 0L3.06641 0C1.02539 0 0 1.01562 0 3.02734L0 14.9609C0 16.9727 1.02539 17.9785 3.06641 17.9785ZM3.08594 16.4062C2.10938 16.4062 1.57227 15.8887 1.57227 14.873L1.57227 3.11523C1.57227 2.09961 2.10938 1.57227 3.08594 1.57227L14.8926 1.57227C15.8594 1.57227 16.4062 2.09961 16.4062 3.11523L16.4062 14.873C16.4062 15.8887 15.8594 16.4062 14.8926 16.4062Z"},null,-1),e.createElementVNode("path",{d:"M4.47266 8.98438C4.47266 9.46289 4.80469 9.78516 5.30273 9.78516L8.17383 9.78516L8.17383 12.666C8.17383 13.1543 8.50586 13.4961 8.98438 13.4961C9.47266 13.4961 9.81445 13.1641 9.81445 12.666L9.81445 9.78516L12.6953 9.78516C13.1836 9.78516 13.5254 9.46289 13.5254 8.98438C13.5254 8.49609 13.1836 8.1543 12.6953 8.1543L9.81445 8.1543L9.81445 5.2832C9.81445 4.78516 9.47266 4.44336 8.98438 4.44336C8.50586 4.44336 8.17383 4.78516 8.17383 5.2832L8.17383 8.1543L5.30273 8.1543C4.80469 8.1543 4.47266 8.49609 4.47266 8.98438Z"},null,-1)]),2)}const Y=a(R,[["render",Z],["__cssModules",{$style:W}]]),J=a(e.defineComponent({__name:"StepList",props:{copyAddToHomeScreenStep:{},copyShareStep:{}},setup(t){const s=t;return(o,l)=>(e.openBlock(),e.createElementBlock("ol",{class:e.normalizeClass(o.$style.list,"iOSPWA-stepList")},[e.createVNode($,{copy:s.copyShareStep},{icon:e.withCtx(()=>[e.createVNode(H)]),_:1},8,["copy"]),e.createVNode($,{copy:s.copyAddToHomeScreenStep},{icon:e.withCtx(()=>[e.createVNode(Y)]),_:1},8,["copy"])],2))}}),[["__cssModules",{$style:{list:"_list_zv6ac_2"}}]]),U=a(e.defineComponent({__name:"Container",props:{appIconPath:{},copyAddToHomeScreenStep:{},copyDescription:{},copyShareStep:{},copySubtitle:{},copyTitle:{},delay:{}},emits:["close"],setup(t,{emit:s}){const o=e.useCssModule(),l=t,n=e.ref(!l.delay);let c;const p=s,d=()=>{document.body.classList.remove(o.noScroll),n.value=!1};return e.onMounted(()=>{l.delay&&(c=window.setTimeout(()=>{var i;(i=document==null?void 0:document.activeElement)==null||i.blur(),n.value=!0},l.delay)),n.value&&document.body.classList.add(o.noScroll)}),e.onBeforeUnmount(()=>{c&&clearTimeout(c),document.body.classList.remove(o.noScroll)}),(i,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o).container,"iOSPWA-container"])},[e.createVNode(L,{isOpen:n.value,onClose:d},null,8,["isOpen"]),e.createVNode(k,{isOpen:n.value,onTransitionend:_[0]||(_[0]=r=>!n.value&&p("close"))},{default:e.withCtx(()=>[e.createVNode(z,{appIconPath:i.appIconPath,copySubtitle:i.copySubtitle,copyTitle:i.copyTitle,onClose:d},null,8,["appIconPath","copySubtitle","copyTitle"]),e.createVNode(S),e.createVNode(j,{copyDescription:i.copyDescription},null,8,["copyDescription"]),e.createVNode(S),e.createVNode(J,{copyShareStep:i.copyShareStep,copyAddToHomeScreenStep:i.copyAddToHomeScreenStep},null,8,["copyShareStep","copyAddToHomeScreenStep"])]),_:1},8,["isOpen"])],2))}}),[["__cssModules",{$style:{container:"_container_1adyk_2",noScroll:"_noScroll_1adyk_10"}}]]),F=e.defineComponent({__name:"PWAPrompt",props:{appIconPath:{default:"/vite.svg"},copyAddToHomeScreenStep:{default:"Press 'Add to Home Screen'"},copyDescription:{default:"This website has app functionality. Add it to your home screen to use it in fullscreen and while offline."},copyShareStep:{default:"Press the 'Share' button on the menu bar below"},copySubtitle:{default:String((C=window==null?void 0:window.location)==null?void 0:C.href)},copyTitle:{default:"Add to Home Screen"},delay:{default:1e3},promptOnVisit:{default:2},timesToShow:{default:2},isShown:{type:Boolean,default:void 0}},emits:["close"],setup(t,{emit:s}){const o=t,l=e.toRef(o,"isShown"),n=e.toRefs(o),c=s,{isValidOS:p}=y(),{numberOfVisits:d,incrementNumberOfVisits:i}=h(),{shouldShowPrompt:_}=w({promptOnVisit:n.promptOnVisit,timesToShow:n.timesToShow,isShown:l});return e.onMounted(()=>{p.value&&d.value!==void 0&&i()}),(r,f)=>e.unref(_)?(e.openBlock(),e.createBlock(U,{key:0,isShown:r.isShown,delay:r.delay,copyTitle:r.copyTitle,copySubtitle:r.copySubtitle,copyDescription:r.copyDescription,copyShareStep:r.copyShareStep,copyAddToHomeScreenStep:r.copyAddToHomeScreenStep,appIconPath:r.appIconPath,onClose:f[0]||(f[0]=b=>c("close"))},null,8,["isShown","delay","copyTitle","copySubtitle","copyDescription","copyShareStep","copyAddToHomeScreenStep","appIconPath"])):e.createCommentVNode("",!0)}});m.PWAPrompt=F,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});