"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9968],{45105:function(e,t,a){a.r(t),a(5769),a(61013),a(63238),a(61418),a(17460),a(14078);var n=a(65009),i=a.n(n),l=a(28469),s=a(56705),o=a(83094),r=a(44614),d=(a(78066),a(56346)),c=a(76543);function u(e){s.ZP.show(),ApiClient.getJSON(ApiClient.getUrl("Auth/Keys")).then((function(t){!function(e,t){var a=t.map((function(e){var t="";t+='<tr class="detailTableBodyRow detailTableBodyRow-shaded">',t+='<td class="detailTableBodyCell">',t+='<button type="button" is="emby-button" data-token="'+i()(e.AccessToken)+'" class="raised raised-mini btnRevoke" data-mini="true" title="'+r.ZP.translate("ButtonRevoke")+'" style="margin:0;">'+r.ZP.translate("ButtonRevoke")+"</button>",t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">',t+=i()(e.AccessToken),t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">',t+=i()(e.AppName)||"",t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">';var a=l.ZP.parseISO8601Date(e.DateCreated,!0);return t+=l.ZP.toLocaleDateString(a)+" "+l.ZP.getDisplayTime(a),(t+="</td>")+"</tr>"})).join("");e.querySelector(".resultBody").innerHTML=a,s.ZP.hide()}(e,t.Items)}))}(0,c.Xz)("pageinit","apiKeysPage",(function(){var e=this;e.querySelector(".btnNewKey").addEventListener("click",(function(){!function(e){a.e(8e3).then(a.bind(a,58e3)).then((function(t){(0,t.default)({title:r.ZP.translate("HeaderNewApiKey"),label:r.ZP.translate("LabelAppName"),description:r.ZP.translate("LabelAppNameExample")}).then((function(t){ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Auth/Keys",{App:t})}).then((function(){u(e)}))}))}))}(e)})),e.querySelector(".tblApiKeys").addEventListener("click",(function(t){var a=o.ZP.parentWithClass(t.target,"btnRevoke");a&&function(e,t){(0,d.Z)(r.ZP.translate("MessageConfirmRevokeApiKey"),r.ZP.translate("HeaderConfirmRevokeApiKey")).then((function(){s.ZP.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Auth/Keys/"+t)}).then((function(){u(e)}))}))}(e,a.getAttribute("data-token"))}))})),(0,c.Xz)("pagebeforeshow","apiKeysPage",(function(){u(this)}))}}]);