{"version":3,"file":"IframeButton.InOxgcES.mjs","names":["useState","useCallback","_Fragment"],"sources":["https:/framerusercontent.com/modules/ajX45t48F7IlY6FsZsMX/flKApLDaG55EePxAlRnT/IframeButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useCallback,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Common Basicons icons as SVG paths\nconst basiconsIcons={play:\"M8 5v14l11-7z\",external:\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3\",video:\"M23 7l-7 5 7 5V7zM3 5h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z\",link:\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\",maximize:\"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7\",globe:\"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z M2 12h20\",eye:\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z\",info:\"M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-18a8 8 0 1 0 0 16 8 8 0 0 0 0-16z M12 10v6M12 6v2\",map:\"M1 6v16l7-4 8 4 7-4V2l-7 4-8-4-7 4z\",image:\"M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14l3-4 4 4 5-7 6 7z\"};/**\n * Iframe Popup Button\n * A customizable button that opens an iframe in a popup modal when clicked.\n * Includes icon selection from Basicons library.\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 50\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function IframeButton(props){const{buttonText=\"Open Content\",iframeUrl=\"https://example.com\",icon=\"external\",iconPosition=\"right\",buttonBackground=\"#0099FF\",buttonTextColor=\"#FFFFFF\",buttonBorderRadius=8,buttonPadding=16,buttonFont,modalWidth=800,modalHeight=600,modalBackground=\"#FFFFFF\",showOverlay=true,overlayColor=\"rgba(0, 0, 0, 0.5)\",iframeBorderRadius=12}=props;const[isOpen,setIsOpen]=useState(false);const handleOpen=useCallback(()=>{startTransition(()=>setIsOpen(true));},[]);const handleClose=useCallback(()=>{startTransition(()=>setIsOpen(false));},[]);const iconPath=basiconsIcons[icon]||basiconsIcons.external;const buttonStyles={display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:8,backgroundColor:buttonBackground,color:buttonTextColor,border:\"none\",borderRadius:buttonBorderRadius,padding:`${buttonPadding}px ${buttonPadding*1.5}px`,cursor:\"pointer\",fontSize:buttonFont?.fontSize||\"14px\",fontWeight:buttonFont?.fontWeight||600,fontFamily:buttonFont?.fontFamily||\"system-ui, -apple-system, sans-serif\",letterSpacing:buttonFont?.letterSpacing,lineHeight:buttonFont?.lineHeight||\"1\",transition:\"transform 0.15s ease, opacity 0.15s ease\",width:props.style?.width===\"100%\"?\"100%\":\"auto\",minWidth:\"max-content\"};const overlayStyles={position:\"fixed\",top:0,left:0,right:0,bottom:0,backgroundColor:showOverlay?overlayColor:\"transparent\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:9999,opacity:isOpen?1:0,pointerEvents:isOpen?\"auto\":\"none\",transition:\"opacity 0.2s ease\"};const modalStyles={backgroundColor:modalBackground,borderRadius:iframeBorderRadius,width:Math.min(modalWidth,typeof window!==\"undefined\"?window.innerWidth-32:modalWidth),height:Math.min(modalHeight,typeof window!==\"undefined\"?window.innerHeight-100:modalHeight),maxWidth:\"calc(100vw - 32px)\",maxHeight:\"calc(100vh - 100px)\",overflow:\"hidden\",position:\"relative\",transform:isOpen?\"scale(1)\":\"scale(0.95)\",transition:\"transform 0.2s ease\",display:\"flex\",flexDirection:\"column\"};const headerStyles={display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",padding:\"12px 16px\",borderBottom:\"1px solid rgba(0,0,0,0.1)\"};const closeButtonStyles={background:\"none\",border:\"none\",cursor:\"pointer\",padding:4,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",borderRadius:4,transition:\"background 0.15s ease\"};const IconSvg=({path,size=16,color=buttonTextColor})=>/*#__PURE__*/_jsx(\"svg\",{width:size,height:size,viewBox:\"0 0 24 24\",fill:\"none\",stroke:color,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:path})});return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"button\",{onClick:handleOpen,style:buttonStyles,onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.9\";e.currentTarget.style.transform=\"scale(1.02)\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";e.currentTarget.style.transform=\"scale(1)\";},onMouseDown:e=>{e.currentTarget.style.transform=\"scale(0.98)\";},onMouseUp:e=>{e.currentTarget.style.transform=\"scale(1.02)\";},children:[iconPosition===\"left\"&&/*#__PURE__*/_jsx(IconSvg,{path:iconPath}),/*#__PURE__*/_jsx(\"span\",{children:buttonText}),iconPosition===\"right\"&&/*#__PURE__*/_jsx(IconSvg,{path:iconPath})]}),isOpen&&/*#__PURE__*/_jsx(\"div\",{style:overlayStyles,onClick:handleClose,children:/*#__PURE__*/_jsxs(\"div\",{style:modalStyles,onClick:e=>e.stopPropagation(),children:[/*#__PURE__*/_jsxs(\"div\",{style:headerStyles,children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:14,fontWeight:500,color:\"#333\"},children:buttonText}),/*#__PURE__*/_jsx(\"button\",{onClick:handleClose,style:closeButtonStyles,onMouseEnter:e=>{e.currentTarget.style.background=\"rgba(0,0,0,0.05)\";},onMouseLeave:e=>{e.currentTarget.style.background=\"transparent\";},\"aria-label\":\"Close modal\",children:/*#__PURE__*/_jsx(IconSvg,{path:\"M18 6L6 18M6 6l12 12\",size:20,color:\"#666\"})})]}),/*#__PURE__*/_jsx(\"iframe\",{src:iframeUrl,style:{flex:1,width:\"100%\",border:\"none\"},title:buttonText,allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true})]})})]});}addPropertyControls(IframeButton,{buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Open Content\",placeholder:\"Enter button text...\"},iframeUrl:{type:ControlType.String,title:\"Iframe URL\",defaultValue:\"https://example.com\",placeholder:\"https://...\"},icon:{type:ControlType.Enum,title:\"Icon\",options:Object.keys(basiconsIcons),optionTitles:Object.keys(basiconsIcons).map(s=>s.charAt(0).toUpperCase()+s.slice(1)),defaultValue:\"external\",displaySegmentedControl:false},iconPosition:{type:ControlType.Enum,title:\"Icon Position\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"right\",displaySegmentedControl:true},buttonBackground:{type:ControlType.Color,title:\"Button Background\",defaultValue:\"#0099FF\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text Color\",defaultValue:\"#FFFFFF\"},buttonBorderRadius:{type:ControlType.Number,title:\"Button Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},buttonPadding:{type:ControlType.Number,title:\"Button Padding\",defaultValue:16,min:8,max:40,step:2,unit:\"px\"},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},modalWidth:{type:ControlType.Number,title:\"Modal Width\",defaultValue:800,min:300,max:1920,step:10,unit:\"px\"},modalHeight:{type:ControlType.Number,title:\"Modal Height\",defaultValue:600,min:200,max:1080,step:10,unit:\"px\"},modalBackground:{type:ControlType.Color,title:\"Modal Background\",defaultValue:\"#FFFFFF\"},showOverlay:{type:ControlType.Boolean,title:\"Show Overlay\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"rgba(0, 0, 0, 0.5)\",hidden:({showOverlay})=>!showOverlay},iframeBorderRadius:{type:ControlType.Number,title:\"Modal Radius\",defaultValue:12,min:0,max:50,step:1,unit:\"px\"}});IframeButton.displayName=\"Iframe Popup Button\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"IframeButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"200\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"50\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./IframeButton.map"],"mappings":"qNAWG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,aAAW,eAAe,YAAU,sBAAsB,OAAK,WAAW,eAAa,QAAQ,mBAAiB,UAAU,kBAAgB,UAAU,qBAAmB,EAAE,gBAAc,GAAG,aAAW,aAAW,IAAI,cAAY,IAAI,kBAAgB,UAAU,cAAY,GAAK,eAAa,qBAAqB,qBAAmB,IAAI,EAAW,CAAC,EAAO,GAAWA,EAAS,GAAM,CAAO,EAAWC,MAAgB,CAAC,MAAoB,EAAU,GAAK,CAAC,EAAG,EAAE,CAAC,CAAO,EAAYA,MAAgB,CAAC,MAAoB,EAAU,GAAM,CAAC,EAAG,EAAE,CAAC,CAAO,EAAS,EAAc,IAAO,EAAc,SAAe,EAAa,CAAC,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,IAAI,EAAE,gBAAgB,EAAiB,MAAM,EAAgB,OAAO,OAAO,aAAa,EAAmB,QAAQ,GAAG,EAAc,KAAK,EAAc,IAAI,IAAI,OAAO,UAA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