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Ac,CAAC,GAPjCA,EAQnB,0BAGA,MADC,MAAM,GAVYA,EAWnB,6BAXmBA,EAArB,MADC,MAAc,sBAAsB,GAChBA,CAAkB,C","sources":["webpack:///./src/js/wc/channels-page/NFBChannelDetail.ts","webpack:///./src/js/wc/channels-page/NFBChannelFeatured.ts"],"sourcesContent":["/**\n * Class NFBChannelDetail\n */\n\nimport { LitElement, html, css, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { store, RootState } from '@src/js/redux/store'\nimport { fetchChannel } from '@src/js/redux/channelsReducer'\nimport { bookmarkButtonType } from '@src/js/wc/cards/NFBDisplayWorkCard'\nimport { stringToBooleanConverter } from '@web-nfb/frontend-static/design-system/wc/_utils'\n\n@customElement('nfb-channel-detail')\nexport default class NFBChannelDetail extends LitElement {\n  @property({ type: String, attribute: 'slug' })\n  slug = ''\n\n  @property({ type: String, attribute: 'list-title' })\n  listTitle = ''\n\n  @property({ converter: stringToBooleanConverter, attribute: 'is-dark' })\n  isDark = false\n\n  @property({ converter: stringToBooleanConverter, attribute: 'is-clothesline' })\n  isClothesLine: boolean = false\n\n  @state()\n  _registryIds: number[] | null\n\n  _rootState: RootState\n\n  static styles = [css`\n    :host {\n      display: flex;\n      min-height: 180px;\n    }\n      \n    nfb-grid-list {\n      width: 100%;\n    }`\n  ]\n\n  async connectedCallback (): Promise<void> {\n    super.connectedCallback()\n    if (store.getState().channels.status === undefined) {\n      await store.dispatch(fetchChannel({ slug: this.slug, include_featured: false, per_page: 100 }))\n      this._rootState = store.getState()\n      const channelDetailState = this._rootState.channels\n      this._registryIds = channelDetailState.list\n    }\n  }\n\n  disconnectedCallback (): void {\n    super.disconnectedCallback()\n  }\n\n  render () {\n    return html`\n    <nfb-grid-list\n      registry-id-list=\"${JSON.stringify(this._registryIds)}\"\n      include-progress-bar=\"true\"\n      bookmark-button-type=\"${bookmarkButtonType.add}\"\n      list-title=\"${this.listTitle}\"\n      list-id=\"${this.slug}\"\n      is-dark=\"${this.isDark ?? nothing}\"\n      is-clothesline=\"${this.isClothesLine ?? nothing}\"\n    >\n    </nfb-grid-list>`\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'nfb-channel-detail': NFBChannelDetail\n  }\n}\n","/**\n * Class NFBChannelFeatured\n */\n\nimport { LitElement, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { store } from '@src/js/redux/store'\nimport { detailedIncludeFields, fetchWorks, selectWorkById, WorkCard } from '@src/js/redux/worksReducer'\nimport { handleUrl } from '@src/js/helpers/element/card'\n\n@customElement('nfb-channel-featured')\nexport default class NFBChannelFeatured extends LitElement {\n  @property({ type: String, attribute: 'channel-slug' })\n  channelSlug: string = ''\n\n  @property({ type: String, attribute: 'channel-title' })\n  channelTitle: string = ''\n\n  @property({ type: Number, attribute: 'featured-id' })\n  featuredId: number\n\n  @state()\n  _featuredWork: WorkCard|null\n\n  async connectedCallback (): Promise<void> {\n    super.connectedCallback()\n\n    await store.dispatch(fetchWorks({\n      idList: [this.featuredId],\n      includeFields: detailedIncludeFields\n    }))\n\n    this._featuredWork = selectWorkById(store.getState().works, this.featuredId)\n  }\n\n  getDescription () {\n    const description = this._featuredWork?.tagline ?? this._featuredWork?.description ?? ''\n    if (description.length <= 250) return description\n    const truncated = description.slice(0, 250).replace(/\\s+\\S*$/, '')\n    return truncated + '...'\n  }\n\n  getGTMAttributes () {\n    return {\n      nfb_list_name: `Channel Featured for ${this.channelTitle}`,\n      nfb_list_id: `channel-featured-${this.channelSlug}`,\n      nfb_version_title: this._featuredWork?.title\n    }\n  }\n\n  render () {\n    if (!this._featuredWork) {\n      return nothing\n    }\n\n    // We're using nfb-hero, but this should be replaced by a future NFBFeatured component\n    return html`\n      <nfb-hero\n        link=\"${handleUrl(this._featuredWork)}\"\n        thumbnail-path=\"${this._featuredWork.story_art_horizontal}\"\n        work-title=\"${this._featuredWork.title}\"\n        title-treatment-path=\"${this._featuredWork.title_treatment}\"\n        description=\"${this.getDescription()}\"\n        is-new-release=\"${this._featuredWork.is_new_release ? 'true' : 'false'}\"\n        coming-soon-date=\"${this._featuredWork.coming_soon}\"\n        label=\"${this._featuredWork.label}\"\n        gtm-attributes=\"${JSON.stringify(this.getGTMAttributes())}\"\n      ></nfb-hero>\n    `\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'nfb-channel-featured': NFBChannelFeatured\n  }\n}\n"],"names":["NFBChannelDetail","store","channelDetailState","NFBChannelFeatured","description"],"sourceRoot":""}