{"version":3,"file":"GetYourGuideAvailability.CT4pntL9.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/2raZUOSl7MZ0IqMpMo8J/n4hm15A8HNV3jjA0GKub/GetYourGuideAvailability.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 560\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function GetYourGuideAvailability(props){const{partnerId=\"VBHRP4S\",tourId=\"412626\",campaign=\"NSL-food-tours\",currency=\"EUR\",locale=\"en-US\",variant=\"horizontal\",allowedPath=\"\",style}=props;const rawCampaign=campaign.trim()||\"availability\";const normalizedCampaign=/^NSL-/i.test(rawCampaign)?\"NSL-\"+rawCampaign.slice(4):\"NSL-\"+rawCampaign.replace(/^NSL[-_]?/i,\"\");const hostRef=React.useRef(null);const isStatic=useIsStaticRenderer();const[isAllowedPage,setIsAllowedPage]=React.useState(isStatic);const[shouldLoad,setShouldLoad]=React.useState(isStatic);React.useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;const pathFilter=allowedPath?.trim();setIsAllowedPage(!pathFilter||pathFilter===\"null\"||window.location.pathname.includes(pathFilter));},[allowedPath,isStatic]);React.useEffect(()=>{if(isStatic||!isAllowedPage||typeof window===\"undefined\")return;const host=hostRef.current;if(!host)return;if(!(\"IntersectionObserver\"in window)){setShouldLoad(true);return;}const observer=new IntersectionObserver(entries=>{if(entries.some(entry=>entry.isIntersecting)){setShouldLoad(true);observer.disconnect();}},{rootMargin:\"600px 0px\"});observer.observe(host);return()=>observer.disconnect();},[isStatic,isAllowedPage]);React.useEffect(()=>{if(isStatic||!isAllowedPage||!shouldLoad||typeof window===\"undefined\"||typeof document===\"undefined\")return;const host=hostRef.current;if(!host||!tourId)return;const retrigger=()=>{if(host.querySelector(\"iframe\"))return;host.removeAttribute(\"data-gyg-widget-created\");host.removeAttribute(\"data-gyg-widget\");window.requestAnimationFrame(()=>host.setAttribute(\"data-gyg-widget\",\"availability\"));};const src=\"https://widget.getyourguide.com/pw/latest/client-loader/widget.js\";let script=document.querySelector('script[src*=\"/pw/latest/client-loader/widget.js\"]');if(!script){script=document.createElement(\"script\");script.async=true;script.src=src;script.setAttribute(\"data-gyg-partner-id\",partnerId);document.head.appendChild(script);}script.addEventListener(\"load\",retrigger,{once:true});retrigger();const retry=window.setTimeout(retrigger,1200);return()=>window.clearTimeout(retry);},[partnerId,tourId,campaign,currency,locale,variant,isStatic,isAllowedPage,shouldLoad]);if(isStatic){return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",minHeight:360,border:\"1px solid #E3E3E3\",borderRadius:12,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:10,padding:24,background:\"#FFFFFF\",color:\"#111111\",textAlign:\"center\",...style},children:[/*#__PURE__*/_jsx(\"strong\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:20},children:\"GetYourGuide availability\"}),/*#__PURE__*/_jsxs(\"span\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:14,color:\"#666666\"},children:[\"Live tour \",tourId,\" \\xb7 prices in \",currency]})]});}if(!isAllowedPage)return null;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",minHeight:360,overflow:\"hidden\",...style},children:/*#__PURE__*/_jsx(\"div\",{ref:hostRef,\"data-gyg-cmp\":normalizedCampaign,\"data-gyg-currency\":currency,\"data-gyg-href\":\"https://widget.getyourguide.com/default/availability.frame\",\"data-gyg-locale-code\":locale,\"data-gyg-partner-id\":partnerId,\"data-gyg-tour-id\":tourId,\"data-gyg-variant\":variant,\"data-gyg-widget\":shouldLoad?\"availability\":undefined,style:{position:\"relative\",width:\"100%\",minHeight:\"100%\"},children:/*#__PURE__*/_jsxs(\"span\",{children:[\"Powered by\",\" \",/*#__PURE__*/_jsx(\"a\",{target:\"_blank\",rel:\"sponsored noopener\",href:\"https://www.getyourguide.com/?partner_id=\"+encodeURIComponent(partnerId)+\"&utm_medium=online_publisher&cmp=\"+encodeURIComponent(normalizedCampaign),children:\"GetYourGuide\"})]})})});}addPropertyControls(GetYourGuideAvailability,{partnerId:{type:ControlType.String,title:\"Partner ID\",defaultValue:\"VBHRP4S\"},tourId:{type:ControlType.String,title:\"Tour ID\",defaultValue:\"412626\"},campaign:{type:ControlType.String,title:\"Campaign\",defaultValue:\"NSL-food-tours\"},currency:{type:ControlType.Enum,title:\"Currency\",options:[\"EUR\",\"USD\",\"GBP\"],defaultValue:\"EUR\"},locale:{type:ControlType.String,title:\"Locale\",defaultValue:\"en-US\"},variant:{type:ControlType.Enum,title:\"Layout\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"],defaultValue:\"horizontal\",displaySegmentedControl:true},allowedPath:{type:ControlType.String,title:\"Only URL\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GetYourGuideAvailability\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"800\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"560\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GetYourGuideAvailability.map"],"mappings":"yQAKG,SAAwB,EAAyB,EAAM,CAAC,GAAK,CAAC,YAAU,UAAU,SAAO,SAAS,WAAS,iBAAiB,WAAS,MAAM,SAAO,QAAQ,UAAQ,aAAa,cAAY,GAAG,SAAO,EAAY,EAAY,EAAS,KAAK,GAAG,eAAqB,EAAmB,SAAS,KAAK,CAAW,EAAE,OAAO,EAAY,MAAM,CAAC,EAAE,OAAO,EAAY,QAAQ,aAAa,EAAE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