{"version":3,"file":"AskBox.IB2sdsx2.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/OBDwMx6BgK8WjQZxhY0U/cTltUDa8LMxJtYn2QHO1/AskBox.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView,useReducedMotion}from\"framer-motion\";import{useEffect,useRef,useState}from\"react\";const C={black:\"#081131\",navy:\"#0f384f\",blue:\"#1d6fd6\"};const font=\"Manrope, 'Manrope Placeholder', sans-serif\";const CSS=`\n@keyframes ab-blink{50%{opacity:0}}\n.ab-box{transition:box-shadow .25s ease, transform .25s ease, border-color .25s ease}\n.ab-box:hover{transform:translateY(-2px);border-color:rgba(18,55,105,.22) !important;box-shadow:0 20px 40px -20px rgba(15,56,79,.5) !important}\n.ab-box:hover .ab-go{background:#0b4063 !important}\n.ab-box:focus-visible{outline:2px solid ${C.blue};outline-offset:3px}\n.ab-arrow{display:inline-block;transition:transform .2s ease}\n.ab-box:hover .ab-arrow{transform:translateX(3px)}\n.ab-root{container-type:inline-size}\n@container (max-width: 460px){\n.ab-box{flex-wrap:wrap;align-items:flex-start !important;padding:16px !important;row-gap:14px !important}\n.ab-text{white-space:normal !important;line-height:22px;padding-top:4px;min-height:48px;flex:1 1 calc(100% - 42px) !important}\n.ab-go{flex:1 1 100% !important;text-align:center;padding:12px 14px !important}\n}\n`;const lines=s=>(s||\"\").split(\"\\n\").map(x=>x.trim()).filter(Boolean);/**\n * Ask ECO-OS box that types example questions and links to a person\n *\n * @framerIntrinsicWidth 560\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function AskBox(props){const{prompts=\"Where can we cut the most next year?\\nHow do we explain the Scope 3 jump to our board?\\nWhat will it take to be ready for CSRD?\\nWhich suppliers should we start with?\",buttonLabel=\"Ask an expert\",link=\"/contact\",style}=props;const list=lines(prompts).length?lines(prompts):[\"Where can we cut the most next year?\"];const isStatic=useIsStaticRenderer();const reduced=useReducedMotion();const ref=useRef(null);const inView=useInView(ref,{amount:.5});const still=isStatic||Boolean(reduced);const[i,setI]=useState(0);const[n,setN]=useState(still?list[0].length:0);useEffect(()=>{if(still||!inView)return;const text=list[i%list.length];let t;if(n<text.length)t=window.setTimeout(()=>setN(n+1),45);else t=window.setTimeout(()=>{setN(0);setI(v=>(v+1)%list.length);},2600);return()=>window.clearTimeout(t);},[n,i,inView,still,list.join(\"|\")]);const text=list[i%list.length];const shown=still?text:text.slice(0,n);return /*#__PURE__*/_jsx(\"div\",{className:\"ab-root\",style:{width:\"100%\"},children:/*#__PURE__*/_jsxs(\"a\",{ref:ref,href:link,className:\"ab-box\",\"aria-label\":`${buttonLabel}: ${text}`,style:{position:\"relative\",width:\"100%\",display:\"flex\",alignItems:\"center\",gap:12,boxSizing:\"border-box\",padding:\"14px 14px 14px 18px\",background:\"#fff\",borderRadius:14,border:\"1px solid rgba(18,55,105,.1)\",boxShadow:\"0 14px 30px -18px rgba(15,56,79,.45)\",textDecoration:\"none\",fontFamily:font,textAlign:\"left\",...style,height:\"auto\"},children:[/*#__PURE__*/_jsx(\"style\",{children:CSS}),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{width:30,height:30,borderRadius:9,background:\"linear-gradient(135deg,#1d6fd6,#5aa9f0)\",display:\"grid\",placeItems:\"center\",flex:\"none\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"15\",height:\"15\",viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"path\",{fill:\"#fff\",d:\"M12 2l2.2 6.3L20.5 10.5 14.2 12.7 12 19l-2.2-6.3L3.5 10.5l6.3-2.2z\"})})}),/*#__PURE__*/_jsxs(\"span\",{\"aria-hidden\":\"true\",className:\"ab-text\",style:{flex:1,minWidth:0,fontSize:16,fontWeight:600,color:C.black,whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\"},children:[shown,/*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",width:2,height:17,background:C.blue,marginLeft:2,verticalAlign:-3,animation:still?undefined:\"ab-blink 1s steps(1) infinite\"}})]}),/*#__PURE__*/_jsxs(\"span\",{className:\"ab-go\",style:{background:C.navy,color:\"#fff\",borderRadius:10,fontSize:14,fontWeight:700,padding:\"10px 14px\",whiteSpace:\"nowrap\",flex:\"none\",transition:\"background .2s ease\"},children:[buttonLabel,\" \",/*#__PURE__*/_jsx(\"span\",{className:\"ab-arrow\",children:\"→\"})]})]})});}addPropertyControls(AskBox,{prompts:{type:ControlType.String,title:\"Questions\",description:\"One per line. They type out in turn.\",displayTextArea:true,defaultValue:\"Where can we cut the most next year?\\nHow do we explain the Scope 3 jump to our board?\\nWhat will it take to be ready for CSRD?\\nWhich suppliers should we start with?\"},buttonLabel:{type:ControlType.String,title:\"Button\",defaultValue:\"Ask an expert\"},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"/contact\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AskBox\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"560\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AskBox.map"],"mappings":"8QAqBG,SAAwB,EAAO,EAAM,CAAC,GAAK,CAAC,UAAQ;;;uCAAyK,cAAY,gBAAgB,OAAK,WAAW,SAAO,EAAY,EAAK,EAAM,CAAO,CAAC,CAAC,OAAO,EAAM,CAAO,EAAE,CAAC,sCAAsC,EAAQ,EAAS,EAAoB,EAAQ,EAAQ,EAAiB,EAAQ,EAAIA,EAAO,IAAI,EAAQ,EAAO,EAAU,EAAI,CAAC,OAAO,EAAE,CAAC,EAAQ,EAAM,GAAU,EAAQ,EAAc,CAAC,EAAE,GAAMC,EAAS,CAAC,EAAO,CAAC,EAA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