1import{b as L,u as _,r as m,j as e,m as f,A as W,a7 as M,e as g}from"./index-CR8jIHGL.js";import{b as $}from"./rolePwaOrigins-BBSemJtU.js";import{S as F}from"./smartphone-c2wtxeoU.js";import{S as O}from"./shopping-bag-Bb3nI1F0.js";import{U as P}from"./users-DCvaygis.js";import{C as T}from"./chart-column-CVwDBBrG.js";import{S as U}from"./shield-KEBAwAUq.js";import{A as k}from"./arrow-left-C6UQi8Yb.js";import{R as B}from"./rotate-ccw-Dw05o2mg.js";import{D as G}from"./download-BS5NsxsA.js";import{C as h}from"./circle-check-FO8rVln-.js";import{E as J}from"./external-link-B3Et6MzL.js";import{C as Y}from"./copy-CBCwGpHF.js";import{S as H}from"./skip-forward-BA1e10Ba.js";import{C as V}from"./circle-3CRAPo1P.js";const v="mfs_pwa_installed_roles",y="mfs_pwa_wizard_progress",n=[{key:"agent",nameKey:"iarRoleAgentName",shortKey:"iarRoleAgentShort",whyKey:"iarRoleAgentWhy",Icon:F,gradient:"from-orange-500 to-amber-500"},{key:"merchant",nameKey:"iarRoleMerchantName",shortKey:"iarRoleMerchantShort",whyKey:"iarRoleMerchantWhy",Icon:O,gradient:"from-rose-500 to-pink-500"},{key:"distributor",nameKey:"iarRoleDistributorName",shortKey:"iarRoleDistributorShort",whyKey:"iarRoleDistributorWhy",Icon:P,gradient:"from-blue-600 to-cyan-500"},{key:"super-distributor",nameKey:"iarRoleSDName",shortKey:"iarRoleSDShort",whyKey:"iarRoleSDWhy",Icon:T,gradient:"from-violet-600 to-purple-500"},{key:"admin",nameKey:"iarRoleAdminName",shortKey:"iarRoleAdminShort",whyKey:"iarRoleAdminWhy",Icon:U,gradient:"from-emerald-600 to-teal-500"}],b=()=>{try{return JSON.parse(localStorage.getItem(v)||"{}")}catch{return{}}},Z=()=>{const o=Number(localStorage.getItem(y));return Number.isFinite(o)&&o>=0&&o<n.length?o:0},xe=()=>{const o=L(),{t}=_(),[a,d]=m.useState(Z),[x,j]=m.useState(b);m.useEffect(()=>{const r=()=>j(b()),i=window.setInterval(r,1500),l=()=>r();return window.addEventListener("focus",l),()=>{window.clearInterval(i),window.removeEventListener("focus",l)}},[]),m.useEffect(()=>{localStorage.setItem(y,String(a))},[a]);const s=n[a],S=!!x[(s==null?void 0:s.key)??""],u=m.useMemo(()=>$(s.key),[s.key]),I=n.every(r=>x[r.key]),N=n.filter(r=>x[r.key]).length,p=t(s.shortKey),C=t(s.nameKey),R=t(s.whyKey),K=m.useCallback(()=>{u.startsWith(window.location.origin)?o(`/install/${s.key}`):window.open(u,"_blank","noopener")},[u,o,s.key]),z=async()=>{try{await navigator.clipboard.writeText(u),g.success(t("iarLinkCopied").replace("{short}",p))}catch{g.error(t("iarCopyFail"))}},A=()=>{const r={...b(),[s.key]:!0};localStorage.setItem(v,JSON.stringify(r)),j(r),g.success(t("iarMarkedInstalled").replace("{short}",p)),a<n.length-1&&d(a+1)},D=()=>{a<n.length-1&&d(a+1)},E=()=>{localStorage.removeItem(y),d(0),g.info(t("iarRestarted"))},w=Math.round(N/n.length*100);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"px-4 sm:px-6 pt-10 pb-6 bg-gradient-to-br from-primary/10 via-background to-background",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("button",{onClick:()=>o("/install"),className:"inline-flex items-center gap-1.5 text-xs font-semibold text-muted-foreground hover:text-foreground",children:[e.jsx(k,{size:14})," ",t("iarAllInstallers")]}),e.jsxs("button",{onClick:E,className:"inline-flex items-center gap-1.5 text-xs font-semibold text-muted-foreground hover:text-foreground",children:[e.jsx(B,{size:12})," ",t("iarRestart")]})]}),e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-primary/10 border border-primary/20 text-xs font-semibold text-primary mb-3",children:[e.jsx(G,{size:12}),t("iarBadge")]}),e.jsx("h1",{className:"text-2xl sm:text-3xl font-extrabold text-foreground tracking-tight",children:t("iarHeading")}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground max-w-xl",children:t("iarSubheading").replace("{count}",String(n.length))}),e.jsxs("div",{className:"mt-5",children:[e.jsxs("div",{className:"flex items-center justify-between text-[11px] font-semibold text-muted-foreground mb-1.5",children:[e.jsx("span",{children:t("iarInstalledCount").replace("{done}",String(N)).replace("{total}",String(n.length))}),e.jsxs("span",{className:"tabular-nums",children:[w,"%"]})]}),e.jsx("div",{className:"h-2 rounded-full bg-muted overflow-hidden",children:e.jsx(f.div,{className:"h-full bg-gradient-to-r from-primary to-emerald-500",initial:{width:0},animate:{width:`${w}%`},transition:{type:"spring",stiffness:120,damping:20}})})]})]})}),e.jsxs("main",{className:"px-4 sm:px-6 pb-16 max-w-3xl mx-auto",children:[e.jsx("ol",{className:"flex items-center justify-between gap-1 mt-6 mb-6 overflow-x-auto",children:n.map((r,i)=>{const l=!!x[r.key],c=i===a;return e.jsx("li",{className:"flex-1 min-w-[60px]",children:e.jsxs("button",{type:"button",onClick:()=>d(i),className:`w-full flex flex-col items-center gap-1.5 px-1 py-2 rounded-xl transition ${c?"bg-primary/10":"hover:bg-accent"}`,children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-[11px] font-bold border-2 transition ${l?"bg-emerald-500 border-emerald-500 text-white":c?"bg-primary border-primary text-primary-foreground":"bg-background border-border text-muted-foreground"}`,children:l?e.jsx(h,{size:16}):i+1}),e.jsx("span",{className:`text-[10px] font-semibold truncate max-w-full ${c?"text-foreground":"text-muted-foreground"}`,children:t(r.shortKey)})]})},r.key)})}),e.jsx(W,{mode:"wait",children:e.jsxs(f.section,{initial:{opacity:0,y:12}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.22},className:"relative overflow-hidden rounded-3xl border border-border bg-card p-6 shadow-lg",children:[e.jsx("div",{className:`absolute inset-x-0 top-0 h-1 bg-gradient-to-r ${s.gradient}`,"aria-hidden":!0}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:`shrink-0 w-14 h-14 rounded-2xl bg-gradient-to-br ${s.gradient} flex items-center justify-center shadow-md`,children:e.jsx(s.Icon,{size:26,className:"text-white"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-[11px] font-bold text-muted-foreground",children:t("iarStepOf").replace("{n}",String(a+1)).replace("{total}",String(n.length))}),S&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-bold text-emerald-600 bg-emerald-500/10 px-2 py-0.5 rounded-full",children:[e.jsx(h,{size:12})," ",t("iarInstalled")]})]}),e.jsx("h2",{className:"text-xl font-extrabold text-foreground mt-0.5",children:C}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:R})]})]}),e.jsxs("div",{className:"mt-5 rounded-2xl bg-muted/50 border border-border p-3",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground mb-1",children:t("iarInstallerLink")}),e.jsx("p",{className:"text-xs font-mono text-foreground break-all",children:u})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-2",children:[e.jsxs("button",{onClick:K,className:`h-11 rounded-xl bg-gradient-to-r ${s.gradient} text-white text-sm font-semibold shadow-sm flex items-center justify-center gap-2 hover:opacity-95 active:scale-[0.98] transition`,children:[e.jsx(J,{size:15}),t("iarOpenInstaller").replace("{short}",p)]}),e.jsxs("button",{onClick:z,className:"h-11 rounded-xl border border-border bg-background hover:bg-accent text-sm font-semibold text-foreground flex items-center justify-center gap-2 transition",children:[e.jsx(Y,{size:14})," ",t("iarCopyLink")]})]}),e.jsxs("div",{className:"mt-4 rounded-2xl bg-background border border-border p-4",children:[e.jsx("p",{className:"text-xs font-bold text-foreground mb-2",children:t("iarWhatToDo")}),e.jsxs("ol",{className:"space-y-1.5 text-xs text-muted-foreground list-decimal list-inside",children:[e.jsx("li",{children:t("iarStep1").replace("{short}",p)}),e.jsx("li",{children:t("iarStep2")}),e.jsx("li",{children:t("iarStep3")})]})]}),e.jsxs("div",{className:"mt-5 flex items-center justify-between gap-2 flex-wrap",children:[e.jsxs("button",{onClick:()=>d(Math.max(0,a-1)),disabled:a===0,className:"inline-flex items-center gap-1.5 h-10 px-3 rounded-xl text-sm font-semibold text-muted-foreground hover:text-foreground disabled:opacity-40",children:[e.jsx(k,{size:14})," ",t("iarBack")]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a<n.length-1&&e.jsxs("button",{onClick:D,className:"inline-flex items-center gap-1.5 h-10 px-3 rounded-xl text-sm font-semibold text-muted-foreground hover:text-foreground",children:[e.jsx(H,{size:14})," ",t("iarSkip")]}),e.jsx("button",{onClick:A,className:"inline-flex items-center gap-1.5 h-10 px-4 rounded-xl bg-primary text-primary-foreground text-sm font-semibold shadow-sm hover:opacity-95 active:scale-[0.98]",children:a===n.length-1?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:15})," ",t("iarMarkFinish")]}):e.jsxs(e.Fragment,{children:[t("iarMarkContinue")," ",e.jsx(M,{size:14})]})})]})]})]},s.key)}),e.jsxs("section",{className:"mt-8",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground mb-2",children:t("iarOverview")}),e.jsx("ul",{className:"rounded-2xl border border-border bg-card divide-y divide-border overflow-hidden",children:n.map((r,i)=>{const l=!!x[r.key],c=i===a;return e.jsxs("li",{className:`flex items-center gap-3 px-4 py-3 ${c?"bg-primary/5":""}`,children:[l?e.jsx(h,{size:18,className:"text-emerald-500 shrink-0"}):e.jsx(V,{size:18,className:"text-muted-foreground shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground truncate",children:[i+1,". ",t(r.nameKey)]}),e.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:t(r.whyKey)})]}),e.jsx("button",{type:"button",onClick:()=>d(i),className:"text-[11px] font-semibold text-primary hover:underline shrink-0",children:t(c?"iarCurrent":"iarGo")})]},r.key)})})]}),I&&e.jsxs(f.div,{initial:{opacity:0,y:8}
1,animate:{opacity:1,y:0},className:"mt-8 rounded-2xl border border-emerald-500/30 bg-emerald-500/10 p-5 text-center",children:[e.jsx(h,{size:32,className:"text-emerald-500 mx-auto mb-2"}),e.jsx("p",{className:"text-base font-bold text-foreground",children:t("iarAllDone")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t("iarAllDoneDesc")}),e.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2",children:[e.jsx("button",{onClick:()=>o("/install/status"),className:"h-10 px-4 rounded-xl border border-border bg-background text-sm font-semibold hover:bg-accent",children:t("iarViewStatus")}),e.jsx("button",{onClick:()=>o("/install"),className:"h-10 px-4 rounded-xl bg-primary text-primary-foreground text-sm font-semibold",children:t("iarDone")})]})]})]})]})};export{xe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.