import{r as e,j as t}from"./vendor-react-AXa6hZO5.js";import{B as r,X as o,D as s,I as i}from"./cec18ad9a-DiLjrOUd.js";import{m as n}from"./vendor-motion-0BJMgYoH.js";import"./vendor-radix-glKlawmm.js";import"./vendor-zod-CMvj0_Fd.js";import"./vendor-intl-BdADXLLt.js";import"./vendor-zustand-CcZsBpBq.js";import"./vendor-icons-Dy3Nea9p.js";import"./vendor-lodash-BKAXkXVe.js";import"./vendor-infra-CFC-WJ8N.js";import"./vendor-router-BSYVf8By.js";import"./vendor-query-D7SPXjZv.js";import"./vendor-growthbook-XJcBFzji.js";const a=e.memo(({content:e,onCtaClick:s,onDismiss:i,ImageComponent:n})=>{const a=n??l;return t.jsxs("div",{className:"w-[190px] rounded-xl shadow-[0px_4px_20px_0px_hsl(var(--always-black)/20%)] relative",children:[t.jsxs("div",{className:"w-full border-0.5 border-border-200 rounded-[12px] overflow-hidden",children:[t.jsx("div",{className:"border-[8px] border-bg-000 rounded-t-[6px] relative overflow-hidden",style:{height:e.imageHeight??99},children:t.jsx(a,{src:e.imageUrl,alt:"",fill:!0,className:"object-cover object-center rounded-[6px]",priority:!0})}),t.jsxs("div",{className:"bg-bg-000 px-2 pt-1 pb-2",children:[t.jsxs("div",{className:"text-left mb-3.5 px-1",children:[t.jsx("p",{className:"font-semibold text-[12px] leading-[140%] text-text-000 mb-1",children:e.title}),t.jsx("p",{className:"font-normal text-[11px] text-text-400 leading-[140%]",children:e.body})]}),t.jsx("div",{onClick:s,className:"w-full bg-text-100 hover:bg-text-200 rounded-md h-8 flex items-center justify-center text-bg-100 font-semibold text-xs transition-colors cursor-pointer",children:e.buttonText})]})]}),t.jsx("div",{className:"absolute right-0 top-0 -mr-2 -mt-2 z-20",children:t.jsx(r,{onClick:i,className:"border-0.5 border-border-400 !bg-bg-000 hover:!bg-bg-300 hover:!border-0.5 hover:!border-border-400 shadow-md",size:"icon_xs",variant:"secondary",option:"rounded",children:t.jsx(o,{className:"h-3 w-3 text-text-100"})})})]})});function l({src:e,alt:r,className:o}){return t.jsx("img",{src:e,alt:r,className:`absolute inset-0 w-full h-full ${o??""}`})}function d({src:e,alt:r,fill:o,className:s,priority:n}){return t.jsx(i,{src:e,alt:r,fill:o,className:s,priority:n})}a.displayName="HomeNudgeV1Content";const c=e.memo(({content:r,enabled:o,onDismiss:i,onAction:l})=>{const c=r,m=e.useCallback(()=>{l()},[l]),p=e.useCallback(e=>{e.preventDefault(),e.stopPropagation(),i()},[i]);if(!o)return null;const x=c.buttonHref.startsWith("http")||c.buttonHref.startsWith("https");return t.jsx(n.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"fixed z-50 bottom-10 right-10",children:t.jsx(s,{href:c.buttonHref,webBehavior:x?"new-tab":"navigate",desktopBehavior:x?"open-in-browser":"navigate",rel:"noreferrer",onClick:m,className:"block cursor-pointer",children:t.jsx(a,{content:c,onCtaClick:m,onDismiss:p,ImageComponent:d})})})});c.displayName="HomeNudgeV1";export{c as HomeNudgeV1};
