{"version":3,"file":"score-button.js","sources":["../../../../src/components/score/score-button/score-button.ts"],"sourcesContent":["import { CSSResultGroup, TemplateResult, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { OutlineButton } from '../../base/outline-button/outline-button';\nimport { SlotController } from '../../controllers/slot-controller';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport componentStyles from './score-button.css.lit';\nimport { isExternalLink, isMessageRequired, isOmittedDomain } from '../../../utilities/external-links'; \n\nexport type ScoreButtonVariant =\n | 'primary'\n | 'secondary'\n | 'login'\n | 'signup'\n | 'filter';\n\n/**\n * The Score Button component\n * @element score-button\n *\n */\n\n@customElement('score-button')\nexport class ScoreButton extends OutlineButton {\n slots = new SlotController(\n this, // This, the host element.\n true // To shift or not to shift LightDom nodes to ShadowDOM.\n );\n static styles: CSSResultGroup = [componentStyles];\n @property({ type: String, attribute: 'sr-only' }) srOnly: string;\n @property({ type: Boolean, attribute: 'is-modal-action' }) isModalAction: boolean;\n @property({ type: String, attribute: 'rel-text' }) relText: string;\n\n render(): TemplateResult {\n const isModalAction = this.isModalAction ? true : false;\n let buttonUrl = this.buttonUrl ? String(this.buttonUrl) : '';\n let buttonTarget = this.buttonTarget ? String(this.buttonTarget) : undefined;\n let isLinkExternal: boolean = isExternalLink(buttonUrl);\n let isLinkOmitted: boolean = isOmittedDomain(buttonUrl);\n // External links should open in the new tab.\n if (isLinkExternal && !isLinkOmitted) {\n buttonTarget = '_blank';\n }\n \n if (isMessageRequired(buttonUrl) && !isModalAction && !isLinkOmitted) {\n // Call the modal in the score_content module.\n // To preserve the external link URL value within the\n // external modal, encode the URL prior to passing to the external modal.\n // When using javascript as an href, web browsers will automatically decode the value\n // which leads to the scoreContentCallModal receiving a decoded URL value.\n // Encoding the URL again before passing to the javascript call ensures any existing encoded\n // characters in the URL are preserved in the scoreContentCallModal once the web browser decodes\n // the value.\n buttonUrl = 'javascript:scoreContentCallModal(\"' + encodeURIComponent(buttonUrl) + '\")';\n buttonTarget = '_self';\n }\n return this.buttonUrl\n ? html` \n ${this.iconTemplate(this.hasLeftIcon, 'left')}\n \n ${this.iconTemplate(this.hasRightIcon, 'right')} ${this.hasSrOnly()}\n `\n : html`开云体育Crown-betting-help@symmjg.comGalaxy-Macau-sales@25674.net威尼斯人在线LOL外围下注esball易世博European-Cup-buying-contact@defraidlivestock.comCrown-camp-media@zaibj.net澳门银河太阳城娱乐城皇冠博彩皇冠博彩58同城绵阳分类信息网肇东信息网正规博彩平台博彩平台太阳城Online-gambling-platform-media@ehulk.netbet365-Asia-website-support@yibangyi.net女生私房话美女图库出门问问高分网 石家庄新浪乐居邢台恋家网欧泰克欧迅科技天助畅运津南政务网上海房价网尚美巴黎安徽医科大学第二附属医院奥鹏教育站点地图济南兼职网