@onside/install-widget 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/AndroidPlatformModal-3kGO8HxK.js +48 -0
- package/dist-lib/AndroidPlatformModal-B_uF1M7D.cjs +1 -0
- package/dist-lib/CheckInstallModal-ClGHu6XA.cjs +1 -0
- package/dist-lib/CheckInstallModal-Do2gfb9L.js +76 -0
- package/dist-lib/Dialog-B1D2BvMl.js +95 -0
- package/dist-lib/Dialog-BRBYK08a.cjs +1 -0
- package/dist-lib/FaqModal-BspE3dHf.cjs +1 -0
- package/dist-lib/FaqModal-J1y4DGzd.js +103 -0
- package/dist-lib/{GoToSafariModal-C_KBizh8.js → GoToSafariModal-BSuOwGJ3.js} +36 -36
- package/dist-lib/GoToSafariModal-Be-O5A-M.cjs +1 -0
- package/dist-lib/UpdateIOSModal-CF7lFNfI.js +81 -0
- package/dist-lib/UpdateIOSModal-Mxvo1zPl.cjs +1 -0
- package/dist-lib/cdn-BmfyFccQ.js +99 -0
- package/dist-lib/cdn-BonUyxCA.cjs +1 -0
- package/dist-lib/hooks.cjs +1 -1
- package/dist-lib/hooks.js +4 -3
- package/dist-lib/index-BzQo1EMv.cjs +1 -0
- package/dist-lib/index-fWIxOyUM.js +194 -0
- package/dist-lib/install-package-CZGZODly.js +451 -0
- package/dist-lib/install-package-Dkv3eM_d.cjs +1 -0
- package/dist-lib/install-package.cjs +1 -1
- package/dist-lib/install-package.d.ts +83 -19
- package/dist-lib/install-package.js +14 -12
- package/dist-lib/install-widget.css +1 -1
- package/dist-lib/useInstallUrl-McaAuMPK.js +65 -0
- package/dist-lib/useInstallUrl-iPCPqYWB.cjs +1 -0
- package/dist-lib/utils.cjs +1 -1
- package/dist-lib/utils.d.ts +1 -2
- package/dist-lib/utils.js +89 -79
- package/package.json +4 -4
- package/dist-lib/AndroidPlatformModal-2Ykjo2V7.js +0 -48
- package/dist-lib/AndroidPlatformModal-DTglyxUG.cjs +0 -1
- package/dist-lib/Dialog-yEP-7Deb.js +0 -1399
- package/dist-lib/Dialog-yZ9bWtK1.cjs +0 -45
- package/dist-lib/GoToSafariModal-Cgx0X0rg.cjs +0 -1
- package/dist-lib/UpdateIOSModal-BGWvssyd.js +0 -170
- package/dist-lib/UpdateIOSModal-CE-d3YCr.cjs +0 -1
- package/dist-lib/install-package-B17QfMPy.cjs +0 -1
- package/dist-lib/install-package-DowlG4hO.js +0 -3036
- package/dist-lib/useInstallUrl-CjUspi0p.cjs +0 -1
- package/dist-lib/useInstallUrl-JIdkWpgj.js +0 -87
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as s, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { c as u } from "./install-package-CZGZODly.js";
|
|
3
|
+
import { useRef as g, useEffect as m } from "react";
|
|
4
|
+
const v = "data:image/svg+xml,%3csvg%20width='10'%20height='16'%20viewBox='0%200%2010%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.9375%2012.25L6.35539%209.83211C6.74592%209.44158%206.74592%208.80842%206.35539%208.41789L3.9375%206'%20stroke='%231E1C1F'%20stroke-opacity='0.6'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", j = ({ breadcrumbs: e, className: i }) => /* @__PURE__ */ s("ul", { className: i, children: e.map((n, o) => /* @__PURE__ */ p("li", { className: "inline-flex", children: [
|
|
5
|
+
/* @__PURE__ */ s("p", { className: "rounded-3xl bg-lightGray px-2 py-0.5 text-sm", children: n }),
|
|
6
|
+
o < e.length - 1 && /* @__PURE__ */ s(
|
|
7
|
+
"img",
|
|
8
|
+
{
|
|
9
|
+
alt: "Arrow icon",
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
className: "ml-1",
|
|
12
|
+
height: 16,
|
|
13
|
+
src: v,
|
|
14
|
+
width: 10
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
] }, n)) }), x = (e) => {
|
|
18
|
+
const { ariaLabel: i, children: n, className: o, poster: r } = e, t = g(null);
|
|
19
|
+
return m(() => {
|
|
20
|
+
const a = () => {
|
|
21
|
+
t.current && t.current.paused && (t.current.muted = !0, t.current.play());
|
|
22
|
+
}, d = () => {
|
|
23
|
+
t.current && (document.visibilityState === "hidden" ? t.current.pause() : document.visibilityState === "visible" && a());
|
|
24
|
+
}, c = () => {
|
|
25
|
+
t.current && t.current.pause();
|
|
26
|
+
};
|
|
27
|
+
return document.addEventListener("visibilitychange", d), window.addEventListener("focus", a), window.addEventListener("blur", c), () => {
|
|
28
|
+
document.removeEventListener("visibilitychange", d), window.removeEventListener("focus", a), window.removeEventListener("blur", c);
|
|
29
|
+
};
|
|
30
|
+
}, []), /* @__PURE__ */ s(
|
|
31
|
+
"video",
|
|
32
|
+
{
|
|
33
|
+
"aria-label": i,
|
|
34
|
+
autoPlay: !0,
|
|
35
|
+
className: u(
|
|
36
|
+
"mt-2 transform-gpu rounded-2xl object-contain object-top",
|
|
37
|
+
o
|
|
38
|
+
),
|
|
39
|
+
controls: !1,
|
|
40
|
+
disablePictureInPicture: !0,
|
|
41
|
+
disableRemotePlayback: !0,
|
|
42
|
+
draggable: !1,
|
|
43
|
+
loop: !0,
|
|
44
|
+
muted: !0,
|
|
45
|
+
playsInline: !0,
|
|
46
|
+
poster: r,
|
|
47
|
+
ref: t,
|
|
48
|
+
"webkit-playsinline": "true",
|
|
49
|
+
"x-webkit-airplay": "deny",
|
|
50
|
+
children: n
|
|
51
|
+
},
|
|
52
|
+
i
|
|
53
|
+
);
|
|
54
|
+
}, l = {
|
|
55
|
+
"images/.gitkeep": "images/.gitkeep.e3b0c442",
|
|
56
|
+
"images/install-sad-android.png": "images/install-sad-android.8b24a6e1.png",
|
|
57
|
+
"scripts/1.0.0/install-package.cjs": "scripts/1.0.0/install-package.7ac30417.cjs",
|
|
58
|
+
"scripts/1.0.0/install-package.js": "scripts/1.0.0/install-package.65685adc.js",
|
|
59
|
+
"video/.gitkeep": "video/.gitkeep.e3b0c442",
|
|
60
|
+
"video/change-region-poster.png": "video/change-region-poster.bc6bda65.png",
|
|
61
|
+
"video/change-region.h264.mp4": "video/change-region.h264.c47b9282.mp4",
|
|
62
|
+
"video/get-approved-poster.jpg": "video/get-approved-poster.4e7177ac.jpg",
|
|
63
|
+
"video/get-approved.mp4": "video/get-approved.5b7b5f4a.mp4",
|
|
64
|
+
"video/open-onside-poster.jpg": "video/open-onside-poster.6b71cae6.jpg",
|
|
65
|
+
"video/open-onside.av1.mp4": "video/open-onside.av1.32f1aa51.mp4",
|
|
66
|
+
"video/open-onside.h264.mp4": "video/open-onside.h264.6df2feb6.mp4",
|
|
67
|
+
"video/update-ios-poster.png": "video/update-ios-poster.e59e58f8.png",
|
|
68
|
+
"video/update-ios.h264.mp4": "video/update-ios.h264.8054177e.mp4"
|
|
69
|
+
}, f = "https://cdn.onside.io/assets/onside-install-widget/";
|
|
70
|
+
function h(e) {
|
|
71
|
+
return e.replace(/^\//, "");
|
|
72
|
+
}
|
|
73
|
+
function b(e) {
|
|
74
|
+
const i = h(e), n = i.split("/").pop() ?? i, o = [
|
|
75
|
+
i,
|
|
76
|
+
`/${i}`,
|
|
77
|
+
n,
|
|
78
|
+
`/${n}`
|
|
79
|
+
];
|
|
80
|
+
for (const r of o)
|
|
81
|
+
if (l[r])
|
|
82
|
+
return l[r];
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
function E(e) {
|
|
86
|
+
if (!e || /^https?:\/\//i.test(e) || e.endsWith(".svg")) return e;
|
|
87
|
+
const i = b(e);
|
|
88
|
+
if (!i) return e;
|
|
89
|
+
try {
|
|
90
|
+
return new URL(i, f).toString();
|
|
91
|
+
} catch {
|
|
92
|
+
return e;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
j as B,
|
|
97
|
+
x as V,
|
|
98
|
+
E as c
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),u=require("./install-package-Dkv3eM_d.cjs"),l=require("react"),g="data:image/svg+xml,%3csvg%20width='10'%20height='16'%20viewBox='0%200%2010%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.9375%2012.25L6.35539%209.83211C6.74592%209.44158%206.74592%208.80842%206.35539%208.41789L3.9375%206'%20stroke='%231E1C1F'%20stroke-opacity='0.6'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",v=({breadcrumbs:e,className:i})=>r.jsx("ul",{className:i,children:e.map((n,s)=>r.jsxs("li",{className:"inline-flex",children:[r.jsx("p",{className:"rounded-3xl bg-lightGray px-2 py-0.5 text-sm",children:n}),s<e.length-1&&r.jsx("img",{alt:"Arrow icon","aria-hidden":"true",className:"ml-1",height:16,src:g,width:10})]},n))}),m=e=>{const{ariaLabel:i,children:n,className:s,poster:o}=e,t=l.useRef(null);return l.useEffect(()=>{const a=()=>{t.current&&t.current.paused&&(t.current.muted=!0,t.current.play())},d=()=>{t.current&&(document.visibilityState==="hidden"?t.current.pause():document.visibilityState==="visible"&&a())},c=()=>{t.current&&t.current.pause()};return document.addEventListener("visibilitychange",d),window.addEventListener("focus",a),window.addEventListener("blur",c),()=>{document.removeEventListener("visibilitychange",d),window.removeEventListener("focus",a),window.removeEventListener("blur",c)}},[]),r.jsx("video",{"aria-label":i,autoPlay:!0,className:u.clsx("mt-2 transform-gpu rounded-2xl object-contain object-top",s),controls:!1,disablePictureInPicture:!0,disableRemotePlayback:!0,draggable:!1,loop:!0,muted:!0,playsInline:!0,poster:o,ref:t,"webkit-playsinline":"true","x-webkit-airplay":"deny",children:n},i)},p={"images/.gitkeep":"images/.gitkeep.e3b0c442","images/install-sad-android.png":"images/install-sad-android.8b24a6e1.png","scripts/1.0.0/install-package.cjs":"scripts/1.0.0/install-package.7ac30417.cjs","scripts/1.0.0/install-package.js":"scripts/1.0.0/install-package.65685adc.js","video/.gitkeep":"video/.gitkeep.e3b0c442","video/change-region-poster.png":"video/change-region-poster.bc6bda65.png","video/change-region.h264.mp4":"video/change-region.h264.c47b9282.mp4","video/get-approved-poster.jpg":"video/get-approved-poster.4e7177ac.jpg","video/get-approved.mp4":"video/get-approved.5b7b5f4a.mp4","video/open-onside-poster.jpg":"video/open-onside-poster.6b71cae6.jpg","video/open-onside.av1.mp4":"video/open-onside.av1.32f1aa51.mp4","video/open-onside.h264.mp4":"video/open-onside.h264.6df2feb6.mp4","video/update-ios-poster.png":"video/update-ios-poster.e59e58f8.png","video/update-ios.h264.mp4":"video/update-ios.h264.8054177e.mp4"},f="https://cdn.onside.io/assets/onside-install-widget/";function h(e){return e.replace(/^\//,"")}function b(e){const i=h(e),n=i.split("/").pop()??i,s=[i,`/${i}`,n,`/${n}`];for(const o of s)if(p[o])return p[o];return null}function w(e){if(!e||/^https?:\/\//i.test(e)||e.endsWith(".svg"))return e;const i=b(e);if(!i)return e;try{return new URL(i,f).toString()}catch{return e}}exports.Breadcrumbs=v;exports.VideoAutoplay=m;exports.cdn=w;
|
package/dist-lib/hooks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./useInstallUrl-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./useInstallUrl-iPCPqYWB.cjs");exports.useInstallUrl=l.useInstallUrl;exports.useInstallUrlStore=l.useInstallUrlStore;
|
package/dist-lib/hooks.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),C=require("./Dialog-BRBYK08a.cjs"),M=require("./FaqModal-BspE3dHf.cjs"),o=require("./install-package-Dkv3eM_d.cjs"),p=require("./utils.cjs"),r=require("./cdn-BonUyxCA.cjs"),q=()=>{const[t,s]=l.useState(!1),n=l.useCallback(()=>{s(!1)},[]),a=l.useCallback(()=>{s(!0)},[]);return{isOpenFaq:t,onCloseFaqModal:n,onOpenFaqModal:a,setIsOpenFaq:s}},g=({openFaq:t})=>{const{modal:s}=o.useMessages();return e.jsxs("div",{className:"flex flex-row items-center justify-center gap-2",children:[e.jsx("p",{className:"font-sans text-lg font-medium",children:s.faq.needHelp}),e.jsx(o.Button,{className:"px-0! font-sans text-lg font-normal",color:"blue",onClick:t,variant:"transparent",children:s.faq.faqLink})]})},_=({onSubmit:t,openFaq:s,step:n,openAppHref:a="#"})=>{const{modal:d}=o.useMessages();return n===1?e.jsxs(e.Fragment,{children:[e.jsx(o.InstallAppButton,{className:"w-full",handleCustomStep:t,location:"get_approved"}),e.jsx(g,{openFaq:s})]}):n===2?e.jsxs(e.Fragment,{children:[e.jsx(o.Button,{className:"w-full text-center",color:"blue",href:a,onClick:t,size:"lg",variant:"primary",children:d.getApproved.openAppButton}),e.jsx(g,{openFaq:s})]}):e.jsx(e.Fragment,{})},b=t=>{const{className:s,spinnerClasses:n,title:a="Loading..."}=t;return e.jsxs("div",{className:o.clsx("flex flex-col items-center justify-center gap-12",s),children:[e.jsx("h2",{className:"text-center !leading-10 text-lg font-medium",children:a}),e.jsx(o.SvgSpinner,{className:o.clsx("size-16 stroke-blue",n)})]})},S=r.cdn("/video/get-approved-poster.jpg"),k=r.cdn("/video/get-approved.mp4"),y=r.cdn("/video/open-onside-poster.jpg"),F=r.cdn("/video/open-onside.av1.mp4"),I=r.cdn("/video/open-onside.h264.mp4"),D=({step:t})=>{const{modal:s}=o.useMessages();return t===1?e.jsxs("div",{className:"mt-4 flex flex-col items-center",children:[e.jsx("h2",{className:"text-center font-sans text-lg font-normal",id:"get-approved",children:s.getApproved.title}),e.jsx("ol",{className:"mt-5 flex list-decimal flex-col gap-2 ps-6 font-sans text-base font-normal",children:s.getApproved.steps.map(n=>e.jsx("li",{children:n},n))}),e.jsx(r.VideoAutoplay,{ariaLabel:"Instruction demonstrating how to get approved for Onside",className:"w-[calc(100%-8px)] self-start",poster:S,children:e.jsx("source",{src:k,type:"video/mp4"})})]}):t===2?e.jsx(b,{className:"flex items-center justify-center",title:s.getApproved.installing}):t===3?e.jsxs("div",{className:"mt-4 flex flex-col items-center",children:[e.jsx("h2",{className:"text-center font-sans text-lg font-normal",id:"open-onside-app",children:s.getApproved.openApp}),e.jsx("div",{className:"mt-5 font-sans text-base font-normal",children:e.jsx("p",{children:s.getApproved.openAppDescription})}),e.jsxs(r.VideoAutoplay,{ariaLabel:"Instruction demonstrating how to open the Onside app",className:"mt-10! w-[calc(100%-8px)] self-start",poster:y,children:[e.jsx("source",{src:F,type:"video/mp4; codecs=av01.0.05M.08"}),e.jsx("source",{src:I,type:"video/mp4"})]})]}):null},P=t=>{const{open:s,onClose:n,onStep3Complete:a,openAppHref:d}=t,[i,u]=l.useState(1),{isOpenFaq:v,onCloseFaqModal:j,onOpenFaqModal:h}=q(),{installState:N}=p.resolveInstallConditions(p.getDeviceInfo()),m=N==="install_available",x=l.useMemo(()=>({2:{delay:o.AVERAGE_INSTALL_TIME,action:()=>u(3)},3:{delay:o.AVERAGE_CHECK_TIME,action:()=>a?.(),skip:!m||!a}}),[a,m]);l.useEffect(()=>{const c=x[i];if(!c||c?.skip)return;const O=setTimeout(c.action,c.delay);return()=>clearTimeout(O)},[i,x]);const f=l.useCallback(()=>{p.trackModalEvent("get_approved","click","close"),n(),setTimeout(()=>{u(1)},500)},[n]),E=l.useCallback(()=>{u(2),p.trackModalEvent("get_approved","click","install")},[]),A=l.useCallback(c=>{c||f()},[f]);return e.jsxs(e.Fragment,{children:[e.jsx(C.Dialog,{"aria-labelledby":"get-approved",className:"outline-hidden",footerContent:e.jsx(_,{openAppHref:d,onSubmit:E,openFaq:h,step:i}),isDisplayingMargins:!0,open:s,onOpenChange:A,children:e.jsx(D,{step:i})}),e.jsx(M.FaqModal,{isOpen:v,onClose:j})]})};exports.GetApprovedModal=P;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as A, useCallback as r, useMemo as F, useEffect as b } from "react";
|
|
3
|
+
import { D as q } from "./Dialog-B1D2BvMl.js";
|
|
4
|
+
import { F as k } from "./FaqModal-J1y4DGzd.js";
|
|
5
|
+
import { u as f, B as O, I as T, c as h, S as V, A as P, b as j } from "./install-package-CZGZODly.js";
|
|
6
|
+
import { resolveInstallConditions as w, getDeviceInfo as L, trackModalEvent as x } from "./utils.js";
|
|
7
|
+
import { V as N, c as i } from "./cdn-BmfyFccQ.js";
|
|
8
|
+
const R = () => {
|
|
9
|
+
const [n, t] = A(!1), o = r(() => {
|
|
10
|
+
t(!1);
|
|
11
|
+
}, []), s = r(() => {
|
|
12
|
+
t(!0);
|
|
13
|
+
}, []);
|
|
14
|
+
return {
|
|
15
|
+
isOpenFaq: n,
|
|
16
|
+
onCloseFaqModal: o,
|
|
17
|
+
onOpenFaqModal: s,
|
|
18
|
+
setIsOpenFaq: t
|
|
19
|
+
};
|
|
20
|
+
}, E = ({ openFaq: n }) => {
|
|
21
|
+
const { modal: t } = f();
|
|
22
|
+
return /* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center gap-2", children: [
|
|
23
|
+
/* @__PURE__ */ e("p", { className: "font-sans text-lg font-medium", children: t.faq.needHelp }),
|
|
24
|
+
/* @__PURE__ */ e(
|
|
25
|
+
O,
|
|
26
|
+
{
|
|
27
|
+
className: "px-0! font-sans text-lg font-normal",
|
|
28
|
+
color: "blue",
|
|
29
|
+
onClick: n,
|
|
30
|
+
variant: "transparent",
|
|
31
|
+
children: t.faq.faqLink
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] });
|
|
35
|
+
}, B = ({
|
|
36
|
+
onSubmit: n,
|
|
37
|
+
openFaq: t,
|
|
38
|
+
step: o,
|
|
39
|
+
openAppHref: s = "#"
|
|
40
|
+
}) => {
|
|
41
|
+
const { modal: d } = f();
|
|
42
|
+
return o === 1 ? /* @__PURE__ */ a(p, { children: [
|
|
43
|
+
/* @__PURE__ */ e(
|
|
44
|
+
T,
|
|
45
|
+
{
|
|
46
|
+
className: "w-full",
|
|
47
|
+
handleCustomStep: n,
|
|
48
|
+
location: "get_approved"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ e(E, { openFaq: t })
|
|
52
|
+
] }) : o === 2 ? /* @__PURE__ */ a(p, { children: [
|
|
53
|
+
/* @__PURE__ */ e(
|
|
54
|
+
O,
|
|
55
|
+
{
|
|
56
|
+
className: "w-full text-center",
|
|
57
|
+
color: "blue",
|
|
58
|
+
href: s,
|
|
59
|
+
onClick: n,
|
|
60
|
+
size: "lg",
|
|
61
|
+
variant: "primary",
|
|
62
|
+
children: d.getApproved.openAppButton
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ e(E, { openFaq: t })
|
|
66
|
+
] }) : /* @__PURE__ */ e(p, {});
|
|
67
|
+
}, G = (n) => {
|
|
68
|
+
const { className: t, spinnerClasses: o, title: s = "Loading..." } = n;
|
|
69
|
+
return /* @__PURE__ */ a(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: h(
|
|
73
|
+
"flex flex-col items-center justify-center gap-12",
|
|
74
|
+
t
|
|
75
|
+
),
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ e("h2", { className: "text-center !leading-10 text-lg font-medium", children: s }),
|
|
78
|
+
/* @__PURE__ */ e(V, { className: h("size-16 stroke-blue", o) })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}, H = i("/video/get-approved-poster.jpg"), z = i("/video/get-approved.mp4"), K = i("/video/open-onside-poster.jpg"), Q = i("/video/open-onside.av1.mp4"), J = i("/video/open-onside.h264.mp4"), U = ({ step: n }) => {
|
|
83
|
+
const { modal: t } = f();
|
|
84
|
+
return n === 1 ? /* @__PURE__ */ a("div", { className: "mt-4 flex flex-col items-center", children: [
|
|
85
|
+
/* @__PURE__ */ e(
|
|
86
|
+
"h2",
|
|
87
|
+
{
|
|
88
|
+
className: "text-center font-sans text-lg font-normal",
|
|
89
|
+
id: "get-approved",
|
|
90
|
+
children: t.getApproved.title
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ e("ol", { className: "mt-5 flex list-decimal flex-col gap-2 ps-6 font-sans text-base font-normal", children: t.getApproved.steps.map((o) => /* @__PURE__ */ e("li", { children: o }, o)) }),
|
|
94
|
+
/* @__PURE__ */ e(
|
|
95
|
+
N,
|
|
96
|
+
{
|
|
97
|
+
ariaLabel: "Instruction demonstrating how to get approved for Onside",
|
|
98
|
+
className: "w-[calc(100%-8px)] self-start",
|
|
99
|
+
poster: H,
|
|
100
|
+
children: /* @__PURE__ */ e("source", { src: z, type: "video/mp4" })
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] }) : n === 2 ? /* @__PURE__ */ e(
|
|
104
|
+
G,
|
|
105
|
+
{
|
|
106
|
+
className: "flex items-center justify-center",
|
|
107
|
+
title: t.getApproved.installing
|
|
108
|
+
}
|
|
109
|
+
) : n === 3 ? /* @__PURE__ */ a("div", { className: "mt-4 flex flex-col items-center", children: [
|
|
110
|
+
/* @__PURE__ */ e(
|
|
111
|
+
"h2",
|
|
112
|
+
{
|
|
113
|
+
className: "text-center font-sans text-lg font-normal",
|
|
114
|
+
id: "open-onside-app",
|
|
115
|
+
children: t.getApproved.openApp
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ e("div", { className: "mt-5 font-sans text-base font-normal", children: /* @__PURE__ */ e("p", { children: t.getApproved.openAppDescription }) }),
|
|
119
|
+
/* @__PURE__ */ a(
|
|
120
|
+
N,
|
|
121
|
+
{
|
|
122
|
+
ariaLabel: "Instruction demonstrating how to open the Onside app",
|
|
123
|
+
className: "mt-10! w-[calc(100%-8px)] self-start",
|
|
124
|
+
poster: K,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ e(
|
|
127
|
+
"source",
|
|
128
|
+
{
|
|
129
|
+
src: Q,
|
|
130
|
+
type: "video/mp4; codecs=av01.0.05M.08"
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ e("source", { src: J, type: "video/mp4" })
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }) : null;
|
|
138
|
+
}, ne = (n) => {
|
|
139
|
+
const { open: t, onClose: o, onStep3Complete: s, openAppHref: d } = n, [c, m] = A(1), { isOpenFaq: _, onCloseFaqModal: C, onOpenFaqModal: I } = R(), { installState: M } = w(L()), u = M === "install_available", g = F(
|
|
140
|
+
() => ({
|
|
141
|
+
2: { delay: j, action: () => m(3) },
|
|
142
|
+
3: {
|
|
143
|
+
delay: P,
|
|
144
|
+
action: () => s?.(),
|
|
145
|
+
skip: !u || !s
|
|
146
|
+
}
|
|
147
|
+
}),
|
|
148
|
+
[s, u]
|
|
149
|
+
);
|
|
150
|
+
b(() => {
|
|
151
|
+
const l = g[c];
|
|
152
|
+
if (!l || l?.skip) return;
|
|
153
|
+
const D = setTimeout(l.action, l.delay);
|
|
154
|
+
return () => clearTimeout(D);
|
|
155
|
+
}, [c, g]);
|
|
156
|
+
const v = r(() => {
|
|
157
|
+
x("get_approved", "click", "close"), o(), setTimeout(() => {
|
|
158
|
+
m(1);
|
|
159
|
+
}, 500);
|
|
160
|
+
}, [o]), S = r(() => {
|
|
161
|
+
m(2), x("get_approved", "click", "install");
|
|
162
|
+
}, []), y = r(
|
|
163
|
+
(l) => {
|
|
164
|
+
l || v();
|
|
165
|
+
},
|
|
166
|
+
[v]
|
|
167
|
+
);
|
|
168
|
+
return /* @__PURE__ */ a(p, { children: [
|
|
169
|
+
/* @__PURE__ */ e(
|
|
170
|
+
q,
|
|
171
|
+
{
|
|
172
|
+
"aria-labelledby": "get-approved",
|
|
173
|
+
className: "outline-hidden",
|
|
174
|
+
footerContent: /* @__PURE__ */ e(
|
|
175
|
+
B,
|
|
176
|
+
{
|
|
177
|
+
openAppHref: d,
|
|
178
|
+
onSubmit: S,
|
|
179
|
+
openFaq: I,
|
|
180
|
+
step: c
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
isDisplayingMargins: !0,
|
|
184
|
+
open: t,
|
|
185
|
+
onOpenChange: y,
|
|
186
|
+
children: /* @__PURE__ */ e(U, { step: c })
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
/* @__PURE__ */ e(k, { isOpen: _, onClose: C })
|
|
190
|
+
] });
|
|
191
|
+
};
|
|
192
|
+
export {
|
|
193
|
+
ne as GetApprovedModal
|
|
194
|
+
};
|