{"version":3,"file":"ZonePin.CMd6Bvdf.mjs","names":[],"sources":["https:/framerusercontent.com/modules/8YjRbiVsAa1bMlMIYuZ2/XwZbpFclYzTeA2tCuzTJ/ZonePin.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget,useIsStaticRenderer}from\"framer\";const withDefaults=(props,defaults)=>{const out={...defaults};for(const k in props)if(props[k]!==undefined)out[k]=props[k];return out;};function getStore(){if(typeof window===\"undefined\")return null;const w=window;if(!w.__thres){w.__thres={zone:0,age:34,days:{},dayRefs:{},phases:{},phaseRefs:{},subs:new Set,v:0};}return w.__thres;}/**\n * Sets the page to one zone when it loads. Put it on a class or coach page\n * and bind \"Zone\" to the CMS, and the page's zone meters and labels take\n * that zone. It draws nothing.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ZonePin(raw){const props=withDefaults(raw,DEFAULTS);const zone=Math.min(5,Math.max(1,Math.round(Number(props.zone)||4)));const delay=Math.min(1,Math.max(0,Number(props.delay)||0));const isStatic=useIsStaticRenderer();React.useEffect(()=>{if(isStatic||RenderTarget.current()===RenderTarget.canvas)return;const s=getStore();if(!s)return;const write=()=>{s.zone=zone;s.openDay=\"\";// The theme component may mount a moment later; it applies the stored zone itself.\nif(s.apply)s.apply(zone);s.v++;s.subs.forEach(fn=>fn());};// A visitor who arrives from another page is still looking at that page's zone:\n// let the new page settle, then move. A fresh load has nothing to move from.\nconst arriving=!!s.zone&&s.zone!==zone;const still=!!window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;const wait=arriving&&!still?Math.round(delay*1e3):0;if(!wait){write();return;}const t=setTimeout(write,wait);return()=>clearTimeout(t);},[zone,delay,isStatic]);return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{width:\"100%\",height:\"100%\",pointerEvents:\"none\"}});}const DEFAULTS={zone:4,delay:.45};addPropertyControls(ZonePin,{zone:{type:ControlType.Number,title:\"Zone\",defaultValue:4,min:1,max:5,step:1,displayStepper:true},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:.45,min:0,max:1,step:.05,unit:\"s\",description:\"The wait before the page takes this zone when a visitor arrives from another page. A fresh load takes it at once.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ZonePin\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ZonePin.map"],"mappings":"uMAAoS,SAAS,GAAU,CAAC,GAAU,IAAS,OAAY,OAAO,KAAK,IAAM,EAAE,EAA4G,MAArG,CAAe,EAAE,UAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC,EAAU,EAAE,OAAQ,CAOre,SAAwB,EAAQ,EAAI,CAAC,IAAM,EAAM,EAAa,EAAI,CAAQ,EAAQ,EAAK,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,OAAO,EAAM,IAAI,GAAG,CAAC,CAAC,CAAC,EAAQ,EAAM,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,OAAO,EAAM,KAAK,GAAG,CAAC,CAAC,EAAQ,EAAS,EAAoB,EAGoD,OAHlD,MAAoB,CAAC,GAAG,GAAU,EAAa,QAAQ,IAAI,EAAa,OAAO,OAAO,IAAM,EAAE,EAAS,EAAE,GAAG,CAAC,EAAE,OAAO,IAAM,MAAU,CAAC,EAAE,KAAK,EAAK,EAAE,QAAQ,GAC9Y,EAAE,OAAM,EAAE,MAAM,CAAI,EAAE,EAAE,IAAI,EAAE,KAAK,QAAQ,GAAI,EAAG,CAAC,CAAE,EAElD,EAAS,CAAC,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