{"version":3,"file":"CursorFlickerFix.DXNX_cwN.mjs","names":[],"sources":["https:/framerusercontent.com/modules/vSl3joqPltZbvjc6UUpQ/s36y9WN0iq6gjUf1fwRo/CursorFlickerFix.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{RenderTarget,addPropertyControls,ControlType}from\"framer\";/**\n * Nav fixes bundle:\n *\n *  1. Ghost-nav fix — invisible stacked navbar instances no longer\n *     capture the mouse (pointer-events: none while hidden). Framer's\n *     cursor hit test (elementFromPoint) skips them for the same reason.\n *\n *     This used to run once on mount and again only on window resize.\n *     The navbar enters with a Framer \"Appear\" effect, so at mount it\n *     still sits at opacity 0.001 — the fix read that as \"hidden\", set\n *     pointer-events: none on the nav container, and never looked again.\n *     The nav then faded in looking perfectly normal but took no hover\n *     and no click until the window was resized.\n *\n *     T-173: the check re-runs when the nav could have changed, but never\n *     while scrolling: after the nav's own animations finish\n *     (getAnimations), at a few fixed times while the page settles,\n *     when scrolling stops (the nav has scroll variants), on nav\n *     animation/transition ends, resize, pageshow and tab visibility.\n *     No page-wide observer and no timer left running after 8 s.\n *\n *  2. Dropdown keeper — canvas navbar dropdowns survive small mouse\n *     detours: premature leave events are held for a grace period and\n *     only replayed if the pointer is genuinely gone.\n *\n * The yellow cursor dot this file used to draw over navbars, and the\n * stripping of Framer's cursor setting from navbar layers, are gone\n * (T-146). The navbar now carries the yellow variant of the site's own\n * Framer cursor component, so one cursor changes colour in place.\n */const DEFAULT_COLOR=\"#F5B31F\"// brand yellow, canvas placeholder only\n;const MENU_GRACE_MS=700;const RECT_MARGIN=28;/* Ghost-nav re-checks while the page (intro, appear effects, fonts) is\n   settling, then only on events; SCROLL_END_MS of quiet ends a scroll. */const RECHECK_AT_MS=[500,1e3,2e3,4e3,8e3];const SCROLL_END_MS=200;function isCanvasTarget(){return RenderTarget.current()===RenderTarget.canvas||RenderTarget.current()===RenderTarget.thumbnail||RenderTarget.current()===RenderTarget.export;}// The code navbar (MnzilNav) renders a <nav> WITHOUT framer- classes and\n// manages its own hover grace — it must be left alone by the keeper.\nfunction isCodeNav(el){return el.tagName===\"NAV\"&&!/(^|\\s)framer-/.test(el.className+\"\");}function findNavRoot(start){let cur=start;let root=null;while(cur&&cur!==document.body){if(cur.tagName===\"NAV\"){if(isCodeNav(cur))return null;root=cur;}else{const nm=cur.getAttribute?cur.getAttribute(\"data-framer-name\"):null;if(nm&&/nav/i.test(nm))root=cur;}cur=cur.parentElement;}return root;}function effectivelyHidden(el){let cur=el;while(cur&&cur!==document.documentElement){const s=window.getComputedStyle(cur);if(s.display===\"none\"||s.visibility===\"hidden\"||parseFloat(s.opacity)<.05){return true;}cur=cur.parentElement;}return false;}let started=false;// ---------------------------------------------------------------------\n// 1. Ghost-nav fix\n// ---------------------------------------------------------------------\nfunction startGhostNavFix(){const containerOf=root=>{let cur=root;let container=root;while(cur&&cur!==document.body){if(/-container(\\s|$)/.test((cur.className||\"\")+\" \")){container=cur;}cur=cur.parentElement;}return container;};const apply=()=>{const seen=new Set;const candidates=[];document.querySelectorAll(\"nav\").forEach(n=>{if(!isCodeNav(n))candidates.push(n);});document.querySelectorAll(\"[data-framer-name]\").forEach(n=>{const nm=n.getAttribute(\"data-framer-name\")||\"\";if(/nav/i.test(nm))candidates.push(n);});candidates.forEach(c=>{const target=containerOf(c);if(seen.has(target))return;seen.add(target);const hidden=effectivelyHidden(target);const want=hidden?\"none\":\"\";if(target.style.pointerEvents!==want){target.style.pointerEvents=want;}});};let scheduled=0;const schedule=()=>{if(scheduled)return;scheduled=window.setTimeout(()=>{scheduled=0;apply();},120);};/*\n     * Framer's Appear effect animates with the Web Animations API, which\n     * mutates no DOM attributes: wait for the animations running inside a\n     * nav to finish, then check once.\n     */const afterNavAnimations=()=>{if(typeof document.getAnimations!==\"function\")return;const running=document.getAnimations().filter(a=>{const t=a.effect?.target;return t instanceof Element&&findNavRoot(t)!==null;});if(running.length)Promise.all(running.map(a=>a.finished.catch(()=>null))).then(schedule);};apply();afterNavAnimations();RECHECK_AT_MS.forEach(ms=>window.setTimeout(()=>{apply();afterNavAnimations();},ms));window.addEventListener(\"resize\",schedule);document.addEventListener(\"visibilitychange\",schedule);window.addEventListener(\"pageshow\",schedule);// Only a timer reset per scroll event; the check runs once scrolling stops.\nlet scrollEnd=0;window.addEventListener(\"scroll\",()=>{window.clearTimeout(scrollEnd);scrollEnd=window.setTimeout(schedule,SCROLL_END_MS);},{passive:true,capture:true});const onNavAnimationEnd=e=>{if(e.target instanceof Element&&findNavRoot(e.target))schedule();};document.addEventListener(\"animationend\",onNavAnimationEnd,true);document.addEventListener(\"transitionend\",onNavAnimationEnd,true);}// ---------------------------------------------------------------------\n// 2. Dropdown keeper\n// ---------------------------------------------------------------------\nlet keeperStarted=false;function startNavMenuKeeper(){if(keeperStarted)return;keeperStarted=true;const pointer={x:0,y:0};const pending=new Map;const insideNav=nav=>{const{x,y}=pointer;const el=document.elementFromPoint(x,y);if(el){if(nav.contains(el)||el===nav)return true;const closestNav=el.closest?el.closest(\"nav\"):null;if(closestNav===nav)return true;if(findNavRoot(el)===nav)return true;}// Grace margin around the nav's own box only. The old code also\n// unioned every absolutely/fixed positioned descendant (a\n// getComputedStyle per descendant); a pointer over such a\n// descendant is already caught by elementFromPoint above.\nconst r=nav.getBoundingClientRect();return x>=r.left-RECT_MARGIN&&x<=r.right+RECT_MARGIN&&y>=r.top-RECT_MARGIN&&y<=r.bottom+RECT_MARGIN;};const flush=nav=>{const p=pending.get(nav);if(!p)return;if(insideNav(nav)){pending.delete(nav);return;}pending.delete(nav);p.evs.forEach(({type,target})=>{if(!target.isConnected)return;const Ctor=type.indexOf(\"pointer\")===0&&typeof PointerEvent!==\"undefined\"?PointerEvent:MouseEvent;const ev=new Ctor(type,{bubbles:type===\"pointerout\"||type===\"mouseout\",cancelable:true,clientX:pointer.x,clientY:pointer.y,relatedTarget:document.body});ev.__navKeeper=true;target.dispatchEvent(ev);});};const onLeaveEvent=e=>{if(e.__navKeeper)return;const t=e.target;if(!(t instanceof Element))return;const nav=findNavRoot(t);if(!nav)return;if(effectivelyHidden(nav))return;const rel=e.relatedTarget;if(rel instanceof Element&&(nav.contains(rel)||rel===nav||findNavRoot(rel)===nav)){return;}e.stopImmediatePropagation();let p=pending.get(nav);if(!p){p={timer:0,evs:[]};pending.set(nav,p);}p.evs.push({type:e.type,target:t});if(p.evs.length>40)p.evs.splice(0,p.evs.length-40);if(p.timer)window.clearTimeout(p.timer);p.timer=window.setTimeout(()=>flush(nav),MENU_GRACE_MS);};window.addEventListener(\"pointermove\",e=>{pointer.x=e.clientX;pointer.y=e.clientY;},{passive:true,capture:true});[\"pointerleave\",\"pointerout\",\"mouseleave\",\"mouseout\"].forEach(type=>document.addEventListener(type,onLeaveEvent,true));}/** Starts all fixes once per page load. Safe to call many times. */export function startNavCursorFix(){if(typeof document===\"undefined\"||!document.body)return;if(started)return;started=true;startGhostNavFix();startNavMenuKeeper();}/** Hook version — call from any code component to activate the fixes. */export function useNavCursorFix(){React.useEffect(()=>{if(isCanvasTarget())return;startNavCursorFix();},[]);}/**\n * Invisible helper component. Drop anywhere on a page (or inside a\n * component) to activate the nav fixes.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerDisableUnlink\n */export default function CursorFlickerFix(props){const{cursorColor=DEFAULT_COLOR}=props;useNavCursorFix();if(isCanvasTarget()){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",minWidth:8,minHeight:8,borderRadius:\"50%\",background:cursorColor,outline:\"1px dashed rgba(0,0,0,0.35)\",pointerEvents:\"none\"},title:\"Nav fixes (ghost-nav pointer events, dropdown keeper)\"});}return null;}addPropertyControls(CursorFlickerFix,{cursorColor:{type:ControlType.Color,title:\"لون الكورزر\",defaultValue:DEFAULT_COLOR}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CursorFlickerFix\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"useNavCursorFix\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"startNavCursorFix\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CursorFlickerFix.map"],"mappings":"+LA+B4I,SAAS,GAAgB,CAAC,OAAO,EAAa,QAAQ,IAAI,EAAa,QAAQ,EAAa,QAAQ,IAAI,EAAa,WAAW,EAAa,QAAQ,IAAI,EAAa,MAAO,CAEzT,SAAS,EAAU,EAAG,CAAC,OAAO,EAAG,UAAU,OAAO,CAAC,gBAAgB,KAAK,EAAG,UAAU,EAAE,CAAE,CAAC,SAAS,EAAY,EAAM,CAAC,IAAI,EAAI,EAAU,EAAK,KAAK,KAAM,GAAK,IAAM,SAAS,MAAK,CAAC,GAAG,EAAI,UAAU,MAAM,CAAC,GAAG,EAAU,CAAG,EAAE,OAAO,KAAK,EAAK,CAAI,KAAK,CAAC,IAAM,EAAG,EAAI,aAAa,EAAI,aAAa,kBAAkB,EAAE,KAAQ,GAAI,OAAO,KAAK,CAAE,IAAE,EAAK,EAAI,CAAC,EAAI,EAAI,aAAc,CAAC,OAAO,CAAK,CAAC,SAAS,EAAkB,EAAG,CAAC,IAAI,EAAI,EAAG,KAAM,GAAK,IAAM,SAAS,iBAAgB,CAAC,IAAM,EAAE,EAAO,iBAAiB,CAAG,EAAE,GAAG,EAAE,UAAU,QAAQ,EAAE,aAAa,UAAU,WAAW,EAAE,OAAO,EAAE,IAAK,MAAO,GAAM,EAAI,EAAI,aAAc,CAAC,MAAO,EAAM,CAGtnB,SAAS,GAAkB,CAAC,IAAM,EAAY,GAAM,CAAC,IAAI,EAAI,EAAS,EAAU,EAAK,KAAM,GAAK,IAAM,SAAS,MAAS,mBAAmB,MAAM,EAAI,WAAW,IAAI,GAAG,I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