{"version":3,"file":"Frameship.B6gaz8j8.mjs","names":["useState","FrameshipUpgradeBanner"],"sources":["https:/framerusercontent.com/modules/1kPVCHEEg0BrtObiM14s/xNKFRgtuwKHtOHN5lF5R/Frameship.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{createPortal}from\"react-dom\";import{useEffect,useState}from\"react\";import{parseFrameshipInfo,useCartStore}from\"https://framerusercontent.com/modules/ibjYTPLnMMPhPLNCj4uG/UGA9L3AHjilsXHVJhwyT/Cart.js\";import{UPGRADE_LINK}from\"https://framerusercontent.com/modules/gd3dcT3w5rYoRy7ZcKte/0LoogzhD5NepnGDaL2Il/Shared.js\";import FrameshipUpgradeBanner from\"https://framerusercontent.com/modules/b6p2QQlcwhhLAA5Operm/q9t93k88yG1i00iu3f0n/LOQtD1uPa.js\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export default function Frameship(props){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[portalContainer,setPortalContainer]=useState(null);const initializeCart=useCartStore(state=>state.initializeCart);useEffect(()=>{initializeCart===null||initializeCart===void 0?void 0:initializeCart();},[]);const attributes={};if(props.shopUrl){attributes[\"data-shop-url\"]=props.shopUrl;}if(props.shopifyAccessToken){attributes[\"data-shopify-access-token\"]=props.shopifyAccessToken;}if(props.projectId){attributes[\"data-project-id\"]=props.projectId;}if(props.productionDomain){attributes[\"data-production-domain\"]=props.productionDomain;}if(props.stagingDomain){attributes[\"data-staging-domain\"]=props.stagingDomain;}const{hasAccess}=parseFrameshipInfo(props.stagingDomain,props.productionDomain);useEffect(()=>{if(!isCanvas){const container=document.createElement(\"div\");document.body.appendChild(container);setPortalContainer(container);return()=>{document.body.removeChild(container);};}},[]);return /*#__PURE__*/_jsx(\"div\",{\"data-frameship-component\":true,...attributes,children:!isCanvas&&portalContainer&&!hasAccess&&/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(\"div\",{\"data-hello\":true,style:{position:\"fixed\",left:20,bottom:20},children:/*#__PURE__*/_jsx(FrameshipUpgradeBanner,{link:UPGRADE_LINK})}),portalContainer)});}Frameship.displayName=\"Frameship (Shopify)\";addPropertyControls(Frameship,{shopUrl:{type:ControlType.String,title:\"Shop URL\",preventLocalization:true,hidden:()=>true},shopifyAccessToken:{type:ControlType.String,preventLocalization:true,hidden:()=>true},projectId:{type:ControlType.String,preventLocalization:true,hidden:()=>true},productionDomain:{type:ControlType.String,preventLocalization:true,hidden:()=>true},stagingDomain:{type:ControlType.String,preventLocalization:true,hidden:()=>true},note:{type:ControlType.Enum,options:[\"IMPORTANT\"],displaySegmentedControl:true,description:\"*Do not delete this component.*\\n\\nThis component is managed by the [Frameship plugin](https://www.framer.com/marketplace/plugins/frameship--5sty6o8n22smpbcb4oypsggk6/)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Frameship\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"+gBAIG,SAAwB,EAAU,EAAM,CAAC,IAAM,EAAS,EAAa,SAAS,GAAG,EAAa,OAAY,CAAC,EAAgB,GAAoBA,EAAS,KAAK,CAAO,EAAe,EAAa,GAAO,EAAM,eAAe,CAAC,MAAc,CAAC,KAAsE,EAAG,EAAE,CAAC,CAAC,IAAM,EAAW,EAAE,CAAI,EAAM,UAAS,EAAW,iBAAiB,EAAM,SAAY,EAAM,qBAAoB,EAAW,6BAA6B,EAAM,oBAAuB,EAAM,YAAW,EAAW,mBAAmB,EAAM,WAAc,EAAM,mBAAkB,EAAW,0BAA0B,EAAM,kBAAqB,EAAM,gBAAe,EAAW,uBAAuB,EAAM,eAAe,GAAK,CAAC,aAAW,EAAmB,EAAM,cAAc,EAAM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