{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/tW1ExjbbJRt9YcZ0Gyxk/7xLQ6of7kXWmBUVuRiYG/Spotify.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useCallback}from\"react\";const urlRegex=/(https?:\\/\\/[^ ]*)/;/**\n * SPOTIFY\n *\n * @framerIntrinsicWidth 280\n * @framerIntrinsicHeight 350\n */ export function Spotify(props){const{theme,url:sourceUrl}=props;const createEmbedUrl=useCallback(()=>{if(sourceUrl.length<5)return null;// If someone pastes the embed code lets still try to render it\nconst strippedUrl=sourceUrl.includes(\"iframe\")?sourceUrl.match(urlRegex)[1].replace(`\"`,\"\"):sourceUrl;const url=new URL(strippedUrl);// Add embed prefix if needed\nif(!url.pathname.includes(\"embed\"))url.pathname=`/embed${url.pathname}`;// Remove params\nurl.search=`theme=${theme}`;// @ben you could add all other bools in here like\n// url.search = `theme=${theme}&dog=${cat}`\nreturn url.toString();},[theme,sourceUrl]);const identifier=createEmbedUrl();return(/*#__PURE__*/ _jsx(\"iframe\",{style:{height:\"100%\",width:\"100%\"},frameBorder:0,src:identifier}));}Spotify.defaultProps={url:\"https://open.spotify.com/album/31qVWUdRrlb8thMvts0yYL?si=Jl-8Mnc3RNGuOtqRC7NXVg\",width:280,height:350,theme:1};addPropertyControls(Spotify,{url:{type:ControlType.String,title:\"URL\"},theme:{type:ControlType.Enum,displaySegmentedControl:true,options:[1,0],optionTitles:[\"On\",\"Off\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"Spotify\":{\"type\":\"reactComponent\",\"name\":\"Spotify\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"350\",\"framerIntrinsicWidth\":\"280\"}}}}\n//# sourceMappingURL=./Spotify.map"],
  "mappings": "8DAA8H,IAAMA,EAAS,qBAKlI,SAASC,EAAQC,EAAM,CAAC,GAAK,CAAC,MAAAC,EAAM,IAAIC,CAAS,EAAEF,EAKbG,EALwCC,EAAY,IAAI,CAAC,GAAGF,EAAU,OAAO,EAAE,OAAO,KACvI,IAAMG,EAAYH,EAAU,SAAS,QAAQ,EAAEA,EAAU,MAAMJ,CAAQ,EAAE,CAAC,EAAE,QAAQ,IAAI,EAAE,EAAEI,EAAgBI,EAAI,IAAI,IAAID,CAAW,EACnI,OAAIC,EAAI,SAAS,SAAS,OAAO,IAAEA,EAAI,SAAS,SAASA,EAAI,QAAQ,IACrEA,EAAI,OAAO,SAASL,CAAK,GAElBK,EAAI,SAAS,CAAE,EAAE,CAACL,EAAMC,CAAS,CAAC,EAAkC,EAAE,OAAqBK,EAAK,SAAS,CAAC,MAAM,CAAC,OAAO,OAAO,MAAM,MAAM,EAAE,YAAY,EAAE,IAAIJ,CAAU,CAAC,CAAG,CAACJ,EAAQ,aAAa,CAAC,IAAI,kFAAkF,MAAM,IAAI,OAAO,IAAI,MAAM,CAAC,EAAES,EAAoBT,EAAQ,CAAC,IAAI,CAAC,KAAKU,EAAY,OAAO,MAAM,KAAK,EAAE,MAAM,CAAC,KAAKA,EAAY,KAAK,wBAAwB,GAAK,QAAQ,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC",
  "names": ["urlRegex", "Spotify", "props", "theme", "sourceUrl", "identifier", "te", "strippedUrl", "url", "p", "addPropertyControls", "ControlType"]
}
