{"version":3,"file":"SentimentHeroVisual.Bm2MnbHY.mjs","names":["useState","useRef","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","p","_e","de","addPropertyControls","ControlType","init_framer_DymZktPS","SentimentHeroVisual","props","animatedScore","setAnimatedScore","animatedPositive","setAnimatedPositive","animatedNeutral","setAnimatedNeutral","animatedNegative","setAnimatedNegative","isVisible","setIsVisible","ref","observer","entry","step","timer","ease","score","positive","neutral","negative","total","posPercent","neuPercent","scoreColor","label","item","i","init_SentimentHeroVisual"],"sources":["https:/framerusercontent.com/modules/DRlcIB81Mupuy3lHOzGB/1mVTezJ5oNlagbYVocoX/SentimentHeroVisual.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 520\n * @framerIntrinsicHeight 400\n */export default function SentimentHeroVisual(props){const{score=58.7,label=\"Mixed-positive\",positive=5706,neutral=98,negative=618}=props;const[animatedScore,setAnimatedScore]=useState(0);const[animatedPositive,setAnimatedPositive]=useState(0);const[animatedNeutral,setAnimatedNeutral]=useState(0);const[animatedNegative,setAnimatedNegative]=useState(0);const[isVisible,setIsVisible]=useState(false);const ref=useRef(null);useEffect(()=>{const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){setIsVisible(true);}},{threshold:.3});if(ref.current)observer.observe(ref.current);return()=>observer.disconnect();},[]);useEffect(()=>{if(!isVisible)return;const duration=1800;const steps=60;const interval=duration/steps;let step=0;const timer=setInterval(()=>{step++;const progress=step/steps;const ease=1-Math.pow(1-progress,3);setAnimatedScore(parseFloat((score*ease).toFixed(1)));setAnimatedPositive(Math.round(positive*ease));setAnimatedNeutral(Math.round(neutral*ease));setAnimatedNegative(Math.round(negative*ease));if(step>=steps)clearInterval(timer);},interval);return()=>clearInterval(timer);},[isVisible,score,positive,neutral,negative]);const total=positive+neutral+negative;const posPercent=positive/total*100;const neuPercent=neutral/total*100;const scoreColor=score>=60?\"#2D6E16\":score>=40?\"#D67B00\":\"#BA383A\";return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{width:\"100%\",height:\"100%\",maxWidth:920,margin:\"0 auto\",display:\"flex\",flexDirection:\"column\",gap:\"16px\",fontFamily:\"Inter, sans-serif\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{background:\"white\",borderRadius:\"16px\",border:\"1px solid #E6E6EB\",padding:\"28px 32px\",display:\"flex\",alignItems:\"center\",gap:\"20px\",boxShadow:\"0px 1px 3px rgba(0,0,0,0.04), 0px 4px 12px rgba(0,0,0,0.03)\",transition:\"transform 0.4s ease, box-shadow 0.4s ease\",transform:isVisible?\"translateY(0)\":\"translateY(20px)\",opacity:isVisible?1:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"64px\",height:\"64px\",borderRadius:\"50%\",border:`3px solid ${scoreColor}`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:\"22px\",fontWeight:600,color:scoreColor,flexShrink:0},children:animatedScore}),/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"14px\",color:\"#50565D\",marginBottom:\"2px\"},children:\"Overall Sentiment\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"17px\",fontWeight:500,color:\"#020A0F\"},children:label})]})]}),/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:\"12px\"},children:[{value:animatedPositive,label:\"Positive mentions\",color:\"#2D6E16\",bgColor:\"#EDF6E9\",delay:.1},{value:animatedNeutral,label:\"Neutral mentions\",color:\"#1B65BE\",bgColor:\"#E8F0FA\",delay:.2},{value:animatedNegative,label:\"Negative mentions\",color:\"#BA383A\",bgColor:\"#FAEAEA\",delay:.3}].map((item,i)=>/*#__PURE__*/_jsxs(\"div\",{style:{flex:1,background:\"white\",borderRadius:\"14px\",border:\"1px solid #E6E6EB\",padding:\"20px 18px\",boxShadow:\"0px 1px 3px rgba(0,0,0,0.04), 0px 4px 12px rgba(0,0,0,0.03)\",transition:`transform 0.5s ease ${item.delay}s, opacity 0.5s ease ${item.delay}s`,transform:isVisible?\"translateY(0)\":\"translateY(20px)\",opacity:isVisible?1:0},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"8px\",marginBottom:\"8px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"10px\",height:\"10px\",borderRadius:\"50%\",background:item.color}}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"28px\",fontWeight:600,color:item.color,lineHeight:1},children:item.value.toLocaleString()})]}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"13px\",color:\"#50565D\",lineHeight:1.3},children:item.label}),/*#__PURE__*/_jsx(\"div\",{style:{marginTop:\"12px\",height:\"4px\",borderRadius:\"2px\",background:\"#F6F6F8\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{height:\"100%\",borderRadius:\"2px\",background:item.color,width:isVisible?`${item.value/positive*100}%`:\"0%\",transition:\"width 1.8s ease\",maxWidth:\"100%\"}})})]},i))}),/*#__PURE__*/_jsxs(\"div\",{style:{background:\"white\",borderRadius:\"14px\",border:\"1px solid #E6E6EB\",padding:\"18px 20px\",boxShadow:\"0px 1px 3px rgba(0,0,0,0.04), 0px 4px 12px rgba(0,0,0,0.03)\",transition:\"opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s\",transform:isVisible?\"translateY(0)\":\"translateY(20px)\",opacity:isVisible?1:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"13px\",color:\"#50565D\",marginBottom:\"10px\",fontWeight:500},children:\"Sentiment Distribution\"}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",height:\"10px\",borderRadius:\"5px\",overflow:\"hidden\",background:\"#F6F6F8\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:isVisible?`${posPercent}%`:\"0%\",background:\"#2D6E16\",transition:\"width 2s ease\",borderRadius:\"5px 0 0 5px\"}}),/*#__PURE__*/_jsx(\"div\",{style:{width:isVisible?`${neuPercent}%`:\"0%\",background:\"#1B65BE\",transition:\"width 2s ease 0.2s\"}}),/*#__PURE__*/_jsx(\"div\",{style:{flex:1,background:\"#BA383A\",borderRadius:\"0 5px 5px 0\",transition:\"width 2s ease 0.4s\"}})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",justifyContent:\"space-between\",marginTop:\"8px\",fontSize:\"12px\",color:\"#A4A8AF\"},children:[/*#__PURE__*/_jsxs(\"span\",{children:[\"Positive \",(positive/total*100).toFixed(1),\"%\"]}),/*#__PURE__*/_jsxs(\"span\",{children:[\"Neutral \",(neutral/total*100).toFixed(1),\"%\"]}),/*#__PURE__*/_jsxs(\"span\",{children:[\"Negative \",(negative/total*100).toFixed(1),\"%\"]})]})]})]});}addPropertyControls(SentimentHeroVisual,{score:{type:ControlType.Number,defaultValue:58.7,min:0,max:100,step:.1,title:\"Score\"},label:{type:ControlType.String,defaultValue:\"Mixed-positive\",title:\"Label\"},positive:{type:ControlType.Number,defaultValue:5706,title:\"Positive\"},neutral:{type:ControlType.Number,defaultValue:98,title:\"Neutral\"},negative:{type:ControlType.Number,defaultValue:618,title:\"Negative\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SentimentHeroVisual\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicWidth\":\"520\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SentimentHeroVisual.map"],"mappings":"A,gMAKG,SAAwBa,EAAoB,EAAM,CAAC,GAAK,CAAC,QAAM,KAAK,QAAM,iBAAiB,WAAS,KAAK,UAAQ,GAAG,WAAS,KAAKC,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