{"version":3,"file":"TierSplit.CgSWVfC2.mjs","names":["useState","useRef","__esmMin","init_npm_react_18_3_1","_e","de","init_jsx_runtime","c","p","ce","useReducedMotion","useInView","motion","init_framer_motion_DhsWWWsN","init_framer_DxfB3JJo","addPropertyControls","useIsStaticRenderer","ControlType","useCycle","inView","ref","loop","reduce","still","cycle","setCycle","t","TierSplit","props","on","a","aimms","seg","radius","color","lab","delay","d","style","barHeight","firstDuration","EASE","restOpacity","secondDuration","secondDelay","showLabels","lower","leftLabel","rightLabel","init_TierSplit","s","i"],"sources":["https:/framerusercontent.com/modules/CgwWJ7bSY44G1o2YrhV7/zSf6WqyMtLGCIZ5H0Fa3/TierSplit.js"],"sourcesContent":["// @ts-nocheck\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{motion,useInView,useReducedMotion}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";function useCycle(ref,loop){const inView=useInView(ref,{amount:.3,once:!loop});const reduce=useReducedMotion();const still=useIsStaticRenderer()||reduce;const[cycle,setCycle]=useState(0);useEffect(()=>{if(still||!inView)return;setCycle(c=>c+1);if(!loop)return;const t=setInterval(()=>setCycle(c=>c+1),8e3);return()=>clearInterval(t);},[inView,still,loop]);return{still,cycle};}const EASE=[.2,.8,.2,1];const lower=s=>String(s||\"\").split(/(aimms)/).map((p,i)=>p===\"aimms\"?/*#__PURE__*/_jsx(\"span\",{style:{textTransform:\"none\"},children:\"aimms\"},i):p);/**\n * The aimms / your company split bar of a tier card. The two parts fill one after the other when scrolled into view.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TierSplit(props){const{aimms=95,color=\"#FFFFFF\",restOpacity=.35,barHeight=4,gap=3,radius=3,delay=.3,firstDuration=1.6,secondDelay=1.2,secondDuration=.8,showLabels=true,leftLabel=\"aimms 95%\",rightLabel=\"Your company 5%\",loop=true,style}=props;const ref=useRef(null);const{still,cycle}=useCycle(ref,loop);const on=still||cycle>0;const a=Math.max(0,Math.min(100,aimms));const seg={display:\"block\",height:\"100%\",borderRadius:radius,background:color,transformOrigin:\"left center\",minWidth:0};const lab=d=>({initial:still?false:{opacity:0,x:-8},animate:{opacity:on?1:0,x:on?0:-8},transition:{duration:.6,delay:delay+d,ease:\"easeOut\"}});return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{...style,display:\"flex\",flexDirection:\"column\",gap:8,width:\"100%\",fontFamily:\"Raleway, sans-serif\"},children:[/*#__PURE__*/_jsxs(\"div\",{\"aria-hidden\":\"true\",style:{display:\"flex\",gap,height:barHeight},children:[/*#__PURE__*/_jsx(motion.i,{style:{...seg,flex:a},initial:still?false:{scaleX:0},animate:{scaleX:on?1:0},transition:{duration:firstDuration,delay,ease:EASE}},\"a\"+cycle),/*#__PURE__*/_jsx(motion.i,{style:{...seg,flex:100-a,opacity:restOpacity},initial:still?false:{scaleX:0},animate:{scaleX:on?1:0},transition:{duration:secondDuration,delay:delay+secondDelay,ease:EASE}},\"b\"+cycle)]}),showLabels&&/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",justifyContent:\"space-between\",gap:8,fontSize:10.5,fontWeight:700,letterSpacing:\"0.08em\",lineHeight:1.3,textTransform:\"uppercase\",color,opacity:.85},children:[/*#__PURE__*/_jsx(motion.span,{...lab(.4),children:lower(leftLabel)},\"l\"+cycle),/*#__PURE__*/_jsx(motion.span,{...lab(1.5),style:{textAlign:\"right\"},children:lower(rightLabel)},\"r\"+cycle)]})]});}addPropertyControls(TierSplit,{aimms:{type:ControlType.Number,title:\"aimms %\",defaultValue:95,min:0,max:100,step:1},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFFFFF\"},restOpacity:{type:ControlType.Number,title:\"Rest opacity\",defaultValue:.35,min:0,max:1,step:.05},barHeight:{type:ControlType.Number,title:\"Bar height\",defaultValue:4,min:1,max:40,step:1},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:3,min:0,max:20,step:1},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:3,min:0,max:20,step:1},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:.3,min:0,max:5,step:.05,unit:\"s\"},firstDuration:{type:ControlType.Number,title:\"First part\",defaultValue:1.6,min:.1,max:5,step:.1,unit:\"s\"},secondDelay:{type:ControlType.Number,title:\"Second after\",defaultValue:1.2,min:0,max:5,step:.1,unit:\"s\"},secondDuration:{type:ControlType.Number,title:\"Second part\",defaultValue:.8,min:.1,max:5,step:.1,unit:\"s\"},showLabels:{type:ControlType.Boolean,title:\"Labels\",defaultValue:true},leftLabel:{type:ControlType.String,title:\"Left label\",defaultValue:\"aimms 95%\",hidden:p=>!p.showLabels},rightLabel:{type:ControlType.String,title:\"Right label\",defaultValue:\"Your company 5%\",hidden:p=>!p.showLabels},loop:{type:ControlType.Boolean,title:\"Repeat\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TierSplit\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TierSplit.map"],"mappings":"A,sQAC2O,SAASkB,EAAS,EAAI,EAAK,CAAC,IAAMC,EAAOR,EAAUS,EAAI,CAAC,OAAO,GAAG,KAAK,CAACC,CAAI,CAAC,EAAQC,EAAOZ,EAAiB,EAAQa,EAAMP,EAAoB,GAAGM,EAAY,CAACE,EAAMC,GAAUzB,EAAS,CAAC,EAA2K,OAAzKS,MAAc,CAA2C,GAAvCc,GAAO,CAACJ,IAAcM,EAAS,GAAGlB,EAAE,CAAC,EAAK,CAACc,GAAK,OAAO,IAAMK,EAAE,gBAAgBD,EAAS,GAAGlB,EAAE,CAAC,EAAE,GAAG,EAAE,UAAU,cAAcmB,CAAC,CAAE,EAAE,CAACP,EAAOI,E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