define(["exports","./../common/globalize.js","./../emby-elements/emby-input/emby-input.js","./../emby-elements/emby-select/emby-select.js","./../emby-elements/emby-button/emby-button.js","./../emby-elements/emby-button/paper-icon-button-light.js","./../emby-elements/emby-scroller/emby-scroller.js","./../emby-elements/emby-dialogclosebutton/emby-dialogclosebutton.js"],function(_exports,_globalize,_embyInput,_embySelect,_embyButton,_paperIconButtonLight,_embyScroller,_embyDialogclosebutton){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["formDialogStyle"]);_exports.default={embed:function(context,item,externalIds){for(var html="",providerIds=item.ProviderIds||{},keys=Object.keys(providerIds),i=0,length=externalIds.length;i<length;i++){var idInfo=externalIds[i],id="txt1"+idInfo.Key,formatString=idInfo.UrlFormatString||"",labelText=_globalize.default.translate("LabelDynamicExternalId").replace("{0}",idInfo.Name),value=(html=html+'<div class="inputContainer">'+'<div class="flex align-items-center">',providerIds[function(keys,key){var keyLower=key.toLowerCase();return keys.filter(function(k){return k.toLowerCase()===keyLower})[0]||key}(keys,idInfo.Key)]||""),html=(html+='<div class="flex-grow">')+('<input is="emby-input" class="txtExternalId '+id+'" value="'+value+'" data-providerkey="'+idInfo.Key+'" data-formatstring="'+formatString+'" label="'+labelText+'"/>')+"</div>";formatString&&(html+='<button type="button" is="paper-icon-button-light" class="btnOpenExternalId align-self-flex-end md-icon" data-fieldid="'+id+'">open_in_browser</button>'),html=html+"</div>"+"</div>"}context.querySelector(".externalIds",context).innerHTML=html,externalIds.length?context.classList.remove("hide"):context.classList.add("hide")},updateObjectFromElements:function(context,item){context=context.querySelectorAll(".txtExternalId"),Array.prototype.map.call(context,function(idElem){var providerKey=idElem.getAttribute("data-providerkey");item.ProviderIds[providerKey]=idElem.value})}}});