{"version":3,"file":"DatePlace_holder.BkdBik5C.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/hIKpJKwY896Y5RWNQUJ7/ednIZL4ws50oyAbkvt4n/DatePlace_holder.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";/** Shown while the field is empty. */const PLACEHOLDER_EN=\"Select a date*\";const PLACEHOLDER_AR=\"اختر تاريخاً*\";const isArabicPage=()=>/\\/ar(\\/|$)/.test(window.location.pathname);/** Includes the marker so converted (type=\"text\") fields still match. */const DATE_INPUT_SELECTOR='input[type=\"date\"], input[data-date-placeholder], input[data-dp-managed]';/**\n * Touch devices open the native picker on a plain tap. Calling showPicker()\n * on top of that toggles the sheet straight back shut on iOS.\n */const prefersNativeTap=()=>window.matchMedia?.(\"(pointer: coarse)\").matches||navigator.maxTouchPoints>0;export function DatePlaceholderOverride(){useEffect(()=>{const cleanups=new Map;const arabic=isArabicPage();const fallbackText=arabic?PLACEHOLDER_AR:PLACEHOLDER_EN;const nativeTap=prefersNativeTap();const setup=input=>{if(cleanups.has(input))return;input.dataset.dpManaged=\"\";const text=input.getAttribute(arabic?\"data-date-placeholder-ar\":\"data-date-placeholder\")||input.placeholder||fallbackText;let deferred=0;let lastOpen=0;const showAsText=()=>{if(input.value)return;// Swapping type rebuilds the control. Doing that under an\n// open picker kills it mid-selection.\nif(document.activeElement===input)return;if(input.type!==\"text\")input.type=\"text\";input.placeholder=text;};const showAsDate=()=>{if(input.type!==\"date\")input.type=\"date\";};const openPicker=()=>{if(nativeTap)return;const now=Date.now();if(now-lastOpen<400)return;// re-entrancy guard\nlastOpen=now;try{input.showPicker?.();}catch{/* no transient activation, or unsupported */}};// Flip the type only. No focus(), no showPicker() — let the\n// browser's own click handling open the sheet, once.\nconst onPointerDown=()=>showAsDate();// Keyboard users never fire pointerdown.\nconst onFocus=()=>{cancelAnimationFrame(deferred);showAsDate();openPicker();};// The picker may still be committing, so let the value land\n// before deciding whether to revert.\nconst onBlur=()=>{cancelAnimationFrame(deferred);deferred=requestAnimationFrame(()=>{deferred=requestAnimationFrame(showAsText);});};const onChange=()=>{if(!input.value)showAsText();};input.addEventListener(\"pointerdown\",onPointerDown);input.addEventListener(\"focus\",onFocus);input.addEventListener(\"blur\",onBlur);input.addEventListener(\"change\",onChange);showAsText();cleanups.set(input,()=>{cancelAnimationFrame(deferred);input.removeEventListener(\"pointerdown\",onPointerDown);input.removeEventListener(\"focus\",onFocus);input.removeEventListener(\"blur\",onBlur);input.removeEventListener(\"change\",onChange);delete input.dataset.dpManaged;input.type=\"date\";});};const scan=()=>{document.querySelectorAll(DATE_INPUT_SELECTOR).forEach(setup);cleanups.forEach((cleanup,input)=>{if(!input.isConnected){cleanup();cleanups.delete(input);}});};scan();let queued=0;const observer=new MutationObserver(()=>{cancelAnimationFrame(queued);queued=requestAnimationFrame(scan);});observer.observe(document.body,{childList:true,subtree:true});return()=>{observer.disconnect();cancelAnimationFrame(queued);cleanups.forEach(cleanup=>cleanup());cleanups.clear();};},[]);return null;}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withDatePlaceholderOverride(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...DatePlaceholderOverride(props)});};}withDatePlaceholderOverride.displayName=\"DatePlaceholderOverride\";\nexport const __FramerMetadata__ = {\"exports\":{\"DatePlaceholderOverride\":{\"type\":\"override\",\"name\":\"DatePlaceholderOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDatePlaceholderOverride\":{\"type\":\"reactHoc\",\"name\":\"withDatePlaceholderOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DatePlace_holder.map"],"mappings":"2LAG2G,SAAgB,GAAyB,CAQ2+B,OAR1+B,MAAc,CAAC,IAAM,E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