{"version":3,"file":"utils.BKw98aQJ.mjs","names":[],"sources":["https:/framerusercontent.com/modules/tfq8EDfrazNLXzc9LJte/hLcdFz4t8UjInDMvzq41/utils.js"],"sourcesContent":["import{isBrowser}from\"framer-motion\";import{useLayoutEffect}from\"react\";export const DEFAULT_FONT_FAMILY=`\"Inter\", system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"`;export function getFlexboxValues(position){const positionParts=position.split(\"-\");let justifyContent,alignItems;switch(positionParts[0]){case\"top\":alignItems=\"flex-start\";break;case\"bottom\":alignItems=\"flex-end\";break;case\"center\":alignItems=\"center\";break;default:alignItems=\"initial\";break;}switch(positionParts[1]){case\"left\":justifyContent=\"flex-start\";break;case\"right\":justifyContent=\"flex-end\";break;case\"center\":justifyContent=\"center\";break;default:justifyContent=\"initial\";break;}return{justifyContent,alignItems};}export function getMultipleShadows(...shadows){const output=[];shadows.forEach(shadow=>{return shadow&&output.push(shadow);});return output.join(\", \");}export function getShadow(shadow){if(shadow){return`${shadow.shadowX}px ${shadow.shadowY}px ${shadow.shadowBlur}px ${shadow.shadowColor}`;}else return null;}export function safeJSONParse(jsonString,onError){try{return JSON.parse(jsonString);}catch{if(onError)onError();}}export const getCookie=(name,cookies)=>{cookies=cookies?cookies:isBrowser?document.cookie:\"\";var _cookies_match;const[,,cookie]=(_cookies_match=cookies.match(`(^|;) ?${name}=([^;]*)(;|$)`))!==null&&_cookies_match!==void 0?_cookies_match:[null,null,null];return cookie;};/**\n * Yields to main thread before continuing execution, which might allow the browser to paint.\n * If `options.priority` is 'user-blocking', it will asynchronously resolve in older browsers.\n * @param {object} options - see https://github.com/WICG/scheduling-apis/blob/main/explainers/yield-and-continuation.md\n * @see interactionResponse for guaranteeing execution after a paint\n */export function yieldToMain(options){if(\"scheduler\"in window){if(\"yield\"in scheduler)return scheduler.yield(options);if(\"postTask\"in scheduler)return scheduler.postTask(()=>{},options);}if((options===null||options===void 0?void 0:options.priority)===\"user-blocking\"){// `setTimeout` could suffer from being delayed for longer: https://developer.chrome.com/blog/introducing-scheduler-yield-origin-trial#the_problem_with_current_yielding_strategies\n// so for browsers not supporting yield, we guarantee execution for high priority actions, but this does not create space for a paint opportunity as trade-off.\nreturn Promise.resolve();}return new Promise(resolve=>{setTimeout(resolve);});}/**\n * Helper function for `yieldToMain`, which yields before calling `fn`.\n * @see yieldToMain\n */export async function yieldBeforeCb(fn,options){await yieldToMain(options);return fn();}/**\n * Similar to `yieldToMain`, but also waits for the next animation frame before yielding (with a fallback of 100ms if the animation frame never fires).\n * Compared to `yieldToMain`, it guarantees improved INP, but might make processing a little slower. Use only if necessary.\n * @see yieldToMain\n */export function interactionResponse(options){return new Promise(resolve=>{setTimeout(resolve,200)// Fallback for the case where the animation frame never fires.\n;requestAnimationFrame(()=>{void yieldBeforeCb(resolve,options);});});}/**\n * Runs `fn` after the next paint. Similar to `useEffect`, but *guarantees* that the function is run after the next paint.\n * @important Does not support a cleanup fn.\n * @see https://thoughtspile.github.io/2021/11/15/unintentional-layout-effect/\n */export function useAfterPaintEffect(fn,deps,options){useLayoutEffect(()=>{const runAfterPaint=async()=>{await interactionResponse(options);fn();};void runAfterPaint();// eslint-disable-next-line react-hooks/exhaustive-deps -- deps are passed in\n},deps);}\nexport const __FramerMetadata__ = {\"exports\":{\"useAfterPaintEffect\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getCookie\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"safeJSONParse\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getFlexboxValues\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"yieldBeforeCb\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getShadow\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getMultipleShadows\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"FlexboxPosition\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"yieldToMain\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"interactionResponse\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEFAULT_FONT_FAMILY\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./utils.map"],"mappings":"qJAA6Q,SAAgB,EAAiB,EAAS,CAAC,IAAM,EAAc,EAAS,MAAM,GAAG,EAAM,EAAe,EAAW,OAAO,EAAc,GAArB,CAAyB,IAAI,MAAM,EAAW,aAAa,MAAM,IAAI,SAAS,EAAW,WAAW,MAAM,IAAI,SAAS,EAAW,SAAS,MAAM,QAAQ,EAAW,UAAU,KAAM,CAAC,OAAO,EAAc,GAArB,CAAyB,IAAI,OAAO,EAAe,aAAa,MAAM,IAAI,QAAQ,EAAe,WAAW,MAAM,IAAI,SAAS,EAAe,SAAS,MAAM,QAAQ,EAAe,UAAU,KAAM,CAAC,MAAM,CAAC,iBAAe,YAAU,CAAE,CAAC,SAAgB,EAAmB,GAAG,EAAQ,CAAC,IAAM,EAAO,CAAC,EAAiE,OAA/D,EAAQ,QAAQ,GAAgB,GAAQ,EAAO,KAAK,CAAM,CAAG,EAAS,EAAO,KAAK,IAAI,CAAE,CAAC,SAAgB,EAAU,EAAO,CAA+G,OAA3G,EAAc,GAAG,EAAO,QAAQ,KAAK,EAAO,QAAQ,KAAK,EAAO,WAAW,KAAK,EAAO,cAA2B,IAAK,CAAC,SAAgB,EAAc,EAAW,EAAQ,CAAC,GAAG,CAAC,OAAO,KAAK,MAAM,CAAU,CAAE,MAAM,CAAI,GAAQ,EAAQ,CAAE,CAAC,CAK9rC,SAAgB,EAAY,EAAQ,CAAC,GAAG,cAAc,EAAO,CAAC,GAAG,UAAU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