{"version":3,"file":"PreloaderConnector.208cmTOB.mjs","names":["React.useState","React.useEffect","_jsx","React.isValidElement","React.cloneElement","__esmMin","z","init_npm_react_18_3_1","_e","init_jsx_runtime","K","c","ce","addPropertyControls","init_framer_ChujFWHC","ControlType","motion","AnimatePresence","init_framer_motion_1EwlFBEG","PreLoaderConnector","props","duration","connectedFrame","isVisible","setIsVisible","safeDuration","timer","containerStyle","frameWrapperStyle","frameStyle","safeFrames","hasFrames","frame","index","init_PreloaderConnector"],"sources":["https:/framerusercontent.com/modules/0OUu9M01UVJkN6MRMAgd/ge6MAi64Jk4CWR1qNXxc/PreloaderConnector.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";export function PreLoaderConnector(props){const{duration=3,connectedFrame}=props;const[isVisible,setIsVisible]=React.useState(true);React.useEffect(()=>{// Валидация duration\nconst safeDuration=Math.max(.1,Math.min(10,Number(duration)||3));const timer=setTimeout(()=>{setIsVisible(false);},safeDuration*1e3);return()=>clearTimeout(timer);},[duration]);const containerStyle={position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:9999,background:\"transparent\"};const frameWrapperStyle={position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"};const frameStyle={width:\"100%\",height:\"100%\",objectFit:\"cover\"};const safeFrames=Array.isArray(connectedFrame)?connectedFrame:[];const hasFrames=safeFrames.length>0;return /*#__PURE__*/_jsx(AnimatePresence,{children:isVisible&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:1},exit:{opacity:0,transition:{duration:0}},style:containerStyle,children:hasFrames&&safeFrames.map((frame,index)=>{if(!/*#__PURE__*/React.isValidElement(frame)){console.warn(`PreLoaderConnector: Invalid frame at index ${index}`);return null;}return /*#__PURE__*/_jsx(\"div\",{style:frameWrapperStyle,children:/*#__PURE__*/React.cloneElement(frame,{style:frameStyle})},`frame-${index}`);})})});}addPropertyControls(PreLoaderConnector,{duration:{type:ControlType.Number,title:\"Duration\",defaultValue:3,min:1,max:10,unit:\"s\",step:.1,displayStepper:true},connectedFrame:{type:ControlType.Array,title:\"Connect Frame\",propertyControl:{type:ControlType.ComponentInstance}}});\nexport const __FramerMetadata__ = {\"exports\":{\"PreLoaderConnector\":{\"type\":\"reactComponent\",\"name\":\"PreLoaderConnector\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PreloaderConnector.map"],"mappings":"A,uPAA6K,SAAgBmB,EAAmBC,EAAM,CAAC,GAAK,CAACC,WAAS,EAAEC,kBAAgBF,EAAW,CAACG,EAAUC,GAAcxB,EAAe,EAAI,EAAEC,MAAoB,CACrU,IAAMwB,EAAa,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,OAAOJ,CAAQ,GAAG,CAAC,CAAC,EAAQK,EAAM,eAAe,CAACF,EAAa,EAAK,CAAE,EAAEC,EAAa,GAAG,EAAE,UAAU,aAAaC,CAAK,CAAE,EAAE,CAACL,CAAQ,CAAC,EAAE,IAAMM,EAAe,CAAC,SAAS,QAAQ,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,OAAO,QAAQ,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,OAAO,KAAK,WAAW,aAAa,EAAQC,EAAkB,CAAC,SAAS,WAAW,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,eAAe,SAAS,WAAW,QAAQ,EAAQC,EAAW,CAAC,MAAM,OAAO,OAAO,OAAO,UAAU,OAAO,EAAQC,EAAW,MAAM,QAAQR,CAAc,EAAEA,EAAe,CAAC,EAAQS,EAAUD,EAAW,OAAO,EAAE,MAAoB5B,gBAAKe,EAAgB,CAAC,SAASM,GAAwBrB,gBAAKc,EAAO,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