{"version":3,"file":"IPhone_vid.CAbgOaFI.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/ysxdGMKDbHwm7n3BzwpY/o02j2ufXzMuggYyc4KfM/IPhone_vid.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * HeroSafetyVideo\n * The 9:16 video block for the Child Safety hero, styled as a\n * realistic iPhone (Dynamic Island, side buttons, home indicator).\n * Drop this next to your text column inside a horizontal Stack.\n *\n * Video source is a YouTube link — paste a normal youtube.com/watch,\n * youtu.be, or Shorts URL. The video autoplays muted on load (browser\n * autoplay policy requires this) with a tap-to-unmute control.\n *\n * Note: the screen is a 9:16 crop. For a clean fill with no\n * letterboxing, use a YouTube Short (uploaded vertical) rather\n * than a horizontal video.\n */function getYouTubeId(url){if(!url)return null;const patterns=[/youtu\\.be\\/([A-Za-z0-9_-]{11})/,/youtube\\.com\\/watch\\?v=([A-Za-z0-9_-]{11})/,/youtube\\.com\\/embed\\/([A-Za-z0-9_-]{11})/,/youtube\\.com\\/shorts\\/([A-Za-z0-9_-]{11})/];for(const pattern of patterns){const match=url.match(pattern);if(match)return match[1];}return null;}export default function HeroSafetyVideo(props){const{videoUrl,posterImage,caption,durationLabel,accentFrom,accentTo,showCaption}=props;const[muted,setMuted]=React.useState(true);const youtubeId=getYouTubeId(videoUrl);const thumbnailUrl=posterImage&&(posterImage.src||posterImage)||(youtubeId?`https://img.youtube.com/vi/${youtubeId}/hqdefault.jpg`:null);const embedSrc=youtubeId?`https://www.youtube.com/embed/${youtubeId}?autoplay=1&mute=${muted?1:0}&loop=1&playlist=${youtubeId}&controls=0&rel=0&modestbranding=1&playsinline=1&iv_load_policy=3`:null;return /*#__PURE__*/_jsxs(\"div\",{style:outerStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:{...glowStyle,background:`radial-gradient(circle at 30% 30%, ${accentFrom}59, ${accentTo}40 60%, transparent 75%)`}}),/*#__PURE__*/_jsxs(\"div\",{style:colStyle,children:[/*#__PURE__*/_jsxs(\"div\",{style:phoneOuterWrap,children:[/*#__PURE__*/_jsx(\"div\",{style:{...sideButton,...muteSwitch}}),/*#__PURE__*/_jsx(\"div\",{style:{...sideButton,...volUp}}),/*#__PURE__*/_jsx(\"div\",{style:{...sideButton,...volDown}}),/*#__PURE__*/_jsx(\"div\",{style:{...sideButton,...powerButton}}),/*#__PURE__*/_jsx(\"div\",{style:phoneFrameStyle,children:/*#__PURE__*/_jsxs(\"div\",{style:phoneInnerStyle,children:[embedSrc?/*#__PURE__*/_jsx(\"iframe\",{src:embedSrc,style:videoStyle,frameBorder:\"0\",allow:\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true},embedSrc):thumbnailUrl?/*#__PURE__*/_jsx(\"img\",{src:thumbnailUrl,alt:\"\",style:videoStyle}):/*#__PURE__*/_jsx(\"div\",{style:{...placeholderStyle,background:`linear-gradient(200deg, #F3DDB2 0%, ${accentTo} 45%, ${accentFrom} 100%)`},children:\"Paste a YouTube link\"}),/*#__PURE__*/_jsx(\"div\",{style:screenGloss}),/*#__PURE__*/_jsx(\"div\",{style:dynamicIsland}),durationLabel&&/*#__PURE__*/_jsx(\"div\",{style:durationTagStyle,children:durationLabel}),youtubeId&&/*#__PURE__*/_jsx(\"button\",{onClick:()=>setMuted(m=>!m),\"aria-label\":muted?\"Unmute video\":\"Mute video\",style:muteBtnStyle,children:muted?/*#__PURE__*/_jsxs(\"svg\",{width:14,height:14,viewBox:\"0 0 24 24\",fill:\"none\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M11 5 6 9H3v6h3l5 4V5Z\",fill:\"#fff\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M16 9l5 6M21 9l-5 6\",stroke:\"#fff\",strokeWidth:\"1.8\",strokeLinecap:\"round\"})]}):/*#__PURE__*/_jsxs(\"svg\",{width:14,height:14,viewBox:\"0 0 24 24\",fill:\"none\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M11 5 6 9H3v6h3l5 4V5Z\",fill:\"#fff\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M15.5 8.5a5 5 0 0 1 0 7\",stroke:\"#fff\",strokeWidth:\"1.8\",strokeLinecap:\"round\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M18 6a8.5 8.5 0 0 1 0 12\",stroke:\"#fff\",strokeWidth:\"1.8\",strokeLinecap:\"round\"})]})}),/*#__PURE__*/_jsx(\"div\",{style:homeIndicator})]})})]}),showCaption&&caption&&/*#__PURE__*/_jsx(\"p\",{style:captionStyle,children:caption})]})]});}const outerStyle={position:\"relative\",display:\"flex\",justifyContent:\"center\",alignItems:\"flex-start\",width:\"100%\",height:\"100%\"};const glowStyle={position:\"absolute\",width:440,height:440,top:-30,filter:\"blur(2px)\",zIndex:0,pointerEvents:\"none\"};const colStyle={position:\"relative\",zIndex:1,display:\"flex\",flexDirection:\"column\",alignItems:\"center\"};const phoneOuterWrap={position:\"relative\",width:290,aspectRatio:\"9 / 18.5\"};const phoneFrameStyle={width:\"100%\",height:\"100%\",borderRadius:46,padding:12,background:\"linear-gradient(155deg, #3a3d42 0%, #1c1d20 45%, #0c0d0e 100%)\",boxShadow:\"0 40px 70px -24px rgba(20,20,24,0.5), 0 12px 24px rgba(20,20,24,0.25), inset 0 0 0 1px rgba(255,255,255,0.06)\"};const phoneInnerStyle={position:\"relative\",width:\"100%\",height:\"100%\",borderRadius:34,overflow:\"hidden\",background:\"#000\",boxShadow:\"inset 0 0 0 2px rgba(0,0,0,0.6)\"};const videoStyle={width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"};const screenGloss={position:\"absolute\",inset:0,background:\"linear-gradient(115deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 22%, rgba(255,255,255,0) 78%, rgba(255,255,255,0.05) 100%)\",pointerEvents:\"none\"};const dynamicIsland={position:\"absolute\",top:14,left:\"50%\",transform:\"translateX(-50%)\",width:84,height:24,borderRadius:14,background:\"#000\",boxShadow:\"inset 0 0 0 1px rgba(255,255,255,0.08)\"};const homeIndicator={position:\"absolute\",bottom:10,left:\"50%\",transform:\"translateX(-50%)\",width:100,height:4,borderRadius:3,background:\"rgba(255,255,255,0.75)\"};const placeholderStyle={width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#4C525C\",fontSize:13,fontWeight:600,textAlign:\"center\",padding:20};const durationTagStyle={position:\"absolute\",bottom:26,left:16,background:\"rgba(0,0,0,0.45)\",color:\"#fff\",fontSize:12,fontWeight:600,padding:\"5px 10px\",borderRadius:999,backdropFilter:\"blur(4px)\"};const muteBtnStyle={position:\"absolute\",bottom:26,right:16,width:30,height:30,borderRadius:\"50%\",background:\"rgba(0,0,0,0.45)\",border:\"none\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backdropFilter:\"blur(4px)\",cursor:\"pointer\",padding:0};const captionStyle={textAlign:\"center\",fontSize:13,color:\"#80848B\",marginTop:18,maxWidth:290,fontFamily:\"Poppins, sans-serif\"};// --- side buttons (purely decorative, positioned on the outer wrap) ---\nconst sideButton={position:\"absolute\",background:\"linear-gradient(180deg, #2c2e32, #17181a)\",boxShadow:\"inset 0 0 0 1px rgba(255,255,255,0.05)\"};const muteSwitch={left:-3,top:\"13%\",width:3,height:\"3.5%\",borderRadius:\"2px 0 0 2px\"};const volUp={left:-3,top:\"20%\",width:3,height:\"7%\",borderRadius:\"2px 0 0 2px\"};const volDown={left:-3,top:\"29%\",width:3,height:\"7%\",borderRadius:\"2px 0 0 2px\"};const powerButton={right:-3,top:\"22%\",width:3,height:\"10%\",borderRadius:\"0 2px 2px 0\"};addPropertyControls(HeroSafetyVideo,{videoUrl:{type:ControlType.String,title:\"YouTube URL\",placeholder:\"https://youtube.com/watch?v=... or /shorts/...\",defaultValue:\"\"},posterImage:{type:ControlType.Image,title:\"Poster (optional)\",description:\"Overrides the YouTube thumbnail — used only if the video fails to load.\"},durationLabel:{type:ControlType.String,title:\"Duration\",defaultValue:\"0:52\",placeholder:\"0:52\"},showCaption:{type:ControlType.Boolean,title:\"Show caption\",defaultValue:true},caption:{type:ControlType.String,title:\"Caption\",defaultValue:\"“Safety lives in the small moments.”\\nEducators & families, in their own words.\",displayTextArea:true,hidden:props=>!props.showCaption},accentFrom:{type:ControlType.Color,title:\"Accent 1\",defaultValue:\"#A1C87E\"},accentTo:{type:ControlType.Color,title:\"Accent 2\",defaultValue:\"#EDB558\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HeroSafetyVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./IPhone_vid.map"],"mappings":"6KAaG,SAAS,EAAa,EAAI,CAAC,GAAG,CAAC,EAAI,OAAO,KAA2L,IAAI,IAAM,IAAW,CAA3L,iCAAiC,6CAA6C,2CAA2C,2CAAyE,EAAE,CAAC,IAAM,EAAM,EAAI,MAAM,CAAO,EAAE,GAAG,EAAM,OAAO,EAAM,EAAG,CAAC,OAAO,IAAK,CAAC,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,WAAS,cAAY,UAAQ,gBAAc,aAAW,WAAS,eAAa,EAAW,CAAC,EAAM,GAAUA,EAAe,EAAI,EAAQ,EAAU,EAAa,CAAQ,EAAQ,EAAa,IAAc,EAAY,KAAK,KAAe,EAAU,8BAA8B,EAAU,gBAAgB,MAAY,EAAS,EAAU,iCAAiC,EAAU,mBAAmB,KAAU,mBAAmB,EAAU,mEAAmE,KAAK,OAAoB,EAAM,MAAM,CAAC,MAAM,EAAW,SAAS,CAAc,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAU,WAAW,sCAAsC,EAAW,MAAM,EAAS,yBAAyB,CAAC,CAAC,EAAe,EAAM,MAAM,CAAC,MAAM,EAAS,SAAS,CAAc,EAAM,MAAM,CAAC,MAAM,EAAe,SA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