define([ "exports", "./../emby-apiclient/connectionmanager.js", "./../emby-apiclient/events.js", "./../common/textencoding.js", "./../common/globalize.js", "./../common/datetime.js", "./../common/itemmanager/itemmanager.js", "./../common/playback/playbackmanager.js", "./../dom.js", "./../browser.js", "./../focusmanager.js", "./../layoutmanager.js", "./../mediainfo/mediainfo.js", "./../common/dataformatter.js", "./../indicators/indicators.js", "./../shortcuts.js", "./../common/servicelocator.js", "./../imageloader/imageloader.js", "./../emby-elements/userdatabuttons/emby-playstatebutton.js", "./../emby-elements/userdatabuttons/emby-ratingbutton.js", "./../emby-elements/emby-checkbox/emby-checkbox.js", "./../emby-elements/emby-button/paper-icon-button-light.js", "./../common/usersettings/usersettings.js", ], function ( _exports, _connectionmanager, _events, _textencoding, _globalize, _datetime, _itemmanager, _playbackmanager, _dom, _browser, _focusmanager, _layoutmanager, _mediainfo, _dataformatter, _indicators, _shortcuts, _servicelocator, _imageloader, _embyPlaystatebutton, _embyRatingbutton, _embyCheckbox, _paperIconButtonLight, _usersettings, ) { Object.defineProperty(_exports, "__esModule", { value: !0 }), (_exports.default = void 0), require([ "css!modules/cardbuilder/card.css", "programStyles", "embyProgressBarStyle", ]); var decodingAttribute = _dom.default.supportsAsyncDecodedImages() ? ' decoding="async"' : "", supportsObjectFit = CSS.supports("object-fit", "contain") && !_browser.default.edge, supportsCssVariables = CSS.supports("color", "var(--fake-var)"), supportsCalc = CSS.supports("width", "min(45.2%,calc(100% - .65em))"), supportsMin = CSS.supports("width", "min(10em, 5vw)"), EnableFocusTransfrom = _dom.default.allowFocusScaling(), supportsNativeLazyLoading = "loading" in HTMLImageElement.prototype; var refreshIndicatorLoaded, cachedWidths = {}; function setListOptions(items, options) { null == options.isBoundListItem && (options.isBoundListItem = !0), options.horizontal, (options.loadingLazyAttribute = ' loading="lazy"'), (options.cardSize && "default" !== options.cardSize) || (options.cardSize = _usersettings.default.cardSize()), (options.itemSelector = ".card"), (options.imageFallback = !1 !== options.imageFallback); for ( var shape = options.shape || "auto", fieldMap = (options.sideFooter && (options.textLinks = !(shape = "banner")), options.fields || (options.fields = []), {}), i = 0, length = options.fields.length; i < length; i++ ) fieldMap[options.fields[i]] = !0; (options.fieldMap = fieldMap), (options.fieldMapWithForceName = Object.assign( Object.assign({}, fieldMap), { ParentNameOrName: !0 }, )); var tagName, templateLines = (function (options) { var options = options.fieldMap, lines = []; return ( options.Name && lines.push(""), options.ParentNameOrName && lines.push(""), (options.ProductionYear || options.OfficialRating || options.Runtime) && lines.push(""), (options.CommunityRating || options.CriticRating) && lines.push( '
91%
', ), options.PersonRole && lines.push(""), options.ChapterTime && lines.push(""), options.ChannelName && lines.push(""), options.LastServerAddress && lines.push(""), options.Overview && lines.push(getOverviewText("")), options.Album && lines.push(""), options.Type && lines.push(""), options.LastActivityDateRelative && lines.push(""), options.DateCreated && lines.push(""), options.DateModified && lines.push(""), options.Size && lines.push(""), options.Version && lines.push(""), options.Url && lines.push(""), options.InstalledVersion && lines.push(""), options.ItemImageName && lines.push(""), options.Filename && lines.push(""), options.FilenameOrName && lines.push(""), (options.Resolution || options.Container || options.Bitrate) && lines.push(""), options.ParentName && lines.push(""), options.CollectionType && lines.push(""), options.LibraryFolders && lines.push(""), options.AppNameVersion && lines.push(""), options.AppName && lines.push(""), options.DeviceUserInfo && lines.push(""), options.CurrentProgramTime && lines.push(""), options.CurrentProgramParentName && lines.push(""), options.CurrentProgramName && lines.push(""), options.SeriesTimerChannel && lines.push(""), options.SeriesTimerTime && lines.push(""), options.ImageEditorStandardButtons && lines.push(""), options.ImageEditorBackdropButtons && lines.push(""), options.Genres && lines.push(""), options.Tags && lines.push(""), options.Studios && lines.push(""), options.SessionNowPlayingInfo && (lines.push(""), lines.push(""), lines.push("")), options.AirTime && lines.push(""), options.AccessToken && lines.push(""), options.DownloadableImageInfo && (lines.push(""), lines.push("")), lines ); })(options), autoShape = (options.lines || options.overlayText || (options.lines = templateLines.length), "auto" === shape || "autooverflow" === shape), items = (shape = autoShape ? _imageloader.default.getShape(items, options) : shape), autoShape = (options.sideFooter && (items = "square"), "auto" === options.preferThumb && (options.preferThumb = "square" === items ? null : "backdrop" === items || "fourThree" === items), !0 === options.preferThumb && autoShape && ((items = "backdrop"), options.sideFooter || (shape = "backdrop")), (options.uiAspect = _imageloader.default.getAspectFromShape( items, options, ).aspect), !options.width && options.widths && (options.width = options.widths[items]), options.rows && "number" != typeof options.rows && (options.rows = options.rows[items]), "card"), isLayoutTV = (shape && (autoShape += " " + shape + "Card"), options.horizontal && (autoShape += " card-horiz " + shape + "Card-horiz"), options.cardClass && (autoShape += " " + options.cardClass), _layoutmanager.default.tv), isSingleClickElement = (isLayoutTV || (autoShape += " card-hoverable"), (options.enableFocusScaling = !1 !== options.enableFocusScaling && isLayoutTV && EnableFocusTransfrom), (options.enableCardBox = options.enableFocusScaling || options.cardLayout || options.sideFooter || !isLayoutTV || !options.isVirtualList), (isLayoutTV && !options.staticElement) || (!1 === options.hoverMenu && "none" !== options.action)), lineContents = (options.enableFocusScaling && (autoShape += " card-focustransform"), options.sideFooter && ((autoShape += " sideFooterCard"), options.horizontal) && (autoShape += " sideFooterCard-horiz"), options.smallSideFooter && ((autoShape += " smallSideFooterCard"), options.horizontal) && (autoShape += " smallSideFooterCard-horiz"), isSingleClickElement ? ((tagName = "button"), (autoShape += " itemAction")) : ((tagName = "div"), options.staticElement || (options.addTabIndex = !0)), isLayoutTV ? ((options.draggable = !1), (options.dropTarget = !1), (options.dragReorder = !1)) : ((options.draggable = !1 !== options.draggable), options.dragReorder && options.draggable ? (autoShape += " drop-target ordered-drop-target-x") : options.dropTarget && (autoShape += " drop-target full-drop-target")), []); for ( options.lines && (lineContents.length = options.lines), i = 0, length = lineContents.length; i < length; i++ ) lineContents[i] = templateLines[i] || " "; var cardBoxClass = ((options.cardBoxClass || "") + " cardBox").trim(), lines = (options.sideFooter && ((cardBoxClass += " cardBox-sideFooter"), isLayoutTV && (cardBoxClass += " cardBox-sideFooter-f"), !0 !== options.centerText) && (options.centerText = !1), null == options.centerText && (options.centerText = !options.overlayText), (options.cardTextCssClass = options.centerText ? "cardText" : "cardText text-align-start"), lineContents.length ? getCardTextLines( lineContents, options.cardTextCssClass, !options.overlayText, !0, lineContents.length, options, ) : ""), cardDefaultTextClass = ( (options.cardDefaultTextClass || "") + " cardText cardDefaultText" ).trim(), cardDefaultTextClass = ((options.cardDefaultTextClass = cardDefaultTextClass), (options.cardLayout || options.sideFooter) && ((cardBoxClass += " visualCardBox"), options.vibrant) && ((cardBoxClass += " visualCardBox-vibrant"), "large" === options.vibrantMode) && (cardBoxClass += " visualCardBox-vibrant-lg"), isLayoutTV && options.enableFocusScaling && ((cardBoxClass += " cardBox-focustransform"), !options.focusTransformTitleAdjust || ("portrait" !== shape && "square" !== shape && "fourThree" !== shape) || (cardBoxClass += " cardBox-focustransform-titleadjust")), isSingleClickElement || !1 === options.moreButton || options.staticElement || (cardBoxClass += " cardBox-touchzoom"), !lineContents.length || options.overlayText || options.cardLayout || options.sideFooter || !1 === options.allowBottomPadding || (options.enableCardBox ? (cardBoxClass += " cardBox-bottompadded") : (autoShape += " card-bottompadded")), options.enableCardBox || (autoShape += " card-padded"), []), innerCardFooterClass = (options.sideFooter || cardDefaultTextClass.push("cardPadder-" + shape), options.cardPadderClass && cardDefaultTextClass.push(options.cardPadderClass), ["innerCardFooter"]), cardContentClass = (options.innerCardFooterClass && innerCardFooterClass.push(options.innerCardFooterClass), (options.round = options.round && "square" === shape), ( (options.cardContentClass || "") + " cardContent cardImageContainer" ).trim()), screenWidth = (options.cardLayout || options.sideFooter || ((cardContentClass += " cardContent-shadow"), "black" === options.background && (cardContentClass += " cardContent-bg-black")), options.paddedImage && (cardContentClass += " paddedImage"), options.defaultBackground && !options.cardLayout && (cardContentClass += " defaultCardBackground"), options.imageClass && (cardContentClass += " " + options.imageClass), options.sideFooter && ((cardContentClass += " cardImageContainer-sideFooter"), options.smallSideFooter) && (cardContentClass += " cardImageContainer-smallSideFooter"), options.round && (cardContentClass += " cardContent-round"), options.enableFocusScaling || options.sideFooter || (isSingleClickElement || options.action, isLayoutTV ? options.cardLayout ? (cardBoxClass += " cardContent-bxsborder") : (cardContentClass += " cardContent-bxsborder") : (cardContentClass += " cardContent-bxsborder-fv")), options.width || ((screenWidth = _dom.default.getWindowSize().innerWidth), (options.width = (function ( cardClass, cardBoxClass, cardContentClass, options, screenWidth, ) { options.sideFooter && (cardClass += " withsidefooter"), options.imageWidthTestClass && (cardClass += " " + options.imageWidthTestClass); var cardSize = options.cardSize, key = cardClass + screenWidth + cardSize; switch (cardSize) { case "": case "normal": case "default": break; default: key += "-" + cardSize; } (screenWidth = _layoutmanager.default.tv) && (key += "-tv"); var itemsContainerClass, width = cachedWidths[key]; return ( width || (console.log("getImageWidth: " + key), (itemsContainerClass = "itemsContainer padded-left padded-right"), screenWidth && (itemsContainerClass += " itemsContainer-tv"), ((screenWidth = document.createElement("div")).className = itemsContainerClass), (screenWidth.style.visibility = "hidden"), options.sideFooter ? (screenWidth.innerHTML = '
') : (screenWidth.innerHTML = '
'), (itemsContainerClass = document.body).appendChild(screenWidth), (width = options.sideFooter ? (cachedWidths[key] = screenWidth.querySelector(".cardImageContainer") .offsetWidth || 400) : (cachedWidths[key] = screenWidth.querySelector(".cardScalable").offsetWidth || 400)), itemsContainerClass.removeChild(screenWidth), console.log("width: " + width)), width ); })(autoShape, cardBoxClass, cardContentClass, options, screenWidth)), (windowWidth = screenWidth), (screen = window.screen) && 20 < screen.availWidth - windowWidth && (options.width = 50 * Math.ceil(options.width / 50))), options.enableCardBox ? '
' : ""), cardDefaultTextClass = cardDefaultTextClass.join(" "), innerCardFooterClass = innerCardFooterClass.join(" "), screen = (isSingleClickElement || "none" === options.action ? (screenWidth += '
') : (screenWidth += ''), "cardFooter"), windowWidth = (options.vibrant && (screen += " cardFooter-vibrant"), (options.outerFooterClass = screen), options.cardLayout && (screenWidth += '
'), (screenWidth += lines), options.cardLayout && (screenWidth += "
"), options.enableCardBox && (screenWidth += "
"), null == options.defaultIcon && (options.sideFooter || options.lines || fieldMap.Name ? (options.defaultIcon = !0) : (options.defaultIcon = !1)), (options.moreTitle = _globalize.default.translate("More")), (options.multiSelectTitle = _globalize.default.translate("MultiSelect")), (options.multiSelect = !1 !== options.multiSelect && !isLayoutTV), (options.contextMenu = !1 !== options.contextMenu), (options.enableUserData = !1 !== options.enableUserData), ""); options.addTabIndex && (windowWidth += ' tabindex="0"'), options.draggable && (windowWidth += ' draggable="true"'), "button" === tagName && (windowWidth += ' type="button"'), (options.fixedAttributes = windowWidth.trim()), (options.templateInnerHTML = screenWidth), (options.cardPadderClass = cardDefaultTextClass), (options.innerCardFooterClass = innerCardFooterClass), (options.tagName = tagName), (options.shape = shape), (options.imageShape = items), (options.className = autoShape), (options.isSingleClickElement = isSingleClickElement), (options.cardContentClass = cardContentClass), (options.cardBoxClass = cardBoxClass); } function buildCardsHtmlInternal(items, options) { setListOptions(items, options); for ( var hasOpenRow, html = "", itemsInRow = 0, rows = options.rows, i = 0, length = items.length; i < length; i++ ) rows && 0 === itemsInRow && (hasOpenRow && ((html += ""), (hasOpenRow = !1)), (html += '
'), (hasOpenRow = !0)), (html += getCardHtml(items[i], i, options)), itemsInRow++, rows && rows <= itemsInRow && ((html += "
"), (hasOpenRow = !1), (itemsInRow = 0)); return hasOpenRow && (html += ""), html; } function getCardTextLines( lines, cssClass, forceLines, isOuterFooter, maxLines, options, ) { for ( var html = "", valid = 0, currentCssClass = cssClass, i = 0, length = lines.length; i < length; i++ ) { var currentCssClass = cssClass, text = lines[i]; if (text && text.html) valid++, (html += text.html); else if ( (0 < valid && isOuterFooter ? (currentCssClass += " cardText-secondary") : 0 === valid && isOuterFooter && (options.sideFooter || (currentCssClass += " cardText-first-padded"), (currentCssClass += " cardText-first")), text && ((html = (html += '
') + text + "
"), valid++, maxLines) && maxLines <= valid) ) break; } if (forceLines) for ( length = maxLines || Math.min(lines.length, maxLines || lines.length); valid < length; ) (currentCssClass = cssClass), 0 < valid && isOuterFooter ? (currentCssClass += " cardText-secondary") : 0 === valid && isOuterFooter && (options.sideFooter || (currentCssClass += " cardText-first-padded"), (currentCssClass += " cardText-first")), (html += '
 
'), valid++; return html; } function isUsingLiveTvNaming(itemType) { return ( "Program" === itemType || "Timer" === itemType || "Recording" === itemType ); } function getAirTimeText(item, showAirDateTime, showAirEndTime) { var airTimeText = ""; if (item.StartDate) try { var date = new Date(Date.parse(item.StartDate)); showAirDateTime && (airTimeText += _datetime.default.toLocaleDateString(date, { weekday: "short", month: "short", day: "numeric", }) + " "), (airTimeText += _datetime.default.getDisplayTime(date)), item.EndDate && showAirEndTime && ((date = new Date(Date.parse(item.EndDate))), (airTimeText += " – " + _datetime.default.getDisplayTime(date))); } catch (e) { console.log("Error parsing date: " + item.StartDate); } return airTimeText; } function getOverviewText(text) { var html = '
'; return { html: html + _textencoding.default.htmlEncode(text || "") + "
", }; } function getTextLinksLine(options, item, linkItems, linkItemType, limit) { linkItems = linkItems || []; for ( var html = "", i = 0, length = (limit = Math.min(linkItems.length, limit)); i < length; i++ ) { var linkItem = linkItems[i], text = linkItem.Name; i < limit - 1 && (text += ","), (html += getTextActionButton( options, linkItem, text, item.ServerId, null, !1, )); } return '
' + html + "
"; } function getCardFooterText( item, itemController, options, fieldMap, imgUrl, footerClass, progressHtml, logoUrl, isOuterFooter, ) { var parentTitleUnderneath, itemType = item.Type, html = "", lines = (logoUrl && (html += ''), []); switch (itemType) { case "MusicAlbum": case "Audio": case "MusicVideo": case "Game": parentTitleUnderneath = !0; } var serverId = item.ServerId || options.serverId, parentTitle = (fieldMap.Album && options.albumFirst && (isOuterFooter && item.AlbumId && item.Album ? lines.push( getTextActionButton(options, { Id: item.AlbumId, ServerId: serverId, Name: item.Album, Type: "MusicAlbum", IsFolder: !0, }), ) : lines.push(item.Album || "")), (!fieldMap.ParentName && !fieldMap.ParentNameOrName) || parentTitleUnderneath || (isOuterFooter && "Episode" === itemType && item.SeriesName ? item.SeriesId ? lines.push( getTextActionButton(options, { Id: item.SeriesId, ServerId: serverId, Name: item.SeriesName, Type: "Series", IsFolder: !0, }), ) : lines.push(_textencoding.default.htmlEncode(item.SeriesName)) : isUsingLiveTvNaming(itemType) ? (lines.push(_textencoding.default.htmlEncode(item.Name)), item.EpisodeTitle || (titleAdded = !0)) : ((parentTitle = item.SeriesName || item.Series || item.Album || (item.AlbumArtist ? item.AlbumArtist.Name || item.AlbumArtist : null) || item.GameSystem || "") || fieldMap.Name) && lines.push(_textencoding.default.htmlEncode(parentTitle))), (fieldMap.Name && !titleAdded) || (fieldMap.ParentNameOrName && !lines.length)); if ( ((parentTitle = parentTitle || titleAdded || !fieldMap.Name ? parentTitle : !0) && (titleAdded = itemController.getDisplayName(item, { includeParentInfo: options.includeParentInfoInTitle, channelNumberFirst: options.channelNumberFirst, })) && (isOuterFooter ? lines.push( getTextActionButton( options, item, titleAdded, serverId, options.parentId, !0, ), ) : lines.push(_textencoding.default.htmlEncode(titleAdded))), fieldMap.Type && lines.push(itemController.getItemTypeName(itemType)), fieldMap.ParentName && parentTitleUnderneath && (isOuterFooter && item.AlbumArtists && item.AlbumArtists.length && "MusicAlbum" === itemType ? ((item.AlbumArtists[0].Type = "MusicArtist"), (item.AlbumArtists[0].IsFolder = !0), lines.push( getTextActionButton( options, item.AlbumArtists[0], null, serverId, ), )) : isOuterFooter && item.ArtistItems && item.ArtistItems.length ? ((item.ArtistItems[0].Type = "MusicArtist"), (item.ArtistItems[0].IsFolder = !0), lines.push( getTextActionButton(options, item.ArtistItems[0], null, serverId), )) : isOuterFooter && item.AlbumArtists && item.AlbumArtists.length ? ((item.AlbumArtists[0].Type = "MusicArtist"), (item.AlbumArtists[0].IsFolder = !0), lines.push( getTextActionButton( options, item.AlbumArtists[0], null, serverId, ), )) : isOuterFooter && item.GameSystem && item.GameSystemId ? lines.push( getTextActionButton(options, { Id: item.GameSystemId, ServerId: serverId, Name: item.GameSystem, Type: "GameSystem", IsFolder: !0, }), ) : lines.push( _textencoding.default.htmlEncode( isUsingLiveTvNaming(itemType) ? item.Name : item.SeriesName || item.Series || item.Album || (item.AlbumArtist ? item.AlbumArtist.Name || item.AlbumArtist : null) || item.GameSystem || "", ), )), options.textLines) ) for ( var additionalLines = options.textLines(item), i = 0, length = additionalLines.length; i < length; i++ ) lines.push(additionalLines[i]); fieldMap.Album && !options.albumFirst && (isOuterFooter && item.AlbumId && item.Album ? lines.push( getTextActionButton(options, { Id: item.AlbumId, ServerId: serverId, Name: item.Album, Type: "MusicAlbum", IsFolder: !0, }), ) : lines.push(item.Album || "")); var _lineParts, parentTitle = fieldMap.CommunityRating, titleAdded = fieldMap.CriticRating, emptyLines = [], parentTitle = ((parentTitle || titleAdded) && ((lineParts = []), parentTitle && item.CommunityRating && lineParts.push( _mediainfo.default.getCommunityRating(item, { outerClass: "cardMediaInfoItem", }), ), titleAdded && item.CriticRating && lineParts.push( _mediainfo.default.getCriticRating(item, { outerClass: "cardMediaInfoItem", }), ), (lineParts.length ? lines : (lineParts.push(" "), emptyLines) ).push( '
' + lineParts.join("") + "
", )), fieldMap.ProductionYear), titleAdded = fieldMap.OfficialRating, lineParts = fieldMap.Runtime; if ( ((parentTitle || titleAdded || lineParts) && ((_lineParts = []), parentTitle && ("Series" === itemType ? "Continuing" === item.Status ? item.ProductionYear && _lineParts.push( _globalize.default.translate( "SeriesYearToPresent", item.ProductionYear || "", ), ) : (parentTitle = item.EndDate ? new Date(Date.parse(item.EndDate)).getFullYear() : null) && item.ProductionYear && parentTitle !== item.ProductionYear ? _lineParts.push(item.ProductionYear + " – " + parentTitle) : item.ProductionYear && _lineParts.push(item.ProductionYear) : item.ProductionYear && _lineParts.push(item.ProductionYear)), lineParts && item.RunTimeTicks && _lineParts.push( _datetime.default.getHumanReadableRuntime(item.RunTimeTicks), ), titleAdded && item.OfficialRating && _lineParts.push(item.OfficialRating), lines.push(_lineParts.join("  "))), fieldMap.Genres) ) if (null != (parentTitle = item.GenreItems) && parentTitle.length) { switch (itemType) { case "Audio": case "MusicAlbum": case "MusicArtist": case "MusicVideo": 0; break; case "Game": case "GameSystem": 0; break; default: 0; } lines.push(getTextLinksLine(options, item, item.GenreItems, 0, 2)); } else emptyLines.push( '
 
', ); return ( fieldMap.Studios && (null != (lineParts = item.Studios) && lineParts.length ? lines.push(getTextLinksLine(options, item, item.Studios, 0, 1)) : emptyLines.push( '
 
', )), fieldMap.Tags && (null != (titleAdded = item.TagItems) && titleAdded.length ? lines.push(getTextLinksLine(options, item, item.TagItems, 0, 2)) : emptyLines.push( '
 
', )), fieldMap.AirTime && lines.push( getAirTimeText( item, options.showAirDateTime, options.showAirEndTime, ) || "", ), fieldMap.ChannelName && (item.ChannelId ? lines.push( getTextActionButton(options, { Id: item.ChannelId, ServerId: serverId, Name: item.ChannelName, ChannelNumber: item.ChannelNumber, Type: "TvChannel", MediaType: item.MediaType, IsFolder: !1, }), ) : lines.push(item.ChannelName || " ")), fieldMap.CurrentProgramParentName && (item.CurrentProgram ? lines.push(item.CurrentProgram.Name || "") : lines.push("")), fieldMap.CurrentProgramName && (item.CurrentProgram ? lines.push(item.CurrentProgram.EpisodeTitle || "") : lines.push(item.Name || "")), fieldMap.CurrentProgramTime && (item.CurrentProgram ? lines.push(getAirTimeText(item.CurrentProgram, !1, !0) || "") : lines.push("")), fieldMap.SeriesTimerTime && (item.RecordAnyTime ? lines.push(_globalize.default.translate("Anytime")) : item.StartDate ? lines.push(_datetime.default.getDisplayTime(item.StartDate)) : lines.push("")), fieldMap.SeriesTimerChannel && (item.RecordAnyChannel || null == (_lineParts = item.ChannelIds) || !_lineParts.length ? lines.push(_globalize.default.translate("AllChannels")) : 1 < (null == (parentTitle = item.ChannelIds) ? void 0 : parentTitle.length) ? lines.push( _globalize.default.translate( "NumberChannelsValue", null == (itemType = item.ChannelIds) ? void 0 : itemType.length, ), ) : item.ChannelName ? lines.push( _itemmanager.default.getDisplayName( { Id: item.ChannelId, ServerId: serverId, Name: item.ChannelName, ChannelNumber: item.ChannelNumber, Type: "TvChannel", MediaType: item.MediaType, IsFolder: !1, }, {}, ), ) : lines.push(_globalize.default.translate("OneChannel"))), fieldMap.PersonRole && (item.Role ? lines.push(_globalize.default.translate("ActorAsRole", item.Role)) : item.PersonType ? lines.push(_globalize.default.translate(item.PersonType)) : lines.push("")), fieldMap.ChapterTime && lines.push( _datetime.default.getDisplayRunningTime(item.StartPositionTicks), ), fieldMap.LastActivityDateRelative && lines.push( itemController.resolveField(item, "LastActivityDateRelative"), ), fieldMap.AppName && lines.push(itemController.resolveField(item, "AppName")), fieldMap.AccessToken && lines.push(itemController.resolveField(item, "AccessToken")), fieldMap.DateCreated && lines.push(itemController.resolveField(item, "DateCreated")), fieldMap.Url && lines.push(item.Url || ""), fieldMap.Version && lines.push(item.Version || ""), fieldMap.CollectionType && (item.Id ? lines.push( _itemmanager.default.getContentTypeName(item.CollectionType), ) : lines.push("")), fieldMap.LibraryFolders && (item.Locations && "boxsets" !== item.CollectionType ? 1 === item.Locations.length ? lines.push(item.Locations[0]) : lines.push( _globalize.default.translate( "NumLocationsValue", item.Locations.length, ), ) : lines.push("")), fieldMap.AppNameVersion && lines.push(itemController.resolveField(item, "AppNameVersion")), fieldMap.InstalledVersion && (item.InstalledVersion ? lines.push( _globalize.default.translate( "LabelVersionInstalled", item.InstalledVersion, ), ) : lines.push("")), fieldMap.InstalledVersion && lines.push(item.Version || ""), fieldMap.ItemImageName && (item.ImageTag ? lines.push(item.Name) : lines.push(" ")), fieldMap.Filename && lines.push(item.FileName || item.Filename), fieldMap.FilenameOrName && lines.push( _textencoding.default.htmlEncode( item.FileName || item.Filename || item.Name || "", ), ), fieldMap.MediaInfo && lines.push({ html: '
' + _mediainfo.default.getPrimaryMediaInfoHtml(item, { episodeTitle: !1, subtitles: !1, endsAt: !1, }) + "
", }), fieldMap.Overview && lines.push(getOverviewText(item.Overview)), (fieldMap.Resolution || fieldMap.Container || fieldMap.Bitrate) && ((lineParts = []), fieldMap.Container && item.Container && lineParts.push(item.Container.toUpperCase()), fieldMap.Resolution && item.Width && item.Height && (titleAdded = _dataformatter.default.getResolutionText(item)) && lineParts.push(titleAdded), fieldMap.Bitrate && item.Bitrate && lineParts.push(_dataformatter.default.bitrateToString(item.Bitrate)), lines.push(lineParts.join("  ") || " ")), fieldMap.DownloadableImageInfo && (lines.push( (function (item) { var text = "", lang = item.DisplayLanguage || item.Language; return ( item.Width && item.Height ? ((text += item.Width + "x" + item.Height), lang && (text += " - " + lang)) : lang && (text += lang), text ); })(item) || "", ), lines.push( (function (item) { var text; return ( "Likes" === item.RatingType ? (text = 1 === item.CommunityRating ? _globalize.default.translate("OneLike") : _globalize.default.translate( "LikeCountValue", item.CommunityRating, )) : item.CommunityRating ? ((text = _dataformatter.default.numberToString( item.CommunityRating, 1, )), item.VoteCount && (text += " - " + (1 === item.VoteCount ? _globalize.default.translate("OneVote") : _globalize.default.translate( "VoteCountValue", item.VoteCount, )))) : (text = _globalize.default.translate("Unrated")), text ); })(item) || "", )), fieldMap.DateModified && lines.push(itemController.resolveField(item, "DateModified")), fieldMap.Size && lines.push(itemController.resolveField(item, "Size")), fieldMap.DeviceUserInfo && ((_lineParts = ""), item.LastUserName && (item.LastUserId ? (_lineParts += getTextActionButton( options, { Id: item.LastUserId, Name: item.LastUserName, ServerId: serverId, Type: "User", }, item.LastUserName + ", " + _dataformatter.default.formatRelativeTime( item.DateLastActivity, ), null, null, )) : item.LastUserName && (_lineParts += item.LastUserName + ", " + _dataformatter.default.formatRelativeTime( item.DateLastActivity, ))), lines.push(_lineParts)), fieldMap.MediaStreamInfo && _mediainfo.default.pushMediaStreamLines( item, options, lines, itemController.getDefaultIcon(item), ), fieldMap.ImageEditorStandardButtons && lines.push( (function (item) { var searchText, html = ""; return ( item.Providers.length && (html += ''), item.ImageTag || (_servicelocator.appHost.supports("fileinput") && (html += '')), item.ImageTag && (html += ''), html ); })(item), ), fieldMap.ImageEditorBackdropButtons && lines.push( (function () { var html = ""; return (html += ''); })(), ), fieldMap.SessionNowPlayingInfo && (function (lines, item) { var playstate = item.PlayState, item = item.NowPlayingItem || {}; lines.push(item.SeriesName || item.Name), "Episode" === item.Type ? lines.push( _itemmanager.default.getDisplayName(item, { includeParentInfo: !0, }), ) : item.ArtistItems && item.ArtistItems.length ? lines.push(item.ArtistItems[0].Name) : item.ProductionYear && lines.push(item.ProductionYear), item.RunTimeTicks && lines.push( _datetime.default.getDisplayRunningTime( playstate.PositionTicks || 0, ) + " / " + _datetime.default.getDisplayRunningTime(item.RunTimeTicks), ); })(lines, item), fieldMap.LastServerAddress && ("Server" === item.Type ? ((parentTitle = _connectionmanager.default.getApiClient(item)), lines.push((parentTitle && parentTitle.serverAddress()) || "")) : lines.push("")), (html += getCardTextLines( (lines = lines.concat(emptyLines)), options.cardTextCssClass, isOuterFooter, isOuterFooter, options.lines, options, )), progressHtml && (html += progressHtml), html && (!isOuterFooter || logoUrl || options.cardLayout) && ((html = '
' + html), (html += "
")), html ); } function getTextActionButton( options, item, text, serverId, parentId, isSameItemAsCard, ) { var dataAttributes; return ( (text = text || _itemmanager.default.getDisplayName(item)), _layoutmanager.default.tv || !1 === options.textLinks ? _textencoding.default.htmlEncode(text) : ((text = _textencoding.default.htmlEncode(text)), (item = isSameItemAsCard ? ((dataAttributes = ""), options.linkButtonAction || "link") : ((dataAttributes = _shortcuts.default.getShortcutAttributesHtml( item, { serverId: serverId, parentId: parentId, isBoundListItem: options.isBoundListItem && isSameItemAsCard, }, )), "link")), '") ); } function getActiveSessionFooterHtml(options, item, apiClient) { var html = ""; return ( (html += '
') + (function (item) { var imgClass, imageUrl, html = ""; return ( item.NowPlayingItem && ((html += '
"), (imgClass = "secondaryText activeSession-deviceimage"), (html = (imageUrl = item.AppIconUrl) ? html + ('
' : (html = html + '
') + _itemmanager.default.getDefaultIcon(item) + "
"), (html += "
"), item.Client && (html = (html += "
") + item.Client + " " + item.ApplicationVersion + "
"), item.DeviceName && (html = (html += '
') + _textencoding.default.htmlEncode(item.DeviceName) + "
"), item.RemoteEndPoint && ((html = html + '
' + item.RemoteEndPoint), (imageUrl = (item.Protocol || "").toLowerCase()) && (html += " " + imageUrl), imageUrl.includes("https") && (html += 'https'), (html += "
")), (html += "
")), html ); })(item) + (function (item) { for ( var html = "", playstate = item.PlayState || {}, nowplayingItem = item.NowPlayingItem || {}, item = item.TranscodingInfo || {}, transcodeReasons = ((html = (html = (html = html + '
' + '
') + _globalize.default.translate("Stream")) + "
" + "
"), nowplayingItem.Container && ((html = (html += "
") + nowplayingItem.Container.toUpperCase()), nowplayingItem.Bitrate && (html += " (" + _dataformatter.default.bitrateToString( nowplayingItem.Bitrate, ) + ")"), (html += "
")), (html = html + "
" + ''), "Transcode" === playstate.PlayMethod ? ((nowplayingItem = []), item.SubProtocol && "progressive" !== item.SubProtocol ? nowplayingItem.push(item.SubProtocol.toUpperCase()) : item.Container && nowplayingItem.push(item.Container.toUpperCase()), item.Bitrate && ((playstate = "("), item.Bitrate && (playstate += _dataformatter.default.bitrateToString( item.Bitrate, )), item.Framerate && (playstate += " " + _dataformatter.default.numberToString( item.Framerate, 3, ) + " fps"), nowplayingItem.push((playstate += ")"))), item.CurrentThrottle && nowplayingItem.push( 'Throttling', ), (html += nowplayingItem.join(" "))) : (html += _globalize.default.translate("HeaderDirectPlay")), (html += "
"), item.TranscodeReasons || []), i = 0, length = transcodeReasons.length; i < length; i++ ) html = (html += "
") + _globalize.default.translate(transcodeReasons[i]) + "
"; return (html = html + "
" + "
"); })(item) + (function (item) { for ( var mediaStream, html = "", playstate = item.PlayState || {}, mediaStreams = (item.NowPlayingItem || {}).MediaStreams || [], videoStreamIndex = playstate.VideoStreamIndex, playstate = item.TranscodingInfo || {}, i = 0, length = mediaStreams.length; i < length; i++ ) if ( "Video" === mediaStreams[i].Type && (null == videoStreamIndex || videoStreamIndex === mediaStreams[i].Index) ) { mediaStream = mediaStreams[i]; break; } if (mediaStream) { if ( ((html = (html = (html = html + '
' + '
') + _globalize.default.translate("Video")) + "
" + "
"), mediaStream.DisplayTitle && ((html = html + '
' + mediaStream.DisplayTitle), playstate.VideoDecoderHwAccel && (html += ''), (html += "
")), (html = html + '
' + ''), !1 === playstate.IsVideoDirect ? ((html = (html = html + _globalize.default.translate("Transcode") + " (") + (playstate.VideoCodec || "").toUpperCase() + " "), playstate.VideoBitrate && (html += _dataformatter.default.bitrateToString( playstate.VideoBitrate, )), (html += ")"), playstate.VideoEncoderHwAccel && (html += '')) : ((html += _globalize.default.translate("HeaderDirectPlay")), mediaStream.BitRate && (html += " (" + _dataformatter.default.bitrateToString( mediaStream.BitRate, ) + ")")), (html += "
"), !1 === playstate.IsVideoDirect) ) for ( var pipeline = playstate.VideoPipelineInfo || [], _i = 0, _length = pipeline.length; _i < _length; _i++ ) { var extra, step = pipeline[_i]; ("ToneMapping" !== step.StepType && "Deinterlace" !== step.StepType && "SubTitleBurnIn" !== step.StepType && "SubtitleOverlay" !== step.StepType) || ((html += '
'), "ToneMapping" === step.StepType ? (html += _globalize.default.translate("HeaderToneMapping")) : "Deinterlace" === step.StepType ? (html += _globalize.default.translate("Deinterlacing")) : ("SubTitleBurnIn" !== step.StepType && "SubtitleOverlay" !== step.StepType) || (html += _globalize.default.translate( "HeaderBurningInSubtitles", )), (extra = []), step.ParamShort ? extra.push(step.ParamShort) : step.Param ? "Subtitles" !== step.Param && extra.push(step.Param) : step.FfmpegOptions && extra.push(step.FfmpegOptions), extra.length && (html += ' (' + extra.join(" ") + ")"), (html += "
")); } html = html + "
" + "
"; } return html; })(item) + (function (item) { for ( var mediaStream, html = "", playstate = item.PlayState || {}, mediaStreams = (item.NowPlayingItem || {}).MediaStreams || [], audioStreamIndex = playstate.AudioStreamIndex, playstate = item.TranscodingInfo || {}, i = 0, length = mediaStreams.length; i < length; i++ ) if ( "Audio" === mediaStreams[i].Type && (null == audioStreamIndex || audioStreamIndex === mediaStreams[i].Index) ) { mediaStream = mediaStreams[i]; break; } return ( mediaStream && ((html = (html += '
') + _globalize.default.translate("Audio") + "
"), (html = (mediaStream.DisplayTitle ? (html += "
") + mediaStream.DisplayTitle + "
" : html) + '
'), !1 === playstate.IsAudioDirect ? ((html = (html = html + _globalize.default.translate("Transcode") + " (") + (playstate.AudioCodec || "").toUpperCase() + " "), playstate.AudioBitrate && (html += _dataformatter.default.bitrateToString( playstate.AudioBitrate, )), (html += ")")) : ((html += _globalize.default.translate("HeaderDirectPlay")), mediaStream.BitRate && (html += " (" + _dataformatter.default.bitrateToString( mediaStream.BitRate, ) + ")")), (html += "
")), html ); })(item) + (function (item, apiClient) { var html = ""; if (item.UserId) { html += '
"; var names = []; item.UserId && names.push(item.UserName); for (var i = 0, length = item.AdditionalUsers.length; i < length; i++) names.push(item.AdditionalUsers[i].UserName); apiClient = item.UserId && item.UserPrimaryImageTag ? apiClient.getUserImageUrl(item.UserId, { tag: item.UserPrimaryImageTag, height: 24, type: "Primary", }) : null; apiClient && (html += ''), (html = html + ("
" + names.join(", ") + "
") + "
"); } return html; })(item, apiClient) + (function (options, item) { var html = ""; return ( options.isSingleClickElement || item.DeviceId === _connectionmanager.default.deviceId() || (item.ServerId && item.NowPlayingItem && item.SupportsRemoteControl && (html = (html += '") + ''), item.ServerId && item.SupportedCommands.includes("DisplayMessage") && item.DeviceId !== _connectionmanager.default.deviceId() && (html += ''), html && ((html = '
' + html), (html += "
"))), html ); })(options, item) + "
" ); } function getCardHtml(item, index, options) { var itemType = item.Type, action = options.action || "link", shape = ("none" !== action && (item.IsFolder && "play" === action ? (action = "link") : "Photo" === item.MediaType ? (action = "playallfromhere") : ("AddServer" !== itemType && "EmbyConnect" !== itemType && "Downloads" !== itemType) || (action = "link")), options.shape), imageShape = options.imageShape, isSingleClickElement = options.isSingleClickElement, serverId = item.ServerId || options.serverId, serverId = serverId ? _connectionmanager.default.getApiClient(serverId) : null, imageItem = options.showCurrentProgramImage ? item.CurrentProgram || item : "ActiveSession" === itemType ? item.NowPlayingItem : item.ProgramInfo || item, blurImageOptions = (!1 !== options.image && imageItem ? ((imgInfo = _imageloader.default.getImageUrl( imageItem, serverId, options, imageShape, )), (blurImageOptions = "large" === options.vibrantMode ? { width: 12, blur: 2, adjustForPixelRatio: !1 } : { width: 1, adjustForPixelRatio: !1 }), (vibrantImgInfo = options.vibrant ? _imageloader.default.getImageUrl( imageItem, serverId, blurImageOptions, imageShape, ) : null), imgInfo.imgUrl || imageItem === item || ((imgInfo = _imageloader.default.getImageUrl( (imageItem = item), serverId, options, imageShape, )), (vibrantImgInfo = options.vibrant ? _imageloader.default.getImageUrl( imageItem, serverId, blurImageOptions, imageShape, ) : null))) : (imgInfo = {}), imgInfo.imgUrl), imageShape = (vibrantImgInfo || imgInfo).imgUrl, vibrantImgInfo = imgInfo.forceName && "Photo" !== item.MediaType, overlayText = options.overlayText, fieldMap = options.fieldMap, cardContentClass = options.cardContentClass, cardImageClass = "cardImage", imageItem = !1 === options.coverImage ? null : _imageloader.default.getCoveredImageClass( imageItem, imgInfo.aspect, options.uiAspect, options.coverImage, ); imageItem && ((cardContentClass += imageItem), (cardImageClass += imageItem)), options.paddedImage && (cardImageClass += " cardImage-padded"), item.Policy && item.Policy.IsDisabled && (cardContentClass += " grayscaleImage"), options.defaultBackground || blurImageOptions || options.cardLayout || (cardContentClass += " defaultCardBackground"); options.round || "MusicArtist" !== itemType || "square" !== shape || (cardContentClass += " cardContent-round"); var cardImageContainerOpen, footerCssClass, logoUrl, imgInfo = options.cardBoxClass, imageItem = (options.playQueueIndicator && item.PlaylistItemId && (_playbackmanager.default.currentItem() || {}).PlaylistItemId === item.PlaylistItemId && (imgInfo += " activePlaylistCardBox"), !1 === options.progress ? null : _indicators.default.getProgressBarHtml(item, { containerClass: "cardProgressBarContainer", animated: !1, })), shape = "", itemController = (options.showChannelLogo && item.ChannelPrimaryImageTag && (logoUrl = serverId.getImageUrl(item.ChannelId, { type: "Primary", height: 40, tag: item.ChannelPrimaryImageTag, })), !1 === options.programIndicators || ("Program" !== itemType && "Timer" !== itemType && "TvChannel" !== itemType) || (imageItem = (function (item) { var html = ""; return ( (item = item.CurrentProgram || item).IsLive ? (html += '
' + _globalize.default.translate("Live") + "
") : item.IsPremiere && (html += '
' + _globalize.default.translate("Premiere") + "
"), html ); })(item) + (imageItem || "")), _itemmanager.default.getItemController(itemType)), vibrantImgInfo = (overlayText || vibrantImgInfo ? ((footerCssClass = options.innerCardFooterClass), (shape += getCardFooterText( item, itemController, options, (function (options, fieldMap, overlayText, forceName) { return overlayText ? !forceName || fieldMap.Name || fieldMap.ParentNameOrName || fieldMap.ParentName ? fieldMap : options.fieldMapWithForceName : !forceName || fieldMap.Name || fieldMap.ParentNameOrName || fieldMap.ParentName ? {} : { ParentNameOrName: !0 }; })(options, fieldMap, overlayText, vibrantImgInfo), 0, footerCssClass, imageItem, (logoUrl = null), !1, )), (imageItem = "")) : imageItem && ((shape = (shape += '
') + imageItem + "
"), (imageItem = "")), ""), fieldMap = (overlayText || ((footerCssClass = options.cardLayout ? options.outerFooterClass : "cardFooter cardFooter-transparent"), options.sideFooter && (footerCssClass += " cardFooter-side"), logoUrl && (footerCssClass += " cardFooter-withlogo"), options.vibrant && imageShape && "large" !== options.vibrantMode && (footerCssClass += " darkContentContainer"), (vibrantImgInfo = getCardFooterText( item, itemController, options, fieldMap, 0, footerCssClass, imageItem, (logoUrl = options.cardLayout ? logoUrl : null), !0, )), options.sideFooter && ((overlayText = "cardFooterContent"), options.centerText || (overlayText += " cardFooterContent-start"), (vibrantImgInfo = '
' + vibrantImgInfo + "
"), "ActiveSession" === itemType) && (vibrantImgInfo += getActiveSessionFooterHtml( options, item, serverId, ))), ""); return ( options.sideFooter || (cardContentClass += " " + options.cardPadderClass), (fieldMap = isSingleClickElement ? ((cardImageContainerOpen = blurImageOptions ? 2 === options.lazy ? supportsObjectFit ? '
 ' : '
' : supportsNativeLazyLoading ? '
 ' : '
' : '
'), "
") : "none" === action ? ((cardImageContainerOpen = blurImageOptions ? 2 === options.lazy ? supportsObjectFit ? '
 ' : '
' : supportsNativeLazyLoading ? '
 ' : '
' : '
'), "
") : ((cardImageContainerOpen = blurImageOptions ? 2 === options.lazy ? supportsObjectFit ? '")), !1 === options.image && !1 === options.imageContainer && (cardImageContainerOpen = fieldMap = ""), options.vibrant && imageShape ? ("large" === options.vibrantMode && (imgInfo += " darkContentContainer"), (cardImageContainerOpen = '
' + cardImageContainerOpen)) : options.enableCardBox && (cardImageContainerOpen = '
' + cardImageContainerOpen), options.typeIndicator && ("Video" === itemType ? (cardImageContainerOpen += '') : "Folder" === itemType || "PhotoAlbum" === itemType ? (cardImageContainerOpen += '') : "Photo" === itemType && (cardImageContainerOpen += '')), !1 !== options.missingIndicator && (cardImageContainerOpen += _indicators.default.getMissingIndicator( item, "cardIndicator cardMissingIndicator", )), !1 !== options.syncIndicator && (100 === (footerCssClass = item.SyncPercent) ? (cardImageContainerOpen += '') : null != footerCssClass && (cardImageContainerOpen += '')), !1 !== options.playedIndicator && (cardImageContainerOpen += _indicators.default.getPlayedIndicatorHtml( item, "cardIndicator card", )), !1 !== options.timerIndicator && (cardImageContainerOpen += _indicators.default.getTimerIndicator( item, "cardIndicator card", )), "CollectionFolder" === itemType || item.CollectionType ? ((imageItem = item.RefreshProgress ? "" : "hide"), options.sideFooter && (imageItem += " cardRefreshIndicator-sideFooter"), (cardImageContainerOpen += '
'), refreshIndicatorLoaded || ((refreshIndicatorLoaded = !0), require(["emby-itemrefreshindicator"]))) : "User" === itemType && item.ConnectLinkType && (cardImageContainerOpen += 'cloud'), !blurImageOptions && options.imageFallback && (cardImageContainerOpen += (function (item, options) { if (null != options.defaultTextContent) return ( '
' + options.defaultTextContent + "
" ); if ("ItemImage" === item.Type) return (function (item, options) { return ( '

' + item.Name + "

" ); })(item, options); var icon = item.Icon || (!1 === options.defaultIcon ? null : _itemmanager.default.getDefaultIcon(item, options)); if (icon) return options.smallSideFooter ? '' + icon + "" : options.sideFooter ? '' + icon + "" : '' + icon + ""; icon = isUsingLiveTvNaming(item.Type) ? item.Name : _itemmanager.default.getDisplayName(item, { includeParentInfo: options.includeParentInfoInTitle, channelNumberFirst: options.channelNumberFirst, }); return ( '
' + icon + "
" ); })(item, options)), (logoUrl = _layoutmanager.default.tv || !1 === options.hoverMenu ? "" : (function (item, itemController, action, options, menuClass) { var html = "", hasContent = !1, menuClass = ((html += '") : ""; })(item, itemController, action, options, options.cardPadderClass)), options.dragReorder && (logoUrl += ''), options.cardParts ? ((overlayText = _shortcuts.default.getShortcutAttributes( item, options, )), options.isSingleClickElement && overlayText.push({ name: "data-action", value: action }), options.isVirtualList || overlayText.push({ name: "data-index", value: index }), options.sideFooter ? (fieldMap += shape) : (fieldMap = shape + fieldMap), (serverId = cardImageContainerOpen + fieldMap + logoUrl + vibrantImgInfo), options.enableCardBox && (serverId += "
"), { attributes: overlayText, html: serverId }) : ((isSingleClickElement = _shortcuts.default.getShortcutAttributesHtml( item, options, )), options.isSingleClickElement && (isSingleClickElement += ' data-action="' + action + '"'), options.isVirtualList || (isSingleClickElement += ' data-index="' + index + '"'), (cardImageClass = options.tagName), options.sideFooter ? (fieldMap += shape) : (fieldMap = shape + fieldMap), (cardContentClass = options.fixedAttributes) && (isSingleClickElement += " " + cardContentClass), (imageShape = "<" + cardImageClass + isSingleClickElement + ' class="' + options.className + '">' + cardImageContainerOpen + fieldMap + logoUrl + vibrantImgInfo), options.enableCardBox && (imageShape += "
"), imageShape + "") ); } var supportsTargetBlank = _servicelocator.appHost.supports("targetblank"); function setUserPreferredSize(element, cardSize) { if (supportsCalc && supportsMin && supportsCssVariables) { var value = element ? cardSize : _usersettings.default.cardSize(); switch (value) { case "extrasmall": value = "3"; break; case "smaller": value = "2"; break; case "small": value = "1"; break; case "large": value = "-1"; break; case "larger": value = "-2"; break; case "extralarge": value = "-3"; break; case "normal": value = "0"; break; default: value = element ? "null" : "0"; } try { element && "null" === value ? element.style.removeProperty("--user-cards-size-adjust") : (element || document.documentElement).style.setProperty( "--user-cards-size-adjust", value, ); } catch (err) { console.log("error in setUserPreferredSize: " + err); } } } _events.default.on( _connectionmanager.default, "localusersignedin", function () { setUserPreferredSize(); }, ), _events.default.on( _usersettings.default, "change", function (e, name, value) { "cardSize" === name && setUserPreferredSize(); }, ), (_exports.default = { setListOptions: setListOptions, getItemsHtml: function (items, options) { return buildCardsHtmlInternal( (items = 1 === arguments.length ? (options = arguments[0]).items : items), options, ); }, getItemParts: function (item, index, options) { return (options.cardParts = !0), getCardHtml(item, index, options); }, buildCards: function (items, options) { var itemsContainer = options.itemsContainer; if (document.body.contains(itemsContainer)) { var parentContainer = options.parentContainer; if (parentContainer) { if (!items.length) return void parentContainer.classList.add("hide"); parentContainer.classList.remove("hide"); } parentContainer = buildCardsHtmlInternal(items, options); (itemsContainer.innerHTML = parentContainer), (itemsContainer.items = items), options.multiSelect && (itemsContainer.enableMultiSelect ? itemsContainer.enableMultiSelect(!0) : itemsContainer.setAttribute("data-multiselect", "true")), options.contextMenu && (itemsContainer.enableContextMenu ? itemsContainer.enableContextMenu(!0) : itemsContainer.setAttribute("data-contextmenu", "true")), parentContainer && _imageloader.default.lazyChildren(itemsContainer), options.autoFocus && _focusmanager.default.autoFocus(itemsContainer); } }, virtualChunkSize: 50, setListClasses: function (elem, listOptions) { var _listOptions$options, elem = elem.classList; (null != (_listOptions$options = listOptions.options) && _listOptions$options.rows) || (listOptions.virtualScrollLayout || "").includes("horizontal") ? elem.remove("vertical-wrap") : elem.add("vertical-wrap"), elem.remove("vertical-list"); }, setUserPreferredSize: setUserPreferredSize, }); });