{"version":3,"sources":["components/skip-to-content/skip-to-content.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQxE;;;GAGG;AACH,cACM,eAAgB,SAAQ,oBAAsB;IAClD;;OAEG;IAEH,kBAAkB,SAA0B;IAE5C;;OAEG;IAEH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,gBAAgB;IAOhB,iBAAiB;IAOjB,MAAM;IAKN,OAAO,CAAC,iBAAiB,KAAA;IAOzB,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,eAAe,CAAC","file":"skip-to-content.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2021\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings.js';\nimport ifNonNull from '../../globals/directives/if-non-null';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './skip-to-content.scss';\n\nconst { prefix } = settings;\n\n/**\n * Skip-to-content link.\n * @element bx-skip-to-content\n */\n@customElement(`${prefix}-skip-to-content`)\nclass BXSkipToContent extends FocusMixin(LitElement) {\n  /**\n   * The assistive text for the link,\n   */\n  @property({ attribute: 'link-assistive-text' })\n  linkAssisstiveText = 'Skip to main content';\n\n  /**\n   * The skip link href.\n   */\n  @property()\n  href?: string;\n\n  createRenderRoot() {\n    return this.attachShadow({\n      mode: 'open',\n      delegatesFocus: Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <= 537,\n    });\n  }\n\n  connectedCallback() {\n    if (!this.hasAttribute('role')) {\n      this.setAttribute('role', 'navigation');\n    }\n    super.connectedCallback();\n  }\n\n  render() {\n    const { linkAssisstiveText } = this;\n    return html` <a class=\"${prefix}--skip-to-content\" href=\"${ifNonNull(this.href)}\"><slot>${linkAssisstiveText}</slot></a> `;\n  }\n\n  updated(changedProperties) {\n    if (changedProperties.has('linkAssisstiveText')) {\n      const { linkAssisstiveText } = this;\n      this.setAttribute('aria-label', linkAssisstiveText);\n    }\n  }\n\n  static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXSkipToContent;\n"]}