PageSourceSearch

https://myciso.co/assets/Preferences-BMWRWSCx.js

js myciso.co collected 2026-10-04 16:19:34 UTC 10,710 bytes, 1 lines download raw bytes

1import{c as M,u as R,r as o,a as T,b as Y,d as A,Z as k,S as V,G as $,e as F,f as U,j as e,m as n,B as x,A as j,C as l,g as c,h as q,L as v,I as B,i as w,T as G,k as L,t as D,l as Q,z as r}from"./index-CuEeMuBD.js";import{S as N}from"./switch-CbvEFjSw.js";import{V as z}from"./video-DEg-0pnB.js";import{N as W}from"./newspaper-xR6qD3bz.js";import{S as Z}from"./settings-BHqyfZ3l.js";const K=M("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]),h={hidden:{opacity:0,y:24},visible:{opacity:1,y:0,transition:{duration:.5,ease:"easeOut"}}},H={visible:{transition:{staggerChildren:.07}}},d=[{key:"product_updates",label:"Product news & feature updates",description:"New modules, platform improvements and release notes",Icon:k},{key:"security_insights",label:"Security insights, research & guides",description:"Blog posts, whitepapers, threat landscape reports",Icon:V},{key:"webinars_events",label:"Webinars & virtual events",description:"Upcoming sessions, live demos and recorded content",Icon:z},{key:"university",label:"MyCISO University",description:"Courses, certifications and learning resources",Icon:$},{key:"conference_followups",label:"Conference & event follow-ups",description:"Post-event communications and reconnect emails",Icon:F},{key:"newsletter",label:"Quarterly business newsletter",description:"Strategy updates, company news and partner highlights",Icon:W}],J=r.object({product_updates:r.boolean(),security_insights:r.boolean(),webinars_events:r.boolean(),university:r.boolean(),conference_followups:r.boolean(),newsletter:r.boolean()}),X=r.object({email:r.string().email("A valid email address is required"),masterPause:r.boolean(),categories:J,message:r.string().optional()});function ee(){return typeof window>"u"?"":new URLSearchParams(window.location.search).get("email")||""}const S={product_updates:!0,security_insights:!0,webinars_events:!0,university:!0,conference_followups:!0,newsletter:!0};function ne(){R({title:"Email Preferences — MyCISO",description:"Manage your MyCISO email preferences.",noIndex:!0});const[C,P]=o.useState(!1),[y,I]=o.useState(!1),{toast:_}=T(),{data:f}=Y({queryKey:["/api/pardot-status"]}),m=f?.configured&&f?.directPreferenceSyncEnabled===!0,t=A({resolver:D(X),defaultValues:{email:ee(),masterPause:!1,categories:{...S},message:""}}),a=t.watch("masterPause"),u=o.useRef(!1),g=o.useRef({...S});o.useEffect(()=>{if(a&&!u.current){const s=t.getValues("categories");g.current={...s},d.forEach(i=>{t.setValue(`categories.${i.key}`,!1,{shouldDirty:!0})})}else if(!a&&u.current){const s=g.current;d.forEach(i=>{t.setValue(`categories.${i.key}`,s[i.key],{shouldDirty:!0})})}u.current=a},[a,t]);const p=U({mutationFn:async s=>(await Q("POST","/api/preferences/unsubscribe-intent",s)).json(),onSuccess:s=>{I(!!s?.pardotSynced),P(!0)},onError:()=>{_({title:"Something went wrong",description:"Please try again or reply directly to any MyCISO email.",variant:"destructive"})}}),E=s=>p.mutate(s);return e.jsxs("div",{className:"min-h-screen",children:[e.jsxs("section",{className:"relative overflow-hidden pt-16 md:pt-[6.5rem]",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[hsl(0,0%,5%)] via-[hsl(0,0%,8%)] to-[hsl(0,0%,12%)]"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,_hsl(287,51%,50%,0.08),transparent_60%)]"}),e.jsx("div",{className:"absolute inset-0 bg-grid-pattern"}),e.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-20 sm:pt-28 pb-16 sm:pb-20",children:e.jsxs(n.div,{initial:"hidden",animate:"visible",variants:H,className:"max-w-3xl mx-auto text-center",children:[e.jsx(n.div,{variants:h,children:e.jsxs(x,{variant:"outline",className:"mb-6 border-primary/30 text-primary bg-primary/10",children:[e.jsx(Z,{className:"w-3 h-3 mr-1"}),"Email Preferences"]})}),e.jsxs(n.h1,{variants:h,className:"text-4xl sm:text-5xl font-bold tracking-tight text-white leading-tight",children:["Manage your"," ",e.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-primary to-[hsl(286,48%,70%)]",children:"preferences"})]}),e.jsx(n.p,{variants:h,className:"mt-6 text-lg text-[hsl(220,10%,70%)] max-w-2xl mx-auto",children:m?"Choose exactly what you want to hear from us. Your preferences are updated instantly across all our email systems.":"Choose exactly what you want to hear from us. We handle every request personally and action it within one business day."})]})})]}),e.jsx("section",{className:"py-16 sm:py-24 bg-background",children:e.jsx("div",{className:"max-w-2xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsx(j,{mode:"wait",children:C?e.jsx(n.div,{initial:{opacity:0,y:16}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.4},children:e.jsx(l,{children:e.jsxs(c,{className:"p-8 sm:p-12 text-center space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(q,{className:"w-14 h-14 text-primary"})}),e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:y?"Your preferences have been updated":"Preferences saved"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:y?"Your preferences have been updated immediately. You will not receive any further unwanted emails from us.":"Thank you. A member of our team will update your preferences within one business day. You will not receive any further unwanted emails from us."}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Questions? Reply directly to any MyCISO email or"," ",e.jsx("a",{href:"/contact",className:"text-primary underline underline-offset-2","data-testid":"link-preferences-contact",children:"get in touch here"}),"."]})]})})},"success"):e.jsx(n.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.4},children:e.jsxs("form",{onSubmit:t.handleSubmit(E),className:"space-y-6","data-testid":"form-preferences",children:[e.jsx(l,{children:e.jsx(c,{className:"p-6",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"pref-email",className:"text-base font-semibold",children:"Your email address"}),e.jsx(B,{id:"pref-email",type:"email",placeholder:"[email protected]","data-testid":"input-preferences-email",...t.register("email")}),t.formState.errors.email&&e.jsx("p",{className:"text-xs text-destructive",children:t.formState.errors.email.message})]})})}),e.jsx(l,{className:a?"border-destructive/50 bg-destructive/5":"",children:e.jsx(c,{className:"p-6",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`mt-0.5 p-2 rounded-lg ${a?"bg-destructive/10":"bg-muted"}`,children:e.jsx(K,{className:`w-5 h-5 ${a?"text-destructive":"text-muted-foreground"}`})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground",children:"Pause all communications"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Temporarily stop all emails from MyCISO for 3 months."}),e.jsx(j,{children:a&&e.jsx(n.p,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"text-xs text-destructive mt-2 font-medium",children:"All communications paused. Toggle off to restore individual settings."})})]})]}),e.jsx(w,{name:"masterPause",control:t.control,render:({field:s})=>e.jsx(N,{checked:s.value,onCheckedChange:s.onChange,"data-testid":"toggle-master-pause"})})]})})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Choose what you want to receive"}),a&&e.jsx(x,{variant:"outline",className:"text-xs border-destructive/30 text-destructive",children:"Overridden by pause"})]}),e.jsx("div",{className:"space-y-2","data-testid":"group-categories",style:{opacity:a?.45:1,transition:"opacity 0.25s ease"},children:d.map((s,i)=>{const O=`categories.${s.key}`;return e.jsx(n.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:i*.04,duration:.3},children:e.jsx(l,{className:"transition-colors hover:border-primary/30",children:e.jsx(c,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"flex-shrink-0 p-2 rounded-lg bg-primary/10",children:e.jsx(s.Icon,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-tight",children:s.description})]})]}),e.jsx(w,{name:O,control:t.control,render:({field:b})=>e.jsx(N,{checked:b.value,onCheckedChange:b.onChange,disabled:a,"data-testid":`toggle-category-${s.key}`})})]})})})},s.key)})})]}),e.jsx(l,{children:e.jsxs(c,{className:"p-6 space-y-2",children:[e.jsxs(v,{htmlFor:"pref-message",className:"text-sm font-semibold",children:["Anything else you'd like us to know?"," ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(optional)"})]}),e.jsx(G,{id:"pref-message",placeholder:"e.g. feel free to reach out about enterprise security topics but hold off on product demos for now...",rows:3,"data-testid":"input-preferences-message",...t.register("message")})]})}),e.jsx(L,{type:"submit",className:"w-full",size:"lg",disabled:p.isPending,"data-testid":"button-submit-preferences",children:p.isPending?"Saving...":"Save my preferences"}),m&&e.jsx("div",{className:"flex justify-center",children:e.jsxs(x,{variant:"outline",className:"border-primary/30 bg-primary/10 text-primary","data-testid":"badge-preferences-instant-updates",children:[e.jsx(k,{className:"w-3 h-3 mr-1"}),"Changes take effect immediately"]})}),e.jsx("p",{className:"text-xs text-muted-foreground text-center leading-relaxed",children:m?"Your preferences will be updated instantly across all our email systems.":"Your preferences are handled by our team and actioned within one business day."}),e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border/40",children:[e.jsx("input",{id:"unsubscribe-all",type:"checkbox",className:"h-3.5 w-3.5 accent-muted-foreground cursor-pointer","data-testid":"checkbox-unsubscribe-all",onChange:s=>{s.target.checked&&d.forEach(i=>
1{t.setValue(`categories.${i.key}`,!1,{shouldDirty:!0})})}}),e.jsx("label",{htmlFor:"unsubscribe-all",className:"text-xs text-muted-foreground cursor-pointer select-none",children:"Unsubscribe from all"})]})]})},"form")})})})]})}export{ne 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.