{"version":3,"file":"Examples.mLbp0rW1.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/JZreMQ2KPaifPK2yorkF/SL6oml1fnuVCIAJuSBdI/Examples.js"],"sourcesContent":["export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";import{useScroll,useTransform}from\"framer-motion\";// Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore=createStore({background:\"#0099FF\",feature:\"none\",variant:\"\",workspaceId:\"\",channel:\"\",owner:\"\",proPlan:\"\"});export function withRotate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,animate:{rotate:90},transition:{duration:2}});};}export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}export function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}const sendCheckoutEvent=priceId=>{window.parent.postMessage({type:\"OPEN_INLINE_CHECKOUT\",priceId},\"*\");};export function withWorkspaceId(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{if(window){const searchParams=new URLSearchParams(window.location.search);const workspace_id=searchParams.get(\"workspace_id\");const channel=searchParams.get(\"channel\");const owner=searchParams.get(\"is_owner\");const interactionType=searchParams.get(\"interaction_type\");// const premium_animation = searchParams.get(\"feature\")\nif(workspace_id){setStore({workspaceId:workspace_id});}if(channel){setStore({channel:channel});}if(owner){setStore({owner:owner});}if(interactionType){setStore({interactionType:interactionType});}// if (premium_animation) {\n//     setStore({ premiumAnimation: premium_animation })\n// }\n}},[]);// console.log(store.premiumAnimation)\n// console.log(store.channel)\nreturn /*#__PURE__*/_jsx(Component,{...props,onClick:e=>{e.preventDefault();const hrefURL=new URL(props.link);const priceId=hrefURL.searchParams.get(\"price_id\");// console.log(\"price_id\", priceId)\nif(store.interactionType===\"event\"){sendCheckoutEvent(priceId);}else{const linkUrl=`${props.link}&workspace_id=${store.workspaceId}&channel=${store.channel}&is_owner=${store.owner}`;window.open(linkUrl);}}});};}export function withDraggable(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,drag:true,// dragConstraints={{ top: -50, left: -50, right: 50, bottom: 50 }}\ndragTransition:{bounceStiffness:600,bounceDamping:20},whileTap:{cursor:\"grabbing\"}});};}export function withScrolledProgress(Component){const startY=0// scroll position when animation starts\n;const distance=1e3// scroll distance after which animation ends\n;const endY=startY+distance;return props=>{const{scrollY}=useScroll();const progress=useTransform(scrollY,[startY,endY],[0,1]);return /*#__PURE__*/_jsx(Component,{...props,progress:progress});};}// get the parameters from the url\nexport function setUseCase(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{if(window){const feature=new URLSearchParams(window.location.search).get(\"feature\");// console.log(feature)\nswitch(feature){case\"file-upload-limit\":case\"file-upload-limit-almost-reached\":case\"file-upload-limit-exceeded\":case\"file-upload-limit-exceeded-no-access\":case\"edit-limit\":case\"edit-limit-almost-reached\":case\"edit-limit-exceeded\":setStore({feature:\"flex\",variant:feature});break;default:setStore({feature:\"none\"});}}},[]);return /*#__PURE__*/_jsx(Component,{...props});};}// set the banner component\nexport function getFeature(Component){return props=>{const[store,setStore]=useStore();const getDisplay=()=>{// console.log(\"get use case \", store.feature)\nreturn store.feature;};const getVariant=()=>{// console.log(\"get mode \", store.mode)\nreturn store.variant;};return /*#__PURE__*/_jsx(Component,{...props,variant:getVariant(),style:{display:getDisplay(),width:\"100%\"}});};}// Strapi API numbers\nexport function withStrapiNumbers(Component){return props=>{const[userCount,setUserCount]=useState(\"\");const[companyCount,setCompanyCount]=useState(\"\");useEffect(()=>{fetch(\"https://lottiefiles.com/api/settings\").then(response=>response.json()).then(data=>{const newUserCount=data.users_count.replace(/ million\\+/g,\"\");setUserCount(newUserCount);setCompanyCount(data.companies_count);}).catch(error=>console.error(error));},[]);const oriText=props.children.props.children.props.children;const oriCmsText=props.text;const strapiNumbers=typeof oriCmsText==\"undefined\"?oriText.replace(\"{users}\",userCount).replace(\"{companies}\",companyCount):oriCmsText.replace(\"{users}\",userCount).replace(\"{companies}\",companyCount);return /*#__PURE__*/_jsx(Component,{...props,text:strapiNumbers});};}export function withPremiumAnimation(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{if(window){const searchParams=new URLSearchParams(window.location.search);const premium_animation=searchParams.get(\"feature\");if(premium_animation==\"use-premium-assets\"){setStore({proPlan:\"none\"});}else{proPlan:\"flex\";}}},[]);const getDisplay=()=>{return store.proPlan;};// console.log(store.proPlan)\nreturn /*#__PURE__*/_jsx(Component,{...props,style:{display:getDisplay()}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setUseCase\":{\"type\":\"reactHoc\",\"name\":\"setUseCase\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withStrapiNumbers\":{\"type\":\"reactHoc\",\"name\":\"withStrapiNumbers\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDraggable\":{\"type\":\"reactHoc\",\"name\":\"withDraggable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withWorkspaceId\":{\"type\":\"reactHoc\",\"name\":\"withWorkspaceId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getFeature\":{\"type\":\"reactHoc\",\"name\":\"getFeature\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPremiumAnimation\":{\"type\":\"reactHoc\",\"name\":\"withPremiumAnimation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrolledProgress\":{\"type\":\"reactHoc\",\"name\":\"withScrolledProgress\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"kXAAa,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,SACf,CAWG,CADA,GAAG,EACO,qBEd8sB,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAU,GAAU,CAMtzB,OANuzB,MAAc,CAAC,GAAG,EAAO,CAAC,IAAM,EAAa,IAAI,gBAA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