{"version":3,"file":"utils.11m7w8P5.mjs","names":[],"sources":["https:/framerusercontent.com/modules/RFM6zI5MxOiqwwNiQep4/2CcJhEanvh9oX5JHRkd8/send.js","https:/framerusercontent.com/modules/tfq8EDfrazNLXzc9LJte/hLcdFz4t8UjInDMvzq41/utils.js"],"sourcesContent":["import{isBrowser}from\"framer-motion\";export const DEFAULT_DOMAIN=\"https://www.googletagmanager.com\";export const DEFAULT_SCRIPT_NAME=\"gtm.js\";/**\n * Function to get and set dataLayer\n * @param dataLayer - The dataLayer\n * @param dataLayerName - The dataLayer name\n */const getDataLayerSnippet=(dataLayer,dataLayerName=\"dataLayer\")=>`window['${dataLayerName}']=window['${dataLayerName}']||[];`+(dataLayer?`window['${dataLayerName}'].push(${JSON.stringify(dataLayer)});`:\"\")+`window['${dataLayerName}'].push({'gtm.start':new Date().getTime(),event:'gtm.js'})`;/**\n * Function to get the GTM script\n * @param dataLayerName - The name of the dataLayer\n * @param customDomain - Custom domain for gtm\n * @param customScriptName - Custom script file name for gtm\n * @param environment - The parameters to use a custom environment\n * @param id - The id of the container\n */const getGTMScript=(dataLayerName,id,environment,customDomain=DEFAULT_DOMAIN,customScriptName=DEFAULT_SCRIPT_NAME)=>{let params=\"\";if(environment){const{gtm_auth,gtm_preview}=environment;params=`&gtm_auth=${gtm_auth}&gtm_preview=${gtm_preview}&gtm_cookies_win=x`;}return`${customDomain}/${customScriptName}?id=${id}${dataLayerName===\"dataLayer\"?\"\":`&l=${dataLayerName}`}${params}`;};/**\n * Function to setup the Google Tag Manager\n * @param params - The snippets params\n */const setupGTM=params=>{const getDataLayerScript=()=>{const dataLayerScript=document.createElement(\"script\");if(params.nonce){dataLayerScript.setAttribute(\"nonce\",params.nonce);}dataLayerScript.innerHTML=getDataLayerSnippet(params.dataLayer,params.dataLayerName);return dataLayerScript;};const getScript=()=>{const script=document.createElement(\"script\");if(params.nonce){script.setAttribute(\"nonce\",params.nonce);}script.src=getGTMScript(params.dataLayerName,params.id,params.environment,params.customDomain,params.customScriptName);script.crossOrigin=\"anonymous\"// allows for more detailed INP collection\n;return script;};return{getDataLayerScript,getScript};};/**\n * Function to init the GTM\n * @param dataLayer - The dataLayer\n * @param dataLayerName - The dataLayer name\n * @param environment - Specify the custom environment to use\n * @param nonce - Server-generated nonce\n * @param id - The ID of the GTM\n */export const initGTM=({dataLayer,dataLayerName,environment,nonce,id,customDomain,customScriptName})=>{const gtm=setupGTM({dataLayer,dataLayerName,environment,nonce,id,customDomain,customScriptName});const dataLayerScript=gtm.getDataLayerScript();const script=gtm.getScript();document.head.append(dataLayerScript,script);};export function sendToGTM(){if(isBrowser){window[\"dataLayer\"]=window[\"dataLayer\"]||[];window[\"dataLayer\"].push(arguments);}}\nexport const __FramerMetadata__ = {\"exports\":{\"DEFAULT_DOMAIN\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEFAULT_SCRIPT_NAME\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"initGTM\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"sendToGTM\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./send.map","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":"4JAsBqU,SAAgB,GAAW,CAAI,IAAW,EAAO,UAAa,EAAO,WAAc,EAAE,CAAC,EAAO,UAAa,KAAK,UAAU,mCAtBzZ,CAAa,EAAe,mCAAgD,EAAoB,SAI5H,GAAqB,EAAU,EAAc,cAAc,WAAW,EAAc,aAAa,EAAc,UAAU,EAAU,WAAW,EAAc,UAAU,KAAK,UA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