PageSourceSearch

https://app.xlift.ai/assets/SettingsPage-V8eVCacq.js

js xlift.ai collected 2026-10-05 13:20:53 UTC 4,689 bytes, 1 lines download raw bytes

1import{ai as w,A as M,o,al as Z,a4 as L,a5 as I,U as E,j as e,C as n,ag as P,$ as A,T as m,a0 as U,X as T,D as b,G as l,aS as D,L as d,E as B,a8 as O}from"./index-dE8a1mPK.js";import{I as C}from"./IconWorld-D3uurcdR.js";import{S as F}from"./Select-DebRlW67.js";import"./OptionsDropdown-wonErrz5.js";import"./CheckIcon-DkMc45y2.js";const _=[{group:"Americas",zones:["America/Los_Angeles","America/Denver","America/Chicago","America/New_York","America/Toronto","America/Mexico_City","America/Bogota","America/Sao_Paulo","America/Buenos_Aires","America/Santiago"]},{group:"Europe",zones:["Europe/London","Europe/Dublin","Europe/Lisbon","Europe/Madrid","Europe/Paris","Europe/Amsterdam","Europe/Berlin","Europe/Rome","Europe/Zurich","Europe/Vienna","Europe/Warsaw","Europe/Stockholm","Europe/Helsinki","Europe/Athens","Europe/Istanbul","Europe/Moscow"]},{group:"Africa & Middle East",zones:["Africa/Cairo","Africa/Lagos","Africa/Johannesburg","Africa/Nairobi","Asia/Jerusalem","Asia/Riyadh","Asia/Dubai","Asia/Tehran"]},{group:"Asia",zones:["Asia/Karachi","Asia/Kolkata","Asia/Dhaka","Asia/Bangkok","Asia/Jakarta","Asia/Singapore","Asia/Hong_Kong","Asia/Shanghai","Asia/Taipei","Asia/Seoul","Asia/Tokyo"]},{group:"Oceania",zones:["Australia/Perth","Australia/Adelaide","Australia/Sydney","Pacific/Auckland"]},{group:"Other",zones:["UTC"]}];function K(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function z(r){var a;try{const t=((a=new Intl.DateTimeFormat("en-US",{timeZone:r,timeZoneName:"shortOffset"}).formatToParts(new Date).find(c=>c.type==="timeZoneName"))==null?void 0:a.value)||"";return t?`${r} (${t})`:r}catch{return r}}function Q(){const r=w(),{data:a,isLoading:j}=M({queryKey:["user"],queryFn:()=>E.getUser()}),[t,c]=o.useState(""),[p,y]=o.useState(""),[g,f]=o.useState(""),[i,h]=o.useState("");o.useEffect(()=>{a&&(c(a.firstName||""),y(a.lastName||""),f(a.companyName||""),h(a.timeZone||""))},[a]);const N=o.useMemo(()=>_.map(s=>({group:s.group,items:s.zones.map(S=>({value:S,label:z(S)}))})),[]),x=Z({mutationFn:s=>E.updateUser(s),onSuccess:()=>{r.invalidateQueries({queryKey:["user"]}),I("Settings saved")},onError:s=>L((s==null?void 0:s.message)||"Could not save")});if(j||!a)return e.jsx(n,{align:"center",mt:"xl",children:e.jsx(P,{})});const v=t!==(a.firstName||"")||p!==(a.lastName||"")||g!==(a.companyName||"")||i!==(a.timeZone||""),u=K(),k=!a.timeZone;return e.jsxs(n,{gap:"lg",style:{maxWidth:720},children:[e.jsxs(n,{gap:4,children:[e.jsx(A,{order:2,children:"Settings"}),e.jsx(m,{c:"dimmed",size:"sm",children:"Your profile and account preferences."})]}),k&&e.jsxs(U,{color:"yellow",icon:e.jsx(C,{size:16}),title:"Set your time zone",children:['Right now your campaigns dispatch in UTC. Set your local zone below so a "post at 9 AM" actually fires at 9 AM your time.',u&&u!=="UTC"&&e.jsxs(m,{size:"sm",mt:4,children:["Your browser says ",e.jsx("strong",{children:z(u)})," —"," ",e.jsx(T,{size:"compact-xs",variant:"subtle",onClick:()=>h(u),children:"use that"})]})]}),e.jsx(b,{withBorder:!0,padding:"lg",children:e.jsxs(n,{gap:"md",children:[e.jsxs(l,{gap:8,children:[e.jsx(D,{size:18}),e.jsx(A,{order:4,children:"Profile"})]}),e.jsxs(l,{grow:!0,children:[e.jsx(d,{label:"First name",value:t,onChange:s=>c(s.currentTarget.value),placeholder:"Itamar"}),e.jsx(d,{label:"Last name",value:p,onChange:s=>y(s.currentTarget.value),placeholder:"Stollman"})]}),e.jsx(d,{label:"Company",value:g,onChange:s=>f(s.currentTarget.value),placeholder:"Xlift"}),e.jsx(d,{label:"Email",value:a.email||"",disabled:!0,description:"Tied to your login — contact support to change."})]})}),e.jsx(b,{withBorder:!0,padding:"lg",children:e.jsxs(n,{gap:"md",children:[e.jsxs(l,{gap:8,justify:"space-between",children:[e.jsxs(l,{gap:8,children:[e.jsx(C,{size:18}),e.jsx(A,{order:4,children:"Time zone"})]}),a.timeZone&&e.jsx(B,{color:"green",leftSection:e.jsx(O,{size:12}),children:"Set"})]}),e.jsx(m,{size:"sm",c:"dimmed",children:'Working hours, post-scheduling times, daily caps, and every "X ago" timestamp are interpreted in this zone.'}),e.jsx(F,{label:"Time zone",data:N,value:i||null,onChange:s=>h(s||""),placeholder:"Pick your zone",searchable:!0,clearable:!0,nothingFoundMessage:"No matches"}),i&&e.jsxs(m,{size:"xs",c:"dimmed",children:["Current time there: ",e.jsx("strong",{children:new Date().toLocaleStr
1ing(void 0,{timeZone:i,dateStyle:"medium",timeStyle:"short"})})]})]})}),e.jsx(l,{justify:"flex-end",children:e.jsx(T,{disabled:!v||x.isPending,loading:x.isPending,onClick:()=>x.mutate({firstName:t.trim()||null,lastName:p.trim()||null,companyName:g.trim()||null,timeZone:i||null}),children:"Save changes"})})]})}export{Q 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.