{"version":3,"file":"shared-lib.D8uHOsoU.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/lgBoQxNllKFfCc4ryt8E/tbTW6BW2wqcUDJfnc0xD/profileStore.js","https:/framerusercontent.com/modules/6XP7Q2uMwCNydLEakM1u/S7U0HWM4zsiU1wkCO9V8/constants.js","https:/framerusercontent.com/modules/pBL9xlYciLON0IYG5ZYl/IsetwQdmzbUEG8JeLKq0/apiClient.js","https:/framerusercontent.com/modules/n8u57irDuaMZ0wovemvs/l4rMihUDvefDiGgTVUz3/siteMetadata.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","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","/**\n * FILE: profileStore.ts\n * LOCATION: framer/stores/profileStore.ts\n * LAYER: Store (Domain State – Profile & Session)\n *\n * RESPONSIBILITY:\n * - Hold authenticated user state\n * - Store profile fields (name, email, address)\n * - Track authentication status (authenticated, loading, fetched)\n *\n * DOES NOT:\n * - Validate session (SessionProvider owns that)\n * - Handle login form draft state (authStore owns that)\n * - Perform profile mutations directly\n *\n * AUTHORITY:\n * - Session validity: GET /auth/me\n * - Profile data: GET /profile\n *\n * DATA FLOW:\n * SessionProvider / ProfileProvider → profileStore → Profile & Nav UI\n */import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";export const useProfileStore=createStore({loading:false,fetched:false,authenticated:false,email:undefined,firstName:undefined,lastName:undefined,displayName:undefined,defaultAddress:undefined,profileComplete:false,error:undefined});\nexport const __FramerMetadata__ = {\"exports\":{\"DefaultAddress\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ProfileState\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useProfileStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./profileStore.map","/**\n * FILE: constants.ts\n * LOCATION: framer/api/constants.ts\n * LAYER: API (Configuration)\n *\n * RESPONSIBILITY:\n * - Define shared API-related constants\n * - Centralize endpoint paths or configuration values\n *\n * DOES NOT:\n * - Perform HTTP calls\n * - Store application state\n * - Contain domain logic\n *\n * AUTHORITY:\n * - Static frontend configuration only\n */export const API_BASE=\"https://api.importa-coffee.com\";export const AUTH_ME_PATH=\"/auth/me\";export const AUTH_START_PATH=\"/auth/start\";export const AUTH_LOGOUT_PATH=\"/auth/logout\";export const PRODUCT_CACHE_KEY=\"importa_product_cache\";export const CATALOG_CACHE_KEY=\"importa_catalog_information_v1\";export const CATALOG_CACHE_TTL=10*60*1e3;export const PRODUCT_CACHE_TTL=60*60*1e3;\nexport const __FramerMetadata__ = {\"exports\":{\"AUTH_ME_PATH\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"API_BASE\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AUTH_START_PATH\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CATALOG_CACHE_TTL\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PRODUCT_CACHE_KEY\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AUTH_LOGOUT_PATH\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CATALOG_CACHE_KEY\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PRODUCT_CACHE_TTL\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./constants.map","/**\n * FILE: apiClient.ts\n * LOCATION: framer/api/apiClient.ts\n * LAYER: API (HTTP Transport Layer)\n *\n * RESPONSIBILITY:\n * - Provide a centralized wrapper around fetch\n * - Apply base API URL configuration\n * - Ensure credentials: \"include\" for cookie-based auth\n * - Normalize error handling for frontend\n *\n * DOES NOT:\n * - Store application state\n * - Contain business logic\n * - Transform domain data\n *\n * AUTHORITY:\n * - Backend API at https://api.importa-coffee.com\n *\n * DATA FLOW:\n * Override / Controller → apiClient → Backend API → JSON Response\n */import{API_BASE}from\"https://framerusercontent.com/modules/6XP7Q2uMwCNydLEakM1u/S7U0HWM4zsiU1wkCO9V8/constants.js\";export async function apiFetch(path,options={}){try{const res=await fetch(`${API_BASE}${path}`,{credentials:\"include\",headers:{Accept:\"application/json\",\"Content-Type\":\"application/json\",...options.headers||{}},...options});const data=await res.json().catch(()=>({}));return{ok:res.ok,status:res.status,data};}catch(error){return{ok:false,status:0,data:{error:\"network_error\"}};}}\nexport const __FramerMetadata__ = {\"exports\":{\"apiFetch\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Generated by Framer (f21d278)\nexport default function metadata(params,activeLocale){return{description:\"Made with Framer\",robots:\"max-image-preview:large\",title:\"Importa Coffee\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"oKAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,CAAC,CAClD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,MAAM,EAAE,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,EAAS,CAAC,EAChI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAW,EAAE,EAAW,OAAO,GAAW,SAAS,OAAO,OAAO,CAAC,GAAG,EAAW,GAAG,EAAS,CAAC,CAAC,EACjJ,EAAa,QAAQ,GAAQ,EAAO,EAAW,CAAC,EAChD,SAAS,GAAU,CACnB,G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