{"version":3,"file":"SectorGallery.CcXRrMxA.mjs","names":["React.useRef","React.useState","__esmMin","_e","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","useReducedMotion","init_framer_motion_DhsWWWsN","init_framer_BWFVvmND","RenderTarget","addPropertyControls","ControlType","SectorGallery","props","pictures","ref","reduced","canvas","paused","setPaused","hovered","setHovered","focused","setFocused","dragging","setDragging","drag","automatic","el","frame","previous","position","tick","loop","now","speed","finish","group","copy","i","label","style","v","controls","init_SectorGallery"],"sources":["https:/framerusercontent.com/modules/AwgkYYmXooY024BWqrcD/SWABeglvgusTnhqFiDJH/SectorGallery.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useReducedMotion}from\"framer-motion\";/** @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto */export default function SectorGallery(props){const{label=\"Sector project gallery\",speed=28,style}=props;const pictures=[props.image1,props.image2,props.image3,props.image4,props.image5,props.image6,props.image7,props.image8].filter(p=>!!p?.src);const ref=React.useRef(null);const reduced=useReducedMotion();const canvas=RenderTarget.current()===RenderTarget.canvas;const[paused,setPaused]=React.useState(false);const[hovered,setHovered]=React.useState(false);const[focused,setFocused]=React.useState(false);const[dragging,setDragging]=React.useState(false);const drag=React.useRef({x:0,left:0,id:-1});const automatic=!canvas&&!reduced&&!paused&&!hovered&&!focused&&!dragging;React.useEffect(()=>{const el=ref.current;if(!el||!automatic||pictures.length<2)return;let frame=0,previous=0,position=el.scrollLeft;const tick=now=>{if(previous){const loop=el.scrollWidth/2;position+=Math.min(now-previous,40)*Math.max(0,speed)/1e3;if(loop&&position>=loop)position-=loop;el.scrollLeft=position;}previous=now;frame=requestAnimationFrame(tick);};frame=requestAnimationFrame(tick);return()=>cancelAnimationFrame(frame);},[automatic,speed,pictures.length]);const finish=e=>{if(drag.current.id!==e.pointerId)return;drag.current.id=-1;setDragging(false);if(e.currentTarget.hasPointerCapture(e.pointerId))e.currentTarget.releasePointerCapture(e.pointerId);};const group=copy=>/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":copy?true:undefined,style:{display:\"flex\",flex:\"0 0 auto\",gap:24,paddingRight:24},children:pictures.map((p,i)=>/*#__PURE__*/_jsx(\"div\",{style:{width:\"clamp(270px, 36vw, 580px)\",height:\"clamp(220px, 27vw, 400px)\",flex:\"0 0 auto\",background:\"#F3F1F5\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"img\",{src:p.src,srcSet:p.srcSet,alt:copy?\"\":p.alt||\"Jazzbones sector project\",draggable:false,loading:i<3?\"eager\":\"lazy\",decoding:\"async\",style:{display:\"block\",width:\"100%\",height:\"100%\",objectFit:\"cover\"}})},i))});return /*#__PURE__*/_jsxs(\"section\",{\"aria-label\":label,style:{...style,width:\"100%\",height:\"auto\",overflow:\"hidden\",color:\"#0A0045\"},children:[/*#__PURE__*/_jsxs(\"div\",{ref:ref,tabIndex:0,\"aria-label\":label+\". Scroll or drag to explore.\",onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),onFocus:()=>setFocused(true),onBlur:()=>setFocused(false),onPointerDown:e=>{setPaused(true);if(e.pointerType!==\"mouse\")return;drag.current={x:e.clientX,left:e.currentTarget.scrollLeft,id:e.pointerId};setDragging(true);e.currentTarget.setPointerCapture(e.pointerId);e.preventDefault();},onPointerMove:e=>{if(drag.current.id===e.pointerId)e.currentTarget.scrollLeft=drag.current.left-(e.clientX-drag.current.x);},onPointerUp:finish,onPointerCancel:finish,onWheel:()=>setPaused(true),onKeyDown:()=>setPaused(true),style:{display:\"flex\",width:\"100%\",overflowX:\"auto\",overflowY:\"hidden\",scrollbarWidth:\"none\",cursor:dragging?\"grabbing\":\"grab\",touchAction:\"pan-x pan-y\",outlineOffset:-2},children:[group(false),!canvas&&group(true)]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",gap:16,paddingTop:16,fontFamily:\"Poppins, sans-serif\",fontSize:12,fontWeight:300,lineHeight:1.4},children:[/*#__PURE__*/_jsx(\"span\",{children:\"Drag to explore\"}),!reduced&&!canvas&&/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-pressed\":paused,onClick:()=>setPaused(v=>!v),style:{font:\"inherit\",color:\"inherit\",background:\"transparent\",border:\"1px solid #DEDCE5\",padding:\"6px 16px\",cursor:\"pointer\"},children:paused?\"Play gallery\":\"Pause gallery\"})]})]});}const controls={label:{type:ControlType.String,title:\"Label\",defaultValue:\"Sector project gallery\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:28,min:0,max:80}};for(let i=1;i<=8;i++)controls[\"image\"+i]={type:ControlType.ResponsiveImage,title:\"Image \"+i};addPropertyControls(SectorGallery,controls);\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SectorGallery\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SectorGallery.map"],"mappings":"A,wPACuC,SAAwBgB,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,yBAAyB,QAAM,GAAG,SAAOC,EAAYC,EAAS,CAACD,EAAM,OAAOA,EAAM,OAAOA,EAAM,OAAOA,EAAM,OAAOA,EAAM,OAAOA,EAAM,OAAOA,EAAM,OAAOA,EAAM,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC,CAACb,GAAG,GAAG,EAAQe,EAAInB,EAAa,IAAI,EAAQoB,EAAQV,EAAiB,EAAQW,EAAOR,EAAa,QAAQ,IAAIA,EAAa,OAAY,CAACS,EAAOC,GAAWtB,EAAe,EAAK,EAAO,CAACuB,EAAQC,GAAYxB,EAAe,EAAK,EAAO,CAACyB,EAAQC,GAAY1B,EAAe,EAAK,EAAO,CAAC2B,EAASC,GAAa5B,EAAe,EAA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