{"version":3,"file":"SelectServicePicker.BnpgpjGY.mjs","names":["useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/gn2zOQ8KSafoW8z0pK1N/LSiFWZ9iwfwctR71j2LH/Recapta_V2.js","https:/framerusercontent.com/modules/37WK3b7flXJdDG2sllhu/IWQWSotJvMuoYUcgb0Wx/SelectServicePicker.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 304\n * @framerIntrinsicHeight 78\n */export default function RecaptchaV2({siteKey=\"6Ld8T7srAAAAAI0Gm27MPkye0q69lufC336dAb-N\",hiddenFieldName=\"g-recaptcha-response\"}){const[token,setToken]=useState(\"\");const[rendered,setRendered]=useState(false);useEffect(()=>{const loadRecaptchaScript=()=>{if(!document.getElementById(\"recaptcha-v2-script\")){const script=document.createElement(\"script\");script.id=\"recaptcha-v2-script\";script.src=\"https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoadCallback&render=explicit\";script.async=true;script.defer=true;document.body.appendChild(script);// Define global callback for Google API\nwindow.onRecaptchaLoadCallback=()=>{renderRecaptcha();};}else{renderRecaptcha();}};const renderRecaptcha=()=>{if(window.grecaptcha&&!rendered){window.grecaptcha.render(\"recaptcha-v2-container\",{sitekey:siteKey,callback:response=>{setToken(response);enableSubmitButton();}});setRendered(true);}};const disableSubmitButton=()=>{const form=findParentForm();if(!form)return;const submitButton=form.querySelector('button[type=\"submit\"]');if(submitButton)submitButton.disabled=true;};const enableSubmitButton=()=>{const form=findParentForm();if(!form)return;const submitButton=form.querySelector('button[type=\"submit\"]');if(submitButton)submitButton.disabled=false;};const findParentForm=()=>{const container=document.getElementById(\"recaptcha-v2-wrapper\");if(!container)return null;return container.closest(\"form\");};loadRecaptchaScript();disableSubmitButton();},[siteKey,rendered]);return /*#__PURE__*/_jsxs(\"div\",{id:\"recaptcha-v2-wrapper\",style:{display:\"flex\",flexDirection:\"column\",gap:8},children:[/*#__PURE__*/_jsx(\"div\",{id:\"recaptcha-v2-container\"}),/*#__PURE__*/_jsx(\"input\",{style:styles.inputBox,type:\"text\",name:hiddenFieldName,value:token,required:true,readOnly:true}),!token&&/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"13px\",color:\"red\",fontFamily:\"Inter, sans-serif\"},children:\"Please verify you're not a robot*\"})]});}const styles={inputBox:{flex:\"1 1 0%\",border:\"none\",outline:\"none\",backgroundColor:\"#fff\",padding:\"0\",color:\"rgb(0, 0, 0)\",fontFamily:'Poppins, \"Poppins Placeholder\", sans-serif',fontSize:\"0\",fontStyle:\"normal\",letterSpacing:\"0\",lineHeight:\"0\",width:\"100%\"}};addPropertyControls(RecaptchaV2,{siteKey:{type:ControlType.String,title:\"Site Key\",defaultValue:\"6Ld8T7srAAAAAI0Gm27MPkye0q69lufC336dAb-N\"},hiddenFieldName:{type:ControlType.String,title:\"Hidden Field Name\",defaultValue:\"g-recaptcha-response\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RecaptchaV2\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicHeight\":\"78\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"304\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Recapta_V2.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function ServiceLocationController(){useEffect(()=>{const normalize=val=>val.trim().toLowerCase().replace(/\\s+/g,\" \");/* ---------------- URL PARAM ---------------- */const params=new URLSearchParams(window.location.search);const rawServiceParam=params.get(\"services\")||params.get(\"service\");// const serviceParam = rawServiceParam.trim().toLowerCase()\nconst serviceParam=rawServiceParam&&rawServiceParam.trim()?rawServiceParam.trim().toLowerCase():null;/* ---------------- MAPS ---------------- */const LOCATION_SERVICE_MAP={\"kafd 3.09\":[\"private office\",\"coworking spaces\",\"meeting and conference room\",\"event spaces\",\"national address\",\"enterprise solutions\"],\"kafd 2.08\":[\"private office\"]};const serviceMapEN={\"private-office\":\"Private Office\",\"private-offices\":\"Private Office\",\"virtual-office\":\"National Address\",\"virtual-offices\":\"National Address\",\"national-address\":\"National Address\",\"enterprise-solution\":\"Enterprise Solutions\",\"enterprise-solutions\":\"Enterprise Solutions\",\"meeting-rooms\":\"Meeting and Conference Room\",\"meeting-room\":\"Meeting and Conference Room\",\"event-spaces\":\"Event Spaces\",\"event-space\":\"Event Spaces\",coworking:\"Coworking Spaces\",\"coworking-spaces\":\"Coworking Spaces\",\"coworking-space\":\"Coworking Spaces\"};const serviceMapAR={\"Private Office\":\"المكاتب الخاصة\",\"National Address\":\"العنوان الوطني\",\"Enterprise Solutions\":\"خدمات المؤسسات\",\"Meeting and Conference Room\":\"قاعة الاجتماعات والمؤتمرات\",\"Event Spaces\":\"قاعات الفعاليات\",\"Coworking Spaces\":\"مساحات العمل المشتركة\"};const isArabicPage=document.documentElement.lang===\"ar\"||window.location.pathname.startsWith(\"/ar\");/* ---------------- SERVICE INIT (ONCE) ---------------- */let serviceInitialized=false;const initServiceOnce=()=>{console.log(serviceInitialized);console.log(serviceParam);console.log(\"serviceParam\");console.log(\"serviceInitialized\");if(serviceInitialized||!serviceParam)return true;const serviceSelect=document.querySelector('select[name=\"Service\"]');if(!serviceSelect||!serviceSelect.options.length)return false;const enLabel=serviceMapEN[serviceParam];const arLabel=enLabel?serviceMapAR[enLabel]:null;const match=Array.from(serviceSelect.options).find(opt=>normalize(opt.text)===normalize(enLabel||\"\")||isArabicPage&&arLabel&&normalize(opt.text)===normalize(arLabel));if(match){serviceSelect.selectedIndex=Array.from(serviceSelect.options).indexOf(match);}serviceInitialized=true;return true;};/* ---------------- FILTER LOGIC ---------------- */const applyLogic=()=>{const locationSelect=document.querySelector('select[name=\"Location\"]');const serviceSelect=document.querySelector('select[name=\"Service\"]');if(!locationSelect||!serviceSelect)return;if(!serviceSelect.options.length)return;console.log(\"applyLogic\");const selectedLocation=normalize(locationSelect.options[locationSelect.selectedIndex]?.text||\"\");const allowedServices=LOCATION_SERVICE_MAP[selectedLocation]||[];let firstVisibleIndex=null;Array.from(serviceSelect.options).forEach((option,index)=>{const label=normalize(option.text);const isAllowed=!allowedServices.length||allowedServices.includes(label);option.hidden=!isAllowed;option.disabled=!isAllowed;if(isAllowed&&firstVisibleIndex===null){firstVisibleIndex=index;}});const current=serviceSelect.options[serviceSelect.selectedIndex];if(!current||current.disabled||current.hidden){serviceSelect.selectedIndex=firstVisibleIndex??0;}serviceSelect.dispatchEvent(new Event(\"change\",{bubbles:true}));};/* ---------------- INIT LOOP ---------------- */const tryInit=()=>{const serviceReady=initServiceOnce();const serviceSelect=document.querySelector('select[name=\"Service\"]');if(serviceReady&&serviceSelect?.options.length){applyLogic();document.querySelector('select[name=\"Location\"]')?.addEventListener(\"change\",applyLogic);return true;}return false;};let rafCount=0;const rafLoop=()=>{if(tryInit()||rafCount>30)return;rafCount++;requestAnimationFrame(rafLoop);};requestAnimationFrame(rafLoop);const observer=new MutationObserver(()=>{if(tryInit())observer.disconnect();});observer.observe(document.body,{childList:true,subtree:true});return()=>observer.disconnect();},[]);return{};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withServiceLocationController(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ServiceLocationController(props)});};}withServiceLocationController.displayName=\"ServiceLocationController\";\nexport const __FramerMetadata__ = {\"exports\":{\"withServiceLocationController\":{\"type\":\"reactHoc\",\"name\":\"withServiceLocationController\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ServiceLocationController\":{\"type\":\"override\",\"name\":\"ServiceLocationController\",\"annotations\":{\"framerContractVersion\":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