{"version":3,"file":"CircularDial.BEUJdt9x.mjs","names":["React.useRef","React.useMemo"],"sources":["https:/framerusercontent.com/modules/fVjtUfRlVSh773isazD2/yQocEtGRSiOYtF9T2ecg/CircularDial.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useInView}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CircularDial(props){const{showOutline,outlineColor,outlineColor2,outlineWidth,outlineOpacity,showTicks,tickCount,tickColor,tickColor2,tickWidth,tickOpacity,tickLength,tickInset,tickCap,animate,animateColors,direction,maxAngle,duration,delay,ease,style}=props;const isStatic=useIsStaticRenderer();const ref=React.useRef(null);const isInView=useInView(ref,{amount:.2});const dir=direction===\"clockwise\"?1:-1;const angle=dir*maxAngle;const cx=50;const cy=50;const safeOutlineWidth=Math.max(0,outlineWidth);const safeTickWidth=Math.max(0,tickWidth);const safeTickCount=Math.max(0,Math.floor(tickCount));const r=React.useMemo(()=>{const maxStroke=Math.max(safeOutlineWidth,safeTickWidth);return Math.max(.001,50-maxStroke/2);},[safeOutlineWidth,safeTickWidth]);const ticks=React.useMemo(()=>{if(!showTicks||safeTickCount<=0)return[];const len=Math.max(0,tickLength);const inset=Math.max(0,tickInset);const rOuter=Math.max(.001,r-inset);const rInner=Math.max(.001,rOuter-len);return Array.from({length:safeTickCount},(_,i)=>{const a=i/safeTickCount*Math.PI*2-Math.PI/2;const cos=Math.cos(a);const sin=Math.sin(a);return{x1:cx+rInner*cos,y1:cy+rInner*sin,x2:cx+rOuter*cos,y2:cy+rOuter*sin,key:`t-${i}`};});},[showTicks,safeTickCount,tickLength,tickInset,r]);const shouldAnimate=!isStatic&&animate&&isInView&&duration>0&&maxAngle!==0;const shouldAnimateColors=animateColors&&shouldAnimate;const rotationTransition=React.useMemo(()=>({duration,delay,ease:ease===\"linear\"?[0,0,1,1]:[.42,0,.58,1],repeat:Infinity,repeatType:\"mirror\"}),[duration,delay,ease]);// SMIL: mirror effect via color1→color2→color1 in one cycle\nconst smilValues=(c1,c2)=>`${c1};${c2};${c1}`;const smilCalcMode=ease===\"linear\"?\"linear\":\"spline\";const smilKeySplines=ease===\"linear\"?undefined:\"0.42 0 0.58 1;0.42 0 0.58 1\";return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"visible\",...style},\"aria-label\":\"Circular dial\",role:\"img\",children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"relative\",width:\"100%\",height:\"100%\",transformOrigin:\"50% 50%\"},initial:{rotate:0},animate:shouldAnimate?{rotate:angle}:{rotate:0},transition:shouldAnimate?rotationTransition:undefined,children:/*#__PURE__*/_jsxs(\"svg\",{width:\"100%\",height:\"100%\",viewBox:\"0 0 100 100\",preserveAspectRatio:\"xMidYMid meet\",style:{display:\"block\"},children:[showOutline&&safeOutlineWidth>0&&/*#__PURE__*/_jsx(\"circle\",{cx:cx,cy:cy,r:r,fill:\"none\",stroke:outlineColor,strokeOpacity:Math.max(0,Math.min(1,outlineOpacity)),strokeWidth:safeOutlineWidth,children:shouldAnimateColors&&/*#__PURE__*/_jsx(\"animate\",{attributeName:\"stroke\",values:smilValues(outlineColor,outlineColor2),dur:`${duration}s`,begin:`${delay}s`,calcMode:smilCalcMode,keySplines:smilKeySplines,keyTimes:\"0;0.5;1\",repeatCount:\"indefinite\"})}),showTicks&&ticks.length>0&&/*#__PURE__*/_jsxs(\"g\",{stroke:tickColor,strokeOpacity:Math.max(0,Math.min(1,tickOpacity)),strokeWidth:safeTickWidth,strokeLinecap:tickCap,children:[shouldAnimateColors&&/*#__PURE__*/_jsx(\"animate\",{attributeName:\"stroke\",values:smilValues(tickColor,tickColor2),dur:`${duration}s`,begin:`${delay}s`,calcMode:smilCalcMode,keySplines:smilKeySplines,keyTimes:\"0;0.5;1\",repeatCount:\"indefinite\"}),ticks.map(t=>/*#__PURE__*/_jsx(\"line\",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},t.key))]})]})})});}addPropertyControls(CircularDial,{showOutline:{type:ControlType.Boolean,title:\"Outline\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},outlineColor:{type:ControlType.Color,title:\"Outline Color\",defaultValue:\"#000000\",hidden:({showOutline})=>!showOutline},outlineColor2:{type:ControlType.Color,title:\"Outline Color 2\",defaultValue:\"#CCCCCC\",hidden:({showOutline})=>!showOutline},outlineWidth:{type:ControlType.Number,title:\"Outline Width\",defaultValue:4,min:0,max:40,step:.5,unit:\"px\",hidden:({showOutline})=>!showOutline},outlineOpacity:{type:ControlType.Number,title:\"Outline Opacity\",defaultValue:1,min:0,max:1,step:.05,hidden:({showOutline})=>!showOutline},showTicks:{type:ControlType.Boolean,title:\"Ticks\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},tickCount:{type:ControlType.Number,title:\"Tick Count\",defaultValue:12,min:0,max:240,step:1,hidden:({showTicks})=>!showTicks},tickColor:{type:ControlType.Color,title:\"Tick Color\",defaultValue:\"#000000\",hidden:({showTicks})=>!showTicks},tickColor2:{type:ControlType.Color,title:\"Tick Color 2\",defaultValue:\"#CCCCCC\",hidden:({showTicks})=>!showTicks},tickWidth:{type:ControlType.Number,title:\"Tick Width\",defaultValue:2,min:0,max:30,step:.5,unit:\"px\",hidden:({showTicks})=>!showTicks},tickOpacity:{type:ControlType.Number,title:\"Tick Opacity\",defaultValue:.7,min:0,max:1,step:.05,hidden:({showTicks})=>!showTicks},tickLength:{type:ControlType.Number,title:\"Tick Length\",defaultValue:10,min:0,max:40,step:.5,unit:\"px\",hidden:({showTicks})=>!showTicks},tickInset:{type:ControlType.Number,title:\"Tick Inset\",defaultValue:6,min:0,max:40,step:.5,unit:\"px\",hidden:({showTicks})=>!showTicks},tickCap:{type:ControlType.Enum,title:\"Tick Cap\",options:[\"round\",\"butt\",\"square\"],optionTitles:[\"Round\",\"Butt\",\"Square\"],defaultValue:\"round\",displaySegmentedControl:true,hidden:({showTicks})=>!showTicks},animate:{type:ControlType.Boolean,title:\"Animate\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},animateColors:{type:ControlType.Boolean,title:\"Animate Colors\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\",hidden:({animate})=>!animate},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"clockwise\",\"counterclockwise\"],optionTitles:[\"CW\",\"CCW\"],defaultValue:\"clockwise\",displaySegmentedControl:true,hidden:({animate})=>!animate},maxAngle:{type:ControlType.Number,title:\"Max Angle\",defaultValue:18,min:0,max:180,step:1,unit:\"deg\",hidden:({animate})=>!animate},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:6,min:.2,max:60,step:.1,unit:\"s\",hidden:({animate})=>!animate},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:10,step:.1,unit:\"s\",hidden:({animate})=>!animate},ease:{type:ControlType.Enum,title:\"Ease\",options:[\"easeInOut\",\"linear\"],optionTitles:[\"Ease In-Out\",\"Linear\"],defaultValue:\"easeInOut\",displaySegmentedControl:true,hidden:({animate})=>!animate}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CircularDial\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CircularDial.map"],"mappings":"yPAGG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,cAAY,eAAa,gBAAc,eAAa,iBAAe,YAAU,YAAU,YAAU,aAAW,YAAU,cAAY,aAAW,YAAU,UAAQ,UAAQ,gBAAc,YAAU,WAAS,WAAS,QAAM,OAAK,SAAO,EAAY,EAAS,EAAoB,EAAQ,EAAIA,E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