import*as t from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as e from"@momentum-ui/utils/lib/getColorValue";import*as s from"lit";import*as i from"lit/decorators.js";import*as r from"lit/directives/class-map.js";import*as o from"lit/directives/if-defined.js";import*as a from"lit/directives/style-map.js";import*as d from"mobx";var n,m,c={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),p=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>
      `}};p([(0,n.property)({type:String})],e.prototype,"id",void 0),p([(0,n.property)({type:String})],e.prototype,"title",void 0),p([(0,n.property)({type:String})],e.prototype,"cardText",void 0),p([(0,n.property)({type:String})],e.prototype,"timestamp",void 0),p([(0,n.property)({type:Boolean})],e.prototype,"summariseMoreVisible",void 0),p([(0,n.property)({type:String})],e.prototype,"variant",void 0),p([(0,n.state)()],e.prototype,"copyChecked",void 0),p([(0,n.state)()],e.prototype,"thumbsUpChecked",void 0),p([(0,n.state)()],e.prototype,"thumbsDownChecked",void 0),e=p([(0,o.w)("md-card-ai")],e),t.ELEMENT=e}(r||(r={}))},9500(e,s,i){var r,o;e.exports=(r={default:()=>t.default},o={},i.d(o,r),o)},3496(t,s,i){var r,o;t.exports=(r={default:()=>e.default},o={},i.d(o,r),o)},2927(t,e,i){var r,o;t.exports=(r={LitElement:()=>s.LitElement,css:()=>s.css,html:()=>s.html,nothing:()=>s.nothing},o={},i.d(o,r),o)},8899(t,e,s){var r,o;t.exports=(r={property:()=>i.property,query:()=>i.query,state:()=>i.state},o={},s.d(o,r),o)},4955(t,e,s){var i,o;t.exports=(i={classMap:()=>r.classMap},o={},s.d(o,i),o)},3517(t,e,s){var i,r;t.exports=(i={ifDefined:()=>o.ifDefined},r={},s.d(r,i),r)},1156(t,e,s){var i,r;t.exports=(i={styleMap:()=>a.styleMap},r={},s.d(r,i),r)},4980(t,e,s){var i,r;t.exports=(i={action:()=>d.action,observable:()=>d.observable},r={},s.d(r,i),r)}},p={};function h(t){var e=p[t];if(void 0!==e)return e.exports;var s=p[t]={exports:{}};return c[t](s,s.exports,h),s.exports}h.m=c,n=[],h.O=(t,e,s,i)=>{if(!e){var r=1/0;for(m=0;m<n.length;m++){for(var[e,s,i]=n[m],o=!0,a=0;a<e.length;a++)(!1&i||r>=i)&&Object.keys(h.O).every(t=>h.O[t](e[a]))?e.splice(a--,1):(o=!1,i<r&&(r=i));if(o){n.splice(m--,1);var d=s();void 0!==d&&(t=d)}}return t}i=i||0;for(var m=n.length;m>0&&n[m-1][2]>i;m--)n[m]=n[m-1];n[m]=[e,s,i]},h.d=(t,e)=>{for(var s in e)h.o(e,s)&&!h.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},h.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{h as __webpack_require__};m={502:0,1745:0,4545:0,4928:0,4971:0,5369:0,6060:0,6920:0,8111:0,8442:0},h.C=t=>{var e,s,{__webpack_esm_ids__:i,__webpack_esm_modules__:r,__webpack_esm_runtime__:o}=t,a=0;for(e in r)h.o(r,e)&&(h.m[e]=r[e]);for(o&&o(h);a<i.length;a++)s=i[a],h.o(m,s)&&m[s]&&m[s][0](),m[i[a]]=0;h.O()},h.O.j=t=>0===m[t];import*as l from"../9609.js";h.C(l);import*as u from"../4084.js";h.C(u);import*as v from"../3305.js";h.C(v);import*as b from"../4739.js";h.C(b);import*as y from"../7154.js";h.C(y);import*as g from"../9773.js";h.C(g);import*as f from"../5983.js";h.C(f);import*as C from"../9488.js";h.C(C);import*as k from"../1821.js";h.C(k);import*as x from"../519.js";h.C(x);import*as E from"../2927.js";h.C(E);var T=h.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,2927],()=>h(7224));const $=(T=h.O(T)).p,w=T.a;export{$ as CardAi,w as CardAiVariant};