{"version":3,"file":"DitherLoop.BqoYkQJq.mjs","names":["useRef","useState","__esmMin","init_ssg_sandbox_shims","navigator","window","_e","de","p","c","init_jsx_runtime","init_npm_react_18_3_1","ce","addPropertyControls","init_framer_CDGohruR","useIsStaticRenderer","ControlType","DitherLoop","props","isStatic","ref","src","setSrc","ready","setReady","video","rm","sd","big","videoLarge","v","go","fill","position","style","radius","alt","poster","posterLarge","init_DitherLoop"],"sources":["https:/framerusercontent.com/modules/HGYXsHxZ6rE0FiTnwl4A/u8OfS7PHKd5K6q5KDzAd/DitherLoop.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function DitherLoop(props){const{video=\"\",poster,videoLarge=\"\",posterLarge,alt=\"\",position=\"50% 50%\",radius=0,style}=props;const isStatic=useIsStaticRenderer();const ref=useRef(null);const[src,setSrc]=useState(\"\");const[ready,setReady]=useState(false);useEffect(()=>{if(isStatic||!video||typeof window===\"undefined\")return;const rm=window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;const sd=navigator.connection&&navigator.connection.saveData;if(rm||sd)return;const big=videoLarge&&window.matchMedia&&window.matchMedia(\"(min-width: 1600px)\").matches;setSrc(big?videoLarge:video);},[isStatic,video,videoLarge]);useEffect(()=>{const v=ref.current;if(!src||!v)return;const go=()=>setReady(true);v.addEventListener(\"playing\",go);v.play().catch(()=>{});return()=>v.removeEventListener(\"playing\",go);},[src]);const fill={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:position,display:\"block\",imageRendering:\"pixelated\"};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",overflow:\"hidden\",borderRadius:radius,background:\"#000000\"},role:\"img\",\"aria-label\":alt,children:[poster&&poster.src?/*#__PURE__*/_jsxs(\"picture\",{children:[posterLarge&&posterLarge.src?/*#__PURE__*/_jsx(\"source\",{media:\"(min-width: 1600px)\",srcSet:posterLarge.src}):null,/*#__PURE__*/_jsx(\"img\",{src:poster.src,alt:\"\",style:fill})]}):null,src?/*#__PURE__*/_jsx(\"video\",{ref:ref,src:src,muted:true,playsInline:true,loop:true,autoPlay:true,preload:\"auto\",\"aria-hidden\":\"true\",style:{...fill,opacity:ready?1:0,transition:\"opacity 0.6s ease\"}}):null]});}addPropertyControls(DitherLoop,{video:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},poster:{type:ControlType.ResponsiveImage,title:\"Poster\"},videoLarge:{type:ControlType.File,title:\"Video 1600+\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},posterLarge:{type:ControlType.ResponsiveImage,title:\"Poster 1600+\"},alt:{type:ControlType.String,title:\"Description\",defaultValue:\"\"},position:{type:ControlType.String,title:\"Focus\",defaultValue:\"50% 50%\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:80}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DitherLoop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DitherLoop.map"],"mappings":"A,4NAGG,SAAwBiB,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,GAAG,SAAO,aAAW,GAAG,cAAY,MAAI,GAAG,WAAS,UAAU,SAAO,EAAE,SAAOC,EAAYC,EAASJ,EAAoB,EAAQK,EAAIpB,EAAO,IAAI,EAAO,CAACqB,EAAIC,GAAQrB,EAAS,EAAE,EAAO,CAACsB,EAAMC,GAAUvB,EAAS,EAAK,EAAEW,MAAc,CAAC,GAAGO,GAAU,CAACM,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