PageSourceSearch

https://vedality.com/assets/notifications-permission-hb34hcJg.js

js vedality.com collected 2026-10-09 22:04:47 UTC 3,284 bytes, 1 lines download raw bytes

1import{a as h,f as g,r as d,j as t,L as b,t as n}from"./index-OIRguTWT.js";import{A as P}from"./AmbientBackground-0CDbpLVu.js";import{g as y,a as j,r as w}from"./push-YwLbgDSo.js";import{B as N}from"./bell-off-CgAJJnP9.js";import{B as v}from"./bell-Cu0CIP6Y.js";import{C as k}from"./check-DDcb-TEG.js";import{M as B}from"./moon-BMyGwnQi.js";function L(){const e=h(),f=g(),[a,i]=d.useState("default"),[m,c]=d.useState(!1);d.useEffect(()=>{i(y()),j().then(i)},[]);async function u(){if(!m){if(a==="granted"){f({to:"/home",replace:!0});return}c(!0);try{const{granted:o,state:l}=await w();i(l),o?(n.success(e("notifPerm.toastGranted")),setTimeout(()=>f({to:"/home",replace:!0}),600)):l==="denied"?n.error(e("notifPerm.toastDenied")):l==="unsupported"?n.message(e("notifPerm.toastUnsupported")):n.message(e("notifPerm.toastNotGranted"))}finally{c(!1)}}}const r=a==="granted",s=a==="denied",x=a==="unsupported",p=[{title:e("notifPerm.f1T"),body:e("notifPerm.f1B")},{title:e("notifPerm.f2T"),body:e("notifPerm.f2B")},{title:e("notifPerm.f3T"),body:e("notifPerm.f3B")}];return t.jsxs("div",{className:"relative mx-auto flex min-h-screen max-w-[480px] flex-col overflow-hidden bg-background px-6",children:[t.jsx(P,{}),t.jsxs("div",{className:"relative flex flex-1 flex-col justify-center text-center",children:[t.jsx("div",{className:`mx-auto flex h-24 w-24 items-center justify-center rounded-3xl text-white shadow-glow ${s?"bg-muted":"bg-gradient-hero animate-breathe"}`,children:s?t.jsx(N,{className:"h-9 w-9"}):t.jsx(v,{className:"h-9 w-9"})}),t.jsx("p",{className:"mt-10 text-[10px] font-medium uppercase tracking-[0.24em] text-primary/70",children:e("notifPerm.eyebrow")}),t.jsx("h1",{className:"mt-3 font-display text-[32px] font-medium leading-[1.05] tracking-tight text-foreground text-balance",children:e(r?"notifPerm.titleGranted":s?"notifPerm.titleDenied":"notifPerm.titleDefault")}),t.jsx("p",{className:"mx-auto mt-4 max-w-sm text-base text-muted-foreground text-pretty",children:e(r?"notifPerm.bodyGranted":s?"notifPerm.bodyDenied":"notifPerm.bodyDefault")}),r&&t.jsxs("div",{className:"mx-auto mt-5 inline-flex items-center gap-2 rounded-full bg-secondary px-3 py-1.5 text-xs font-medium text-primary",children:[t.jsx(k,{className:"h-3.5 w-3.5"})," ",e("notifPerm.enabled")]}),t.jsx("div",{className:"mt-8 space-y-2 text-left",children:p.map(o=>t.jsxs("div",{className:"flex gap-3 rounded-2xl bg-card/70 p-4 shadow-soft border border-border/60",children:[t.jsx(B,{className:"mt-0.5 h-4 w-4 text-primary"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-semibold text-foreground",children:o.title}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o.body})]})]},o.title))})]}),t.jsxs("div",{className:"relative pb-10 pt-6",children:[t.jsx("button",{onClick:u,disabled:m||s||x,className:"press flex w-full items-center justify-center rounded-full bg-gradient-hero py-4 text-base font-medium text-white shadow-glow disabled:opacity-60",children:e(m?"notifPerm.asking":r?"notifPerm.continueLabel":s?"notifPerm.blocked":x?"notifPerm.unsupported":"notifPerm.allow")}),t.jsx(b,{to:"/home",replace:!0,className:"mt-2 block w-full py-3 text-center text-sm text-muted-foreground",children:e(r?"notifPerm.skip":"notifPerm.later")})]})]})}export{L as component};

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.