/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import a from"./SBOSBG32.js";import{b as u}from"./W4YXXJAS.js";import{b as m}from"./S7VQX4XX.js";import{a as g}from"./XN2LWKJE.js";import{b as p}from"./ODCCVHGI.js";import{F as l,G as d,H as h,L as o,h as c,i}from"./42WFQ3AX.js";export default $arcgis.t(([,,,{b:r}])=>{var f=c`/** @license
 * Copyright 2025 Esri
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

.display-flex {
  display: flex;
}

.align-items-center {
  align-items: center;
}

.justify-content-center {
  justify-content: center;
}

.footer {
  width: 100%;
}

.footer-override {
  --calcite-dialog-footer-space: 0px;
}

.footer-card {
  width: 200px;
  height: 100px;
  cursor: pointer;
  padding-bottom: 2px;
}

.padding-1 {
  padding: 1rem;
}

.padding-bottom-1 {
  padding-bottom: 1rem;
}

.padding-end-1 {
  padding-inline-end: 1rem;
}

.padding-start-1 {
  padding-inline-start: 1rem;
}

.padding-top-1 {
  padding-top: 1rem;
}

.padding-top-1-2 {
  padding-top: .5rem;
}

.background-black {
  background-color: var(--calcite-color-foreground-3);
}

calcite-card:hover img {
  -webkit-filter: brightness(30%);
  filter: brightness(30%);
  -webkit-transition: all .1s ease;
  -moz-transition: all .1s ease;
  -o-transition: all .1s ease;
  -ms-transition: all .1s ease;
  transition: all .1s ease;
}

calcite-card:hover {
  outline: 2px solid var(--calcite-color-brand);
  box-sizing: border-box;
  cursor: pointer;
}

.calcite-card-selected {
  /* border: 2px solid var(--calcite-card-accent-color-selected, var(--calcite-color-brand)); */
    outline: 2px solid var(--calcite-color-brand);
  box-sizing: border-box;
  cursor: pointer;
}

calcite-card:hover .hover-text {
  opacity: 1;
  color: #ffffff;
}

.hover-text {
  transition: .1s ease;
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100%;
  font-size: var(--calcite-spacing-lg);
}

.card-image-wrap {
  width: 100%;
  position: relative;
  margin-bottom: 0;
  -webkit-box-flex: 0 0 auto;
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
}

.card-image {
  width: 100%;
  display: block;
}

video,
img {
  max-width: 100%;
  height: auto;
}

img {
  overflow-clip-margin: content-box;
  overflow: clip;
  display: block;
}`,n=class extends h{constructor(){super(...arguments),this.open=!1,this._screenshots=[],this._translations=g({name:"solution-snapshot-gallery",blocking:!0}),this._configContextConsumer=m({context:u,subscribe:!0}),this._displayText="",this._paginationControl=l(),this._screenshotNames=[]}static{this.properties={card:[0,{},{attribute:!1}],screenshot:[0,{},{attribute:!1}],itemProperties:[0,{},{attribute:!1}],open:[5,{},{type:Boolean}],_screenshots:[16,{},{state:!0}],_translations:[16,{},{state:!0}]}}static{this.styles=f}willUpdate(e){e.has("screenshot")&&this.screenshot&&(this._displayText=this.screenshot.alt),e.has("itemProperties")&&this.itemProperties&&(this._screenshots=this.itemProperties.preview.filter(t=>t.format==="image"),this._screenshotNames=this._screenshots.map(t=>t.name))}render(){return i`<calcite-dialog class="footer-override" .heading=${this.card?.title} modal @calciteDialogClose=${()=>this.open=!1} .open=${this.open} outside-close-disabled width=l>${this._getScreenshotView()}${this._getFooter()}</calcite-dialog>`}_getScreenshotView(){return this.screenshot?i`<div class="display-flex justify-content-center">${this._getImage(this.screenshot)}</div>`:""}_getFooter(){let e=this._screenshotNames.indexOf(this.screenshot?.name||""),s=document.body.classList.contains("calcite-mode-dark")?"calcite-mode-dark":"";return i`<div class="footer" slot=footer><div class=${`display-flex align-items-center padding-start-1 padding-top-1-2 background-black ${s}`}><calcite-label layout=inline><calcite-pagination class="padding-end-1" @calcitePaginationChange=${this._changeScreenshot} page-size=1 start-item=${e+1} total-items=${this._screenshots.length??o} ${d(this._paginationControl)}></calcite-pagination>${this._displayText}</calcite-label></div>${this._getCards()}</div>`}_changeScreenshot(){this.screenshot=this._screenshots[this._paginationControl.value.startItem-1]}_getCards(){return i`<calcite-card-group class="card-group padding-1" .label=${this._translations.seeSolutionScreenshots} selection-mode=single>${this._screenshots.map(e=>{let t=e.name===this.screenshot?.name;return i`<calcite-card class=${`footer-card ${t?"calcite-card-selected":""}`} .label=${e.alt} @click=${()=>this._showScreenshot(e)} .selected=${t}><div class="card-image-wrap" slot=thumbnail>${this._getImage(e,"thumbnail")}<div class="hover-text">${this._translations.viewScreenshot}</div></div></calcite-card>`})}</calcite-card-group>`}_getImage(e,t){return i`<img alt=${e.alt??o} slot=${t??o} src=${this._getSource(this._configContextConsumer.value.authentication,this.card?.id||"",e.name)??o}>`}_showScreenshot(e){this.screenshot=e}_getSource(e,t,s){let a=this._configContextConsumer.value;return a.agoBasedEnterpriseSolutionsGroupId&&a.isEnterprise?r(t||"",s,void 0,a.agolPortalUrl):e?r(t||"",s,e):""}};p("solution-snapshot-gallery",n);return n},"identity/IdentityManager","identity/OAuthInfo","portal/Portal",a)