var t,e,s={7224(t,e,s){s.d(e,{a:()=>i,p:()=>r}),s(5983),s(1821);var i,r,o=s(9609),a=s(4084),d=s(2927),n=s(8899),m=s(4955),c=s(5308),h=function(t,e,s,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,i);else for(var d=t.length-1;d>=0;d--)(r=t[d])&&(a=(o<3?r(a):o>3?r(e,s,a):r(e,s))||a);return o>3&&a&&Object.defineProperty(e,s,a),a};!function(t){t.USER_QUERY="user_query",t.RESPONSE="response"}(i||(i={})),function(t){let e=class extends d.LitElement{constructor(){super(...arguments),this.id="",this.title="",this.cardText="",this.timestamp="",this.summariseMoreVisible=!1,this.variant=i.RESPONSE,this.copyChecked=!1,this.thumbsUpChecked=!1,this.thumbsDownChecked=!1}static get styles(){return[a.A,c.A]}thumbsUpToggled(){this.thumbsDownChecked=!1,this.thumbsUpChecked=!this.thumbsUpChecked,this.dispatchEvent(new CustomEvent("thumbs-up-toggled",{detail:{id:this.id},bubbles:!0,composed:!0}))}thumbsDownToggled(){this.thumbsUpChecked=!1,this.thumbsDownChecked=!this.thumbsDownChecked,this.dispatchEvent(new CustomEvent("thumbs-down-toggled",{detail:{id:this.id},bubbles:!0,composed:!0}))}summariseMoreToggled(){this.dispatchEvent(new CustomEvent("summarise-more-toggled",{detail:{id:this.id},bubbles:!0,composed:!0}))}copyToggled(){navigator.clipboard.writeText(this.cardText),this.copyChecked=!0,setTimeout(()=>{this.copyChecked=!1},2e3)}get bottomBorderRadiusClass(){return this.timestamp?"with-bottom-border-radius":"no-bottom-border-radius"}get cardTextClassMap(){return{"md-card-ai-card-body-user-query":this.variant===i.USER_QUERY,[`md-card-ai-card-body-response-${this.bottomBorderRadiusClass}`]:this.variant===i.RESPONSE}}renderHeader(){return this.variant===i.RESPONSE&&""!==this.title?d.html`
          <div class="md-card-ai-header">
            <slot name="card-header-aside">
              <md-icon name="cisco-ai-assistant-color-gradient" iconSet="momentumBrandVisuals"></md-icon>
            </slot>
            <div class="md-card-ai-header-title">
              <slot name="card-header-title">
                <h3>${this.title}</h3>
              </slot>
            </div>
          </div>
        `:d.nothing}renderCardText(){return""!==this.cardText?d.html`
          <div class=${(0,m.classMap)(this.cardTextClassMap)}>
            <h3>${this.cardText}</h3>
            ${this.renderResponseCard()}
          </div>
        `:d.nothing}renderThumbsUpButton(){const t=this.thumbsUpChecked?"secondary":"ghost",e=this.thumbsUpChecked?"This is helpful, selected":"This is helpful";return d.html`
        <div class="md-card-ai-thumbs-up">
          <md-button
            circle
            variant=${t}
            size="28"
            ariaLabel=${e}
            @click=${this.thumbsUpToggled}
          >
            <md-icon slot="icon" name="like-regular" iconSet="momentumDesign"></md-icon>
          </md-button>
        </div>
      `}renderThumbsDownButton(){const t=this.thumbsDownChecked?"secondary":"ghost",e=this.thumbsDownChecked?"This is not helpful, selected":"This is not helpful";return d.html`
        <div>
          <md-button
            circle
            variant=${t}
            size="28"
            ariaLabel=${e}
            @click=${this.thumbsDownToggled}
          >
            <md-icon slot="icon" name="dislike-regular" iconSet="momentumDesign"></md-icon>
          </md-button>
        </div>
      `}renderCopyButton(){const t=this.copyChecked?"secondary":"ghost",e=this.copyChecked?"Copied, selected":"Copy summary";return d.html`
        <div class="md-card-ai-copy-button-container">
          <md-button
            size="32"
            variant=${t}
            ariaLabel=${e}
            outline
            @click=${this.copyToggled}
          >
            <md-icon
              slot="icon"
              name=${this.copyChecked?"check-regular":"copy-regular"}
              iconSet="momentumDesign"
            ></md-icon>
            <span slot="text">${this.copyChecked?"Copied":"Copy"}</span>
          </md-button>
        </div>
      `}renderResponseCard(){return this.variant===i.RESPONSE&&""!==this.timestamp?d.html`
          <div class="md-card-ai-divider"></div>
          <div class="md-card-ai-time-wrapper">
            <time class="md-card-ai-time" aria-hidden="true" datetime=${this.timestamp}> ${this.timestamp} </time>
            <span class="md-card-ai-dot-separator">&#8226;</span>
            <div class="md-card-ai-feedback">${this.renderThumbsUpButton()} ${this.renderThumbsDownButton()}</div>
            ${this.renderCopyButton()}
          </div>
        `:d.nothing}renderFooter(){return this.variant===i.RESPONSE&&this.summariseMoreVisible?d.html`
          <div class="md-card-ai-footer">
            <md-button size="32" variant="ghost" outline @click=${this.summariseMoreToggled}>
              <span slot="text">Summarise more</span>
            </md-button>
          </div>
        `:d.nothing}render(){return d.html`
        <div class="md-card-ai" id="${this.id}" part="card" tabindex="0">
          ${this.renderHeader()}
          <div class="content-margin">${this.renderCardText()} ${this.renderFooter()}</div>
        </div>
      `}};h([(0,n.property)({type:String})],e.prototype,"id",void 0),h([(0,n.property)({type:String})],e.prototype,"title",void 0),h([(0,n.property)({type:String})],e.prototype,"cardText",void 0),h([(0,n.property)({type:String})],e.prototype,"timestamp",void 0),h([(0,n.property)({type:Boolean})],e.prototype,"summariseMoreVisible",void 0),h([(0,n.property)({type:String})],e.prototype,"variant",void 0),h([(0,n.state)()],e.prototype,"copyChecked",void 0),h([(0,n.state)()],e.prototype,"thumbsUpChecked",void 0),h([(0,n.state)()],e.prototype,"thumbsDownChecked",void 0),e=h([(0,o.w)("md-card-ai")],e),t.ELEMENT=e}(r||(r={}))}},i={};function r(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={exports:{}};return s[t](o,o.exports,r),o.exports}r.m=s,t=[],r.O=(e,s,i,o)=>{if(!s){var a=1/0;for(c=0;c<t.length;c++){for(var[s,i,o]=t[c],d=!0,n=0;n<s.length;n++)(!1&o||a>=o)&&Object.keys(r.O).every(t=>r.O[t](s[n]))?s.splice(n--,1):(d=!1,o<a&&(a=o));if(d){t.splice(c--,1);var m=i();void 0!==m&&(e=m)}}return e}o=o||0;for(var c=t.length;c>0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[s,i,o]},r.d=(t,e)=>{for(var s in e)r.o(e,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={4971:0},r.C=t=>{var s,i,{__webpack_esm_ids__:o,__webpack_esm_modules__:a,__webpack_esm_runtime__:d}=t,n=0;for(s in a)r.o(a,s)&&(r.m[s]=a[s]);for(d&&d(r);n<o.length;n++)i=o[n],r.o(e,i)&&e[i]&&e[i][0](),e[o[n]]=0;r.O()},r.O.j=t=>0===e[t];import*as o from"../9609.js";r.C(o);import*as a from"../4084.js";r.C(a);import*as d from"../4955.js";r.C(d);import*as n from"../3517.js";r.C(n);import*as m from"../1156.js";r.C(m);import*as c from"../3305.js";r.C(c);import*as h from"../4739.js";r.C(h);import*as p from"../7154.js";r.C(p);import*as l from"../9773.js";r.C(l);import*as u from"../5983.js";r.C(u);import*as b from"../7755.js";r.C(b);import*as v from"../1821.js";r.C(v);import*as C from"../4980.js";r.C(C);import*as g from"../9500.js";r.C(g);import*as y from"../519.js";r.C(y);import*as f from"../4137.js";r.C(f);import*as k from"../8165.js";r.C(k);import*as T from"../2451.js";r.C(T);var E=r.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,4980,9500,519,4137,8165,2451],()=>r(7224));const $=(E=r.O(E)).p,j=E.a;export{$ as CardAi,j as CardAiVariant};