1import{r as c,b as v,j as e,P as B,A as w,h as M}from"./index-DGfu4eos.js";import{a as N,B as k}from"./blog-CAWQbsm2.js";import{S as p}from"./search-BkUJu4-H.js";import"./arrow-up-right-C0XWoBfZ.js";const x={success:"Youâre on the list.",successBody:"The Monopro Brief will arrive about once a month.",existing:"Youâre already subscribed. We kept your place on the list.",error:"Enter a valid work email and try again.",consent:"By subscribing, you agree to receive the Monopro Brief. You can unsubscribe at any time."},S={en:x,ko:{success:"구ë
ì´ ìë£ëììµëë¤.",successBody:"í ë¬ì í ë² ì ë 모ë
¸íë¡ ë¸ë¦¬í를 ë³´ë´ë립ëë¤.",existing:"ì´ë¯¸ 구ë
ì¤ì
ëë¤. 기존 구ë
ìí를 ì ì§íìµëë¤.",error:"ì í¨í ì
ë¬´ì© ì´ë©ì¼ì ì
ë ¥í´ ì£¼ì¸ì.",consent:"구ë
íë©´ 모ë
¸íë¡ ë¸ë¦¬í ìì ì ëìíê² ë©ëë¤. ì¸ì ë 구ë
ì ì·¨ìí ì ììµëë¤."},ja:{success:"è³¼èªãåãä»ãã¾ããã",successBody:"æã«ä¸åº¦ç¨åº¦ãMonopro Briefããéããã¾ãã",existing:"ãã§ã«è³¼èªããã¦ãã¾ããç»é²ç¶æ
ãç¶æãã¾ããã",error:"æå¹ãªæ³äººã¡ã¼ã«ããå
¥åãã ããã",consent:"è³¼èªããã¨Monopro Briefã®åä¿¡ã«åæãããã¨ã«ãªãã¾ãããã¤ã§ãè§£é¤ã§ãã¾ãã"},"zh-TW":{success:"è¨é±å®æã",successBody:"Monopro Brief ç´æ¯æå¯é䏿¬¡ã",existing:"æ¤ä¿¡ç®±å·²è¨é±ï¼æåå·²ä¿çæ¨çè¨é±çæ
ã",error:"è«è¼¸å
¥ææçå·¥ä½ä¿¡ç®±ã",consent:"è¨é±å³è¡¨ç¤ºåææ¥æ¶ Monopro Briefï¼æ¨å¯é¨æåæ¶ã"},de:{success:"Sie sind eingetragen.",successBody:"Der Monopro Brief erscheint ungefähr einmal im Monat.",existing:"Sie sind bereits angemeldet.",error:"Geben Sie eine gültige geschäftliche E-Mail ein.",consent:"Mit der Anmeldung stimmen Sie dem Monopro Brief zu. Eine Abmeldung ist jederzeit möglich."},th:{success:"สมัà¸à¸£à¸£à¸±à¸à¸à¹à¸²à¸§à¸ªà¸²à¸£à¹à¸¥à¹à¸§",successBody:"à¹à¸£à¸²à¸à¸°à¸ªà¹à¸ Monopro Brief à¸à¸£à¸°à¸¡à¸²à¸à¹à¸à¸·à¸à¸à¸¥à¸°à¸à¸£à¸±à¹à¸",existing:"à¸à¸µà¹à¸¡à¸¥à¸à¸µà¹à¸ªà¸¡à¸±à¸à¸£à¸à¸¢à¸¹à¹à¹à¸¥à¹à¸§",error:"à¸à¸£à¸à¸à¸à¸µà¹à¸¡à¸¥à¸à¸²à¸à¸à¸µà¹à¸à¸¹à¸à¸à¹à¸à¸",consent:"à¸à¸²à¸£à¸ªà¸¡à¸±à¸à¸£à¸«à¸¡à¸²à¸¢à¸à¸¶à¸à¸¢à¸´à¸à¸¢à¸à¸¡à¸£à¸±à¸ Monopro Brief à¹à¸¥à¸°à¸¢à¸à¹à¸¥à¸´à¸à¹à¸à¹à¸à¸¸à¸à¹à¸¡à¸·à¹à¸"},vi:{success:"Bạn Äã ÄÄng ký.",successBody:"Monopro Brief sẽ ÄÆ°á»£c gá»i khoảng má»t lần má»i tháng.",existing:"Email nà y Äã ÄÄng ký. Chúng tôi giữ nguyên trạng thái cá»§a bạn.",error:"Hãy nháºp email công viá»c hợp lá».",consent:"Khi ÄÄng ký, bạn Äá»ng ý nháºn Monopro Brief và có thá» há»§y bất cứ lúc nà o."}};function C(n="en"){const d=n.startsWith("zh")?"zh-TW":n.split("-")[0];return S[d]??x}function L(){const[n,d]=c.useState(""),[r,y]=c.useState("all"),[g,j]=c.useState(""),[t,a]=c.useState("idle"),{t:i,i18n:l}=v(),u=c.useMemo(()=>N(l.resolvedLanguage).filter(s=>(r==="all"||r==="cases")&&`${s.title} ${s.category} ${s.excerpt}`.toLowerCase().includes(n.toLowerCase())),[r,n,l.resolvedLanguage]),o=C(l.resolvedLanguage),b=async s=>{var h;s.preventDefault(),a("sending");try{const m=await fetch("/api/newsletter/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:g,locale:l.resolvedLanguage,market:(h=M())==null?void 0:h.code})}),f=await m.json();if(!m.ok)throw new Error("subscribe_failed");a(f.existing?"existing":"success")}catch{a("error")}};return e.jsxs(e.Fragment,{children:[e.jsx(B,{title:i("insights.metaTitle"),description:i("insights.body")}),e.jsx("section",{className:"insights-hero",children:e.jsxs("div",{className:"container insights-hero__inner",children:[e.jsxs("div",{children:[e.jsx("div",{className:"eyebrow eyebrow--small eyebrow--light",children:i("insights.kicker")}),e.jsx("h1",{children:i("insights.title")}),e.jsx("p",{children:i("insights.body")})]}),e.jsxs("div",{className:"insights-hero__mark",children:[e.jsx("span",{children:"AI"}),e.jsx("i",{children:i("insights.fieldNotes")})]})]})}),e.jsx("section",{className:"insights-page",children:e.jsxs("div",{className:"container",children:[e.jsxs("div",{className:"insights-toolbar",children:[e.jsx("div",{children:[["all",i("insights.all")],["cases",i("insights.cases")]].map(([s,h])=>e.jsx("button",{className:r===s?"active":"","aria-pressed":r===s,type:"button",onClick:()=>y(s),children:h},s))}),e.jsxs("label",{children:[e.jsx(p,{size:18}),e.jsx("input",{value:n,onChange:s=>d(s.target.value),placeholder:i("insights.search")})]})]}),u.length>0?e.jsx("div",{className:"blog-grid blog-grid--insights",children:u.map(s=>e.jsx(k,{post:s},s.slug))}):e.jsxs("div",{className:"empty-state",children:[e.jsx(p,{}),e.jsx("h2",{children:i("insights.emptyTitle")}),e.jsx("p",{children:i("insights.emptyBody")})]}),e.jsxs("div",{className:"newsletter",children:[e.jsxs("div",{children:[e.jsx("span",{children:i("insights.brief")}),e.jsx("h2",{children:i("insights.newsletter")}),e.jsx("p",{children:i("insights.newsletterBody")})]}),e.jsxs("form",{onSubmit:s=>void b(s),children:[e.jsxs("div",{children:[e.jsx("input",{required:!0,type:"email",value:g,onChange:s=>{j(s.target.value),a("idle")},placeholder:i("insights.email"),"aria-label":i("insights.email")}),e.jsx("small",{children:o.consent})]}),e.jsxs("button",{className:"button button--primary",type:"submit",disabled:t==="sending",children:[t==="sending"?"â¦":i("insights.subscribe")," ",e.jsx(w,{size:17})]}),t!=="idle"&&t!=="sending"&&e.jsx("p",{className:`newsletter__status newsletter__status--${t}`,role:"status",children:t==="success"?`${o.success} ${o.successBody}`:t==="existing"?o.existing:o.error})]})]})]})})]})}export{L as Insights};
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.