{"version":3,"file":"EmbedGallery.BcFcvmfP.mjs","names":[],"sources":["https:/framerusercontent.com/modules/TPdEYf0R9itPboX3t0B7/jnCQ7ACdwEmBcumMXpIT/EmbedGallery.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const convertGalleryId=galleryId=>{if(!galleryId)return\"\";if(galleryId.startsWith(\"gal_\")){return galleryId;}if(galleryId.startsWith(\"<script\")){return galleryId.split(' id=\"')[1].split('\"')[0];}// https://picflow.com/a/gallery/Aey54i9mTZUaRNLM/designer\nif(galleryId.includes(\"/a/gallery/\")){const idFromUrl=galleryId.split(\"/a/gallery/\")[1].split(\"/\")[0];console.log({idFromUrl});if(idFromUrl.startsWith(\"gal_\"))return idFromUrl;return\"gal_\"+idFromUrl;}return\"gal_\"+galleryId;};/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 700\n */export default function EmbedGallery(props){// Create and append the new script\nif(typeof window===\"undefined\")return;useEffect(()=>{if(document.getElementById(\"picflow-embed-script\"))return;const script=document.createElement(\"script\");script.src=\"https://picflow.com/embed/main.js\";script.type=\"module\";script.async=true;script.id=\"picflow-embed-script\";document.head.appendChild(script);return()=>{};},[]);const refId=Math.random().toString();// update attributes when props change\nuseEffect(()=>{const galleryEl=document.querySelector('[data-framer-ref-id=\"'+refId+'\"]');if(!galleryEl)return;if(props.lightboxEnabled){galleryEl.setAttribute(\"lightbox\",props.lightbox);}else{galleryEl.removeAttribute(\"lightbox\");}galleryEl.setAttribute(\"id\",convertGalleryId(props.galleryId));galleryEl.setAttribute(\"downloads\",props.download);galleryEl.setAttribute(\"protection\",props.protection);galleryEl.setAttribute(\"no-padding\",props.padding?\"false\":\"true\");galleryEl.setAttribute(\"show-cover\",props.showCover?\"true\":\"false\");},[props.galleryId,props.lightbox,props.lightboxEnabled,props.download,props.protection,props.padding,props.showCover]);return /*#__PURE__*/_jsx(\"picflow-gallery\",{id:convertGalleryId(props.galleryId),\"framer-ref-id\":refId,lightbox:props.lightboxEnabled?props.lightbox:undefined,downloads:props.download,protection:props.protection,\"no-padding\":!props.padding,\"no-background\":\"true\",\"show-cover\":props.showCover,mode:\"framer\"});}EmbedGallery.displayName=\"Embed Gallery\";EmbedGallery.defaultProps={galleryId:\"\",lightbox:\"rgba(0, 0, 0, 0.8)\",lightBoxEnabled:true,download:false,protection:false,padding:false,showCover:false};addPropertyControls(EmbedGallery,{galleryId:{type:ControlType.String,title:\"Gallery\",description:\"Paste Gallery ID, URL, or Embed Code.\"},lightboxEnabled:{type:ControlType.Boolean,title:\"Lightbox Enabled\"},lightbox:{type:ControlType.Color,title:\"Lightbox Color\",hidden(props){return props.lightboxEnabled===false;}},download:{type:ControlType.Boolean,title:\"Downloads\",enabledTitle:\"On\",disabledTitle:\"Off\",description:\"[Only available with Picflow Pro](https://picflow.com/pricing)\"},protection:{type:ControlType.Boolean,title:\"Right Click Protection\",enabledTitle:\"On\",disabledTitle:\"Off\",description:\"[Only available with Picflow Pro](https://picflow.com/pricing)\"},padding:{type:ControlType.Boolean,title:\"Padding\",enabledTitle:\"On\",disabledTitle:\"Off\"},showCover:{type:ControlType.Boolean,title:\"Cover\",enabledTitle:\"Show\",disabledTitle:\"Hide\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EmbedGallery\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"700\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmbedGallery.map"],"mappings":"yLAKG,SAAwB,EAAa,EAAM,CAC9C,GAAU,IAAS,OAAY,OAAO,MAAc,CAAC,GAAG,SAAS,eAAe,uBAAuB,CAAC,OAAO,IAAM,EAAO,SAAS,cAAc,SAAS,CAA0J,MAAzJ,GAA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