{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/6bP8kKMcmjyMBZ4dtW9J/8B86K6ARsC5yHBNNpDKj/AudioPlayerButton.js"],
  "sourcesContent": ["// Play/Pause Button with Sound\n// Plays a sound on click, toggles icon between play and pause\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * AudioPlayerButton\n *\n * @framerIntrinsicWidth 180\n * @framerIntrinsicHeight 48\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function AudioPlayerButton(props){const{label,audioFile=\"https://framerusercontent.com/assets/8w3IUatLX9a5JVJ6XPCVuHi94.mp3\",background,textColor,iconColor,borderRadius,font,style}=props;const audioRef=useRef(null);const[playing,setPlaying]=useState(false);const[isHovered,setIsHovered]=useState(false);useEffect(()=>{if(!audioRef.current)return;const audio=audioRef.current;const handleEnded=()=>startTransition(()=>setPlaying(false));audio.addEventListener(\"ended\",handleEnded);return()=>audio.removeEventListener(\"ended\",handleEnded);},[]);useEffect(()=>{if(!audioRef.current)return;if(playing){audioRef.current.play();}else{audioRef.current.pause();audioRef.current.currentTime=0;}},[playing]);function handleClick(){startTransition(()=>setPlaying(p=>!p));}if(RenderTarget.current()===RenderTarget.thumbnail)return null;return /*#__PURE__*/_jsxs(\"button\",{style:{...style,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:8,background:isHovered?\"#DADCE3\":background,color:textColor,border:\"none\",borderRadius,padding:\"12px 24px\",cursor:\"pointer\",outline:\"none\",transition:\"background 0.2s ease-in-out\",...font},onClick:handleClick,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),\"aria-pressed\":playing,type:\"button\",children:[/*#__PURE__*/_jsx(\"span\",{style:{display:\"flex\",alignItems:\"center\"},children:playing?// Pause icon\n/*#__PURE__*/_jsxs(\"svg\",{width:\"22\",height:\"22\",viewBox:\"0 0 22 22\",fill:\"none\",\"aria-label\":\"Pause\",style:{display:\"block\"},children:[/*#__PURE__*/_jsx(\"rect\",{x:\"5\",y:\"4\",width:\"4\",height:\"14\",rx:\"1.5\",fill:iconColor}),/*#__PURE__*/_jsx(\"rect\",{x:\"13\",y:\"4\",width:\"4\",height:\"14\",rx:\"1.5\",fill:iconColor})]}):// Play icon\n/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsxs(\"g\",{children:[/*#__PURE__*/_jsx(\"path\",{d:\"M 0 0 L 24 0 L 24 24 L 0 24 Z\",fill:\"rgba(0, 0, 0, 0)\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M 12 2.25 C 6.615 2.25 2.25 6.615 2.25 12 C 2.25 17.385 6.615 21.75 12 21.75 C 17.385 21.75 21.75 17.385 21.75 12 C 21.744 6.618 17.382 2.256 12 2.25 Z M 15.802 12.617 L 10.927 15.992 C 10.697 16.15 10.399 16.168 10.152 16.039 C 9.905 15.909 9.751 15.654 9.75 15.375 L 9.75 8.625 C 9.75 8.346 9.905 8.09 10.152 7.96 C 10.399 7.831 10.698 7.849 10.927 8.008 L 15.802 11.383 C 16.005 11.523 16.126 11.754 16.126 12 C 16.126 12.246 16.005 12.477 15.802 12.617 Z\",fill:\"rgb(0, 18, 77)\"})]})})}),/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:600},children:label}),/*#__PURE__*/_jsx(\"audio\",{ref:audioRef,src:audioFile,preload:\"auto\"})]});}addPropertyControls(AudioPlayerButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Listen Now\"},audioFile:{type:ControlType.File,allowedFileTypes:[\"mp3\",\"wav\",\"ogg\"]},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#D8D9DF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#00124D\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#00124D\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:100,min:0,max:100},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"Cabinet Grotesk\",defaultValue:{fontSize:\"18px\",variant:\"Bold\",letterSpacing:\"-0.01em\",lineHeight:\"100%\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AudioPlayerButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"180\",\"framerIntrinsicHeight\":\"48\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AudioPlayerButton.map"],
  "mappings": "oGAUkB,SAARA,EAAmCC,EAAM,CAAC,GAAK,CAAC,MAAAC,EAAM,UAAAC,EAAU,qEAAqE,WAAAC,EAAW,UAAAC,EAAU,UAAAC,EAAU,aAAAC,EAAa,KAAAC,EAAK,MAAAC,CAAK,EAAER,EAAYS,EAASC,EAAO,IAAI,EAAO,CAACC,EAAQC,CAAU,EAAEC,EAAS,EAAK,EAAO,CAACC,EAAUC,CAAY,EAAEF,EAAS,EAAK,EAAEG,EAAU,IAAI,CAAC,GAAG,CAACP,EAAS,QAAQ,OAAO,IAAMQ,EAAMR,EAAS,QAAcS,EAAY,IAAIC,EAAgB,IAAIP,EAAW,EAAK,CAAC,EAAE,OAAAK,EAAM,iBAAiB,QAAQC,CAAW,EAAQ,IAAID,EAAM,oBAAoB,QAAQC,CAAW,CAAE,EAAE,CAAC,CAAC,EAAEF,EAAU,IAAI,CAAKP,EAAS,UAAkBE,EAASF,EAAS,QAAQ,KAAK,GAAQA,EAAS,QAAQ,MAAM,EAAEA,EAAS,QAAQ,YAAY,GAAG,EAAE,CAACE,CAAO,CAAC,EAAE,SAASS,GAAa,CAACD,EAAgB,IAAIP,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EAAK,QAAQ,CAAC,IAAIZ,EAAS,IAAIP,EAAU,QAAQ,MAAM,CAAC,CAAC,CAAC,CAAC,CAAE,CAACsB,EAAoBzB,EAAkB,CAAC,MAAM,CAAC,KAAK0B,EAAY,OAAO,MAAM,QAAQ,aAAa,YAAY,EAAE,UAAU,CAAC,KAAKA,EAAY,KAAK,iBAAiB,CAAC,MAAM,MAAM,KAAK,CAAC,EAAE,WAAW,CAAC,KAAKA,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,UAAU,CAAC,KAAKA,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,UAAU,CAAC,KAAKA,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,aAAa,CAAC,KAAKA,EAAY,OAAO,MAAM,SAAS,aAAa,IAAI,IAAI,EAAE,IAAI,GAAG,EAAE,KAAK,CAAC,KAAKA,EAAY,KAAK,MAAM,OAAO,SAAS,WAAW,gBAAgB,kBAAkB,aAAa,CAAC,SAAS,OAAO,QAAQ,OAAO,cAAc,UAAU,WAAW,MAAM,CAAC,CAAC,CAAC",
  "names": ["AudioPlayerButton", "props", "label", "audioFile", "background", "textColor", "iconColor", "borderRadius", "font", "style", "audioRef", "pe", "playing", "setPlaying", "ye", "isHovered", "setIsHovered", "ue", "audio", "handleEnded", "Z", "handleClick", "p", "RenderTarget", "u", "addPropertyControls", "ControlType"]
}
