{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framerusercontent.com/modules/9nrjJ8Sqq53QSLtMlufX/RumK2yMAv9rPjFcA8OUP/PriceCard.js"],
  "sourcesContent": ["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map", "import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */const useStore=createStore({background:\"#0099FF\",cart:[],currency:\"GBP\"});// Convert from USD base\nfunction convertPrice(basePrice,currency){const numPrice=parseFloat(basePrice);if(isNaN(numPrice))return basePrice;const rates={USD:1,GBP:.67,EUR:.87};const rate=rates[currency]??1;const converted=numPrice*rate;// Round to nearest 10\nconst rounded=Math.round(converted/10)*10;return rounded.toString();}export default function PriceCard(props){const[store,setStore]=useStore();useEffect(()=>{const fetchData=async()=>{try{const response=await fetch(\"https://opensheet.elk.sh/1-2DpOGvgnI0AnYhEO376XEwGTouJgHFCWzfbIyXHOVw/Sheet1\");const data=await response.json();setStore({allData:data});}catch(error){console.error(\"Error fetching data from Google Sheet:\",error);}};fetchData();},[]);const{tint,room,stories,slug,fromHeader,fromMobile,price,fromListingDetail}=props;const[filteredItems,setFilteredItems]=useState(room);const[mySlug,setMySlug]=useState(slug??\"null\");const handleCurrency=value=>setStore({currency:value});return /*#__PURE__*/_jsx(_Fragment,{children:fromHeader?/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:\"5px\",padding:\"10px\",borderRadius:\"12px\",backgroundColor:\"#fff\",maxWidth:\"150px\",margin:\"0 auto\",width:\"150px\"},children:[\"USD\",\"GBP\",\"EUR\"].map(currency=>/*#__PURE__*/_jsxs(\"button\",{onClick:()=>handleCurrency(currency),style:{...buttonStyle,display:\"flex\",alignItems:\"center\",gap:\"8px\",padding:\"8px 16px\",borderRadius:\"20px\",fontFamily:\"poltawski Nowy\",marginBottom:\"6px\"},onMouseEnter:e=>e.target.style.backgroundColor=\"#e2e8f0\",onMouseLeave:e=>e.target.style.backgroundColor=\"#f1f5f9\",children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"10px\",height:\"10px\",borderRadius:\"50%\",backgroundColor:store.currency===currency?\"#806B52\":\"#f1f5f9\"}}),currency===\"USD\"&&\"$\",currency===\"GBP\"&&\"\\xa3\",currency===\"EUR\"&&\"\u20AC\",\" \",currency]},currency))}):/*#__PURE__*/_jsx(\"div\",{children:/*#__PURE__*/_jsxs(\"h1\",{style:{color:\"#000\",fontSize:fromListingDetail?\"12px\":fromMobile?\"12px\":\"20px\"},children:[store.currency===\"USD\"&&\"$\",store.currency===\"GBP\"&&\"\\xa3\",store.currency===\"EUR\"&&\"\u20AC\",convertPrice(price,store.currency)]})})});}const buttonStyle={padding:\"8px\",border:\"0px solid #cbd5e1\",fontWeight:\"bold\",cursor:\"pointer\",width:\"90%\",alignSelf:\"center\",transition:\"background 0.5s\"};addPropertyControls(PriceCard,{tint:{title:\"Tint\",type:ControlType.Number,defaultValue:10},price:{title:\"Price\",type:ControlType.String,defaultValue:\"10\"},room:{title:\"Room\",type:ControlType.String,defaultValue:\"\"},stories:{title:\"Stories\",type:ControlType.String,defaultValue:\"\"},slug:{title:\"slug\",type:ControlType.String,defaultValue:\"\"},fromHeader:{title:\"fromHeader\",type:ControlType.Boolean,defaultValue:true},fromListingDetail:{title:\"fromListingDetail\",type:ControlType.Boolean,defaultValue:false},fromMobile:{title:\"From Mobile\",type:ControlType.Boolean,defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PriceCard\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PriceCard.map"],
  "mappings": "mIAAqF,SAASA,EAAYC,EAAO,CACjH,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGF,CAAM,CAAC,CAAC,CAAC,EACjDG,EAAaC,GAAU,CAC1B,OAAOA,GAAW,aAAYA,EAASA,EAASH,EAAU,KAAK,GAAGA,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOL,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC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amB,EAAMX,EAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,IAAMuB,EAAY,CAAC,QAAQ,MAAM,OAAO,oBAAoB,WAAW,OAAO,OAAO,UAAU,MAAM,MAAM,UAAU,SAAS,WAAW,iBAAiB,EAAEE,EAAoB3B,EAAU,CAAC,KAAK,CAAC,MAAM,OAAO,KAAK4B,EAAY,OAAO,aAAa,EAAE,EAAE,MAAM,CAAC,MAAM,QAAQ,KAAKA,EAAY,OAAO,aAAa,IAAI,EAAE,KAAK,CAAC,MAAM,OAAO,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,QAAQ,CAAC,MAAM,UAAU,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,KAAK,CAAC,MAAM,OAAO,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,WAAW,CAAC,MAAM,aAAa,KAAKA,EAAY,QAAQ,aAAa,EAAI,EAAE,kBAAkB,CAAC,MAAM,oBAAoB,KAAKA,EAAY,QAAQ,aAAa,EAAK,EAAE,WAAW,CAAC,MAAM,cAAc,KAAKA,EAAY,QAAQ,aAAa,EAAK,CAAC,CAAC",
  "names": ["createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "useStore", "createStore", "convertPrice", "basePrice", "currency", "numPrice", "rate", "converted", "PriceCard", "props", "store", "setStore", "ue", "data", "error", "tint", "room", "stories", "slug", "fromHeader", "fromMobile", "price", "fromListingDetail", "filteredItems", "setFilteredItems", "ye", "mySlug", "setMySlug", "handleCurrency", "value", "p", "l", "u", "buttonStyle", "e", "addPropertyControls", "ControlType"]
}
