{"version":3,"file":"Anchor-4b19a809.js","sources":["../../../../../../app/node_modules/@restart/ui/esm/Anchor.js"],"sourcesContent":["const _excluded = [\"onKeyDown\"];\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/anchor-has-content */\n\nimport * as React from 'react';\nimport { useEventCallback } from '@restart/hooks';\nimport { useButtonProps } from './Button';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function isTrivialHref(href) {\n return !href || href.trim() === '#';\n}\n/**\n * An generic `` component that covers a few A11y cases, ensuring that\n * cases where the `href` is missing or trivial like \"#\" are treated like buttons.\n */\nconst Anchor = /*#__PURE__*/React.forwardRef((_ref, ref) => {\n let {\n onKeyDown\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n const [buttonProps] = useButtonProps(Object.assign({\n tagName: 'a'\n }, props));\n const handleKeyDown = useEventCallback(e => {\n buttonProps.onKeyDown(e);\n onKeyDown == null ? void 0 : onKeyDown(e);\n });\n if (isTrivialHref(props.href) || props.role === 'button') {\n return /*#__PURE__*/_jsx(\"a\", Object.assign({\n ref: ref\n }, props, buttonProps, {\n onKeyDown: handleKeyDown\n }));\n }\n return /*#__PURE__*/_jsx(\"a\", Object.assign({\n ref: ref\n }, props, {\n onKeyDown: onKeyDown\n }));\n});\nAnchor.displayName = 'Anchor';\nexport default Anchor;"],"names":["_excluded","_objectWithoutPropertiesLoose","source","excluded","target","sourceKeys","key","i","isTrivialHref","href","Anchor","React.forwardRef","_ref","ref","onKeyDown","props","buttonProps","useButtonProps","handleKeyDown","useEventCallback","e","_jsx","Anchor$1"],"mappings":"oLAAA,MAAMA,EAAY,CAAC,WAAW,EAC9B,SAASC,EAA8BC,EAAQC,EAAU,CAAE,GAAID,GAAU,KAAM,MAAO,CAAE,EAAE,IAAIE,EAAS,CAAE,EAAMC,EAAa,OAAO,KAAKH,CAAM,EAAOI,EAAKC,EAAG,IAAKA,EAAI,EAAGA,EAAIF,EAAW,OAAQE,IAAOD,EAAMD,EAAWE,CAAC,EAAO,EAAAJ,EAAS,QAAQG,CAAG,GAAK,KAAaF,EAAOE,CAAG,EAAIJ,EAAOI,CAAG,GAAK,OAAOF,CAAS,CAQ5S,SAASI,EAAcC,EAAM,CAClC,MAAO,CAACA,GAAQA,EAAK,KAAI,IAAO,GAClC,CAKA,MAAMC,EAAsBC,EAAgB,WAAC,CAACC,EAAMC,IAAQ,CAC1D,GAAI,CACA,UAAAC,CACN,EAAQF,EACJG,EAAQd,EAA8BW,EAAMZ,CAAS,EACvD,KAAM,CAACgB,CAAW,EAAIC,EAAe,OAAO,OAAO,CACjD,QAAS,GACb,EAAKF,CAAK,CAAC,EACHG,EAAgBC,EAAiBC,GAAK,CAC1CJ,EAAY,UAAUI,CAAC,EACvBN,GAAa,MAAgBA,EAAUM,CAAC,CAC5C,CAAG,EACD,OAAIZ,EAAcO,EAAM,IAAI,GAAKA,EAAM,OAAS,SAC1BM,MAAK,IAAK,OAAO,OAAO,CAC1C,IAAKR,CACX,EAAOE,EAAOC,EAAa,CACrB,UAAWE,CACZ,CAAA,CAAC,EAEgBG,MAAK,IAAK,OAAO,OAAO,CAC1C,IAAKR,CACN,EAAEE,EAAO,CACR,UAAWD,CACZ,CAAA,CAAC,CACJ,CAAC,EACDJ,EAAO,YAAc,SACrB,MAAAY,EAAeZ","x_google_ignoreList":[0]}