{"version":3,"file":"GoogleMapsEmbed.Go7kRYTk.mjs","names":["React.useRef","React.useState","React.useCallback","_Fragment"],"sources":["https:/framerusercontent.com/modules/2A3RNmrMWN9tJ6GtT6Nt/g5uX3Sou73AVTPg8S4OQ/GoogleMapsEmbed.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Instructions:\n * Use the edit-code-component tool to implement the following changes.\n * Goal:\n * Create a before and after slider with the following property controls: before image, after image, interaction, show divider (yes, no), divider color, divider width, slide size, aria labels (before, after)\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function BeforeAfterSlider(props){const{beforeImage={src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Before image\"},afterImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"After image\"},interaction=\"drag\",showDivider=true,dividerColor=\"#FFFFFF\",dividerWidth=2,slideSize=40,cornerRadius=0,ariaBefore=\"Before\",ariaAfter=\"After\",style}=props;const isStatic=useIsStaticRenderer();const containerRef=React.useRef(null);const[position,setPosition]=React.useState(50);const[dragging,setDragging]=React.useState(false);const clamp=React.useCallback((n,min,max)=>Math.max(min,Math.min(max,n)),[]);const updateFromClientX=React.useCallback(clientX=>{const el=containerRef.current;if(!el)return;const rect=el.getBoundingClientRect();if(!rect.width)return;const x=clientX-rect.left;const next=x/rect.width*100;React.startTransition(()=>setPosition(clamp(next,0,100)));},[clamp]);const onPointerDown=React.useCallback(e=>{if(isStatic||interaction!==\"drag\")return;e.preventDefault();e.currentTarget.setPointerCapture?.(e.pointerId);React.startTransition(()=>setDragging(true));updateFromClientX(e.clientX);},[interaction,isStatic,updateFromClientX]);const onPointerMove=React.useCallback(e=>{if(isStatic)return;if(interaction===\"drag\"){if(!dragging)return;updateFromClientX(e.clientX);}else{updateFromClientX(e.clientX);}},[dragging,interaction,isStatic,updateFromClientX]);const onPointerUp=React.useCallback(e=>{if(isStatic||interaction!==\"drag\")return;e.preventDefault();React.startTransition(()=>setDragging(false));},[interaction,isStatic]);const safeDividerWidth=Number.isFinite(dividerWidth)?clamp(dividerWidth,1,20):2;const safeSlideSize=Number.isFinite(slideSize)?clamp(slideSize,16,120):40;const safeCornerRadius=Number.isFinite(cornerRadius)?clamp(cornerRadius,0,200):0;const beforeAlt=(beforeImage?.alt||ariaBefore||\"Before\").trim();const afterAlt=(afterImage?.alt||ariaAfter||\"After\").trim();const isFullWidth=!!style&&style.width===\"100%\";const isFullHeight=!!style&&style.height===\"100%\";return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:safeCornerRadius,touchAction:\"none\",userSelect:\"none\",cursor:isStatic?\"default\":interaction===\"drag\"?\"ew-resize\":\"col-resize\",...isFullWidth?{}:{minWidth:\"max-content\"},...isFullHeight?{}:{},...style},role:\"group\",\"aria-label\":\"Before and after\",onPointerDown:onPointerDown,onPointerMove:isStatic?undefined:onPointerMove,onPointerUp:onPointerUp,onPointerCancel:onPointerUp,children:[/*#__PURE__*/_jsx(\"img\",{src:afterImage?.src,srcSet:afterImage?.srcSet,alt:afterAlt,draggable:false,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:safeCornerRadius}}),/*#__PURE__*/_jsx(\"img\",{src:beforeImage?.src,srcSet:beforeImage?.srcSet,alt:beforeAlt,draggable:false,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:safeCornerRadius,clipPath:`inset(0 ${100-position}% 0 0)`}}),showDivider&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:`${position}%`,width:`${safeDividerWidth}px`,height:\"100%\",background:dividerColor,transform:`translateX(-${safeDividerWidth/2}px)`,zIndex:2},\"aria-hidden\":\"true\"}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:`${position}%`,top:\"50%\",width:`${safeSlideSize}px`,height:`${safeSlideSize}px`,transform:`translate(-${safeSlideSize/2}px, -${safeSlideSize/2}px)`,borderRadius:999,background:dividerColor,boxShadow:\"0 6px 18px rgba(0,0,0,0.18)\",zIndex:3,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",pointerEvents:\"none\"},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsxs(\"svg\",{width:safeSlideSize*.55,height:safeSlideSize*.55,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"#000\",strokeWidth:\"2\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M9 6l-6 6 6 6\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M15 6l6 6-6 6\"})]})})]})]});}addPropertyControls(BeforeAfterSlider,{beforeImage:{type:ControlType.ResponsiveImage,title:\"Before Image\"},afterImage:{type:ControlType.ResponsiveImage,title:\"After Image\"},interaction:{type:ControlType.Enum,title:\"Interaction\",options:[\"drag\",\"hover\"],optionTitles:[\"Drag\",\"Hover\"],defaultValue:\"drag\",displaySegmentedControl:true},showDivider:{type:ControlType.Boolean,title:\"Show Divider\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},dividerColor:{type:ControlType.Color,title:\"Divider Color\",defaultValue:\"#FFFFFF\",hidden:({showDivider})=>!showDivider},dividerWidth:{type:ControlType.Number,title:\"Divider Width\",defaultValue:2,min:1,max:20,step:1,unit:\"px\",hidden:({showDivider})=>!showDivider},slideSize:{type:ControlType.Number,title:\"Slide Size\",defaultValue:40,min:16,max:120,step:1,unit:\"px\",hidden:({showDivider})=>!showDivider},cornerRadius:{type:ControlType.Number,title:\"Corner Radius\",defaultValue:0,min:0,max:200,step:1,unit:\"px\"},ariaBefore:{type:ControlType.String,title:\"Aria Before\",defaultValue:\"Before\"},ariaAfter:{type:ControlType.String,title:\"Aria After\",defaultValue:\"After\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BeforeAfterSlider\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GoogleMapsEmbed.map"],"mappings":"iNAQG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,cAAY,CAAC,IAAI,sEAAsE,IAAI,eAAe,CAAC,aAAW,CAAC,IAAI,sEAAsE,IAAI,cAAc,CAAC,cAAY,OAAO,cAAY,GAAK,eAAa,UAAU,eAAa,EAAE,YAAU,GAAG,eAAa,EAAE,aAAW,SAAS,YAAU,QAAQ,SAAO,EAAY,EAAS,GAAqB,CAAO,EAAaA,EAAa,KAAK,CAAM,CAAC,EAAS,GAAaC,EAAe,GAAG,CAAM,CAAC,EAAS,GAAaA,EAAe,GAAM,CAAO,EAAMC,GAAmB,EAAE,EAAI,IAAM,KAAK,IAAI,EAAI,KAAK,IAAI,EAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAO,EAAkBA,EAAkB,GAAS,CAAC,IAAM,EAAG,EAAa,QAAQ,GAAG,CAAC,EAAG,OAAO,IAAM,EAAK,EAAG,uBAAuB,CAAC,GAAG,CAAC,EAAK,MAAM,OAAiC,IAAM,GAAxB,EAAQ,EAAK,MAAkB,EAAK,MAAM,IAAI,MAA0B,EAAY,EAAM,EAAK,EAAE,IAAI,CAAC,CAAC,EAAG,CAAC,EAAM,CAAC,CAAO,EAAcA,EAAkB,GAAG,CAAI,GAAU,IAAc,SAAc,EAAE,gBAAgB,CAAC,EAAE,cAAc,oBAAoB,EAAE,UAAU,CAAC,MAA0B,EAAY,GAAK,CAAC,CAAC,EAAkB,EAAE,QAA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