/*! For license information please see 39469.ec2b8fb1ae9773fc6d8b.chunk.js.LICENSE.txt */
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[39469],{39469:function(t,e,r){r(29305),r(32733),r(36947),r(26437),r(52697),r(78557),r(90076),r(45309);var n=r(53096),o=r(6940),i=r(67430),a=r(75384);function c(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof l?n:l,s=Object.create(c.prototype);return u(s,"_invoke",function(r,n,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,c=0,u=t,p.n=r,a}};function d(r,n){for(c=r,u=n,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];r>3?(o=y===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,p.v=n,p.n=i[1]):d<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function l(){}function s(){}function f(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(u(e={},n,(function(){return this})),e),d=f.prototype=l.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,u(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return s.prototype=f,u(d,"constructor",f),u(f,"constructor",s),s.displayName="GeneratorFunction",u(f,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,n,(function(){return this})),u(d,"toString",(function(){return"[object Generator]"})),(c=function(){return{w:i,m:y}})()}function u(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}u=function(t,e,r,n){function i(e,r){u(t,e,(function(t){return this._invoke(e,r,t)}))}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},u(t,e,r,n)}function l(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function s(t,e){return function(){var r={Fields:"PrimaryImageAspectRatio,MediaSourceCount,Chapters,Trickplay",EnableImageTypes:"Primary,Backdrop,Banner,Thumb",UserId:t.getCurrentUserId()};return t.getJSON(t.getUrl("Playlists/".concat(e,"/Items"),r))}}function f(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(r){return o.A.getListViewHtml({items:r,showIndex:!1,playFromHere:!0,action:"playallfromhere",smallIcon:!0,dragHandle:e,playlistId:t,showParentTitle:!0})}}function p(){var t;return t=c().m((function t(e,r){var o,u,l,p,d,y;return c().w((function(t){for(;;)switch(t.n){case 0:return o=i.tF.getApiClient(r.ServerId),u=(0,a.C)(o),l=!1,t.n=1,(0,n.C)(u).getPlaylistUser({playlistId:r.Id,userId:o.getCurrentUserId()}).catch((function(t){return console.info("[PlaylistViewer] Failed to fetch playlist permissions",t),{data:{}}}));case 1:p=t.v,d=p.data,l=!!d.CanEdit,(y=e.querySelector("#childrenContent .itemsContainer")).classList.add("vertical-list"),y.classList.remove("vertical-wrap"),y.enableDragReordering(l),y.fetchData=s(o,r.Id),y.getItemsHtml=f(r.Id,l);case 2:return t.a(2)}}),t)})),p=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){l(i,n,o,a,c,"next",t)}function c(t){l(i,n,o,a,c,"throw",t)}a(void 0)}))},p.apply(this,arguments)}function d(t){t.querySelector("#childrenContent").classList.add("verticalSection-extrabottompadding"),t.querySelector("#childrenContent .itemsContainer").refreshItems()}var y={render:function(t,e){t.playlistInit?d(t):(t.playlistInit=!0,function(t,e){return p.apply(this,arguments)}(t,e).finally((function(){d(t)})))}};e.default=y}}]);