{"version":3,"file":"PromoCode.SylWUPAn.mjs","names":["React.useState","React.useRef","_Fragment","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","init_jsx_runtime","p","ce","navigator","addPropertyControls","init_framer_D1IzEvwH","ControlType","copyText","text","area","ok","PromoCode","props","copied","setCopied","timer","onCopy","layer","trackingId","code","fill","brand","font","css","label","mutedColor","textColor","copyLabel","l","copiedLabel","init_PromoCode"],"sources":["https:/framerusercontent.com/modules/mTtVn1dl3EZo48YkBfFB/1hmVnniyGnVtFHKVFnPh/PromoCode.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Copy with the async clipboard API, falling back to a hidden textarea for older browsers\nasync function copyText(text){try{if(typeof navigator!==\"undefined\"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(text);return true;}}catch{}if(typeof document===\"undefined\")return false;const area=document.createElement(\"textarea\");area.value=text;area.setAttribute(\"readonly\",\"\");area.style.position=\"fixed\";area.style.opacity=\"0\";document.body.appendChild(area);area.select();let ok=false;try{ok=document.execCommand(\"copy\");}catch{}document.body.removeChild(area);return ok;}const css=`\n.pc-btn { transition: filter 0.18s, transform 0.18s cubic-bezier(0.2, 0, 0, 1); }\n.pc-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }\n.pc-btn:focus-visible { outline: 2px solid var(--pc-brand); outline-offset: 2px; }\n`;/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function PromoCode(props){const{code=\"BLACKFRIDAY30\",label=\"Use code\",copyLabel=\"Copy\",copiedLabel=\"Copied\",trackingId=\"promo-code\",font,textColor=\"#1B1E28\",mutedColor=\"#878895\",fill=\"#FFFFFF\",brand=\"#555DFF\"}=props;const[copied,setCopied]=React.useState(false);const timer=React.useRef(null);React.useEffect(()=>()=>{if(timer.current)window.clearTimeout(timer.current);},[]);const onCopy=async()=>{const layer=typeof window!==\"undefined\"?window.dataLayer:null;if(Array.isArray(layer))layer.push({event:\"promo_copy\",tracking_id:trackingId,promo_code:code});if(!await copyText(code))return;setCopied(true);if(timer.current)window.clearTimeout(timer.current);timer.current=window.setTimeout(()=>setCopied(false),1800);};return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,display:\"inline-flex\",alignItems:\"center\",gap:12,padding:\"6px 6px 6px 16px\",borderRadius:14,background:fill,border:`1.5px dashed ${brand}`,fontFamily:font?.fontFamily,\"--pc-brand\":brand},children:[/*#__PURE__*/_jsx(\"style\",{children:css}),label?/*#__PURE__*/_jsx(\"span\",{style:{color:mutedColor,fontSize:14,lineHeight:1.2,whiteSpace:\"nowrap\",...font},children:label}):null,/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,fontSize:18,lineHeight:1.2,fontWeight:600,letterSpacing:\"0.06em\",whiteSpace:\"nowrap\",fontVariantNumeric:\"tabular-nums\"},children:code}),/*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"pc-btn\",onClick:onCopy,\"aria-live\":\"polite\",\"aria-label\":`${copyLabel} ${code}`,style:{height:36,display:\"inline-flex\",alignItems:\"center\",gap:6,padding:\"0 14px\",border:0,borderRadius:10,background:brand,color:\"#FFFFFF\",fontFamily:\"inherit\",fontSize:14,fontWeight:600,lineHeight:1,cursor:\"pointer\",whiteSpace:\"nowrap\",boxShadow:\"inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 20px -6px rgba(85, 93, 255, 0.5)\"},children:[/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 16 16\",width:\"14\",height:\"14\",fill:\"none\",\"aria-hidden\":\"true\",children:copied?/*#__PURE__*/_jsx(\"path\",{d:\"M3 8.5l3 3 7-7\",stroke:\"currentColor\",strokeWidth:\"1.8\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"rect\",{x:\"5.5\",y:\"5.5\",width:\"8\",height:\"8\",rx:\"2\",stroke:\"currentColor\",strokeWidth:\"1.5\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M10.5 3.5v-.5a1.5 1.5 0 0 0-1.5-1.5H4A1.5 1.5 0 0 0 2.5 3v5A1.5 1.5 0 0 0 4 9.5h.5\",stroke:\"currentColor\",strokeWidth:\"1.5\"})]})}),copied?copiedLabel:copyLabel]})]});}addPropertyControls(PromoCode,{code:{type:ControlType.String,title:\"Code\",defaultValue:\"BLACKFRIDAY30\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Use code\"},copyLabel:{type:ControlType.String,title:\"Copy label\",defaultValue:\"Copy\"},copiedLabel:{type:ControlType.String,title:\"Copied label\",defaultValue:\"Copied\"},trackingId:{type:ControlType.String,title:\"Tracking ID\",defaultValue:\"promo-code\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#1B1E28\"},mutedColor:{type:ControlType.Color,title:\"Muted\",defaultValue:\"#878895\"},fill:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#FFFFFF\"},brand:{type:ControlType.Color,title:\"Brand\",defaultValue:\"#555DFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PromoCode\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PromoCode.map"],"mappings":"A,2NACA,eAAegB,EAAS,EAAK,CAAC,GAAG,CAAC,GAAUJ,IAAY,QAAaA,EAAU,WAAW,UAAqD,OAA1C,MAAMA,EAAU,UAAU,UAAUK,CAAI,EAAS,EAAM,MAAM,CAAC,CAAC,GAAG,OAAO,SAAW,IAAY,MAAO,GAAM,IAAMC,EAAK,SAAS,cAAc,UAAU,EAAE,EAAK,MAAMD,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