{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/ukiCpujs4o8fVaNFuXcs/iKiCR851vnIwQkuyJe4E/Clipboard.js"],
  "sourcesContent": ["/**\n * --------------------------------------------------------------------\n * Clipboard\n * --------------------------------------------------------------------\n * Distributed under the VIAL License:\n * https://www.abruptive.com/policies/vial\n *\n * Unauthorized access or use of this code will result in prosecution\n * according to the furthest extent of the law.\n *\n * \u00A9 Abruptive LLC \u00B7 All Rights Reserved\n * --------------------------------------------------------------------\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{toast}from\"https://framer.com/m/Sonner-2W7J.js\";/**\n * --------------------------------------------------------------------\n * Component\n * --------------------------------------------------------------------\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function Clipboard({text,alert,trigger,triggerClicked,duration,...props}){const[isCopied,setIsCopied]=useState(false);const timeoutRef=useRef(null);/**\n     * Click handler to copy text to clipboard.\n     */const handleClick=e=>{e.preventDefault();// Clear previous timeouts.\nif(timeoutRef.current){clearTimeout(timeoutRef.current);}// Add the status to clipboard.\nnavigator.clipboard.writeText(text);// Fire the copied status.\nsetIsCopied(true);// Fire up the alert notification.\ntoast(alert);// Reset the copied status.\ntimeoutRef.current=setTimeout(()=>{setIsCopied(false);timeoutRef.current=null;},duration);};/**\n     * Render the component.\n     */return /*#__PURE__*/_jsx(\"div\",{onClick:handleClick,...props,children:isCopied?triggerClicked:trigger});}/**\n * --------------------------------------------------------------------\n * Display\n * --------------------------------------------------------------------\n */Clipboard.displayName=\"Clipboard\";/**\n * --------------------------------------------------------------------\n * Controls\n * --------------------------------------------------------------------\n */addPropertyControls(Clipboard,{text:{type:ControlType.String,displayTextArea:true},alert:{type:ControlType.String,displayTextArea:true,defaultValue:\"The text was copied to your clipboard.\"},trigger:{title:\"Trigger\",type:ControlType.ComponentInstance},triggerClicked:{title:\"Clicked\",type:ControlType.ComponentInstance},duration:{type:ControlType.Number,displayStepper:true,step:1e3,min:1e3,max:5e3,defaultValue:2e3}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Clipboard\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Clipboard.map"],
  "mappings": "yLAmBkB,SAARA,EAA2B,CAAC,KAAAC,EAAK,MAAAC,EAAM,QAAAC,EAAQ,eAAAC,EAAe,SAAAC,EAAS,GAAGC,CAAK,EAAE,CAAC,GAAK,CAACC,EAASC,CAAW,EAAEC,EAAS,EAAK,EAAQC,EAAWC,EAAO,IAAI,EAS7J,OAAoBC,EAAK,MAAM,CAAC,QAPdC,GAAG,CAACA,EAAE,eAAe,EAC3CH,EAAW,SAAS,aAAaA,EAAW,OAAO,EACtDI,EAAU,UAAU,UAAUb,CAAI,EAClCO,EAAY,EAAI,EAChBO,EAAMb,CAAK,EACXQ,EAAW,QAAQ,WAAW,IAAI,CAACF,EAAY,EAAK,EAAEE,EAAW,QAAQ,IAAK,EAAEL,CAAQ,CAAE,EAE/B,GAAGC,EAAM,SAASC,EAASH,EAAeD,CAAO,CAAC,CAAE,CAI5GH,EAAU,YAAY,YAItBgB,EAAoBhB,EAAU,CAAC,KAAK,CAAC,KAAKiB,EAAY,OAAO,gBAAgB,EAAI,EAAE,MAAM,CAAC,KAAKA,EAAY,OAAO,gBAAgB,GAAK,aAAa,wCAAwC,EAAE,QAAQ,CAAC,MAAM,UAAU,KAAKA,EAAY,iBAAiB,EAAE,eAAe,CAAC,MAAM,UAAU,KAAKA,EAAY,iBAAiB,EAAE,SAAS,CAAC,KAAKA,EAAY,OAAO,eAAe,GAAK,KAAK,IAAI,IAAI,IAAI,IAAI,IAAI,aAAa,GAAG,CAAC,CAAC",
  "names": ["Clipboard", "text", "alert", "trigger", "triggerClicked", "duration", "props", "isCopied", "setIsCopied", "ye", "timeoutRef", "pe", "p", "e", "navigator", "v", "addPropertyControls", "ControlType"]
}
