{"version":3,"file":"CopyButton-lB9rZ_Of.js","sources":["../../../node_modules/@mantine/hooks/esm/use-clipboard/use-clipboard.mjs","../../../node_modules/@mantine/core/esm/components/CopyButton/CopyButton.mjs"],"sourcesContent":["'use client';\nimport { useState } from 'react';\n\nfunction useClipboard({ timeout = 2e3 } = {}) {\n const [error, setError] = useState(null);\n const [copied, setCopied] = useState(false);\n const [copyTimeout, setCopyTimeout] = useState(null);\n const handleCopyResult = (value) => {\n window.clearTimeout(copyTimeout);\n setCopyTimeout(window.setTimeout(() => setCopied(false), timeout));\n setCopied(value);\n };\n const copy = (valueToCopy) => {\n if (\"clipboard\" in navigator) {\n navigator.clipboard.writeText(valueToCopy).then(() => handleCopyResult(true)).catch((err) => setError(err));\n } else {\n setError(new Error(\"useClipboard: navigator.clipboard is not supported\"));\n }\n };\n const reset = () => {\n setCopied(false);\n setError(null);\n window.clearTimeout(copyTimeout);\n };\n return { copy, reset, error, copied };\n}\n\nexport { useClipboard };\n//# sourceMappingURL=use-clipboard.mjs.map\n","'use client';\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useClipboard } from '@mantine/hooks';\nimport 'react';\nimport 'clsx';\nimport '../../core/MantineProvider/Mantine.context.mjs';\nimport '../../core/MantineProvider/default-theme.mjs';\nimport '../../core/MantineProvider/MantineProvider.mjs';\nimport '../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs';\nimport { useProps } from '../../core/MantineProvider/use-props/use-props.mjs';\nimport '../../core/MantineProvider/MantineCssVariables/MantineCssVariables.mjs';\nimport '../../core/Box/Box.mjs';\nimport '../../core/DirectionProvider/DirectionProvider.mjs';\n\nconst defaultProps = {\n timeout: 1e3\n};\nfunction CopyButton(props) {\n const { children, timeout, value, ...others } = useProps(\"CopyButton\", defaultProps, props);\n const clipboard = useClipboard({ timeout });\n const copy = () => clipboard.copy(value);\n return /* @__PURE__ */ jsx(Fragment, { children: children({ copy, copied: clipboard.copied, ...others }) });\n}\nCopyButton.displayName = \"@mantine/core/CopyButton\";\n\nexport { CopyButton };\n//# sourceMappingURL=CopyButton.mjs.map\n"],"names":["useClipboard","timeout","error","setError","useState","copied","setCopied","copyTimeout","setCopyTimeout","handleCopyResult","value","valueToCopy","err","defaultProps","CopyButton","props","children","others","useProps","clipboard","jsx","Fragment"],"mappings":"8DAGA,SAASA,EAAa,CAAE,QAAAC,EAAU,GAAG,EAAK,CAAA,EAAI,CAC5C,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAAA,SAAS,IAAI,EACjC,CAACC,EAAQC,CAAS,EAAIF,EAAAA,SAAS,EAAK,EACpC,CAACG,EAAaC,CAAc,EAAIJ,EAAAA,SAAS,IAAI,EAC7CK,EAAoBC,GAAU,CAClC,OAAO,aAAaH,CAAW,EAC/BC,EAAe,OAAO,WAAW,IAAMF,EAAU,EAAK,EAAGL,CAAO,CAAC,EACjEK,EAAUI,CAAK,CAChB,EAaD,MAAO,CAAE,KAZKC,GAAgB,CACxB,cAAe,UACjB,UAAU,UAAU,UAAUA,CAAW,EAAE,KAAK,IAAMF,EAAiB,EAAI,CAAC,EAAE,MAAOG,GAAQT,EAASS,CAAG,CAAC,EAE1GT,EAAS,IAAI,MAAM,oDAAoD,CAAC,CAE3E,EAMc,MALD,IAAM,CAClBG,EAAU,EAAK,EACfH,EAAS,IAAI,EACb,OAAO,aAAaI,CAAW,CAChC,EACqB,MAAAL,EAAO,OAAAG,CAAQ,CACvC,CCXA,MAAMQ,EAAe,CACnB,QAAS,GACX,EACA,SAASC,EAAWC,EAAO,CACzB,KAAM,CAAE,SAAAC,EAAU,QAAAf,EAAS,MAAAS,EAAO,GAAGO,CAAQ,EAAGC,EAAS,aAAcL,EAAcE,CAAK,EACpFI,EAAYnB,EAAa,CAAE,QAAAC,EAAS,EAE1C,OAAuBmB,EAAIC,EAAU,CAAE,SAAUL,EAAS,CAAE,KAD/C,IAAMG,EAAU,KAAKT,CAAK,EAC2B,OAAQS,EAAU,OAAQ,GAAGF,CAAM,CAAE,CAAC,CAAE,CAC5G,CACAH,EAAW,YAAc","x_google_ignoreList":[0,1]}