"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(28469),i=a(56705),l=a(83094),s=a(44614),o=(a(78066),a(56346)),r=a(76543);function d(e){i.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="'+e.AccessToken+'" class="raised raised-mini btnRevoke" data-mini="true" title="'+s.ZP.translate("ButtonRevoke")+'" style="margin:0;">'+s.ZP.translate("ButtonRevoke")+"</button>",t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">',t+=e.AccessToken,t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">',t+=e.AppName||"",t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">';var a=n.ZP.parseISO8601Date(e.DateCreated,!0);return t+=n.ZP.toLocaleDateString(a)+" "+n.ZP.getDisplayTime(a),(t+="</td>")+"</tr>"})).join("");e.querySelector(".resultBody").innerHTML=a,i.ZP.hide()}(e,t.Items)}))}(0,r.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:s.ZP.translate("HeaderNewApiKey"),label:s.ZP.translate("LabelAppName"),description:s.ZP.translate("LabelAppNameExample")}).then((function(t){ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Auth/Keys",{App:t})}).then((function(){d(e)}))}))}))}(e)})),e.querySelector(".tblApiKeys").addEventListener("click",(function(t){var a=l.ZP.parentWithClass(t.target,"btnRevoke");a&&function(e,t){(0,o.Z)(s.ZP.translate("MessageConfirmRevokeApiKey"),s.ZP.translate("HeaderConfirmRevokeApiKey")).then((function(){i.ZP.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Auth/Keys/"+t)}).then((function(){d(e)}))}))}(e,a.getAttribute("data-token"))}))})),(0,r.Xz)("pagebeforeshow","apiKeysPage",(function(){d(this)}))}}]);