PageSourceSearch

https://www.scientificamerican.com/static/chunks/DynamicLabelInput-RERncfZN.js

js scientificamerican.com collected 2026-10-01 07:50:30 UTC 3,592 bytes, 1 lines download raw bytes

1import{a as f}from"./vendor-shared-ShLQKC4n.js";import{r as l,j as n}from"./vendor-react-DdEP1kCQ.js";import{v,d as F}from"./core-DTFOJR-b.js";import{L as g}from"./data-CNckH7dx.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="4b13c8de-30e3-4dfb-8ad5-553bb950b933",t._sentryDebugIdIdentifier="sentry-dbid-4b13c8de-30e3-4dfb-8ad5-553bb950b933")}catch{}})();const A=()=>{const[t,i]=l.useState(null),[a,s]=l.useState(null);l.useEffect(()=>{const o=window.location.search.includes("debug=emailcollector")===!1&&(f.get("sa_collector")==="1"||f.get("_emailCollectorRegistered")==="1");i(o),s(o)},[]);const e=v("/api/email-collector/",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},authMode:"skip",csrf:!0}),r=e.data&&"action"in e.data?e.data:null,b=e.data&&"error"in e.data?e.data:e.error||null,d=e.data&&"lists"in e.data?e.data.lists:[];return l.useEffect(()=>{r?.action==="success"&&s(!0)},[r?.action]),{subscribe:l.useCallback(({email:u="",lists:o=["today_in_science"],ignore_suggestion:L=!1})=>{const p=new URLSearchParams;return p.append("email",u),o?.length&&o.forEach(w=>p.append("list",w)),L&&p.append("ignore_suggestion","1"),e.refetch({body:p})},[e.refetch]),subscribed:a||r?.action==="success",subscribedLists:d,initialSubscribed:t,collectorResponse:r,collectorError:b,api:e}},N=()=>n.jsxs(n.Fragment,{children:["I agree my information will be processed in accordance with the Scientific American Inc."," ",n.jsx("a",{href:"/page/privacy-policy/","data-click-position":"newsletter-fine-print-signup-privacy",children:"Privacy Policy"}),". ",_]}),R=({lists:t=["today_in_science","internal_marketing_opt_in"]})=>{const{marketingLists:i,newsletters:a}=t.reduce((s,e)=>(g[e]&&(h[e]?s.marketingLists.push(h[e]):s.newsletters.push(g[e].title)),s),{marketingLists:[],newsletters:[]});return n.jsxs(n.Fragment,{children:["By giving us your email, you are agreeing to receive"," ",!!a.length&&"the ",y.format(a),a.length===1&&" newsletter, ",a.length>1&&" newsletters, ",!!i.length&&"emails regarding ",y.format(i),!!i.length&&", ","and to our"," ",n.jsx("a",{href:"/page/terms-of-use/",target:"_blank",children:"Terms of Use"})," ","and"," ",n.jsx("a",{href:"/page/privacy-policy/",target:"_blank",children:"Privacy Policy"}),". ",_]})},h={internal_marketing_opt_in:"special offers from Scientific American",external_marketing_opt_in:"third party partner products and services"},_="We leverage third party services to both verify and deliver email. By providing your email address, you also consent to having the email address shared with third parties for those purposes.",y=new Intl.ListFormat("en",{style:"long",type:"conjunction"}),x="input-SZ4ZB",I="inputField-cL40E",S="inputFieldFilled-Ht2S2",C="inputLabel-vm-5Q",E="inputLabelContent-Wqagf",c={input:x,inputField:I,inputFieldFilled:S,inputLabel:C,inputLabelContent:E},k=l.forwardRef(({inputId:t="email",inputName:i="email",inputType:a="email",labelHtmlFor:s="email",labelText:e="Enter your email",...r},b)=>{const[d,m]=l.useState("");return n.jsxs("span",{className:c.input,children:[n.jsx("input",{ref:b,...r,required:!0,className:F(c.inputField,d&&c.inputFieldFilled,r.className),id:t,type:a,name:i,value:d,onChange:u=>m(u.target.value)}),n.jsx("label",{htmlFor:t||s,className:c.inputLabel,children:n.jsx("span",{className:c.inputLabelContent,children:e})})]})});k.displayName="DynamicLabelInput";export{N as C,k as D,R as F,A as u};

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.