PageSourceSearch

https://jforh.com/assets/CookieConsentBanner-BFo28XnS.js

js jforh.com collected 2026-10-08 12:26:36 UTC 8,807 bytes, 1 lines download raw bytes

1import{r as n,a as j,j as e,L as y}from"./vendor-react-CcKkUfnx.js";import{A as N,m as k,aL as S,X as u,aB as C,n as _}from"./vendor-ui-Rp8Pe-x-.js";function P(){const[i,r]=n.useState(!1),[f,o]=n.useState(!1),[l,d]=n.useState(0);n.useEffect(()=>{const t=()=>{const g=document.querySelector("[data-mobile-shell] nav");if(!g){d(0);return}const w=g.getBoundingClientRect().height,h=document.querySelector('[data-mobile-shell] [aria-label*="Quick add"]'),v=h?Math.max(0,window.innerHeight-h.getBoundingClientRect().top):0;d(Math.round(Math.max(w,v)))};t();const a=typeof ResizeObserver<"u"?new ResizeObserver(t):null,x=document.querySelector("[data-mobile-shell]");return a&&x&&a.observe(x),window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{a?.disconnect(),window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[i]);const[s,c]=n.useState({necessary:!0,analytics:!1,marketing:!1});n.useEffect(()=>{if(localStorage.getItem("cookieConsent"))return;const t=setTimeout(()=>r(!0),1e3);return()=>clearTimeout(t)},[]),n.useEffect(()=>{if(!i)return;const t=()=>{(window.scrollY+window.innerHeight)/document.documentElement.scrollHeight>=.5&&m()};return window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)},[i]),n.useEffect(()=>{const t=localStorage.getItem("cookieConsent");if(t)try{const a=JSON.parse(t);window.gtag&&window.gtag("consent","update",{ad_storage:a.marketing?"granted":"denied",ad_user_data:a.marketing?"granted":"denied",ad_personalization:a.marketing?"granted":"denied",analytics_storage:a.analytics?"granted":"denied"})}catch(a){console.error("Error parsing saved consent:",a)}},[]);const p=()=>{const t={necessary:!0,analytics:!0,marketing:!0,timestamp:new Date().toISOString()};localStorage.setItem("cookieConsent",JSON.stringify(t)),r(!1),window.gtag&&window.gtag("consent","update",{ad_storage:"granted",ad_user_data:"granted",ad_personalization:"granted",analytics_storage:"granted"})},m=()=>{const t={necessary:!0,analytics:!1,marketing:!1,timestamp:new Date().toISOString()};localStorage.setItem("cookieConsent",JSON.stringify(t)),r(!1),window.gtag&&window.gtag("consent","update",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied"})},b=()=>{const t={...s,timestamp:new Date().toISOString()};localStorage.setItem("cookieConsent",JSON.stringify(t)),r(!1),o(!1),window.gtag&&window.gtag("consent","update",{ad_storage:s.marketing?"granted":"denied",ad_user_data:s.marketing?"granted":"denied",ad_personalization:s.marketing?"granted":"denied",analytics_storage:s.analytics?"granted":"denied"})};return i?j.createPortal(e.jsx(N,{children:e.jsx(k.div,{initial:{y:100,opacity:0},animate:{y:0,opacity:1},exit:{y:100,opacity:0},className:"pointer-events-none fixed bottom-0 left-0 right-0 z-[9999] p-4 pb-6 sm:p-6",style:{paddingBottom:l?`calc(${l}px + 0.75rem)`:"max(1.5rem, env(safe-area-inset-bottom, 0px))"},children:e.jsx("div",{className:"pointer-events-auto container mx-auto max-w-6xl",children:e.jsx("div",{className:"bg-white/95 backdrop-blur-xl rounded-xl sm:rounded-3xl shadow-lg sm:shadow-2xl border border-slate-200 overflow-hidden max-h-[90vh] overflow-y-auto",children:f?e.jsxs("div",{className:"p-6 sm:p-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"text-xl font-black text-slate-900 uppercase tracking-tight",children:"Cookie Preferences"}),e.jsx("button",{onClick:()=>o(!1),className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-lg transition-colors",children:e.jsx(u,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsx("div",{className:"p-4 bg-slate-50 rounded-2xl border border-slate-200",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("h4",{className:"font-bold text-slate-900 text-sm uppercase tracking-wide",children:"Necessary Cookies"}),e.jsx("span",{className:"px-2 py-0.5 bg-slate-200 text-slate-600 text-xs font-bold rounded-full uppercase",children:"Always On"})]}),e.jsx("p",{className:"text-xs text-slate-600 leading-relaxed",children:"Essential for the website to function. These cookies enable core functionality such as security, authentication, and accessibility. Cannot be disabled."})]}),e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:"w-12 h-6 bg-orange-500 rounded-full relative cursor-not-allowed",children:e.jsx("div",{className:"absolute right-1 top-1 w-4 h-4 bg-white rounded-full shadow-sm"})})})]})}),e.jsx("div",{className:"p-4 bg-slate-50 rounded-2xl border border-slate-200",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-bold text-slate-900 text-sm uppercase tracking-wide mb-2",children:"Analytics Co
1okies"}),e.jsx("p",{className:"text-xs text-slate-600 leading-relaxed",children:"Help us understand how visitors interact with our website by collecting and reporting information anonymously. Used to improve user experience."})]}),e.jsx("div",{className:"flex-shrink-0",children:e.jsx("button",{onClick:()=>c({...s,analytics:!s.analytics}),className:`w-12 h-6 rounded-full relative transition-colors ${s.analytics?"bg-orange-500":"bg-slate-300"}`,children:e.jsx("div",{className:`absolute top-1 w-4 h-4 bg-white rounded-full shadow-sm transition-transform ${s.analytics?"right-1":"left-1"}`})})})]})}),e.jsx("div",{className:"p-4 bg-slate-50 rounded-2xl border border-slate-200",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-bold text-slate-900 text-sm uppercase tracking-wide mb-2",children:"Marketing Cookies"}),e.jsx("p",{className:"text-xs text-slate-600 leading-relaxed",children:"Used to track visitors across websites to display ads that are relevant and engaging. May be set through our site by advertising partners."})]}),e.jsx("div",{className:"flex-shrink-0",children:e.jsx("button",{onClick:()=>c({...s,marketing:!s.marketing}),className:`w-12 h-6 rounded-full relative transition-colors ${s.marketing?"bg-orange-500":"bg-slate-300"}`,children:e.jsx("div",{className:`absolute top-1 w-4 h-4 bg-white rounded-full shadow-sm transition-transform ${s.marketing?"right-1":"left-1"}`})})})]})})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[e.jsxs("button",{onClick:b,className:"flex-1 px-6 py-3 bg-gradient-to-r from-orange-500 to-amber-500 text-white rounded-xl font-bold hover:from-orange-600 hover:to-amber-600 transition-all shadow-lg shadow-orange-500/30 flex items-center justify-center gap-2",children:[e.jsx(_,{className:"w-5 h-5"}),"Save Preferences"]}),e.jsx("button",{onClick:()=>o(!1),className:"sm:flex-none px-6 py-3 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-xl font-bold transition-all",children:"Cancel"})]})]}):e.jsxs("div",{className:"p-3 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(S,{className:"w-4 h-4 sm:w-5 sm:h-5 text-orange-500 flex-shrink-0"}),e.jsxs("p",{className:"text-xs sm:text-sm text-slate-600 flex-1 min-w-0",children:[e.jsx("span",{className:"hidden sm:inline",children:"We use cookies to enhance your experience. "}),e.jsx("span",{className:"sm:hidden",children:"We use cookies. "}),e.jsx(y,{to:"/legal/privacy-policy",className:"text-orange-600 hover:underline font-medium",children:"Privacy Policy"})]}),e.jsx("button",{onClick:()=>r(!1),className:"flex-shrink-0 inline-flex min-h-11 min-w-11 items-center justify-center text-slate-400 hover:text-slate-600 rounded transition-colors sm:hidden","aria-label":"Close",children:e.jsx(u,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex gap-2 mt-2 sm:mt-3",children:[e.jsx("button",{onClick:p,className:"min-h-11 px-4 sm:px-5 py-1.5 sm:py-2.5 bg-gradient-to-r from-orange-500 to-amber-500 text-white rounded-lg sm:rounded-xl text-xs sm:text-sm font-bold hover:from-orange-600 hover:to-amber-600 transition-all shadow-sm",children:"Accept"}),e.jsx("button",{onClick:m,className:"min-h-11 px-4 sm:px-5 py-1.5 sm:py-2.5 bg-slate-100 hover:bg-slate-200 text-slate-600 rounded-lg sm:rounded-xl text-xs sm:text-sm font-bold transition-all",children:"Reject"}),e.jsxs("button",{onClick:()=>o(!0),className:"hidden sm:flex px-5 py-2.5 border border-slate-200 hover:border-orange-400 text-slate-600 hover:text-orange-600 rounded-xl text-sm font-bold transition-all items-center gap-2",children:[e.jsx(C,{className:"w-4 h-4"}),"Customize"]})]})]})})})})}),document.body):null}export{P as CookieConsentBanner};

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.