/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import{a as e}from"./ONARC6AZ.js";import{a as _}from"./BM4VSEDV.js";import{b as f}from"./HVT2WBVC.js";import"./UBPOT5V3.js";import"./ISFTCFSJ.js";import{E as d,F as v,G as h,I as o,K as a,h as l,i as t,t as m}from"./FFF5HUPM.js";import"./EXBEKVP5.js";var $=l`@layer{:host{display:block}.instant-apps-popover__content{display:flex;flex-direction:column;padding:0 5% 5%;max-width:35vw;font-family:var(--calcite-sans-family);font-size:.875rem}.instant-apps-popover__content .instant-apps-popover__action{align-self:flex-start;--calcite-color-foreground-2: transparent}.instant-apps-popover__content span{display:inline-block;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);margin:0 0 10px;font-family:var(--calcite-sans-family)}.instant-apps-popover__content p{line-height:19.12px;margin:0 0 10px;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.instant-apps-popover__content .instant-apps-popover__footer span{margin-bottom:0;font-weight:400;font-size:.875rem;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:first-child{--calcite-color-foreground-3: transparent}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:last-child{margin-left:5px}.instant-apps-popover__content .instant-apps-popover__img{width:100%;margin-bottom:10px}.instant-apps-popover__content.instant-apps-popover--action-disabled{padding:5%}.instant-apps-popover__content.instant-apps-popover--action-disabled #subtitle{margin:0 0 10px}}`,n={content:"instant-apps-popover__content",buttonContainer:"instant-apps-popover__button-container",action:"instant-apps-popover__action",actionDisabled:"instant-apps-popover--action-disabled",img:"instant-apps-popover__img",footer:"instant-apps-popover__footer"},p=class extends h{constructor(){super(...arguments),this._messages=_({name:"instant-apps-popover"}),this.popoverEl=d(),this.popoverTitle="",this.subtitle="",this.content="",this.placement="trailing-start",this.pagination=!1,this.disableAction=!1}static{this.properties={popoverTitle:3,subtitle:3,content:3,imgSrc:3,imgAlt:3,mediaSrc:3,index:11,referenceElement:3,parent:0,placement:1,refId:1,pagination:7,disableAction:7,popoverAction:0,messageOverrides:0}}static{this.styles=$}static{this.shadowRootOptions=m}updated(){!this.hasUpdated&&this.popoverEl.value&&(this.popoverEl.value.referenceElement=this.referenceElement)}render(){return t`<calcite-popover .heading=${this.popoverTitle} auto-close .placement=${this.placement} .messageOverrides=${{close:this._messages.close}} trigger-disabled ref-id=${this.refId??a} closable .referenceElement=${this.referenceElement} .label=${this.popoverTitle} ${v(this.popoverEl)}><div class=${`${n.content}${this.disableAction?` ${n.actionDisabled}`:""}`}>${this.disableAction?null:e("popover-action",t`<calcite-action class=${o(n.action)} @click=${this.popoverAction} .icon=${document.dir==="rtl"?"chevron-right":"chevron-left"} text-enabled .text=${this._messages.back??""}></calcite-action>`)}<section><span id=subtitle>${this.subtitle}</span><p>${this.content}</p>${this.imgSrc?e(`iac-popover-img-${this.refId}`,t`<img class=${o(n.img)} src=${this.imgSrc??a} alt=${(this.imgAlt?this.imgAlt:"")??a}>`):null}</section>${this.pagination?e(`iac-popover-footer-${this.index}`,t`<div class=${o(n.footer)}><span>${this.index+1} ${this._messages?.of} ${this.parent?.instantAppsPopovers?.size}</span>${this.renderPagination()}</div>`):null}</div></calcite-popover>`}renderPagination(){let{index:r,_messages:s,parent:i}=this;if(!i)return null;let g=i.instantAppsPopovers.size,u=r===0,c=r===g-1;return e("pagination-button-container",t`<div class=${o(n.buttonContainer)}>${u?null:e("prev",t`<calcite-button @click=${async()=>await i?.previous()} appearance=outline kind=neutral>${s.back}</calcite-button>`)}${e("next",t`<calcite-button @click=${async()=>{c?await i?.done():await i?.next()}}>${c?s.done:s.next}</calcite-button>`)}</div>`)}};f("instant-apps-popover",p);export{p as InstantAppsPopover};
