(this.webpackJsonpbazarr=this.webpackJsonpbazarr||[]).push([[0],{303:function(e,t,n){},323:function(e,t,n){},325:function(e,t,n){},336:function(e,t,n){},337:function(e,t,n){},339:function(e,t,n){},340:function(e,t,n){},341:function(e,t,n){},472:function(e,t,n){},473:function(e,t,n){},474:function(e,t,n){},475:function(e,t,n){"use strict";n.r(t);n(290);var r,a=n(0),c=n.n(a),i=n(30),s=n.n(i),o=n(90),l=n(33),u=n(28),d=n(95),j=(n(299),n(252)),b=n.n(j),h=n(253),O=n(23),f=n(3),p=n(497),x="UPDATE_PROVIDER_LIST",v="UPDATE_ALL_LANGUAGES_LIST",m="UPDATE_LANGUAGES_PROFILE_LIST",g="UPDATE_SYSTEM_STATUS",y="UPDATE_SYSTEM_TASKS",k="UPDATE_SYSTEM_LOGS",S="SYSTEM_UPDATE_RELEASES",w="UPDATE_SYSTEM_SETTINGS",C="SYSTEM_RUN_TASK",N="SERIES_UPDATE_WANTED_RANGE",I="UPDATE_SERIES_WANTED_LIST",P="UPDATE_SERIES_EPISODE_LIST",A="UPDATE_SERIES_HISTORY_LIST",T="UPDATE_SEIRES_INFO",M="SERIES_UPDATE_RANGE",E="UPDATE_SERIES_BLACKLIST",B="MOVIES_UPDATE_WANTED_RANGE",K="UPDATE_MOVIE_WANTED_LIST",z="UPDATE_MOVIE_HISTORY_LIST",D="UPDATE_MOVIE_INFO",R="MOVIES_UPDATE_RANGE",L="UPDATE_MOVIES_BLACKLIST",_="SITE_AUTH_SUCCESS",H="SITE_NEED_AUTH",U="SITE_SYSTEM_INITIALIZED",F="SITE_INITIALIZE_FAILED",G="SITE_SAVE_LOCALSTORAGE",q="SITE_NOTIFICATIONS_ADD",W="SITE_NOTIFICATIONS_REMOVE",Y="SITE_NOTIFICATIONS_REMOVE_BY_TIMESTAMP",V="SITE_SIDEBAR_UPDATE",Q="SITE_BADGE_UPDATE",X="SITE_OFFLINE_UPDATE",J=n(22),Z=n(6),$=n(15);function ee(e){return Object($.isString)(e)||Object($.isNumber)(e)}function te(e){return Object($.isNull)(e)||Object($.isUndefined)(e)}function ne(e){return!te(e)}function re(e){return"radarrId"in e}function ae(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=null!==(e=window.Bazarr.baseUrl)&&void 0!==e?e:"/";return t&&!n.endsWith("/")&&(n+="/"),n}function ce(){var e=Object(l.h)();return Object(a.useCallback)((function(){return e.push("/")}),[e])}function ie(e,t){Object(a.useEffect)((function(){e();var n=null;return void 0!==t&&(n=setInterval(e,t)),function(){null!==n&&clearInterval(n)}}),[e,t])}function se(e,t){return function(e,t,n,r){var c=Object(a.useState)(e),i=Object(Z.a)(c,2)[1];Object(a.useEffect)((function(){i((function(a){return a!==e&&(e!==t?r&&r():n&&n()),e}))}),[e,t,r,n])}(e.updating,!0,void 0,t)}function oe(e,t,n){t({updating:!0,data:n}),e.then((function(e){t({updating:!1,data:e})})).catch((function(e){t({updating:!1,error:e,data:n})}))}function le(e){return re(e)?e.radarrId:"sonarrEpisodeId"in e?e.sonarrEpisodeId:function(e){return"episodeFileCount"in e}(e)?e.sonarrSeriesId:-1}function ue(e){var t=e.items;return e.order.flatMap((function(e){return null!==e&&e in t?[t[e]]:[]}))}function de(e,t,n){var r=Object(J.a)(e);return t.filter((function(e){return!te(e)})).forEach((function(e){var t=r.findIndex((function(t,r){return!te(t)&&n(t,e)}));-1!==t?r[t]=e:r.push(e)})),r}function je(){for(var e=arguments.length,t=new Array(e),n=0;n0?(r=h).push.apply(r,Object(J.a)(Array(O).fill(null))):O<0&&(h=Array(s).fill(null),b=Object(f.a)({},d)),"number"===typeof l&&"number"===typeof u?(a=h).splice.apply(a,[l,u].concat(Object(J.a)(j))):void 0===l&&(h=j),{updating:!1,data:{items:b,order:h}}}var pe,xe,ve=Object(p.a)((r={},Object(O.a)(r,K,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedMovieList:fe(t,e.wantedMovieList,"radarrId")})})),Object(O.a)(r,B,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedMovieList:fe(t,e.wantedMovieList,"radarrId")})})),Object(O.a)(r,z,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{historyList:Oe(t,e.historyList.data)})})),Object(O.a)(r,D,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{movieList:fe(t,e.movieList,"radarrId")})})),Object(O.a)(r,R,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{movieList:fe(t,e.movieList,"radarrId")})})),Object(O.a)(r,L,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{blacklist:Oe(t,e.blacklist.data)})})),r),{movieList:{updating:!0,data:{items:{},order:[]}},wantedMovieList:{updating:!0,data:{items:{},order:[]}},historyList:{updating:!0,data:[]},blacklist:{updating:!0,data:[]}}),me=Object(p.a)((pe={},Object(O.a)(pe,I,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedEpisodesList:fe(t,e.wantedEpisodesList,"sonarrEpisodeId")})})),Object(O.a)(pe,N,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedEpisodesList:fe(t,e.wantedEpisodesList,"sonarrEpisodeId")})})),Object(O.a)(pe,P,(function(e,t){var n=Oe(t,[]),r=n.updating,a=n.error,c=n.data,i=Object(f.a)({},e.episodeList.data);c.length>0&&(i[c[0].sonarrSeriesId]=c);return Object(f.a)(Object(f.a)({},e),{},{episodeList:{updating:r,error:a,data:i}})})),Object(O.a)(pe,A,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{historyList:Oe(t,e.historyList.data)})})),Object(O.a)(pe,T,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{seriesList:fe(t,e.seriesList,"sonarrSeriesId")})})),Object(O.a)(pe,M,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{seriesList:fe(t,e.seriesList,"sonarrSeriesId")})})),Object(O.a)(pe,E,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{blacklist:Oe(t,e.blacklist.data)})})),pe),{seriesList:{updating:!0,data:{items:{},order:[]}},wantedEpisodesList:{updating:!0,data:{items:{},order:[]}},episodeList:{updating:!0,data:{}},historyList:{updating:!0,data:[]},blacklist:{updating:!0,data:[]}}),ge="storage-ui-pageSize",ye={get pageSize(){var e;return parseInt(null!==(e=localStorage.getItem(ge))&&void 0!==e?e:"50")},set pageSize(e){localStorage.setItem(ge,e.toString())}};function ke(){return{pageSize:ye.pageSize}}var Se,we=Object(p.a)((xe={},Object(O.a)(xe,H,(function(e){return Object(f.a)(Object(f.a)({},e),{},{auth:!1})})),Object(O.a)(xe,_,(function(e){return Object(f.a)(Object(f.a)({},e),{},{auth:!0})})),Object(O.a)(xe,U,(function(e){return Object(f.a)(Object(f.a)({},e),{},{initialized:!0})})),Object(O.a)(xe,F,(function(e){return Object(f.a)(Object(f.a)({},e),{},{initialized:"An Error Occurred When Initializing Bazarr UI"})})),Object(O.a)(xe,G,(function(e,t){var n=t.payload;for(var r in n){var a=n[r];localStorage.setItem(r,a)}return Object(f.a)(Object(f.a)({},e),ke())})),Object(O.a)(xe,q,(function(e,t){var n=[].concat(Object(J.a)(e.notifications.filter((function(e){return e.id!==t.payload.id}))),[t.payload]);return Object(f.a)(Object(f.a)({},e),{},{notifications:n})})),Object(O.a)(xe,W,(function(e,t){var n=e.notifications.filter((function(e){return e.id!==t.payload}));return Object(f.a)(Object(f.a)({},e),{},{notifications:n})})),Object(O.a)(xe,Y,(function(e,t){var n=e.notifications.filter((function(e){return e.timestamp!==t.payload}));return Object(f.a)(Object(f.a)({},e),{},{notifications:n})})),Object(O.a)(xe,V,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{sidebar:t.payload})})),Object(O.a)(xe,Q,{next:function(e,t){var n=t.payload.item;return n&&!0!==t.error?Object(f.a)(Object(f.a)({},e),{},{badges:n}):e},throw:function(e){return e}}),Object(O.a)(xe,X,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{offline:t.payload})})),xe),Object(f.a)({initialized:!1,auth:!0,pageSize:50,notifications:[],sidebar:"",badges:{movies:0,episodes:0,providers:0},offline:!1},ke())),Ce=Object(p.a)((Se={},Object(O.a)(Se,v,(function(e,t){var n=Oe(t,[]),r=Object(f.a)(Object(f.a)({},n),{},{data:n.data.filter((function(e){return e.enabled}))});return Object(f.a)(Object(f.a)({},e),{},{languages:n,enabledLanguage:r})})),Object(O.a)(Se,m,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{languagesProfiles:Oe(t,[])})})),Object(O.a)(Se,g,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{status:Oe(t,e.status.data)})})),Object(O.a)(Se,y,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{tasks:Oe(t,e.tasks.data)})})),Object(O.a)(Se,C,(function(e,t){var n=t.payload,r=e.tasks,a=Object(J.a)(r.data),c=a.findIndex((function(e){return e.job_id===n}));return-1!==c&&(a[c].job_running=!0),Object(f.a)(Object(f.a)({},e),{},{tasks:Object(f.a)(Object(f.a)({},r),{},{data:a})})})),Object(O.a)(Se,x,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{providers:Oe(t,e.providers.data)})})),Object(O.a)(Se,k,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{logs:Oe(t,e.logs.data)})})),Object(O.a)(Se,S,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{releases:Oe(t,e.releases.data)})})),Object(O.a)(Se,w,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{settings:Oe(t,e.settings.data)})})),Se),{languages:{updating:!0,data:[]},enabledLanguage:{updating:!0,data:[]},languagesProfiles:{updating:!0,data:[]},status:{updating:!0,data:void 0},tasks:{updating:!0,data:[]},providers:{updating:!0,data:[]},logs:{updating:!0,data:[]},releases:{updating:!0,data:[]},settings:{updating:!0,data:void 0}}),Ne=Object(d.c)({system:Ce,series:me,movie:ve,site:we}),Ie=[b.a,h.a];var Pe=Object(d.d)(Ne,d.a.apply(void 0,Ie)),Ae=(n(303),n(54)),Te=n(7),Me=n(12),Ee=n(485),Be=n(482),Ke=n(256),ze=n(483),De=n(42),Re=n(43),Le=n(129),_e=n.n(Le),He=n(9),Ue=n.n(He),Fe=n(14),Ge=new(function(){function e(){Object(De.a)(this,e)}return Object(Re.a)(e,[{key:"get",value:function(e,t){return rt.axios.get("/badges".concat(e),{params:t})}},{key:"all",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("").then((function(t){e(t.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]),e}()),qe=n(51),We=n(53),Ye=function(){function e(t){Object(De.a)(this,e),this.prefix=void 0,this.prefix=t}return Object(Re.a)(e,[{key:"createFormdata",value:function(e){if(e){var t=function(){var t=new FormData,n=function(n){var r=e[n];r instanceof Array?r.length>0?r.forEach((function(e){return t.append(n,e)})):t.append(n,""):t.append(n,e[n])};for(var r in e)n(r);return{v:t}}();return"object"===typeof t?t.v:void 0}}},{key:"get",value:function(e,t){return rt.axios.get(this.prefix+e,{params:t})}},{key:"post",value:function(e,t,n){var r=this.createFormdata(t);return rt.axios.post(this.prefix+e,r,{params:n})}},{key:"patch",value:function(e,t,n){var r=this.createFormdata(t);return rt.axios.patch(this.prefix+e,r,{params:n})}},{key:"delete",value:function(e,t,n){var r=this.createFormdata(t);return rt.axios.delete(this.prefix+e,{params:n,data:r})}}]),e}(),Ve=new(function(e){Object(qe.a)(n,e);var t=Object(We.a)(n);function n(){return Object(De.a)(this,n),t.call(this,"/episodes")}return Object(Re.a)(n,[{key:"bySeriesId",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{seriesid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"wanted",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("/wanted",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"wantedBy",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/wanted",{episodeid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"byEpisodeId",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{episodeid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"history",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/history",{episodeid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadSubtitles",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n,r){var a=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.patch("/subtitles",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"uploadSubtitles",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n,r){var a=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.post("/subtitles",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"deleteSubtitles",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n,r){var a=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.delete("/subtitles",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"blacklist",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/blacklist").then((function(t){e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addBlacklist",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n,r){var a=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.post("/blacklist",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"deleteBlacklist",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.delete("/blacklist",n,{all:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(Ye)),Qe=new(function(e){Object(qe.a)(n,e);var t=Object(We.a)(n);function n(){return Object(De.a)(this,n),t.call(this,"/files")}return Object(Re.a)(n,[{key:"browse",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get(t,{path:n}).then((function(t){return e(t.data)})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"bazarr",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.browse("",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sonarr",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.browse("/sonarr",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"radarr",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.browse("/radarr",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Ye)),Xe=new(function(e){Object(qe.a)(n,e);var t=Object(We.a)(n);function n(){return Object(De.a)(this,n),t.call(this,"/history")}return Object(Re.a)(n,[{key:"stats",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n,r,a){var c=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){c.get("/stats",{timeframe:t,action:n,provider:r,language:a}).then((function(t){return e(t.data)})).catch(i)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r,a){return e.apply(this,arguments)}}()}]),n}(Ye)),Je=new(function(e){Object(qe.a)(n,e);var t=Object(We.a)(n);function n(){return Object(De.a)(this,n),t.call(this,"/movies")}return Object(Re.a)(n,[{key:"blacklist",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/blacklist").then((function(t){e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addBlacklist",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/blacklist",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"deleteBlacklist",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.delete("/blacklist",n,{all:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"movies",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{radarrid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"moviesBy",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"modify",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("",{radarrid:t.id,profileid:t.profileid}).then((function(){return e()})).catch((function(e){return r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"wanted",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("/wanted",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"wantedBy",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/wanted",{radarrid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"history",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/history",{radarrid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"action",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.patch("",t).then((function(){return e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadSubtitles",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.patch("/subtitles",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"uploadSubtitles",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/subtitles",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"deleteSubtitles",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.delete("/subtitles",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(Ye)),Ze=new(function(e){Object(qe.a)(n,e);var t=Object(We.a)(n);function n(){return Object(De.a)(this,n),t.call(this,"/providers")}return Object(Re.a)(n,[{key:"providers",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("").then((function(t){e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"reset",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.post("",{action:"reset"}).then((function(){return e()})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"movies",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/movies",{radarrid:t}).then((function(t){return e(t.data.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadMovieSubtitle",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/movies",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"episodes",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/episodes",{episodeid:t}).then((function(t){return e(t.data.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadEpisodeSubtitle",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n,r){var a=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.post("/episodes",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()}]),n}(Ye)),$e=new(function(e){Object(qe.a)(n,e);var t=Object(We.a)(n);function n(){return Object(De.a)(this,n),t.call(this,"/series")}return Object(Re.a)(n,[{key:"series",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{seriesid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"seriesBy",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"modify",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("",{seriesid:t.id,profileid:t.profileid}).then((function(){return e()})).catch((function(e){return r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"action",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.patch("",t).then((function(){return e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Ye)),et=new(function(e){Object(qe.a)(n,e);var t=Object(We.a)(n);function n(){return Object(De.a)(this,n),t.call(this,"/subtitles")}return Object(Re.a)(n,[{key:"info",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/info",{filenames:t}).then((function(t){return e(t.data.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"modify",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.patch("",n,{action:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(Ye)),tt=new(function(e){Object(qe.a)(n,e);var t=Object(We.a)(n);function n(){return Object(De.a)(this,n),t.call(this,"/system")}return Object(Re.a)(n,[{key:"performAction",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("",void 0,{action:t}).then(e).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"login",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/account",{username:t,password:n},{action:"login"}).then(e).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"logout",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.post("/account",void 0,{action:"logout"}).then(e).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"shutdown",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.performAction("shutdown"));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restart",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.performAction("restart"));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"settings",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/settings").then((function(t){e(t.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"setSettings",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("/settings",t).then((function(t){e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"languages",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/languages").then((function(t){e(t.data)})).catch((function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"languagesProfileList",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/languages/profiles").then((function(t){return e(t.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"status",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/status").then((function(t){e(t.data.data)})).catch((function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"logs",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/logs").then((function(t){return e(t.data.data)})).catch((function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"releases",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/releases").then((function(t){return e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"deleteLogs",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.delete("/logs").then((function(){return e()})).catch((function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"getTasks",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(){var t=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/tasks").then((function(t){e(t.data.data)})).catch((function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"runTask",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("/tasks",{taskid:t}).then((function(){e()})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"testNotification",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t,n){var r=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.patch("/notifications",{protocol:t,path:n}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"search",value:function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n=this;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/searches",{query:t}).then((function(t){return e(t.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Ye)),nt=new(function(){function e(){Object(De.a)(this,e),this.axios=void 0;var t="/"===window.Bazarr.baseUrl?"/":"".concat(window.Bazarr.baseUrl,"/");this.recreateAxios(t,window.Bazarr.apiKey)}return Object(Re.a)(e,[{key:"recreateAxios",value:function(e,t){this.axios=_e.a.create({baseURL:e}),this.axios.defaults.headers.post["Content-Type"]="application/json",this.axios.defaults.headers.common["x-api-key"]=t}},{key:"urlTest",value:function(e,t,n){var r=this;return new Promise((function(a,c){r.axios.get("test/".concat(e,"/").concat(t,"api/system/status"),{params:n}).then((function(e){return a(e.data)})).catch(c)}))}}]),e}()),rt=new(function(){function e(){Object(De.a)(this,e),this.axios=void 0,this.source=void 0;var t="/"===window.Bazarr.baseUrl?"/api/":"".concat(window.Bazarr.baseUrl,"/api/");this.initialize(t,window.Bazarr.apiKey)}return Object(Re.a)(e,[{key:"initialize",value:function(e,t){var n=this;this.axios=_e.a.create({baseURL:e}),this.axios.defaults.headers.post["Content-Type"]="application/json",this.axios.defaults.headers.common["X-API-KEY"]=t,this.source=_e.a.CancelToken.source(),this.axios.interceptors.request.use((function(e){return e.cancelToken=n.source.token,e})),this.axios.interceptors.response.use((function(e){return n.onOnline(),e.status>=200&&e.status<300?Promise.resolve(e):(n.handleError(e.status),Promise.reject(e))}),(function(e){if(e.response){var t=e.response;n.handleError(t.status),n.onOnline()}else n.onOffline(),e.message="You have disconnected to Bazarr backend";return Promise.reject(e)}))}},{key:"onOnline",value:function(){Pe.getState().site.offline&&Pe.dispatch(zt(!1))}},{key:"onOffline",value:function(){Pe.dispatch(zt(!0))}},{key:"handleError",value:function(e){switch(e){case 401:Pe.dispatch(It())}}}]),e}());var at=new Map,ct=new Map;function it(e,t,n){return function(r){var a=ct.get(t),c=new Date;if(Object($.isEqual)(a,n)){var i=at.get(t);if(i)if(c.getTime()-i.getTime()<200)return Promise.resolve()}else ct.set(t,n);return at.set(t,c),r({type:e,payload:{loading:!0,parameters:n}}),new Promise((function(a,c){t.apply(void 0,Object(J.a)(n)).then((function(t){r({type:e,payload:{loading:!1,item:t,parameters:n}}),a()})).catch((function(t){r({type:e,error:!0,payload:{loading:!1,item:t,parameters:n}}),c(t)}))}))}}function st(e,t){return function(){for(var n=arguments.length,r=new Array(n),a=0;a0&&void 0!==arguments[0]&&arguments[0],t=an(ft),n=rn((function(t){return e?t.system.enabledLanguage.data:t.system.languages.data}));return sn(n,t)}function jn(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=dn(e),n=Object(Z.a)(t,1),r=n[0];return Object(a.useCallback)((function(e){return void 0===e?void 0:r.find((function(t){return t.code2===e}))}),[r])}function bn(e){var t=jn(!0);return Object(a.useMemo)((function(){var n;return null!==(n=null===e||void 0===e?void 0:e.items.map((function(e){var n,r,a=e.language;return{hi:"True"===e.hi,forced:"True"===e.forced,code2:a,name:null!==(n=null===(r=t(a))||void 0===r?void 0:r.name)&&void 0!==n?n:""}})))&&void 0!==n?n:[]}),[t,null===e||void 0===e?void 0:e.items])}function hn(){var e=an(tn);return sn(rn((function(e){return e.series.seriesList})),e)}function On(e){var t=hn(),n=Object(Z.a)(t,2),r=n[0],c=n[1],i=an($t);return sn(Object(a.useMemo)((function(){var t=r.data.items,n=null;return e&&!isNaN(e)&&e in t&&(n=t[e]),Object(f.a)(Object(f.a)({},r),{},{data:n})}),[e,r]),Object(a.useCallback)((function(){e&&!isNaN(e)&&(c([e]),i(e))}),[e,c,i]))}function fn(e){var t=an($t),n=Object(a.useCallback)((function(){void 0===e||isNaN(e)||t(e)}),[t,e]),r=rn((function(e){return e.series.episodeList})),c=Object(a.useMemo)((function(){return void 0===e||isNaN(e)?[]:null!==(t=r.data[e])&&void 0!==t?t:[];var t}),[e,r.data]);return sn(Object(f.a)(Object(f.a)({},r),{},{data:c}),n)}function pn(){var e=an(Ft);return sn(rn((function(e){return e.movie.movieList})),e)}function xn(e){var t=pn(),n=Object(Z.a)(t,2),r=n[0],c=n[1];return sn(Object(a.useMemo)((function(){var t=r.data.items,n=null;return e&&!isNaN(e)&&e in t&&(n=t[e]),Object(f.a)(Object(f.a)({},r),{},{data:n})}),[e,r]),Object(a.useCallback)((function(){e&&!isNaN(e)&&c([e])}),[e,c]))}function vn(){var e=an(Wt);return sn(rn((function(e){return e.system.providers})),e)}function mn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=an(Mt),r=an(Bt);return Object(a.useCallback)((function(a){var c=Object(f.a)(Object(f.a)({},a),{},{id:e,timestamp:new Date});n(c),setTimeout((function(){return r(c.timestamp)}),1e3*t)}),[n,r,t,e])}function gn(){var e,t,n=on();return null===(e=null===(t=Object(Z.a)(n,1)[0].data)||void 0===t?void 0:t.general.use_sonarr)||void 0===e||e}function yn(){var e,t,n=on();return null===(e=null===(t=Object(Z.a)(n,1)[0].data)||void 0===t?void 0:t.general.use_radarr)||void 0===e||e}var kn=n(25),Sn=n(502),wn=n(503),Cn=n(481),Nn=n(1),In=(n(323),["Tab","Enter"," ",",",";","."]),Pn=function(e){var t=e.defaultValue,n=e.disabled,r=e.onChange,c=Object(a.useState)(null!==t&&void 0!==t?t:[]),i=Object(Z.a)(c,2),s=i[0],o=i[1],l=Object(a.useRef)(null),u=Object(a.useCallback)((function(e){var t=Object(J.a)(s);t.push(e),o(t),r&&r(t)}),[s,r]),d=Object(a.useCallback)((function(e){var t;if(-1!==(e=null!==(t=e)&&void 0!==t?t:s.length-1)){var n=Object(J.a)(s);n.splice(e,1),o(n),r&&r(n)}}),[s,r]),j=Object(a.useCallback)((function(){l.current&&(l.current.value="")}),[l]),b=Object(a.useCallback)((function(e){var t=e.key,n=e.currentTarget.value;In.includes(t)&&0!==n.length?(e.preventDefault(),u(n),j()):"Backspace"===t&&0===n.length&&(e.preventDefault(),d())}),[u,d,j]),h=Object(a.useCallback)((function(e){var t=e.key,n=e.currentTarget.value;In.includes(t)&&0!==n.length&&e.preventDefault()}),[]),O=Object(a.useCallback)((function(e){var t=e.currentTarget.value;0!==t.length&&(e.preventDefault(),u(t),j())}),[u,j]),f=Object(a.useMemo)((function(){return s.map((function(e,t){return Object(Nn.jsx)("span",{title:e,className:"custom-chip ".concat(n?"":"active"),onClick:function(){n||d(t)},children:e},t)}))}),[s,d,n]);return Object(Nn.jsxs)("div",{className:"form-control custom-chip-input d-flex",children:[Object(Nn.jsx)("div",{className:"chip-container",children:f}),Object(Nn.jsx)("input",{disabled:n,className:"main-input p-0",ref:l,onKeyUp:b,onKeyDown:h,onBlur:O})]})},An=n(498),Tn=n(496),Mn="--back--";function En(e){var t=e.lastIndexOf("/");return-1===t&&(t=e.lastIndexOf("\\")),t}function Bn(e){if(e.endsWith("/")||e.endsWith("\\"))return e;var t=En(e);return e.slice(0,t+1)}var Kn=function(e){var t=e.defaultValue,n=e.onChange,r=e.load,c=e.drop,i=Object(a.useState)(!1),s=Object(Z.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(null!==t&&void 0!==t?t:""),d=Object(Z.a)(u,2),j=d[0],b=d[1],h=Object(a.useState)((function(){return Bn(j)})),O=Object(Z.a)(h,2),f=O[0],p=O[1],x=Object(a.useState)(!0),v=Object(Z.a)(x,2),m=v[0],g=v[1],y=Object(a.useMemo)((function(){var e=En(j);return j.slice(e+1)}),[j]),k=Object(a.useMemo)((function(){var e=En(f.slice(0,-1));return f.slice(0,e+1)}),[f]),S=Object(a.useState)([]),w=Object(Z.a)(S,2),C=w[0],N=w[1],I=Object(a.useMemo)((function(){if(m)return Object(Nn.jsx)(An.a.Item,{children:Object(Nn.jsx)(Cn.a,{size:"sm",animation:"border"})});var e=[];return e.push.apply(e,Object(J.a)(C.filter((function(e){return e.name.startsWith(y)})).map((function(e){return Object(Nn.jsxs)(An.a.Item,{eventKey:e.path,children:[Object(Nn.jsx)(Me.a,{icon:e.children?Ae.e:Ae.d,className:"mr-2"}),Object(Nn.jsx)("span",{children:e.name})]},e.name)})))),0===e.length&&e.push(Object(Nn.jsx)(An.a.Header,{children:"No Files"},"no-files")),0!==k.length?[Object(Nn.jsxs)(An.a.Item,{eventKey:Mn,children:[Object(Nn.jsx)(Me.a,{icon:Te.P,className:"mr-2"}),Object(Nn.jsx)("span",{children:"Back"})]},"back"),Object(Nn.jsx)(An.a.Divider,{},"back-divider")].concat(e):e}),[C,y,k,m]);Object(a.useEffect)((function(){if(j!==f){var e=Bn(j);e!==f&&(p(e),n&&n(e))}}),[f,j,n]);var P=Object(a.useRef)(null);return Object(a.useEffect)((function(){o&&(g(!0),r(f).then((function(e){N(e)})).finally((function(){return g(!1)})))}),[f,r,o]),Object(Nn.jsxs)(An.a,{show:o,drop:c,onSelect:function(e){var t;e&&(b(e!==Mn?e:k),null===(t=P.current)||void 0===t||t.focus())},onToggle:function(e,t,n){e||"select"===n.source?e&&l(!0):l(!1)},children:[Object(Nn.jsx)(An.a.Toggle,{as:Tn.a.Control,placeholder:"Click to start",type:"text",value:j,onChange:function(e){b(e.currentTarget.value)},ref:P}),Object(Nn.jsx)(An.a.Menu,{className:"w-100",style:{maxHeight:256,overflowY:"auto"},children:I})]})},zn=n(40),Dn=function(e){var t=e.value,n=e.emptyText,r=e.multiple,c=e.disabled,i=e.onChange,s=Object(a.useState)([]),o=Object(Z.a)(s,2),l=o[0],u=o[1],d=Object(a.useRef)(null);Object(a.useEffect)((function(){t&&(u(t),0===t.length&&d.current&&(d.current.value=""))}),[t]);var j=Object(a.useMemo)((function(){return 0===l.length?n:r?"".concat(l.length," Files"):l[0].name}),[l,n,r]);return Object(Nn.jsx)(Tn.a.File,{disabled:c,custom:!0,label:j,multiple:r,ref:d,onChange:function(e){var t=e.target.files;if(t){var n,r=[],a=Object(zn.a)(t);try{for(a.s();!(n=a.n()).done;){var c=n.value;r.push(c)}}catch(s){a.e(s)}finally{a.f()}u(r),i&&i(r)}}})},Rn=n(282);n(325);function Ln(e){var t=e.className,n=e.placeholder,r=e.label,c=e.disabled,i=e.clearable,s=e.loading,o=e.options,l=e.multiple,u=e.onChange,d=e.defaultValue,j=e.value,b=Object(a.useCallback)((function(e){var t;return null===(t=o.find((function(t){return t.value===e})))||void 0===t?void 0:t.label}),[o]),h=Object(a.useCallback)((function(e){if(null!==e&&void 0!==e){if(l)return e.map((function(e){var t;return{label:r?r(e):null!==(t=b(e))&&void 0!==t?t:"Unknown",value:e}}));var t,n=e;return{label:r?r(n):null!==(t=b(n))&&void 0!==t?t:"Unknown",value:n}}return e}),[r,l,b]),O=Object(a.useMemo)((function(){return h(d)}),[d,h]),f=Object(a.useMemo)((function(){return h(j)}),[h,j]);return Object(Nn.jsx)(Rn.a,{isLoading:s,placeholder:n,isSearchable:o.length>=10,isMulti:l,closeMenuOnSelect:!l,defaultValue:O,value:f,isClearable:i,isDisabled:c,options:o,className:"custom-selector w-100 ".concat(null!==t&&void 0!==t?t:""),classNamePrefix:"selector",onChange:function(e){if(u){var t,n=null;if(Object($.isArray)(e))n=e.map((function(e){return e.value}));else n=null!==(t=null===e||void 0===e?void 0:e.value)&&void 0!==t?t:null;u(n)}}})}var _n,Hn=n(281),Un=(n(335),n(336),function(e){var t=e.min,n=e.max,r=e.tooltips,a=e.defaultValue,c=e.onChange,i=e.onAfterChange;return Object(Nn.jsxs)("div",{className:"d-flex flex-row align-items-center py-2",children:[Object(Nn.jsx)("span",{className:"text-muted pr-3",children:null!==t&&void 0!==t?t:0}),Object(Nn.jsx)(Hn.a,{min:null!==t&&void 0!==t?t:0,max:null!==n&&void 0!==n?n:100,className:"custom-rc-slider",step:1,defaultValue:a,onChange:c,onAfterChange:i,handle:function(e){return Object(Nn.jsx)("div",{className:"rc-slider-handle",style:{left:"".concat(e.offset,"%")},children:Object(Nn.jsx)(Fn,{tooltips:r,value:e.value})})}}),Object(Nn.jsx)("span",{className:"text-muted pl-3",children:null!==n&&void 0!==n?n:100})]})}),Fn=function(e){var t=e.tooltips,n=e.value,r=Object(a.useMemo)((function(){var e=["rc-slider-handle-tips"];return void 0!==t&&("string"===typeof t?e.push("rc-slider-handle-tips-always"):!1===t&&e.push("rc-slider-handle-tips-hidden")),e.join(" ")}),[t]);return Object(Nn.jsx)("span",{className:r,children:n})};function Gn(e){var t,n=e.exist,r=e.state,c=e.children,i=n?!n(r.data):!((t=r.data)instanceof Array?0!==t.length:null!==t&&void 0!==t),s=mn("async-overlay");if(Object(a.useEffect)((function(){r.updating||void 0===r.error||i||s({type:"error",message:r.error.message})}),[r,s,i]),r.updating){if(i)return Object(Nn.jsx)(ba,{})}else if(r.error&&i)return Object(Nn.jsx)(Be.a,{children:Object(Nn.jsxs)(ze.a,{variant:"danger",className:"my-4",children:[Object(Nn.jsxs)(ze.a.Heading,{children:[Object(Nn.jsx)(Me.a,{className:"mr-2",icon:Te.t}),Object(Nn.jsx)("span",{children:"Ouch! You got an error"})]}),Object(Nn.jsx)("p",{children:r.error.message}),Object(Nn.jsx)("hr",{}),Object(Nn.jsx)("div",{className:"d-flex justify-content-end",children:Object(Nn.jsx)(Ke.a,{variant:"outline-danger",onClick:be,children:"Reload"})})]})});return c?c(r.data,r.error):null}function qn(e){var t=e.promise,n=e.children,r=Object(a.useState)(null),c=Object(Z.a)(r,2),i=c[0],s=c[1];return Object(a.useEffect)((function(){t().then((function(e){return s(e)})).catch((function(){}))}),[t]),null===i?Object(Nn.jsx)(ba,{}):n(i)}function Wn(e){var t=e.label,n=e.state,r=Object(kn.a)(e,["label","state"]),c=Object(a.useMemo)((function(){return n.data.map((function(e){return{label:t(e),value:e}}))}),[n,t]);return Object(Nn.jsx)(Ln,Object(f.a)({loading:n.updating,options:c,label:t},r))}function Yn(e){var t=e.children,n=e.className,r=e.promise,c=e.onSuccess,i=e.noReset,s=e.error,o=e.onChange,l=e.disabled,u=Object(kn.a)(e,["children","className","promise","onSuccess","noReset","error","onChange","disabled"]),d=Object(a.useState)(!1),j=Object(Z.a)(d,2),b=j[0],h=j[1],O=Object(a.useState)(_n.Invalid),p=Object(Z.a)(O,2),x=p[0],v=p[1],m=Object(a.useState)(null),g=Object(Z.a)(m,2)[1];Object(a.useEffect)((function(){if(!i){if(x===_n.Error||x===_n.Success){var e=setTimeout((function(){return v(_n.Invalid)}),2e3);g(e)}return function(){g((function(e){return e&&clearTimeout(e),null}))}}}),[x,i]);var y=Object(a.useCallback)((function(){if(x===_n.Invalid){var e=r();e&&(h(!0),o&&o(!0),e.then((function(e){v(_n.Success),c&&c(e)})).catch((function(){v(_n.Error),s&&s()})).finally((function(){h(!1),o&&o(!1)})))}}),[s,o,r,c,x]),k=t;return b&&(k=Object(Nn.jsx)(Me.a,{icon:Te.j,spin:!0})),x===_n.Success?k=Object(Nn.jsx)(Me.a,{icon:Te.h}):x===_n.Error&&(k=Object(Nn.jsx)(Me.a,{icon:Te.X})),Object(Nn.jsx)(Ke.a,Object(f.a)(Object(f.a)({className:n,disabled:b||l||x!==_n.Invalid},u),{},{onClick:y,children:k}))}!function(e){e[e.Success=0]="Success",e[e.Error=1]="Error",e[e.Invalid=2]="Invalid"}(_n||(_n={}));var Vn=n(484),Qn=function(e){var t=e.icon,n=e.onClick;return Object(Nn.jsx)(Ke.a,{as:Vn.a,className:"mx-1 p-1",variant:"secondary",onClick:n,children:Object(Nn.jsx)(Me.a,{icon:t})})},Xn=function(e){var t=e.onClick,n=(e.destructive,e.disabled),r=e.variant,a=e.className,c=e.size,i=Object(kn.a)(e,["onClick","destructive","disabled","variant","className","size"]);return Object(Nn.jsx)(Ke.a,{disabled:i.loading||n,size:null!==c&&void 0!==c?c:"sm",variant:null!==r&&void 0!==r?r:"light",className:"text-nowrap ".concat(null!==a&&void 0!==a?a:""),onClick:t,children:Object(Nn.jsx)(Jn,Object(f.a)({},i))})},Jn=function(e){var t=e.icon,n=e.children,r=e.loading;return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(Me.a,{style:{width:"1rem"},icon:r?Te.j:t,spin:r}),n&&!r?Object(Nn.jsx)("span",{className:"ml-2 font-weight-bold",children:n}):null]})},Zn=function(e){var t=e.children,n=e.icon,r=e.disabled,a=e.updating,c=e.updatingIcon,i=e.onClick,s=n;return a&&(s=c||Te.S),Object(Nn.jsxs)(Ke.a,{variant:"dark",className:"d-flex flex-column text-nowrap py-1",disabled:r||a,onClick:i,children:[Object(Nn.jsx)(Me.a,{className:"mx-auto my-1",icon:s,spin:a}),Object(Nn.jsx)("span",{className:"align-bottom text-themecolor small text-center",children:t})]})};var $n=Zn,er=function(e){var t=e.children,n=e.pos,r="d-flex flex-grow-1 align-items-center justify-content-".concat(n);return Object(Nn.jsx)("div",{className:r,children:t})},tr=(n(337),function(e){var t,n=e.children,r=e.scroll,c=e.className,i=Object(a.useMemo)((function(){var e=["content-header","bg-dark","p-2"];return void 0!==c&&e.push(c),!1!==r&&e.push("scroll"),e.join(" ")}),[r,c]);return t=!1!==r?Object(Nn.jsx)("div",{className:"d-flex flex-nowrap flex-grow-1",children:n}):n,Object(Nn.jsx)(Ee.a,{className:i,children:t})});tr.Button=$n,tr.Group=er,tr.AsyncButton=function(e){var t=e.promise,n=e.onSuccess,r=Object(kn.a)(e,["promise","onSuccess"]),c=Object(a.useState)(!1),i=Object(Z.a)(c,2),s=i[0],o=i[1],l=Object(a.useCallback)((function(){o(!0),t().then((function(e){o(!1),n&&n(e)}))}),[n,t]);return Object(Nn.jsx)(Zn,Object(f.a)({updating:s,onClick:l},r))};function nr(e){var t=e.options,n=Object(kn.a)(e,["options"]),r=Object(a.useMemo)((function(){return t.map((function(e){return{label:e.name,value:e}}))}),[t]);return Object(Nn.jsx)(Ln,Object(f.a)({placeholder:"Language...",options:r,label:function(e){return e.name}},n))}var rr=n(495),ar=c.a.createContext([[],function(e){}]),cr=c.a.createContext([[],function(e){}]);function ir(){var e=Object(a.useContext)(ar),t=Object(Z.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(cr),i=Object(Z.a)(c,2),s=i[0],o=i[1];return Object(a.useCallback)((function(e,t){"modal ".concat(e," sending payload"),r([].concat(Object(J.a)(n),[e])),o([].concat(Object(J.a)(s),[null!==t&&void 0!==t?t:null]))}),[n,s,r,o])}function sr(){var e=Object(a.useContext)(ar),t=Object(Z.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(cr),i=Object(Z.a)(c,2),s=i[0],o=i[1];return Object(a.useCallback)((function(){var e=Object(J.a)(n);e.pop();var t=Object(J.a)(s);t.pop(),r(e),o(t)}),[n,s,r,o])}function or(e){var t=Object(a.useContext)(ar)[0];return e===t[t.length-1]}function lr(e,t){var n=or(e);Object(a.useEffect)((function(){n&&t()}),[n,t])}function ur(e){var t=Object(a.useContext)(cr)[0],n=Object(a.useContext)(ar)[0];return Object(a.useMemo)((function(){var r=n.findIndex((function(t){return t===e}));return-1!==r?t[r]:null}),[n,t,e])}var dr,jr=function(e){var t=e.children,n=Object(a.useState)([]),r=Object(Z.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)([]),o=Object(Z.a)(s,2),l=o[0],u=o[1];return Object(Nn.jsx)(ar.Provider,{value:[c,i],children:Object(Nn.jsx)(cr.Provider,{value:[l,u],children:t})})},br=function(e){var t=e.size,n=e.closeable,r=e.modalKey,a=e.title,c=e.children,i=e.footer,s=or(r),o=sr(),l=!1!==n;return Object(Nn.jsxs)(rr.a,{centered:!0,size:t,show:s,onHide:o,backdrop:l?void 0:"static",children:[Object(Nn.jsx)(rr.a.Header,{closeButton:l,children:a}),Object(Nn.jsx)(rr.a.Body,{children:c}),Object(Nn.jsx)(rr.a.Footer,{hidden:void 0===i,children:i})]})},hr=br,Or=function(e){var t=e.history,n=e.update,r=e.promise,a=t.provider,c=t.subs_id,i=t.language,s=t.subtitles_path,o=t.blacklisted;return c&&a&&i?Object(Nn.jsx)(Yn,{size:"sm",variant:"light",noReset:!0,disabled:o,promise:function(){var e=i.code2;return r({provider:a,subs_id:c,subtitles_path:s,language:e})},onSuccess:n,children:Object(Nn.jsx)(Me.a,{icon:Te.u})}):null},fr=function(e){var t,n=Object.assign({},e),r=ur(n.modalKey),c=Object(a.useState)({updating:!1,data:[]}),i=Object(Z.a)(c,2),s=i[0],o=i[1],l=Object(a.useCallback)((function(){r&&oe(Je.history(r.radarrId),o,[])}),[r]);Object(a.useEffect)((function(){l()}),[l]);var u=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){return Object(Nn.jsx)(da,{action:e.value})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(Nn.jsx)(ha,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(Nn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(Nn.jsx)("span",{children:e.value})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row.original;return Object(Nn.jsx)(Or,{update:l,promise:function(e){return Je.addBlacklist(t.radarrId,e)},history:t})}}]}),[l]);return Object(Nn.jsx)(hr,Object(f.a)(Object(f.a)({title:"History - ".concat(null!==(t=null===r||void 0===r?void 0:r.title)&&void 0!==t?t:"")},n),{},{children:Object(Nn.jsx)(Gn,{state:s,children:function(e){return Object(Nn.jsx)(ua,{emptyText:"No History Found",columns:u,data:e})}})}))},pr=function(e){var t,n=ur(e.modalKey),r=Object(a.useState)({updating:!1,data:[]}),c=Object(Z.a)(r,2),i=c[0],s=c[1],o=Object(a.useCallback)((function(){n&&oe(Ve.history(n.sonarrEpisodeId),s,[])}),[n]);Object(a.useEffect)((function(){return o()}),[o]);var l=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){return Object(Nn.jsx)(da,{action:e.value})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(Nn.jsx)(ha,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(Nn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(Nn.jsx)("span",{children:e.value})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row.original,n=t.sonarrSeriesId,r=t.sonarrEpisodeId;return Object(Nn.jsx)(Or,{history:t,update:o,promise:function(e){return Ve.addBlacklist(n,r,e)}})}}]}),[o]);return Object(Nn.jsx)(hr,Object(f.a)(Object(f.a)({title:"History - ".concat(null!==(t=null===n||void 0===n?void 0:n.title)&&void 0!==t?t:"")},e),{},{children:Object(Nn.jsx)(Gn,{state:i,children:function(e){return Object(Nn.jsx)(ua,{emptyText:"No History Found",columns:l,data:e})}})}))},xr=function(e){var t=e.onSuccess,n=e.submit,r=Object(kn.a)(e,["onSuccess","submit"]),c=ln(),i=Object(Z.a)(c,1)[0],s=ur(r.modalKey),o=sr(),l=Object(a.useMemo)((function(){return i.map((function(e){return{label:e.name,value:e.profileId}}))}),[i]),u=Object(a.useState)(null),d=Object(Z.a)(u,2),j=d[0],b=d[1],h=Object(a.useState)(!1),O=Object(Z.a)(h,2),p=O[0],x=O[1],v=Object(a.useMemo)((function(){return Object(Nn.jsx)(Yn,{noReset:!0,onChange:x,promise:function(){if(s){var e=le(s);return n({id:[e],profileid:[j]})}return null},onSuccess:function(){o(),t&&s&&t(s)},children:"Save"})}),[o,j,s,t,n]);return Object(Nn.jsx)(hr,Object(f.a)(Object(f.a)({closeable:!p,footer:v,title:null===s||void 0===s?void 0:s.title},r),{},{children:Object(Nn.jsx)(Be.a,{fluid:!0,children:Object(Nn.jsxs)(Tn.a,{children:[Object(Nn.jsxs)(Tn.a.Group,{children:[Object(Nn.jsx)(Tn.a.Label,{children:"Audio"}),Object(Nn.jsx)(Tn.a.Control,{type:"text",disabled:!0,defaultValue:null===s||void 0===s?void 0:s.audio_language.map((function(e){return e.name})).join(", ")})]}),Object(Nn.jsxs)(Tn.a.Group,{children:[Object(Nn.jsx)(Tn.a.Label,{children:"Languages Profiles"}),Object(Nn.jsx)(Ln,{clearable:!0,options:l,defaultValue:null===s||void 0===s?void 0:s.profileId,onChange:function(e){return b(void 0===e?null:e)}})]})]})})}))},vr=function(e){var t,n=e,r=dn(!0),c=Object(Z.a)(r,1)[0],i=ur(n.modalKey),s=xn(null===i||void 0===i?void 0:i.radarrId),o=Object(Z.a)(s,2)[1],l=sr(),u=Object(a.useState)(!1),d=Object(Z.a)(u,2),j=d[0],b=d[1],h=Object(a.useState)(null),O=Object(Z.a)(h,2),p=O[0],x=O[1],v=un(null===i||void 0===i?void 0:i.profileId),m=function(e){var t=jn();return Object(a.useMemo)((function(){return t(e)}),[e,t])}(null===v||void 0===v||null===(t=v.items[0])||void 0===t?void 0:t.language);Object(a.useEffect)((function(){return x(null!==m&&void 0!==m?m:null)}),[m]);var g=Object(a.useState)(null),y=Object(Z.a)(g,2),k=y[0],S=y[1],w=Object(a.useState)(!1),C=Object(Z.a)(w,2),N=C[0],I=C[1],P=Object(a.useMemo)((function(){return null!==k&&(null===p||void 0===p?void 0:p.code2)}),[p,k]),A=Object(Nn.jsx)(Yn,{noReset:!0,disabled:!P,onChange:b,promise:function(){return k&&i&&p?Je.uploadSubtitles(i.radarrId,{file:k,forced:N,hi:!1,language:p.code2}):null},onSuccess:function(){l(),o()},children:"Upload"});return Object(Nn.jsx)(hr,Object(f.a)(Object(f.a)({title:"Upload - ".concat(null===i||void 0===i?void 0:i.title),closeable:!j,footer:A},n),{},{children:Object(Nn.jsx)(Be.a,{fluid:!0,children:Object(Nn.jsxs)(Tn.a,{children:[Object(Nn.jsxs)(Tn.a.Group,{children:[Object(Nn.jsx)(Tn.a.Label,{children:"Language"}),Object(Nn.jsx)(nr,{options:c,value:p,onChange:function(e){e&&x(e)}})]}),Object(Nn.jsxs)(Tn.a.Group,{children:[Object(Nn.jsx)(Tn.a.Label,{children:"Subtitle File"}),Object(Nn.jsx)(Dn,{emptyText:"Select...",onChange:function(e){S(e[0])}})]}),Object(Nn.jsx)(Tn.a.Group,{children:Object(Nn.jsx)(Tn.a.Check,{custom:!0,id:"forced-checkbox",defaultChecked:N,onChange:function(e){return I(e.target.checked)},label:"Forced"})})]})})}))};!function(e){e[e.Update=0]="Update",e[e.Valid=1]="Valid",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(dr||(dr={}));var mr=function(e){var t=ur(e.modalKey),n=fn(null===t||void 0===t?void 0:t.sonarrSeriesId),r=Object(Z.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)(!1),o=Object(Z.a)(s,2),l=o[0],u=o[1],d=sr(),j=Object(a.useState)([]),b=Object(Z.a)(j,2),h=b[0],p=b[1],x=Object(a.useState)({}),v=Object(Z.a)(x,2),m=v[0],g=v[1],y=bn(un(null===t||void 0===t?void 0:t.profileId)),k=Object(a.useMemo)((function(){return h.map((function(e){return e.form.file}))}),[h]);Object(a.useEffect)((function(){var e=h.reduce((function(e,t){var n={state:dr.Valid,infos:[]},r=t.form,a=t.instance;return t.didCheck?a?void 0!==a.subtitles.find((function(e){return e.code2===r.language}))&&(n.infos.push("Overwrite existing subtitle"),n.state=dr.Warning):(n.infos.push("Season or episode info is missing"),n.state=dr.Error):n.state=dr.Update,e[r.file.name]=n,e}),{});g(e)}),[h]);var S=Object(a.useCallback)(function(){var e=Object(Fe.a)(Ue.a.mark((function e(t){var n,r,a;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((n=t.map((function(e){return e.form.file.name}))).length>0)){e.next=7;break}return e.next=4,et.info(n);case 4:r=e.sent,a=r.reduce((function(e,t){var n=c.data.find((function(e){return e.season===t.season&&e.episode===t.episode}));return n&&(e[t.filename]=n),e}),{}),p((function(e){return e.map((function(e){return Object(f.a)(Object(f.a)({},e),{},{didCheck:!0,instance:a[e.form.file.name]})}))}));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c.data]),w=Object(a.useCallback)((function(e){if(e){var t=h.map((function(t){var n,r,a=t.form;return Object(f.a)(Object(f.a)({},t),{},{form:Object(f.a)(Object(f.a)({},a),{},{language:e.code2,hi:null!==(n=e.hi)&&void 0!==n&&n,forced:null!==(r=e.forced)&&void 0!==r&&r})})}));p(t)}}),[h]),C=Object(a.useCallback)((function(e){var t=y[0],n=e.map((function(e){var n,r;return{form:{file:e,language:t.code2,hi:null!==(n=t.hi)&&void 0!==n&&n,forced:null!==(r=t.forced)&&void 0!==r&&r},didCheck:!1}}));p(n);var r=e.reduce((function(e,t){return Object(f.a)(Object(f.a)({},e),{},Object(O.a)({},t.name,{state:dr.Update,infos:[]}))}),{});g(r),S(n)}),[y,S]),N=Object(a.useCallback)(Object(Fe.a)(Ue.a.mark((function e(){var n,r,a,c,i,s;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t){e.next=2;break}return e.abrupt("return");case 2:n=t.sonarrSeriesId,r=h.reduce((function(e,t){return e[t.form.file.name]={state:dr.Update,infos:[]},e}),{}),g(r),a=Object(zn.a)(h),e.prev=6,a.s();case 8:if((c=a.n()).done){e.next=18;break}if(!(i=c.value).instance){e.next=16;break}return s=i.instance.sonarrEpisodeId,e.next=14,Ve.uploadSubtitles(n,s,i.form);case 14:r=Object(f.a)(Object(f.a)({},r),{},Object(O.a)({},i.form.file.name,{state:dr.Valid,infos:[]})),g(r);case 16:e.next=8;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(6),a.e(e.t0);case 23:return e.prev=23,a.f(),e.finish(23);case 26:case"end":return e.stop()}}),e,null,[[6,20,23,26]])}))),[t,h]),I=Object(a.useMemo)((function(){return h.length>0&&h.every((function(e){return void 0!==e.instance}))}),[h]),P=h.length>0,A=Object(a.useMemo)((function(){return[{id:"Icon",accessor:"instance",className:"text-center",Cell:function(e){var t=e.row,n=e.loose,r=t.original.form.file.name,a=n[1],c=Te.j,i=void 0,s=!1,o=[];if(r in a){var l=a[r];switch(o=l.infos,l.state){case dr.Error:c=Te.t,i="var(--danger)";break;case dr.Valid:c=Te.h,i="var(--success)";break;case dr.Warning:c=Te.A,i="var(--warning)";break;case dr.Update:s=!0}}return Object(Nn.jsx)(ja,{messages:o,color:i,icon:c,spin:s})}},{Header:"File",accessor:function(e){return e.form.file.name}},{Header:"Episode",accessor:"instance",className:"vw-1",Cell:function(e){var t=e.value,n=e.loose,r=e.row,c=e.externalUpdate,i=n[2].map((function(e){return{label:"(".concat(e.season,"x").concat(e.episode,") ").concat(e.title),value:e}})),s=Object(a.useCallback)((function(e){if(e){var t=Object(f.a)({},r.original);t.instance=e,c&&c(r,t)}}),[r,c]);return Object(Nn.jsx)(Ln,{options:i,value:null!==t&&void 0!==t?t:null,onChange:s})}},{accessor:"form",Cell:function(e){var t=e.row,n=e.externalUpdate,r=e.loose,a=Object(Z.a)(r,1)[0];return Object(Nn.jsx)(Ke.a,{size:"sm",variant:"light",disabled:a,onClick:function(){n&&n(t)},children:Object(Nn.jsx)(Me.a,{icon:Te.Z})})}}]}),[]),T=Object(a.useCallback)((function(e,t){p((function(n){var r=Object(J.a)(n);return t?r[e.index]=t:r.splice(e.index,1),r}))}),[]),M=Object(Nn.jsxs)("div",{className:"d-flex flex-row flex-grow-1 justify-content-between",children:[Object(Nn.jsx)("div",{className:"w-25",children:Object(Nn.jsx)(nr,{disabled:l,options:y,defaultValue:y.length>0?y[0]:void 0,onChange:w})}),Object(Nn.jsxs)("div",{children:[Object(Nn.jsx)(Ke.a,{hidden:l,disabled:0===h.length,variant:"outline-secondary",className:"mr-2",onClick:function(){return C([])},children:"Clean"}),Object(Nn.jsx)(Yn,{noReset:!0,disabled:!I,onChange:u,promise:N,onSuccess:function(){d(),C([]),i()},children:"Upload"})]})]});return Object(Nn.jsx)(hr,Object(f.a)(Object(f.a)({size:"lg",title:"Upload Subtitles",closeable:!l,footer:M},e),{},{children:Object(Nn.jsxs)(Be.a,{fluid:!0,className:"flex-column",children:[Object(Nn.jsx)(Tn.a,{children:Object(Nn.jsx)(Tn.a.Group,{children:Object(Nn.jsx)(Dn,{emptyText:"Select...",disabled:P||0===y.length,multiple:!0,value:k,onChange:C})})}),Object(Nn.jsx)("div",{hidden:!P,children:Object(Nn.jsx)(ta,{columns:A,data:h,loose:[l,m,c.data],responsive:!1,externalUpdate:T})})]})}))},gr=n(486),yr=n(487),kr=n(55),Sr="useAsyncPagination",wr="loading-change";function Cr(e){e.stateReducers.push(Nr),e.useInstance.push(Pr),e.useOptions.push(Ir)}function Nr(e,t,n,r){if(t.type===wr&&r){var a=t.pageToLoad,c=!1,i=r.asyncState,s=e.pageIndex,o=e.pageSize,l=s;"prev"===a?l-=1:"next"===a?l+=1:"number"===typeof a&&(l=a);var u=l*o,d=u+o;if(i){var j=i.error,b=i.data.order.slice(u,d),h=0===b.length&&void 0!==j,O=0!==b.length&&b.every($.isNull);h||O?c=!0:b.every(ne)&&(a=void 0)}return Object(f.a)(Object(f.a)({},e),{},{pageToLoad:a,needLoadingScreen:c})}return e}function Ir(e){return e.manualPagination=!0,void 0===e.initialState&&(e.initialState={}),e.initialState.pageToLoad=0,e.initialState.needLoadingScreen=!0,e}function Pr(e){var t,n=e.plugins,r=e.asyncLoader,c=e.dispatch,i=e.asyncState,s=e.asyncId,o=e.rows,l=e.nextPage,u=e.previousPage,d=e.gotoPage,j=e.state,b=j.pageIndex,h=j.pageSize,O=j.pageToLoad;Object(kr.ensurePluginOrder)(n,["usePagination"],Sr);var f=null!==(t=null===i||void 0===i?void 0:i.data.order.length)&&void 0!==t?t:0,p=Math.ceil(f/h),x=b*h,v=x+h;Object(a.useEffect)((function(){void 0!==O&&r&&r(x,h)}),[r,x,h,O]);var m=Object(a.useCallback)((function(e){c({type:wr,pageToLoad:e})}),[c]);Object(a.useEffect)((function(){!1===(null===i||void 0===i?void 0:i.updating)&&m()}),[null===i||void 0===i?void 0:i.updating,m]);var g=Object(a.useCallback)((function(e){var t;(t="number"===typeof e?e:e(b))!==b&&(m(t),d(t))}),[b,m,d]),y=Object(a.useCallback)((function(){0!==b&&(m("prev"),u())}),[m,u,b]),k=Object(a.useCallback)((function(){b!==p&&(m("next"),l())}),[m,l,p,b]),S=Object(a.useMemo)((function(){var e;return(null!==(e=null===i||void 0===i?void 0:i.data.order.slice(x,v).filter(ne))&&void 0!==e?e:[]).flatMap((function(e){var t=o.find((function(t){return s&&s(t.original)===e}));return t?[t]:[]}))}),[x,v,s,null===i||void 0===i?void 0:i.data.order,o]);Object.assign(e,{previousPage:y,nextPage:k,gotoPage:g,page:S,pageCount:p})}Cr.pluginName=Sr;var Ar=Cr,Tr="useCustomSelection",Mr=Object(a.forwardRef)((function(e,t){var n=e.indeterminate,r=e.idIn,c=Object(kn.a)(e,["indeterminate","idIn"]),i=Object(a.useRef)(null),s=t||i;return Object(a.useEffect)((function(){"object"===typeof s&&s.current&&(s.current.indeterminate=null!==n&&void 0!==n&&n)}),[s,n]),Object(Nn.jsx)(Tn.a.Check,Object(f.a)({custom:!0,id:r,ref:s},c))}));function Er(e){e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(Object(J.a)(e),[n.isSelecting])})),e.visibleColumns.push(Kr),e.useInstance.push(Br)}function Br(e){var t=e.plugins,n=e.rows,r=e.onSelect,c=e.isSelecting,i=e.state.selectedRowIds;Object(kr.ensurePluginOrder)(t,["useRowSelect"],Tr),Object(a.useEffect)((function(){if(c){var e=Object.keys(i).flatMap((function(e){var t,r;return null!==(t=null===(r=n.find((function(t){return t.id===e})))||void 0===r?void 0:r.original)&&void 0!==t?t:[]}));r&&r(e)}}),[i,r,n,c])}function Kr(e,t){return t.instance.isSelecting?[{id:"---selection---",Header:function(e){var t=e.getToggleAllRowsSelectedProps;return Object(Nn.jsx)(Mr,Object(f.a)({idIn:"table-header-selection"},t()))},Cell:function(e){var t=e.row;return Object(Nn.jsx)(Mr,Object(f.a)({idIn:"table-cell-".concat(t.index)},t.getToggleRowSelectedProps()))}}].concat(Object(J.a)(e.filter((function(e){return!0!==e.selectHide})))):e}Er.pluginName=Tr;var zr=Er;function Dr(e){e.useOptions.push(Rr)}function Rr(e){var t=rn((function(e){return e.site})).pageSize;return void 0===e.autoResetPage&&(e.autoResetPage=!1),void 0===e.autoResetExpanded&&(e.autoResetExpanded=!1),void 0===e.initialState&&(e.initialState={}),e.initialState.needLoadingScreen=!1,void 0===e.initialState.pageSize&&(e.initialState.pageSize=t),void 0===e.asyncLoader&&(e.initialState.pageToLoad=void 0),e}Dr.pluginName="useLocalSettings";var Lr,_r=Dr,Hr={af:"afrikaans",sq:"albanian",am:"amharic",ar:"arabic",hy:"armenian",az:"azerbaijani",eu:"basque",be:"belarusian",bn:"bengali",bs:"bosnian",bg:"bulgarian",ca:"catalan",ceb:"cebuano",ny:"chichewa","zh-cn":"chinese (simplified)","zh-tw":"chinese (traditional)",co:"corsican",hr:"croatian",cs:"czech",da:"danish",nl:"dutch",en:"english",eo:"esperanto",et:"estonian",tl:"filipino",fi:"finnish",fr:"french",fy:"frisian",gl:"galician",ka:"georgian",de:"german",el:"greek",gu:"gujarati",ht:"haitian creole",ha:"hausa",haw:"hawaiian",iw:"hebrew",hi:"hindi",hmn:"hmong",hu:"hungarian",is:"icelandic",ig:"igbo",id:"indonesian",ga:"irish",it:"italian",ja:"japanese",jw:"javanese",kn:"kannada",kk:"kazakh",km:"khmer",ko:"korean",ku:"kurdish (kurmanji)",ky:"kyrgyz",lo:"lao",la:"latin",lv:"latvian",lt:"lithuanian",lb:"luxembourgish",mk:"macedonian",mg:"malagasy",ms:"malay",ml:"malayalam",mt:"maltese",mi:"maori",mr:"marathi",mn:"mongolian",my:"myanmar (burmese)",ne:"nepali",no:"norwegian",ps:"pashto",fa:"persian",pl:"polish",pt:"portuguese",pa:"punjabi",ro:"romanian",ru:"russian",sm:"samoan",gd:"scots gaelic",sr:"serbian",st:"sesotho",sn:"shona",sd:"sindhi",si:"sinhala",sk:"slovak",sl:"slovenian",so:"somali",es:"spanish",su:"sundanese",sw:"swahili",sv:"swedish",tg:"tajik",ta:"tamil",te:"telugu",th:"thai",tr:"turkish",uk:"ukrainian",ur:"urdu",uz:"uzbek",vi:"vietnamese",cy:"welsh",xh:"xhosa",yi:"yiddish",yo:"yoruba",zu:"zulu",fil:"Filipino",he:"Hebrew"},Ur=[{label:"White",value:"white"},{label:"Light Gray",value:"lightgray"},{label:"Red",value:"red"},{label:"Green",value:"green"},{label:"Yellow",value:"yellow"},{label:"Blue",value:"blue"},{label:"Magenta",value:"magenta"},{label:"Cyan",value:"cyan"},{label:"Black",value:"black"},{label:"Dark Red",value:"darkred"},{label:"Dark Green",value:"darkgreen"},{label:"Dark Yellow",value:"darkyellow"},{label:"Dark Blue",value:"darkblue"},{label:"Dark Magenta",value:"darkmagenta"},{label:"Dark Cyan",value:"darkcyan"},{label:"Dark Grey",value:"darkgrey"}];!function(e){e[e.Pending=0]="Pending",e[e.Processing=1]="Processing",e[e.Done=2]="Done"}(Lr||(Lr={}));var Fr=function(e){var t=e.state,n=Ae.f;switch(t){case Lr.Pending:n=Te.l;break;case Lr.Processing:n=Te.j;break;case Lr.Done:n=Te.h}return Object(Nn.jsx)(Me.a,{icon:n,spin:t===Lr.Processing})};var Gr=function(e){var t=e.process,n=Object(kn.a)(e,["process"]),r=Object(a.useState)(null),c=Object(Z.a)(r,2),i=c[0],s=c[1],o=Object(a.useCallback)((function(){if(i){var e="color(name=".concat(i,")");t(e)}}),[i,t]),l=Object(a.useMemo)((function(){return Object(Nn.jsx)(Ke.a,{disabled:null===i,onClick:o,children:"Save"})}),[i,o]);return Object(Nn.jsx)(hr,Object(f.a)(Object(f.a)({title:"Choose Color",footer:l},n),{},{children:Object(Nn.jsx)(Ln,{options:Ur,onChange:s})}))},qr=function(e){var t=e.process,n=Object(kn.a)(e,["process"]),r=Object(a.useState)(null),c=Object(Z.a)(r,2),i=c[0],s=c[1],o=Object(a.useState)(null),l=Object(Z.a)(o,2),u=l[0],d=l[1],j=null!==i&&null!==u&&i!==u,b=Object(a.useCallback)((function(){if(j){var e=function(e,t){return"change_FPS(from=".concat(e,",to=").concat(t,")")}(i,u);t(e)}}),[j,i,u,t]),h=Object(a.useMemo)((function(){return Object(Nn.jsx)(Ke.a,{disabled:!j,onClick:b,children:"Save"})}),[b,j]);return Object(Nn.jsx)(hr,Object(f.a)(Object(f.a)({title:"Change Frame Rate",footer:h},n),{},{children:Object(Nn.jsxs)(gr.a,{className:"px-2",children:[Object(Nn.jsx)(Tn.a.Control,{placeholder:"From",type:"number",onChange:function(e){var t=parseFloat(e.currentTarget.value);isNaN(t)?s(null):s(t)}}),Object(Nn.jsx)(Tn.a.Control,{placeholder:"To",type:"number",onChange:function(e){var t=parseFloat(e.currentTarget.value);isNaN(t)?d(null):d(t)}})]})}))},Wr=function(e){var t=e.process,n=Object(kn.a)(e,["process"]),r=Object(a.useState)(!0),c=Object(Z.a)(r,2),i=c[0],s=c[1],o=Object(a.useState)([0,0,0,0]),l=Object(Z.a)(o,2),u=l[0],d=l[1],j=Object(a.useCallback)((function(e){return function(t){var n=parseFloat(t.currentTarget.value);isNaN(n)&&(n=0);var r=Object(J.a)(u);r[e]=n,d(r)}}),[u]),b=u.some((function(e){return 0!==e})),h=Object(a.useCallback)((function(){if(b){var e=u.map((function(e){return i?e:-e})),n=(r=e[0],a=e[1],c=e[2],s=e[3],"shift_offset(h=".concat(r,",m=").concat(a,",s=").concat(c,",ms=").concat(s,")"));t(n)}var r,a,c,s}),[t,b,u,i]),O=Object(a.useMemo)((function(){return Object(Nn.jsx)(Ke.a,{disabled:!b,onClick:h,children:"Save"})}),[h,b]);return Object(Nn.jsx)(hr,Object(f.a)(Object(f.a)({title:"Adjust Times",footer:O},n),{},{children:Object(Nn.jsxs)(gr.a,{children:[Object(Nn.jsx)(gr.a.Prepend,{children:Object(Nn.jsx)(Ke.a,{variant:"secondary",title:i?"Later":"Earlier",onClick:function(){return s(!i)},children:Object(Nn.jsx)(Me.a,{icon:i?Te.M:Te.G})})}),Object(Nn.jsx)(Tn.a.Control,{type:"number",placeholder:"hour",onChange:j(0)}),Object(Nn.jsx)(Tn.a.Control,{type:"number",placeholder:"min",onChange:j(1)}),Object(Nn.jsx)(Tn.a.Control,{type:"number",placeholder:"sec",onChange:j(2)}),Object(Nn.jsx)(Tn.a.Control,{type:"number",placeholder:"ms",onChange:j(3)})]})}))},Yr=function(e){var t=e.process,n=Object(kn.a)(e,["process"]),r=dn(!0),c=Object(Z.a)(r,1)[0],i=Object(a.useMemo)((function(){return c.filter((function(e){return e.code2 in Hr}))}),[c]),s=Object(a.useState)(null),o=Object(Z.a)(s,2),l=o[0],u=o[1],d=Object(a.useCallback)((function(){l&&t("translate",{language:l.code2})}),[l,t]),j=Object(a.useMemo)((function(){return Object(Nn.jsx)(Ke.a,{disabled:!l,onClick:d,children:"Translate"})}),[d,l]);return Object(Nn.jsxs)(hr,Object(f.a)(Object(f.a)({title:"Translate to",footer:j},n),{},{children:[Object(Nn.jsx)(Tn.a.Label,{children:"Enabled languages not listed here are unsupported by Google Translate."}),Object(Nn.jsx)(nr,{options:i,onChange:u})]}))},Vr=function(e){var t=e.update,n=Object(kn.a)(e,["update"]),r=ur(n.modalKey),i=Object(a.useState)(!1),s=Object(Z.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)({}),d=Object(Z.a)(u,2),j=d[0],b=d[1],h=Object(a.useState)([]),p=Object(Z.a)(h,2),x=p[0],v=p[1],m=function(e){var t=Object(a.useContext)(ar),n=Object(Z.a)(t,2),r=n[0],c=n[1],i=Object(a.useContext)(cr),s=Object(Z.a)(i,2),o=s[0],l=s[1];return Object(a.useCallback)((function(){var t=r.findIndex((function(t){return t===e}));if(-1!==t){var n=r.slice(0,t+1),a=o.slice(0,t+1);c(n),l(a)}}),[r,o,c,l,e])}(n.modalKey),g=Object(a.useCallback)(function(){var e=Object(Fe.a)(Ue.a.mark((function e(n,r){var a,c,i,s,o;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m(),l(!0),a=x.reduce((function(e,t){return Object(f.a)(Object(O.a)({},t.path,Lr.Pending),e)}),{}),b(a),c=Object(zn.a)(x),e.prev=6,c.s();case 8:if((i=c.n()).done){e.next=19;break}return s=i.value,a=Object(f.a)(Object(f.a)({},a),{},Object(O.a)({},s.path,Lr.Processing)),b(a),o=Object(f.a)({id:s.id,type:s.type,language:s.language,path:s.path},r),e.next=15,et.modify(n,o);case 15:a=Object(f.a)(Object(f.a)({},a),{},Object(O.a)({},s.path,Lr.Done)),b(a);case 17:e.next=8;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(6),c.e(e.t0);case 24:return e.prev=24,c.f(),e.finish(24);case 27:l(!1),t();case 29:case"end":return e.stop()}}),e,null,[[6,21,24,27]])})));return function(t,n){return e.apply(this,arguments)}}(),[m,x,t]),y=ir(),k=Object(a.useMemo)((function(){return[{id:"state",accessor:"path",selectHide:!0,Cell:function(e){var t=e.value,n=e.loose;if(n){var r=n[0];if(t in r){var a=r[t];return Object(Nn.jsx)(Fr,{state:a})}}return null}},{Header:"Language",accessor:"_language",Cell:function(e){var t=e.value;return Object(Nn.jsx)(Vn.a,{variant:"secondary",children:Object(Nn.jsx)(ha,{text:t,long:!0})})}},{id:"file",Header:"File",accessor:"path",Cell:function(e){var t=e.value,n=t.lastIndexOf("/");return-1===n&&(n=t.lastIndexOf("\\")),-1!==n?t.slice(n+1):t}}]}),[]),S=Object(a.useMemo)((function(){var e;return null!==(e=null===r||void 0===r?void 0:r.flatMap((function(e){var t=function(e){return re(e)?[e.radarrId,"movie"]:[e.sonarrEpisodeId,"episode"]}(e),n=Object(Z.a)(t,2),r=n[0],a=n[1];return e.subtitles.flatMap((function(e){return null!==e.path?[{id:r,type:a,language:e.code2,path:e.path,_language:e}]:[]}))})))&&void 0!==e?e:[]}),[r]),w=[kr.useRowSelect,zr],C=Object(a.useMemo)((function(){return Object(Nn.jsxs)(An.a,{as:yr.a,onSelect:function(e){return e&&g(e)},children:[Object(Nn.jsx)(Xn,{size:"sm",loading:o,disabled:0===x.length,icon:Te.L,onClick:function(){return g("sync")},children:"Sync"}),Object(Nn.jsx)(An.a.Toggle,{disabled:o||0===x.length,split:!0,variant:"light",size:"sm",className:"px-2"}),Object(Nn.jsxs)(An.a.Menu,{children:[Object(Nn.jsx)(An.a.Item,{eventKey:"remove_HI",children:Object(Nn.jsx)(Jn,{icon:Te.p,children:"Remove HI Tags"})}),Object(Nn.jsx)(An.a.Item,{eventKey:"remove_tags",children:Object(Nn.jsx)(Jn,{icon:Te.n,children:"Remove Style Tags"})}),Object(Nn.jsx)(An.a.Item,{eventKey:"OCR_fixes",children:Object(Nn.jsx)(Jn,{icon:Te.z,children:"OCR Fixes"})}),Object(Nn.jsx)(An.a.Item,{eventKey:"common",children:Object(Nn.jsx)(Jn,{icon:Te.F,children:"Common Fixes"})}),Object(Nn.jsx)(An.a.Item,{eventKey:"fix_uppercase",children:Object(Nn.jsx)(Jn,{icon:Te.W,children:"Fix Uppercase"})}),Object(Nn.jsx)(An.a.Item,{eventKey:"reverse_rtl",children:Object(Nn.jsx)(Jn,{icon:Te.r,children:"Reverse RTL"})}),Object(Nn.jsx)(An.a.Item,{onSelect:function(){return y("add-color")},children:Object(Nn.jsx)(Jn,{icon:Te.J,children:"Add Color"})}),Object(Nn.jsx)(An.a.Item,{onSelect:function(){return y("change-frame-rate")},children:Object(Nn.jsx)(Jn,{icon:Te.v,children:"Change Frame Rate"})}),Object(Nn.jsx)(An.a.Item,{onSelect:function(){return y("adjust-times")},children:Object(Nn.jsx)(Jn,{icon:Te.l,children:"Adjust Times"})}),Object(Nn.jsx)(An.a.Item,{onSelect:function(){return y("translate-sub")},children:Object(Nn.jsx)(Jn,{icon:Te.B,children:"Translate"})})]})]})}),[y,o,x.length,g]);return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(hr,Object(f.a)(Object(f.a)({title:"Subtitle Tools",footer:C,closeable:!o},n),{},{children:Object(Nn.jsx)(ta,{isSelecting:!o&&0!==S.length,emptyText:"No External Subtitles Found",plugins:w,columns:k,onSelect:v,data:S,loose:[j]})})),Object(Nn.jsx)(Gr,{process:g,modalKey:"add-color"}),Object(Nn.jsx)(qr,{process:g,modalKey:"change-frame-rate"}),Object(Nn.jsx)(Wr,{process:g,modalKey:"adjust-times"}),Object(Nn.jsx)(Yr,{process:g,modalKey:"translate-sub"})]})},Qr=function(e){var t=e.onSearch,n=e.onFocus,r=e.onBlur,c=e.className,i=Object(a.useState)(""),s=Object(Z.a)(i,2),o=s[0],u=s[1],d=Object(a.useState)([]),j=Object(Z.a)(d,2),b=j[0],h=j[1],O=Object(l.h)(),f=Object(a.useCallback)((function(e){""===e?h([]):t(e).then((function(e){return h(e)}))}),[t]),p=Object(a.useMemo)((function(){return Object($.throttle)(f,500)}),[f]);Object(a.useEffect)((function(){p(o)}),[o,p]);var x=Object(a.useCallback)((function(){u(""),h([])}),[]),v=Object(a.useMemo)((function(){var e=b.map((function(e){return Object(Nn.jsx)(An.a.Item,{eventKey:e.link,disabled:void 0===e.link,children:Object(Nn.jsx)("span",{children:e.name})},e.name)}));return 0===e.length&&e.push(Object(Nn.jsx)(An.a.Header,{children:"No Found"},"notify")),e}),[b]);return Object(Nn.jsxs)(An.a,{show:0!==o.length,className:c,onFocus:n,onBlur:r,onSelect:function(e){e&&(x(),O.push(e))},children:[Object(Nn.jsx)(Tn.a.Control,{type:"text",size:"sm",placeholder:"Search...",value:o,onChange:function(e){return u(e.currentTarget.value)}}),Object(Nn.jsx)(An.a.Menu,{style:{maxHeight:256,overflowY:"auto"},children:v})]})},Xr=n(488);function Jr(e){return{style:{emptyText:e.emptyText,responsive:e.responsive,hoverable:e.hoverable,striped:e.striped,borderless:e.borderless,small:e.small,hideHeader:e.hideHeader,headersRenderer:e.headersRenderer,rowRenderer:e.rowRenderer},options:Object(kn.a)(e,["emptyText","responsive","hoverable","striped","borderless","small","hideHeader","headersRenderer","rowRenderer"])}}function Zr(e){return e.map((function(e){return Object(Nn.jsx)("th",Object(f.a)(Object(f.a)({},e.getHeaderProps()),{},{children:e.render("Header")}))}))}function $r(e){return Object(Nn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getRowProps()),{},{children:e.cells.map((function(e){return Object(Nn.jsx)("td",Object(f.a)(Object(f.a)({className:e.column.className},e.getCellProps()),{},{children:e.render("Cell")}))}))}))}function ea(e){var t=e.emptyText,n=e.responsive,r=e.hoverable,c=e.striped,i=e.borderless,s=e.small,o=e.hideHeader,l=e.headers,u=e.rows,d=e.headersRenderer,j=e.rowRenderer,b=e.prepareRow,h=e.tableProps,O=e.tableBodyProps,p=Object(a.useMemo)((function(){return l.reduce((function(e,t){return t.headers.length>e?t.headers.length:e}),0)}),[l]),x=0===u.length,v=null!==d&&void 0!==d?d:Zr,m=null!==j&&void 0!==j?j:$r;return Object(Nn.jsxs)(Xr.a,Object(f.a)(Object(f.a)({size:s?"sm":void 0,striped:null===c||void 0===c||c,borderless:null===i||void 0===i||i,hover:r,responsive:null===n||void 0===n||n},h),{},{children:[Object(Nn.jsx)("thead",{hidden:o,children:l.map((function(e){return Object(Nn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getHeaderGroupProps()),{},{children:v(e.headers)}))}))}),Object(Nn.jsx)("tbody",Object(f.a)(Object(f.a)({},O),{},{children:t&&x?Object(Nn.jsx)("tr",{children:Object(Nn.jsx)("td",{colSpan:p,className:"text-center",children:t})}):u.map((function(e){return b(e),m(e)}))}))]}))}function ta(e){var t=e.plugins,n=Jr(Object(kn.a)(e,["plugins"])),r=n.style,a=n.options,c=kr.useTable.apply(void 0,[a,_r].concat(Object(J.a)(null!==t&&void 0!==t?t:[]))),i=c.getTableProps,s=c.getTableBodyProps,o=c.headerGroups,l=c.rows,u=c.prepareRow;return Object(Nn.jsx)(ea,Object(f.a)(Object(f.a)({},r),{},{headers:o,rows:l,prepareRow:u,tableProps:i(),tableBodyProps:s()}))}function na(e,t){return e.isGrouped?Object(Nn.jsx)("span",Object(f.a)(Object(f.a)({},t.getToggleRowExpandedProps()),{},{children:e.render("Cell")})):t.canExpand||e.isAggregated?null:e.render("Cell")}function ra(e){if(e.canExpand){var t=e.cells.find((function(e){return e.isGrouped}));if(t){var n=e.isExpanded?90:void 0;return Object(Nn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getRowProps()),{},{children:Object(Nn.jsx)("td",Object(f.a)(Object(f.a)({className:"p-0"},t.getCellProps()),{},{colSpan:e.cells.length,children:Object(Nn.jsxs)("span",Object(f.a)(Object(f.a)({},e.getToggleRowExpandedProps()),{},{className:"d-flex align-items-center p-2",children:[t.render("Cell"),Object(Nn.jsx)(Me.a,{className:"mx-2",icon:Te.i,rotation:n})]}))}))}))}return null}return Object(Nn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getRowProps()),{},{children:e.cells.filter((function(e){return!e.isPlaceholder})).map((function(t){return Object(Nn.jsx)("td",Object(f.a)(Object(f.a)({className:t.column.className},t.getCellProps()),{},{children:na(t,e)}))}))}))}function aa(e){return e.filter((function(e){return!e.isGrouped})).map((function(e){return Object(Nn.jsx)("th",Object(f.a)(Object(f.a)({},e.getHeaderProps()),{},{children:e.render("Header")}))}))}var ca,ia=function(e){var t=[kr.useGroupBy,kr.useSortBy,kr.useExpanded];return Object(Nn.jsx)(ta,Object(f.a)(Object(f.a)({},e),{},{plugins:t,headersRenderer:aa,rowRenderer:ra}))},sa=n(506),oa=n(257),la=function(e){var t=e.count,n=e.index,r=e.size,c=e.total,i=e.canPrevious,s=e.previous,o=e.canNext,l=e.next,u=e.goto,d=e.loadState,j=0===c?0:r*n+1,b=Math.min(r*(n+1),c),h=void 0!==d,O=Object(a.useMemo)((function(){return Object(J.a)(Array(t).keys()).map((function(e){return Math.abs(e-n)>=4&&0!==e&&e!==t-1?null:Object(Nn.jsx)(sa.a.Item,{disabled:h,active:n===e,onClick:function(){return u(e)},children:e+1},e)})).flatMap((function(e,t,n){return null===e?null===n[t+1]?[]:Object(Nn.jsx)(sa.a.Ellipsis,{disabled:!0},t):[e]}))}),[t,n,u,h]);return Object(Nn.jsx)(Be.a,{fluid:!0,className:"mb-3",children:Object(Nn.jsxs)(Ee.a,{children:[Object(Nn.jsx)(oa.a,{className:"d-flex align-items-center justify-content-start",children:Object(Nn.jsxs)("span",{children:["Show ",j," to ",b," of ",c," entries"]})}),Object(Nn.jsx)(oa.a,{className:"d-flex justify-content-end",children:Object(Nn.jsxs)(sa.a,{className:"m-0",hidden:t<=1,children:[Object(Nn.jsx)(sa.a.Prev,{onClick:s,disabled:!i&&h}),O,Object(Nn.jsx)(sa.a.Next,{onClick:l,disabled:!o&&h})]})})]})})};function ua(e){var t=e.async,n=e.autoScroll,r=e.canSelect,i=e.plugins,s=Jr(Object(kn.a)(e,["async","autoScroll","canSelect","plugins"])),o=s.style,l=s.options,u=[_r,kr.usePagination];t&&u.push(Ar),r&&u.push(kr.useRowSelect,zr),i&&u.push.apply(u,Object(J.a)(i));var d=kr.useTable.apply(void 0,[l].concat(u)),j=d.getTableProps,b=d.getTableBodyProps,h=d.headerGroups,O=d.rows,p=d.prepareRow,x=d.page,v=d.canNextPage,m=d.canPreviousPage,g=d.pageCount,y=d.gotoPage,k=d.nextPage,S=d.previousPage,w=d.setPageSize,C=d.state,N=C.pageIndex,I=C.pageSize,P=C.pageToLoad,A=C.needLoadingScreen,T=rn((function(e){return e.site.pageSize}));Object(a.useEffect)((function(){n&&he()}),[N,n]),Object(a.useEffect)((function(){var e=l.isSelecting;r&&!Object($.isUndefined)(e)&&w(e?O.length:T)}),[r,T,l.isSelecting,O.length,w]);var M=l.asyncState?l.asyncState.data.order.length:O.length,E=Object(a.useCallback)((function(e){var t=N*I,n=t+I;return!1===e.order.slice(t,n).every($.isNull)}),[N,I]);return A&&l.asyncState?Object(Nn.jsx)(Gn,{state:l.asyncState,exist:E}):Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(ea,Object(f.a)(Object(f.a)({},o),{},{headers:h,rows:x,prepareRow:p,tableProps:j(),tableBodyProps:b()})),Object(Nn.jsx)(la,{loadState:P,count:g,index:N,size:I,total:M,canPrevious:m,canNext:v,previous:S,next:k,goto:y})]})}!function(e){e[e.Delete=0]="Delete",e[e.Download=1]="Download",e[e.Manual=2]="Manual",e[e.Upgrade=3]="Upgrade",e[e.Upload=4]="Upload",e[e.Sync=5]="Sync"}(ca||(ca={}));var da=function(e){var t=e.action,n=e.title,r=null;switch(t){case ca.Delete:r=Te.Z;break;case ca.Download:r=Te.q;break;case ca.Manual:r=Te.bb;break;case ca.Sync:r=Te.l;break;case ca.Upgrade:r=Te.O;break;case ca.Upload:r=Te.m}return r?Object(Nn.jsx)(Me.a,{title:n,icon:r}):null},ja=function(e){var t=e.messages,n=Object(kn.a)(e,["messages"]),r=Object(Nn.jsx)(Sn.a,{hidden:0===t.length,id:"overlay-icon",children:Object(Nn.jsx)(Sn.a.Content,{children:t.map((function(e){return Object(Nn.jsx)("li",{children:e},e)}))})});return Object(Nn.jsx)(wn.a,{overlay:r,children:Object(Nn.jsx)(Me.a,Object(f.a)({},n))})},ba=function(e){var t=e.children,n=e.animation;return Object(Nn.jsxs)("div",{className:"d-flex flex-column flex-grow-1 align-items-center py-5",children:[Object(Nn.jsx)(Cn.a,{animation:null!==n&&void 0!==n?n:"border",className:"mb-2"}),t]})},ha=function(e){var t=e.text,n=e.className,r=e.long,c=Object(a.useMemo)((function(){var e=t.code2,n=":HI",a=":Forced";r&&(e=t.name,n=" HI",a=" Forced");var c=e;return t.hi?c+=n:t.forced&&(c+=a),c}),[t,r]);return Object(Nn.jsx)("span",{title:t.name,className:n,children:c})},Oa=function(e){var t=e.children,n=e.text,r=e.placement,a=e.delay;if(Object($.isNull)(n)||Object($.isUndefined)(n))return t;var c=Object(Nn.jsx)(Sn.a,{className:"mw-100 py-1",id:n,children:Object(Nn.jsx)("span",{className:"mx-2",children:n})});return Object(Nn.jsx)(wn.a,{delay:a,overlay:c,placement:r,children:t})},fa=n(489),pa=n(504),xa="data:image/png;base64,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",va=n(285),ma=n(259),ga=c.a.createContext([]),ya=c.a.createContext({}),ka=function(e){var t=e.link,n=e.name,r=e.icon,c=Object(a.useContext)(ya),i=Object(a.useContext)(ws),s=Object(a.useMemo)((function(){var e=null;if(n in c){var t=c[n];"number"===typeof t&&(e=t)}return e}),[c,n]);return Object(Nn.jsx)(u.c,{activeClassName:"sb-active",className:"list-group-item list-group-item-action sidebar-button",to:t,onClick:i,children:Object(Nn.jsx)(wa,{badge:null!==s&&void 0!==s?s:void 0,name:n,icon:r})})},Sa=function(e){var t=e.icon,n=e.name,r=e.children,c=Object(a.useContext)(ya),i=Object(a.useContext)(ga),s=Object(a.useContext)(ws),o=n.toLowerCase(),l=rn((function(e){return e.site.sidebar})),d=Pa(),j=Object(a.useMemo)((function(){var e=null,t=null;if(n in c){var r=c[n];if("number"===typeof r)e=r;else if("object"===typeof r)for(var a in e=0,t=r,r)e+=r[a]}return[e,t]}),[c,n]),b=Object(Z.a)(j,2),h=b[0],O=b[1],f=Object(a.useMemo)((function(){return l===o}),[l,o]),p=Object(a.useMemo)((function(){return"sidebar-collapse-box ".concat(f?"active":"")}),[f]),x=Object(a.useMemo)((function(){return r.filter((function(e){var t;return!i.includes(null!==(t=e.hiddenKey)&&void 0!==t?t:"")})).map((function(e){var t,n=null;return O&&e.name in O&&(n=O[e.name]),Object(Nn.jsx)(u.c,{activeClassName:"sb-active",className:"list-group-item list-group-item-action sidebar-button sb-collapse",to:e.link,onClick:s,children:Object(Nn.jsx)(wa,{badge:0===n?void 0:null!==(t=n)&&void 0!==t?t:void 0,name:e.name})},e.name)}))}),[r,i,O,s]);return 0===x.length?null:Object(Nn.jsxs)("div",{className:p,children:[Object(Nn.jsx)(va.a,{action:!0,className:"sidebar-button",onClick:function(){d(f?"":o)},children:Object(Nn.jsx)(wa,{badge:0===h?void 0:null!==h&&void 0!==h?h:void 0,icon:t,name:n})}),Object(Nn.jsx)(ma.a,{in:f,children:Object(Nn.jsx)("div",{className:"sidebar-collapse",children:x})})]})},wa=function(e){var t=e.name,n=e.icon,r=e.badge;return Object(Nn.jsxs)(c.a.Fragment,{children:[n&&Object(Nn.jsx)(Me.a,{size:"1x",className:"icon",icon:n}),Object(Nn.jsxs)("span",{className:"d-flex flex-grow-1 justify-content-between",children:[t," ",Object(Nn.jsx)(Vn.a,{variant:"secondary",children:r})]})]})},Ca="sonarr-disabled",Na="radarr-disabled",Ia=[{icon:Te.L,name:"Series",link:"/series",hiddenKey:Ca},{icon:Te.v,name:"Movies",link:"/movies",hiddenKey:Na},{icon:Te.l,name:"History",children:[{name:"Series",link:"/history/series",hiddenKey:Ca},{name:"Movies",link:"/history/movies",hiddenKey:Na},{name:"Statistics",link:"/history/stats"}]},{icon:Te.u,name:"Blacklist",children:[{name:"Series",link:"/blacklist/series",hiddenKey:Ca},{name:"Movies",link:"/blacklist/movies",hiddenKey:Na}]},{icon:Te.t,name:"Wanted",children:[{name:"Series",link:"/wanted/series",hiddenKey:Ca},{name:"Movies",link:"/wanted/movies",hiddenKey:Na}]},{icon:Te.o,name:"Settings",children:[{name:"General",link:"/settings/general"},{name:"Languages",link:"/settings/languages"},{name:"Providers",link:"/settings/providers"},{name:"Subtitles",link:"/settings/subtitles"},{name:"Sonarr",link:"/settings/sonarr"},{name:"Radarr",link:"/settings/radarr"},{name:"Notifications",link:"/settings/notifications"},{name:"Scheduler",link:"/settings/scheduler"},{name:"UI",link:"/settings/ui"}]},{icon:Te.C,name:"System",children:[{name:"Tasks",link:"/system/tasks"},{name:"Logs",link:"/system/logs"},{name:"Providers",link:"/system/providers"},{name:"Status",link:"/system/status"},{name:"Releases",link:"/system/releases"}]}];n(339);function Pa(){return an(Kt)}var Aa=function(e){var t=e.open;ie(an(At));var n=Object(a.useContext)(ws),r=rn((function(e){return e.site.badges})),i=r.movies,s=r.episodes,o=r.providers,u=Object(a.useMemo)((function(){return{Wanted:{Series:s,Movies:i},System:{Providers:o}}}),[i,s,o]),d=gn(),j=yn(),b=Object(a.useMemo)((function(){var e=[];return d||e.push(Ca),j||e.push(Na),e}),[d,j]),h=Object(l.h)(),O=Pa();Object(a.useEffect)((function(){var e=h.location.pathname.split("/"),t=e.length;O(t>=3?e[t-2]:e[t-1])}),[h.location.pathname,O]);var p=["sidebar-container"],x=["sidebar-overlay"];!0===t&&(p.push("open"),x.push("open"));var v=Object(a.useMemo)((function(){return Ia.map((function(e){var t;return b.includes(null!==(t=e.hiddenKey)&&void 0!==t?t:"")?null:"children"in e?Object(Nn.jsx)(Sa,Object(f.a)({},e),e.name):Object(Nn.jsx)(ka,Object(f.a)({},e),e.link)}))}),[b]),m=ce();return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsxs)("aside",{className:p.join(" "),children:[Object(Nn.jsx)(Be.a,{className:"sidebar-title d-flex align-items-center d-md-none",children:Object(Nn.jsx)(fa.a,{alt:"brand",src:xa,width:"32",height:"32",onClick:m,className:"cursor-pointer"})}),Object(Nn.jsx)(ga.Provider,{value:b,children:Object(Nn.jsx)(ya.Provider,{value:u,children:Object(Nn.jsx)(pa.a,{variant:"flush",children:v})})})]}),Object(Nn.jsx)("div",{className:x.join(" "),onClick:n})]})},Ta=n(500);n(340);function Ma(e){return Ea.apply(this,arguments)}function Ea(){return(Ea=Object(Fe.a)(Ue.a.mark((function e(t){var n;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,tt.search(t);case 2:return n=e.sent,e.abrupt("return",n.map((function(e){var t;return t=e.sonarrSeriesId?"/series/".concat(e.sonarrSeriesId):e.radarrId?"/movies/".concat(e.radarrId):"",{name:"".concat(e.title," (").concat(e.year,")"),link:t}})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ba=function(){var e,t,n=an(It),r=on(),c="none"!==(null!==(e=null===(t=Object(Z.a)(r,1)[0].data)||void 0===t?void 0:t.auth.type)&&void 0!==e?e:"none"),i=Object(a.useContext)(ws),s=rn((function(e){return e.site.offline})),o=Object(a.useMemo)((function(){return Object(Nn.jsxs)(An.a,{alignRight:!0,children:[Object(Nn.jsx)(An.a.Toggle,{className:"dropdown-hidden",as:Ke.a,children:Object(Nn.jsx)(Me.a,{icon:Te.bb})}),Object(Nn.jsxs)(An.a.Menu,{children:[Object(Nn.jsx)(An.a.Item,{onClick:function(){tt.restart()},children:"Restart"}),Object(Nn.jsx)(An.a.Item,{onClick:function(){tt.shutdown()},children:"Shutdown"}),Object(Nn.jsx)(An.a.Divider,{hidden:!c}),Object(Nn.jsx)(An.a.Item,{hidden:!c,onClick:function(){tt.logout().then((function(){return n()}))},children:"Logout"})]})]})}),[c,n]),l=Object(a.useState)(!1),u=Object(Z.a)(l,2),d=u[0],j=u[1],b=Object(a.useCallback)((function(){j(!0),tt.status().finally((function(){return j(!1)}))}),[]),h=ce();return Object(Nn.jsxs)(Ta.a,{bg:"primary",className:"flex-grow-1 px-0",children:[Object(Nn.jsx)("div",{className:"header-icon px-3 m-0 d-none d-md-block",children:Object(Nn.jsx)(fa.a,{alt:"brand",src:xa,width:"32",height:"32",onClick:h,className:"cursor-pointer"})}),Object(Nn.jsx)(Ke.a,{className:"mx-2 m-0 d-md-none",onClick:i,children:Object(Nn.jsx)(Me.a,{icon:Te.c})}),Object(Nn.jsx)(Be.a,{fluid:!0,children:Object(Nn.jsxs)(Ee.a,{noGutters:!0,className:"flex-grow-1",children:[Object(Nn.jsx)(oa.a,{xs:6,sm:4,className:"d-flex align-items-center",children:Object(Nn.jsx)(Qr,{onSearch:Ma})}),Object(Nn.jsxs)(oa.a,{className:"d-flex flex-row align-items-center justify-content-end pr-2",children:[Object(Nn.jsx)(Ke.a,{href:"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XHHRWXT9YB7WE&source=url",target:"_blank",children:Object(Nn.jsx)(Me.a,{icon:Te.x})}),s?Object(Nn.jsx)(Xn,{loading:d,className:"ml-2",variant:"warning",icon:Te.I,onClick:b,children:"Reconnect"}):o]})]})})]})},Ka=n(501);n(341);var za=function(e){var t=e.message,n=e.id,r=e.type,c=an(Et),i=Object(a.useCallback)((function(){return c(n)}),[c,n]);return Object(Nn.jsxs)(Ka.a,{onClose:i,animation:!1,children:[Object(Nn.jsxs)(Ka.a.Header,{children:[Object(Nn.jsx)(Me.a,{className:"mr-1",icon:Te.t}),Object(Nn.jsx)("strong",{className:"mr-auto",children:Object($.capitalize)(r)})]}),Object(Nn.jsx)(Ka.a.Body,{children:t})]})},Da=function(){var e=rn((function(e){return e.site.notifications})),t=Object(a.useMemo)((function(){return e.map((function(e,t){return Object(Nn.jsx)(za,Object(f.a)({},e),e.id)}))}),[e]);return Object(Nn.jsx)("div",{className:"alert-container",children:Object(Nn.jsx)("div",{className:"toast-container",children:t})})},Ra="/empty-page",La=function(){return Object(Nn.jsxs)(Be.a,{className:"d-flex flex-column align-items-center my-5",children:[Object(Nn.jsxs)("h1",{children:[Object(Nn.jsx)(Me.a,{className:"mr-2",icon:Ae.c}),"404"]}),Object(Nn.jsx)("p",{children:"The Request URL No Found"})]})},_a=n(36),Ha=function(e){var t=e.blacklist,n=e.update,r=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t="/movies/".concat(e.row.original.radarrId);return Object(Nn.jsx)(u.b,{to:t,children:Object(Nn.jsx)("span",{children:e.value})})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(Nn.jsx)(ha,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(Nn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(Nn.jsx)("span",{children:e.value})}):null}},{accessor:"subs_id",Cell:function(e){var t=e.value;return Object(Nn.jsx)(Yn,{size:"sm",variant:"light",noReset:!0,promise:function(){return Je.deleteBlacklist(!1,{provider:e.row.original.provider,subs_id:t})},onSuccess:n,children:Object(Nn.jsx)(Me.a,{icon:Te.Z})})}}]}),[n]);return Object(Nn.jsx)(ua,{emptyText:"No Blacklisted Movies Subtitles",columns:r,data:t})},Ua=function(){var e=function(){var e=an(Gt);return sn(rn((function(e){return e.movie.blacklist})),e)}(),t=Object(Z.a)(e,2),n=t[0],r=t[1];return ie(r),Object(Nn.jsx)(Gn,{state:n,children:function(e){return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsx)("title",{children:"Movies Blacklist - Bazarr"})}),Object(Nn.jsx)(tr,{children:Object(Nn.jsx)(tr.AsyncButton,{icon:Te.Z,disabled:0===e.length,promise:function(){return Je.deleteBlacklist(!0)},onSuccess:r,children:"Remove All"})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(Ha,{blacklist:e,update:r})})]})}})},Fa=function(e){var t=e.blacklist,n=e.update,r=Object(a.useMemo)((function(){return[{Header:"Series",accessor:"seriesTitle",className:"text-nowrap",Cell:function(e){var t="/series/".concat(e.row.original.sonarrSeriesId);return Object(Nn.jsx)(u.b,{to:t,children:Object(Nn.jsx)("span",{children:e.value})})}},{Header:"Episode",accessor:"episode_number"},{accessor:"episodeTitle"},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(Nn.jsx)(ha,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(Nn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(Nn.jsx)("span",{children:e.value})}):null}},{accessor:"subs_id",Cell:function(e){var t=e.value;return Object(Nn.jsx)(Yn,{size:"sm",variant:"light",noReset:!0,promise:function(){return Ve.deleteBlacklist(!1,{provider:e.row.original.provider,subs_id:t})},onSuccess:n,children:Object(Nn.jsx)(Me.a,{icon:Te.Z})})}}]}),[n]);return Object(Nn.jsx)(ua,{emptyText:"No Blacklisted Series Subtitles",columns:r,data:t})},Ga=function(){var e=function(){var e=an(nn);return sn(rn((function(e){return e.series.blacklist})),e)}(),t=Object(Z.a)(e,2),n=t[0],r=t[1];return ie(r),Object(Nn.jsx)(Gn,{state:n,children:function(e){return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsx)("title",{children:"Series Blacklist - Bazarr"})}),Object(Nn.jsx)(tr,{children:Object(Nn.jsx)(tr.AsyncButton,{icon:Te.Z,disabled:0===e.length,promise:function(){return Ve.deleteBlacklist(!0)},onSuccess:r,children:"Remove All"})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(Fa,{blacklist:e,update:r})})]})}})},qa=function(){var e=gn(),t=yn();return Object(Nn.jsxs)(l.e,{children:[e&&Object(Nn.jsx)(l.c,{exact:!0,path:"/blacklist/series",children:Object(Nn.jsx)(Ga,{})}),t&&Object(Nn.jsx)(l.c,{path:"/blacklist/movies",children:Object(Nn.jsx)(Ua,{})}),Object(Nn.jsx)(l.c,{path:"/blacklist/*",children:Object(Nn.jsx)(l.b,{to:Ra})})]})},Wa=function(e){var t=e.state,n=e.columns,r=e.type,a=e.tableUpdater,c=Object($.capitalize)(r);return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsxs)("title",{children:[c," History - Bazarr"]})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(Gn,{state:t,children:function(e){return Object(Nn.jsx)(ua,{emptyText:"Nothing Found in ".concat(c," History"),columns:n,data:e,externalUpdate:a})}})})]})},Ya=function(){var e=function(){var e=an(_t);return sn(rn((function(e){return e.movie.historyList})),e)}(),t=Object(Z.a)(e,2),n=t[0],r=t[1];ie(r);var c=Object(a.useCallback)((function(e){return r()}),[r]),i=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){return Object(Nn.jsx)(da,{action:e.value})}},{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t="/movies/".concat(e.row.original.radarrId);return Object(Nn.jsx)(u.b,{to:t,children:Object(Nn.jsx)("span",{children:e.value})})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(Nn.jsx)(Vn.a,{variant:"secondary",children:Object(Nn.jsx)(ha,{text:t,long:!0})}):null}},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(Nn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(Nn.jsx)("span",{children:e.value})}):null}},{accessor:"description",Cell:function(e){var t=e.row,n=e.value,r=Object(Nn.jsx)(Sn.a,{id:"description-".concat(t.id),children:Object(Nn.jsx)(Sn.a.Content,{children:n})});return Object(Nn.jsx)(wn.a,{overlay:r,children:Object(Nn.jsx)(Me.a,{size:"sm",icon:Te.A})})}},{accessor:"blacklisted",Cell:function(e){var t=e.row,n=e.externalUpdate,r=t.original;return Object(Nn.jsx)(Or,{history:r,update:function(){return n&&n(t)},promise:function(e){return Je.addBlacklist(r.radarrId,e)}})}}]}),[]);return Object(Nn.jsx)(Wa,{type:"movies",state:n,columns:i,tableUpdater:c})},Va=function(){var e=function(){var e=an(en);return sn(rn((function(e){return e.series.historyList})),e)}(),t=Object(Z.a)(e,2),n=t[0],r=t[1];ie(r);var c=Object(a.useCallback)((function(e){return r()}),[r]),i=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){var t=e.value;return Object(Nn.jsx)(da,{action:t})}},{Header:"Series",accessor:"seriesTitle",Cell:function(e){var t="/series/".concat(e.row.original.sonarrSeriesId);return Object(Nn.jsx)(u.b,{to:t,children:Object(Nn.jsx)("span",{children:e.value})})}},{Header:"Episode",accessor:"episode_number"},{Header:"Title",accessor:"episodeTitle"},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(Nn.jsx)(Vn.a,{variant:"secondary",children:Object(Nn.jsx)(ha,{text:t,long:!0})}):null}},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(Nn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(Nn.jsx)("span",{children:e.value})}):null}},{accessor:"description",Cell:function(e){var t=e.row,n=e.value,r=Object(Nn.jsx)(Sn.a,{id:"description-".concat(t.id),children:Object(Nn.jsx)(Sn.a.Content,{children:n})});return Object(Nn.jsx)(wn.a,{overlay:r,children:Object(Nn.jsx)(Me.a,{size:"sm",icon:Te.A})})}},{accessor:"blacklisted",Cell:function(e){var t=e.row,n=e.externalUpdate,r=t.original,a=r.sonarrEpisodeId,c=r.sonarrSeriesId;return Object(Nn.jsx)(Or,{history:r,update:function(){return n&&n(t)},promise:function(e){return Ve.addBlacklist(c,a,e)}})}}]}),[]);return Object(Nn.jsx)(Wa,{type:"series",state:n,columns:i,tableUpdater:c})},Qa=n(509),Xa=n(490),Ja=n(494),Za=n(279),$a=n(280),ec=n(140),tc=n(136),nc=n(284),rc=[{label:"Automatically Downloaded",value:0},{label:"Manually Downloaded",value:1},{label:"Upgraded",value:2}],ac=[{label:"Last Week",value:"week"},{label:"Last Month",value:"month"},{label:"Last Trimester",value:"trimester"},{label:"Last Year",value:"year"}];function cc(e){var t=e.movies.map((function(e){return{date:e.date,movies:e.count}})),n=e.series.map((function(e){return{date:e.date,series:e.count}}));return Object($.merge)(t,n)}var ic=function(e){return e.name},sc=function(e){var t=e.children;return Object(Nn.jsx)(oa.a,{xs:6,lg:3,className:"p-1",children:t})},oc=function(){var e=dn(!0),t=Object(Z.a)(e,1)[0],n=vn(),r=Object(Z.a)(n,2),i=r[0];ie(r[1]);var s=Object(a.useState)("month"),o=Object(Z.a)(s,2),l=o[0],u=o[1],d=Object(a.useState)(null),j=Object(Z.a)(d,2),b=j[0],h=j[1],O=Object(a.useState)(null),f=Object(Z.a)(O,2),p=f[0],x=f[1],v=Object(a.useState)(null),m=Object(Z.a)(v,2),g=m[0],y=m[1],k=Object(a.useCallback)((function(){return Xe.stats(l,null!==b&&void 0!==b?b:void 0,null===g||void 0===g?void 0:g.name,null===p||void 0===p?void 0:p.code2)}),[l,null===p||void 0===p?void 0:p.code2,b,g]);return Object(Nn.jsxs)(Be.a,{fluid:!0,className:"vh-75",children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsx)("title",{children:"History Statistics - Bazarr"})}),Object(Nn.jsx)(qn,{promise:k,children:function(e){return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsxs)(tr,{scroll:!1,children:[Object(Nn.jsx)(sc,{children:Object(Nn.jsx)(Ln,{placeholder:"Time...",options:ac,value:l,onChange:function(e){return u(null!==e&&void 0!==e?e:"month")}})}),Object(Nn.jsx)(sc,{children:Object(Nn.jsx)(Ln,{placeholder:"Action...",clearable:!0,options:rc,value:b,onChange:h})}),Object(Nn.jsx)(sc,{children:Object(Nn.jsx)(Wn,{placeholder:"Provider...",clearable:!0,state:i,label:ic,onChange:y})}),Object(Nn.jsx)(sc,{children:Object(Nn.jsx)(nr,{clearable:!0,options:t,value:p,onChange:x})})]}),Object(Nn.jsx)(Qa.a,{height:"100%",children:Object(Nn.jsxs)(Xa.a,{data:cc(e),children:[Object(Nn.jsx)(Ja.a,{strokeDasharray:"4 2"}),Object(Nn.jsx)(Za.a,{dataKey:"date"}),Object(Nn.jsx)($a.a,{allowDecimals:!1}),Object(Nn.jsx)(ec.a,{}),Object(Nn.jsx)(tc.a,{verticalAlign:"top"}),Object(Nn.jsx)(nc.a,{name:"Series",dataKey:"series",fill:"#2493B6"}),Object(Nn.jsx)(nc.a,{name:"Movies",dataKey:"movies",fill:"#FFC22F"})]})})]})}})]})},lc=function(){var e=gn(),t=yn();return Object(Nn.jsxs)(l.e,{children:[e&&Object(Nn.jsx)(l.c,{exact:!0,path:"/history/series",children:Object(Nn.jsx)(Va,{})}),t&&Object(Nn.jsx)(l.c,{exact:!0,path:"/history/movies",children:Object(Nn.jsx)(Ya,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/history/stats",children:Object(Nn.jsx)(oc,{})}),Object(Nn.jsx)(l.c,{path:"/history/*",children:Object(Nn.jsx)(l.b,{to:Ra})})]})},uc=function(e){var t,n,r,i=e.state,s=e.dirtyItems,o=e.update,l=e.modify,u=e.editMode,d=e.select,j=e.columns,b=e.loader,h=e.name,O=ir(),f=Object(a.useCallback)((function(e,t){O(t,e.original)}),[O]),p=i.data,x=Object(a.useMemo)((function(){return ue(p)}),[p]),v=(t=x,n=s,r=dc,Object(a.useMemo)((function(){return de(t,n,r)}),[t,n,r])),m=ln(),g=Object(Z.a)(m,1)[0];return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(ua,{async:!0,autoScroll:!0,canSelect:!0,columns:j,data:v,asyncState:i,asyncId:le,asyncLoader:b,loose:[g],isSelecting:u,onSelect:d,emptyText:"No ".concat(h," Found"),externalUpdate:f}),Object(Nn.jsx)(xr,{modalKey:"edit",submit:l,onSuccess:function(e){var t=le(e);o([t])}})]})};function dc(e,t){return le(e)===le(t)}var jc,bc=function(e){var t=e.updateAction,n=Object(kn.a)(e,["updateAction"]),r=n.state,i=Object(a.useState)(!1),s=Object(Z.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(!1),d=Object(Z.a)(u,2),j=d[0],b=d[1],h=cn(t,Object(a.useCallback)((function(){l((function(e){return b(e),e})),k([])}),[])),O=Object(a.useState)([]),p=Object(Z.a)(O,2),x=p[0],v=p[1],m=Object(a.useState)([]),g=Object(Z.a)(m,2),y=g[0],k=g[1],S=ln(),w=Object(Z.a)(S,1)[0],C=Object(a.useMemo)((function(){var e=[];return e.push(Object(Nn.jsx)(An.a.Item,{children:"Clear Profile"},"clear-profile")),e.push(Object(Nn.jsx)(An.a.Divider,{},"dropdown-divider")),e.push.apply(e,Object(J.a)(w.map((function(e){return Object(Nn.jsx)(An.a.Item,{eventKey:e.profileId.toString(),children:e.name},e.profileId)})))),e}),[w]),N=Object(a.useCallback)((function(e){var t=e?parseInt(e):null,n=x.map((function(e){var n=Object(f.a)({},e);return n.profileId=t,n})),r=de(y,n,dc);k(r)}),[x,y]),I=Object(a.useCallback)((function(){n.state.data.order.every(ne)?b(!0):h(),l(!0)}),[n.state.data.order,h]),P=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&y.length>0){var t=y.map(le);h(t)}else b(!1),k([]);l(!1),v([])}),[y,h]),A=Object(a.useCallback)((function(){var e={id:[],profileid:[]};return y.forEach((function(t){var n=le(t);e.id.push(n),e.profileid.push(t.profileId)})),n.modify(e)}),[y,n]);return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsxs)("title",{children:[n.name," - Bazarr"]})}),Object(Nn.jsx)(tr,{scroll:!1,children:j?Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(tr.Group,{pos:"start",children:Object(Nn.jsxs)(An.a,{onSelect:N,children:[Object(Nn.jsx)(An.a.Toggle,{disabled:0===x.length,variant:"light",children:"Change Profile"}),Object(Nn.jsx)(An.a.Menu,{children:C})]})}),Object(Nn.jsxs)(tr.Group,{pos:"end",children:[Object(Nn.jsx)(tr.Button,{icon:Te.ab,onClick:function(){return P(!0)},children:"Cancel"}),Object(Nn.jsx)(tr.AsyncButton,{icon:Te.h,disabled:0===y.length,promise:A,onSuccess:function(){return P()},children:"Save"})]})]}):Object(Nn.jsx)(tr.Button,{updating:o!==j,disabled:0===r.data.order.length&&r.updating,icon:Te.E,onClick:I,children:"Mass Edit"})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(uc,Object(f.a)(Object(f.a)({},n),{},{update:h,dirtyItems:y,editMode:j,select:v}))})]})},hc=function(){var e=pn(),t=Object(Z.a)(e,1)[0],n=an(Ht),r=Object(a.useMemo)((function(){return[{accessor:"monitored",selectHide:!0,Cell:function(e){var t=e.value;return Object(Nn.jsx)(Me.a,{title:t?"monitored":"unmonitored",icon:t?Te.d:Ae.a})}},{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t=e.row,n=e.value;if(e.isSelecting)return n;var r="/movies/".concat(t.original.radarrId);return Object(Nn.jsx)(Oa,{text:t.original.sceneName,delay:1,children:Object(Nn.jsx)(u.b,{to:r,children:Object(Nn.jsx)("span",{children:n})})})}},{Header:"Exist",accessor:"exist",selectHide:!0,Cell:function(e){var t=e.row,n=e.value,r=t.original.path;return Object(Nn.jsx)(Me.a,{title:r,icon:n?Te.h:Te.t})}},{Header:"Audio",accessor:"audio_language",Cell:function(e){return e.value.map((function(e){return Object(Nn.jsx)(Vn.a,{variant:"secondary",className:"mr-2",children:e.name},e.code2)}))}},{Header:"Languages Profile",accessor:"profileId",Cell:function(e){var t,n,r=e.value,a=e.loose;return a&&null!==(t=null===(n=a[0].find((function(e){return e.profileId===r})))||void 0===n?void 0:n.name)&&void 0!==t?t:null}},{Header:"Missing Subtitles",accessor:"missing_subtitles",selectHide:!0,Cell:function(e){return e.value.map((function(e){return Object(Nn.jsx)(Vn.a,{className:"mx-2",variant:"warning",children:e.code2},e.code2)}))}},{accessor:"radarrId",selectHide:!0,Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(Nn.jsx)(Qn,{icon:Te.cb,onClick:function(){return n&&n(t,"edit")}})}}]}),[]);return Object(Nn.jsx)(bc,{state:t,name:"Movies",loader:n,updateAction:Ft,columns:r,modify:function(e){return Je.modify(e)}})};n(472);!function(e){e[e.Ready=0]="Ready",e[e.Searching=1]="Searching",e[e.Finished=2]="Finished"}(jc||(jc={}));var Oc=function(e){var t=e.onSelect,n=e.onDownload,r=Object(kn.a)(e,["onSelect","onDownload"]),i=Object(a.useState)([]),s=Object(Z.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(jc.Ready),d=Object(Z.a)(u,2),j=d[0],b=d[1],h=ur(r.modalKey),O=Object(a.useCallback)(Object(Fe.a)(Ue.a.mark((function e(){var t;return Ue.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h){e.next=14;break}if(b(jc.Searching),t=[],!re(h)){e.next=9;break}return e.next=6,Ze.movies(h.radarrId);case 6:t=e.sent,e.next=12;break;case 9:return e.next=11,Ze.episodes(h.sonarrEpisodeId);case 11:t=e.sent;case 12:l(t),b(jc.Finished);case 14:case"end":return e.stop()}}),e)}))),[h]);Object(a.useEffect)((function(){null!==h&&b(jc.Ready)}),[h]);var p=Object(a.useMemo)((function(){return[{Header:"Score",accessor:function(e){return"".concat(e.score,"%")}},{accessor:"language",Cell:function(e){var t=e.row.original,n={code2:e.value,hi:"True"===t.hearing_impaired,forced:"True"===t.forced,name:""};return Object(Nn.jsx)(Vn.a,{variant:"secondary",children:Object(Nn.jsx)(ha,{text:n})})}},{Header:"Provider",accessor:"provider",Cell:function(e){var t=e.value,n=e.row.original.url;return n?Object(Nn.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:t}):t}},{Header:"Release",accessor:"release_info",className:"text-nowrap",Cell:function(e){var t=e.value,n=Object(a.useState)(!1),r=Object(Z.a)(n,2),c=r[0],i=r[1],s=Object(a.useMemo)((function(){return t.slice(1).map((function(e,t){return Object(Nn.jsx)("span",{className:"release-text hidden-item",children:e},t)}))}),[t]);if(0===t.length)return Object(Nn.jsx)("span",{className:"text-muted",children:"Cannot get release info"});var o=["release-container","d-flex","justify-content-between","align-items-center"];return t.length>1&&o.push("release-multi"),Object(Nn.jsxs)("div",{className:o.join(" "),onClick:function(){return i((function(e){return!e}))},children:[Object(Nn.jsxs)("div",{className:"text-container",children:[Object(Nn.jsx)("span",{className:"release-text",children:t[0]}),Object(Nn.jsx)(ma.a,{in:c,children:Object(Nn.jsx)("div",{children:s})})]}),t.length>1&&Object(Nn.jsx)(Me.a,{className:"release-icon",icon:Te.g,rotation:c?180:void 0})]})}},{Header:"Upload",accessor:function(e){var t;return null!==(t=e.uploader)&&void 0!==t?t:"-"}},{accessor:"matches",Cell:function(e){var t=e.row.original,n=t.matches,r=t.dont_matches;return Object(Nn.jsx)(fc,{matches:n,dont:r})}},{accessor:"subtitle",Cell:function(e){var n=e.row,r=e.externalUpdate,a=n.original;return Object(Nn.jsx)(Yn,{size:"sm",variant:"light",noReset:!0,promise:function(){return t(h,a)},onSuccess:function(){return r&&r(n)},children:Object(Nn.jsx)(Me.a,{icon:Te.q})})}}]}),[t,h]),x=Object(a.useMemo)((function(){var e,t;return j===jc.Ready?Object(Nn.jsxs)("div",{className:"px-4 py-5",children:[Object(Nn.jsx)("p",{className:"mb-3 small",children:null!==(e=null===h||void 0===h?void 0:h.path)&&void 0!==e?e:""}),Object(Nn.jsx)(Ke.a,{variant:"primary",block:!0,onClick:O,children:"Start Search"})]}):j===jc.Searching?Object(Nn.jsx)(ba,{animation:"grow"}):Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)("p",{className:"mb-3 small",children:null!==(t=null===h||void 0===h?void 0:h.path)&&void 0!==t?t:""}),Object(Nn.jsx)(ua,{emptyText:"No Result",columns:p,data:o,externalUpdate:n})]})}),[j,p,o,O,null===h||void 0===h?void 0:h.path,n]),v=Object(a.useMemo)((function(){return Object(Nn.jsx)(Ke.a,{variant:"light",hidden:j!==jc.Finished,onClick:O,children:"Search Again"})}),[j,O]),m=Object(a.useMemo)((function(){var e="Unknown";return h&&(e=h.sceneName?h.sceneName:(re(h),h.title)),"Search - ".concat(e)}),[h]);return Object(Nn.jsx)(br,Object(f.a)(Object(f.a)({closeable:j!==jc.Searching,size:"xl",title:m,footer:v},r),{},{children:x}))},fc=function(e){var t=e.matches,n=e.dont,r=Te.h,c="var(--success)";n.length>0&&(r=Te.A,c="var(--warning)");var i=Object(a.useMemo)((function(){return t.map((function(e,t){return Object(Nn.jsx)("p",{className:"text-nowrap m-0",children:e},"match-".concat(t))}))}),[t]),s=Object(a.useMemo)((function(){return n.map((function(e,t){return Object(Nn.jsx)("p",{className:"text-nowrap m-0",children:e},"dont-".concat(t))}))}),[n]),o=Object(a.useMemo)((function(){return Object(Nn.jsx)(Sn.a,{className:"w-100",id:"manual-search-matches-info",children:Object(Nn.jsx)(Sn.a.Content,{children:Object(Nn.jsx)(Be.a,{fluid:!0,children:Object(Nn.jsxs)(Ee.a,{children:[Object(Nn.jsxs)(oa.a,{xs:6,children:[Object(Nn.jsx)(Me.a,{color:"var(--success)",icon:Te.h}),i]}),Object(Nn.jsxs)(oa.a,{xs:6,children:[Object(Nn.jsx)(Me.a,{color:"var(--danger)",icon:Te.X}),s]})]})})})})}),[i,s]);return Object(Nn.jsx)(wn.a,{overlay:o,placement:"left",children:Object(Nn.jsx)(Me.a,{icon:r,color:c})})},pc=function(e){var t=e.icon,n=e.desc,r=e.children;return Object(Nn.jsxs)(Vn.a,{title:n,variant:"secondary",className:"mr-2 my-1 text-truncate",children:[Object(Nn.jsx)(Me.a,{icon:t}),Object(Nn.jsx)("span",{className:"ml-1",children:r})]})},xc=function(e){var t=e.item,n=e.details,r=Object(a.useMemo)((function(){var e,r=[];return r.push(Object(Nn.jsx)(pc,{icon:Ae.e,desc:"File Path",children:t.path},"file-path")),r.push.apply(r,Object(J.a)(null!==(e=null===n||void 0===n?void 0:n.map((function(e,t){return Object(Nn.jsx)(pc,{icon:e.icon,children:e.text},je(t,"detail",e.text))})))&&void 0!==e?e:[])),t.tags.length>0&&r.push(Object(Nn.jsx)(pc,{icon:Te.V,desc:"Tags",children:t.tags.join("|")},"tags")),r}),[n,t.path,t.tags]),c=Object(a.useMemo)((function(){return t.audio_language.map((function(e,t){return Object(Nn.jsx)(pc,{icon:Te.H,desc:"Audio Language",children:e.name},je(t,"audio",e.code2))}))}),[t.audio_language]),i=un(t.profileId),s=bn(i),o=Object(a.useMemo)((function(){var e=[];return i&&(e.push(Object(Nn.jsx)(pc,{icon:Te.T,desc:"Languages Profile",children:i.name},"language-profile")),e.push.apply(e,Object(J.a)(s.map((function(e,t){return Object(Nn.jsx)(pc,{icon:Te.B,desc:"Language",children:Object(Nn.jsx)(ha,{long:!0,text:e})},je(t,"lang",e.code2))}))))),e}),[i,s]),l=Object(a.useMemo)((function(){return Object(Nn.jsxs)(Sn.a,{id:"item-overview-alternative",children:[Object(Nn.jsx)(Sn.a.Title,{children:"Alternate Titles"}),Object(Nn.jsx)(Sn.a.Content,{children:t.alternativeTitles.map((function(e,t){return Object(Nn.jsx)("li",{children:e},t)}))})]})}),[t.alternativeTitles]);return Object(Nn.jsx)(Be.a,{fluid:!0,style:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"top center",backgroundImage:"url('".concat(t.fanart,"')")},children:Object(Nn.jsxs)(Ee.a,{className:"p-4 pb-4",style:{backgroundColor:"rgba(0,0,0,0.7)"},children:[Object(Nn.jsx)(oa.a,{sm:"auto",children:Object(Nn.jsx)(fa.a,{className:"d-none d-sm-block my-2",style:{maxHeight:250},src:t.poster})}),Object(Nn.jsx)(oa.a,{children:Object(Nn.jsxs)(Be.a,{fluid:!0,className:"text-white",children:[Object(Nn.jsxs)(Ee.a,{children:[Object(Nn.jsx)("h1",{children:t.title}),Object(Nn.jsx)("span",{hidden:0===t.alternativeTitles.length,children:Object(Nn.jsx)(wn.a,{overlay:l,children:Object(Nn.jsx)(Me.a,{className:"mx-2",icon:Ae.b})})})]}),Object(Nn.jsx)(Ee.a,{children:r}),Object(Nn.jsx)(Ee.a,{children:c}),Object(Nn.jsx)(Ee.a,{children:o}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)("span",{children:t.overview})})]})})]})})},vc="Missing Subtitles",mc=function(e){var t=e.movie,n=e.update,r=Object(a.useMemo)((function(){return[{Header:"Subtitle Path",accessor:"path",Cell:function(e){return null===e.value||0===e.value.length?"Video File Subtitle Track":e.value===vc?Object(Nn.jsx)("span",{className:"text-muted",children:e.value}):e.value}},{Header:"Language",accessor:"name",Cell:function(e){var t=e.row;return t.original.path===vc?Object(Nn.jsx)(Vn.a,{variant:"primary",children:Object(Nn.jsx)(ha,{text:t.original,long:!0})}):Object(Nn.jsx)(Vn.a,{variant:"secondary",children:Object(Nn.jsx)(ha,{text:t.original,long:!0})})}},{accessor:"code2",Cell:function(e){var r=e.row.original;return null===r.path||0===r.path.length?null:r.path===vc?Object(Nn.jsx)(Yn,{promise:function(){return Je.downloadSubtitles(t.radarrId,{language:r.code2,hi:r.hi,forced:r.forced})},onSuccess:function(){return n(t.radarrId)},variant:"light",size:"sm",children:Object(Nn.jsx)(Me.a,{icon:Te.R})}):Object(Nn.jsx)(Yn,{variant:"light",size:"sm",promise:function(){var e;return Je.deleteSubtitles(t.radarrId,{language:r.code2,hi:r.hi,forced:r.forced,path:null!==(e=r.path)&&void 0!==e?e:""})},onSuccess:function(){return n(t.radarrId)},children:Object(Nn.jsx)(Me.a,{icon:Te.Z})})}}]}),[t,n]),c=Object(a.useMemo)((function(){var e=t.missing_subtitles.map((function(e){return e.path=vc,e}));return t.subtitles.concat(e)}),[t.missing_subtitles,t.subtitles]);return Object(Nn.jsx)(ta,{columns:r,data:c,emptyText:"No Subtitles Found For This Movie"})},gc=function(e,t){e=e;var n=t.language,r=t.hearing_impaired,a=t.forced,c=t.provider,i=t.subtitle;return Ze.downloadMovieSubtitle(e.radarrId,{language:n,hi:r,forced:a,provider:c,subtitle:i})},yc=Object(l.i)((function(e){var t=e.match,n=Number.parseInt(t.params.id),r=xn(n),c=Object(Z.a)(r,2),i=c[0],s=c[1];ie(s);var o=i.data,u=ir(),d=Object(a.useState)(!0),j=Object(Z.a)(d,2),b=j[0],h=j[1],O=Object(a.useCallback)((function(){null===i.data&&h(!1)}),[i.data]);if(se(i,O),isNaN(n)||!b)return Object(Nn.jsx)(l.b,{to:Ra});if(!o)return Object(Nn.jsx)(ba,{});var f=void 0!==o.profileId;return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsxs)("title",{children:[o.title," - Bazarr (Movies)"]})}),Object(Nn.jsxs)(tr,{children:[Object(Nn.jsxs)(tr.Group,{pos:"start",children:[Object(Nn.jsx)(tr.AsyncButton,{icon:Te.U,promise:function(){return Je.action({action:"scan-disk",radarrid:o.radarrId})},onSuccess:s,children:"Scan Disk"}),Object(Nn.jsx)(tr.AsyncButton,{icon:Te.R,disabled:null===o.profileId,promise:function(){return Je.action({action:"search-missing",radarrid:o.radarrId})},onSuccess:s,children:"Search"}),Object(Nn.jsx)(tr.Button,{icon:Te.bb,disabled:null===o.profileId,onClick:function(){return u("manual-search",o)},children:"Manual"}),Object(Nn.jsx)(tr.Button,{icon:Te.y,onClick:function(){return u("history",o)},children:"History"}),Object(Nn.jsx)(tr.Button,{icon:Te.Y,onClick:function(){return u("tools",[o])},children:"Tools"})]}),Object(Nn.jsxs)(tr.Group,{pos:"end",children:[Object(Nn.jsx)(tr.Button,{disabled:!f||null===o.profileId,icon:Te.m,onClick:function(){return u("upload",o)},children:"Upload"}),Object(Nn.jsx)(tr.Button,{icon:Te.cb,onClick:function(){return u("edit",o)},children:"Edit Movie"})]})]}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(xc,{item:o,details:[]})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(mc,{movie:o,update:s})}),Object(Nn.jsx)(xr,{modalKey:"edit",submit:function(e){return Je.modify(e)},onSuccess:s}),Object(Nn.jsx)(Vr,{modalKey:"tools",size:"lg",update:s}),Object(Nn.jsx)(fr,{modalKey:"history",size:"lg"}),Object(Nn.jsx)(vr,{modalKey:"upload",size:"lg"}),Object(Nn.jsx)(Oc,{modalKey:"manual-search",onDownload:s,onSelect:gc})]})})),kc=function(){return Object(Nn.jsxs)(l.e,{children:[Object(Nn.jsx)(l.c,{exact:!0,path:"/movies",children:Object(Nn.jsx)(hc,{})}),Object(Nn.jsx)(l.c,{path:"/movies/:id",children:Object(Nn.jsx)(yc,{})})]})},Sc=n(507),wc=function(){var e=hn(),t=Object(Z.a)(e,1)[0],n=an(Xt),r=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t=e.row,n=e.value;if(e.isSelecting)return n;var r="/series/".concat(t.original.sonarrSeriesId);return Object(Nn.jsx)(u.b,{to:r,children:Object(Nn.jsx)("span",{children:n})})}},{Header:"Exist",accessor:"exist",selectHide:!0,Cell:function(e){var t=e.value,n=e.row.original.path;return Object(Nn.jsx)(Me.a,{title:n,icon:t?Te.h:Te.t})}},{Header:"Audio",accessor:"audio_language",Cell:function(e){return e.value.map((function(e){return Object(Nn.jsx)(Vn.a,{variant:"secondary",className:"mr-2",children:e.name},e.code2)}))}},{Header:"Languages Profile",accessor:"profileId",Cell:function(e){var t,n,r=e.value,a=e.loose;return a&&null!==(t=null===(n=a[0].find((function(e){return e.profileId===r})))||void 0===n?void 0:n.name)&&void 0!==t?t:null}},{Header:"Episodes",accessor:"episodeFileCount",selectHide:!0,Cell:function(e){var t=e.row.original,n=t.episodeFileCount,r=t.episodeMissingCount,a=t.profileId,c=0,i="";0!==n&&a?(c=n-r,i="".concat(n-r,"/").concat(n)):c=0;var s=0===r?"primary":"warning";return Object(Nn.jsx)(Sc.a,{className:"my-a",variant:s,min:0,max:n,now:c,label:i})}},{accessor:"sonarrSeriesId",selectHide:!0,Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(Nn.jsx)(Qn,{icon:Te.cb,onClick:function(){n&&n(t,"edit")}})}}]}),[]);return Object(Nn.jsx)(bc,{state:t,name:"Series",updateAction:tn,loader:n,columns:r,modify:function(e){return $e.modify(e)}})},Cc=function(e){var t=e.seriesid,n=e.episodeid,r=e.missing,a=e.subtitle,c=a.hi,i=a.forced,s=On(t),o=Object(Z.a)(s,2)[1],l=a.path;return r||l?Object(Nn.jsxs)(Yn,{promise:function(){return r?Ve.downloadSubtitles(t,n,{hi:c,forced:i,language:a.code2}):l?Ve.deleteSubtitles(t,n,{hi:c,forced:i,path:l,language:a.code2}):null},onSuccess:o,as:Vn.a,className:"mr-1",variant:r?"primary":"secondary",children:[Object(Nn.jsx)(ha,{className:"pr-1",text:a}),Object(Nn.jsx)(Me.a,{size:"sm",icon:r?Te.R:Te.Z})]}):Object(Nn.jsx)(Vn.a,{className:"mr-1",variant:"secondary",children:Object(Nn.jsx)(ha,{text:a,long:!1})})},Nc=function(e,t){e=e;var n=t.language,r=t.hearing_impaired,a=t.forced,c=t.provider,i=t.subtitle;return Ze.downloadEpisodeSubtitle(e.sonarrSeriesId,e.sonarrEpisodeId,{language:n,hi:r,forced:a,provider:c,subtitle:i})},Ic=function(e){var t=e.episodes,n=e.update,r=ir(),i=Object(a.useMemo)((function(){return[{accessor:"monitored",Cell:function(e){return Object(Nn.jsx)(Me.a,{title:e.value?"monitored":"unmonitored",icon:e.value?Te.d:Ae.a})}},{accessor:"season",Cell:function(e){return"Season ".concat(e.value)}},{Header:"Episode",accessor:"episode"},{Header:"Title",accessor:"title",className:"text-nowrap",Cell:function(e){var t=e.value,n=e.row;return Object(Nn.jsx)(Oa,{text:n.original.sceneName,delay:1,children:Object(Nn.jsx)("span",{children:t})})}},{Header:"Audio",accessor:"audio_language",Cell:function(e){return e.value.map((function(e){return Object(Nn.jsx)(Vn.a,{variant:"secondary",children:e.name},e.code2)}))}},{Header:"Subtitles",accessor:"missing_subtitles",Cell:function(e){var t=e.row.original,n=t.sonarrSeriesId;return Object(a.useMemo)((function(){var e=t.sonarrEpisodeId,r=t.missing_subtitles.map((function(t,r){return Object(Nn.jsx)(Cc,{missing:!0,seriesid:n,episodeid:e,subtitle:t},je(r,t.code2,"missing"))})),a=t.subtitles.filter((function(e){return-1===t.missing_subtitles.findIndex((function(t){return t.code2===e.code2}))})).map((function(t,r){return Object(Nn.jsx)(Cc,{seriesid:n,episodeid:e,subtitle:t},je(r,t.code2,"valid"))}));return[].concat(Object(J.a)(r),Object(J.a)(a))}),[t,n])}},{Header:"Actions",accessor:"sonarrEpisodeId",Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(Nn.jsxs)(yr.a,{children:[Object(Nn.jsx)(Xn,{icon:Te.bb,onClick:function(){n&&n(t,"manual-search")}}),Object(Nn.jsx)(Xn,{icon:Te.y,onClick:function(){n&&n(t,"history")}}),Object(Nn.jsx)(Xn,{icon:Te.e,onClick:function(){n&&n(t,"tools")}})]})}}]}),[]),s=Object(a.useCallback)((function(e,t){r(t,"tools"===t?[e.original]:e.original)}),[r]),o=Object(a.useMemo)((function(){return t.data.reduce((function(e,t){return Math.max(e,t.season)}),0)}),[t]),l=Object(a.useMemo)((function(){return{columns:i,data:t.data,externalUpdate:s,initialState:{sortBy:[{id:"season",desc:!0},{id:"episode",desc:!0}],groupBy:["season"],expanded:Object(O.a)({},"season:".concat(o),!0)}}}),[t,i,o,s]);return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(Gn,{state:t,children:function(){return Object(Nn.jsx)(ia,Object(f.a)({emptyText:"No Episode Found For This Series"},l))}}),Object(Nn.jsx)(Vr,{modalKey:"tools",size:"lg",update:n}),Object(Nn.jsx)(pr,{modalKey:"history",size:"lg"}),Object(Nn.jsx)(Oc,{modalKey:"manual-search",onDownload:n,onSelect:Nc})]})},Pc=Object(l.i)((function(e){var t,n=e.match,r=Number.parseInt(n.params.id),c=On(r),i=Object(Z.a)(c,2),s=i[0],o=i[1],u=s.data,d=fn(null===(t=s.data)||void 0===t?void 0:t.sonarrSeriesId),j=Object(Z.a)(d,1)[0];ie(o);var b=0!==j.data.length,h=Object(a.useMemo)((function(){var e;return[{icon:Te.w,text:"".concat(null===u||void 0===u?void 0:u.episodeFileCount," files")},{icon:Te.a,text:null!==(e=null===u||void 0===u?void 0:u.seriesType)&&void 0!==e?e:""}]}),[u]),O=ir(),f=Object(a.useState)(!0),p=Object(Z.a)(f,2),x=p[0],v=p[1],m=Object(a.useCallback)((function(){null===s.data&&v(!1)}),[s.data]);return se(s,m),isNaN(r)||!x?Object(Nn.jsx)(l.b,{to:Ra}):u?Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsxs)("title",{children:[u.title," - Bazarr (Series)"]})}),Object(Nn.jsxs)(tr,{children:[Object(Nn.jsxs)(tr.Group,{pos:"start",children:[Object(Nn.jsx)(tr.AsyncButton,{icon:Te.U,disabled:!b,promise:function(){return $e.action({action:"scan-disk",seriesid:r})},onSuccess:o,children:"Scan Disk"}),Object(Nn.jsx)(tr.AsyncButton,{icon:Te.R,promise:function(){return $e.action({action:"search-missing",seriesid:r})},onSuccess:o,disabled:0===u.episodeFileCount||null===u.profileId||!b,children:"Search"})]}),Object(Nn.jsxs)(tr.Group,{pos:"end",children:[Object(Nn.jsx)(tr.Button,{disabled:0===u.episodeFileCount||!b,icon:Te.e,onClick:function(){return O("tools",j.data)},children:"Tools"}),Object(Nn.jsx)(tr.Button,{disabled:0===u.episodeFileCount||null===u.profileId||!b,icon:Te.m,onClick:function(){return O("upload",u)},children:"Upload"}),Object(Nn.jsx)(tr.Button,{icon:Te.cb,onClick:function(){return O("edit",u)},children:"Edit Series"})]})]}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(xc,{item:u,details:h})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(Ic,{episodes:j,update:o})}),Object(Nn.jsx)(xr,{modalKey:"edit",submit:function(e){return $e.modify(e)},onSuccess:o}),Object(Nn.jsx)(mr,{modalKey:"upload"})]}):Object(Nn.jsx)(ba,{})})),Ac=function(){return Object(Nn.jsxs)(l.e,{children:[Object(Nn.jsx)(l.c,{exact:!0,path:"/series",children:Object(Nn.jsx)(wc,{})}),Object(Nn.jsx)(l.c,{path:"/series/:id",children:Object(Nn.jsx)(Pc,{})})]})},Tc="languages-enabled",Mc="languages-profiles",Ec="notifications-providers",Bc="settings-general-use_sonarr",Kc="settings-general-use_radarr",zc=c.a.createContext([{},function(){}]);var Dc=function(e){var t=e.children,n=e.title,r=an(Tt),c=Object(a.useState)({}),i=Object(Z.a)(c,2),s=i[0],o=i[1],u=Object(a.useState)(!1),d=Object(Z.a)(u,2),j=d[0],b=d[1],h=Object(a.useState)({}),f=Object(Z.a)(h,2),p=f[0],x=f[1],v=Object(a.useCallback)((function(){o({}),b(!1)}),[]),m=cn(St,v),g=Object(a.useCallback)((function(e){!function(e){if(Mc in e){var t=e[Mc];e[Mc]=JSON.stringify(t)}if(Tc in e){var n=e[Tc];e[Tc]=n.map((function(e){return e.code2}))}if(Ec in e){var r=e[Ec];e[Ec]=r.map((function(e){return JSON.stringify(e)}))}}(e),b(!0),tt.setSettings(e).finally(m)}),[m]),y=Object(a.useCallback)((function(e){r(e),o({})}),[r]);Object(a.useEffect)((function(){var e={};e.__default__=g,e.storage=y,x(e)}),[g,y]);var k=Object(a.useMemo)((function(){return p.__default__}),[p]),S=Object(a.useCallback)((function(){var e=new Map;for(var t in s){var n=t.split("-")[0];if(0!==n.length){var r=e.get(n);r?r[t]=s[t]:e.set(n,Object(O.a)({},t,s[t]))}}var a={};e.forEach((function(e,t){t in p?p[t](e):a=Object($.merge)(a,e)})),k(a)}),[s,p,k]);return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsx)("title",{children:n})}),Object(Nn.jsx)(l.a,{when:Object.keys(s).length>0,message:"You have unsaved changes, are you sure you want to leave?"}),Object(Nn.jsx)(tr,{children:Object(Nn.jsx)(tr.Button,{icon:Te.Q,updating:j,disabled:0===Object.keys(s).length,onClick:S,children:"Save"})}),Object(Nn.jsx)(zc.Provider,{value:[s,o],children:Object(Nn.jsx)(Ee.a,{className:"p-4",children:Object(Nn.jsx)(Be.a,{children:t})})})]})};function Rc(){var e=Object(a.useContext)(zc);return Object(Z.a)(e,1)[0]}function Lc(){var e=Object(a.useContext)(zc),t=Object(Z.a)(e,2)[1];return Object(a.useCallback)((function(e,n){t((function(t){var r=Object(f.a)({},t);return r[n]=e,r}))}),[t])}function _c(e,t,n){var r=on(),c=Object(Z.a)(r,1)[0].data,i=Object(o.d)(),s=Object(a.useMemo)((function(){var n=null;if(void 0===c)return n;var r=e.split("-");if("settings"!==r[0])return null;r=r.slice(0);var a,i=c,s=Object(zn.a)(r);try{for(s.s();!(a=s.n()).done;){var o=a.value;if(o in i&&(i=i[o]),t(i)){n=i;break}}}catch(l){s.e(l)}finally{s.f()}return n}),[e,c,t]);return n&&void 0!==c?n(c,i.getState()):s}function Hc(e,t,n){var r=_c(e,t,n),a=Rc();return e in a?a[e]:r}var Uc=c.a.createContext(["",function(e){}]),Fc=c.a.createContext((function(e){}));function Gc(){return Object(a.useContext)(Fc)}var qc=function(e){var t=e.children,n=Object(a.useState)(!1);return Object(Nn.jsx)(Uc.Provider,{value:n,children:t})};qc.Control=function(e){var t=e.children,n=Object(a.useContext)(Uc);return Object(Nn.jsx)(Fc.Provider,{value:n[1],children:t})},qc.Content=function(e){var t=e.on,n=e.eventKey,r=e.indent,c=e.children,i=Object(a.useContext)(Uc),s=Object(Z.a)(i,1)[0],o=Object(a.useMemo)((function(){return t&&"string"===typeof s?t(s):n?s===n:!0===s}),[t,s,n]);return Object(Nn.jsx)(ma.a,{in:o,className:!1===r?void 0:"pl-4",children:Object(Nn.jsx)("div",{children:c})})};var Wc=qc,Yc=n(505),Vc=(n(473),function(e){var t=e.header,n=e.hidden,r=e.children;return Object(Nn.jsxs)(Ee.a,{hidden:n,className:"flex-column mt-3",children:[Object(Nn.jsxs)(oa.a,{children:[Object(Nn.jsx)("h4",{children:t}),Object(Nn.jsx)("hr",{})]}),Object(Nn.jsx)(oa.a,{children:r})]})}),Qc=function(e){var t=e.children,n=e.name,r=e.hidden;return Object(Nn.jsxs)(Tn.a.Group,{hidden:r,children:[n&&Object(Nn.jsx)(Tn.a.Label,{children:n}),t]})},Xc=function(e){return Object(Nn.jsx)(oa.a,{className:"p-2",xs:6,lg:4,children:Object(Nn.jsx)(Jc,Object(f.a)({},e))})},Jc=function(e){var t=e.header,n=e.subheader,r=e.plus,a=e.onClick;return Object(Nn.jsx)(Yc.a,{className:"settings-card",onClick:function(){return a&&a()},children:r?Object(Nn.jsx)(Yc.a.Body,{className:"d-flex justify-content-center align-items-center",children:Object(Nn.jsx)(Me.a,{size:"2x",icon:Te.M})}):Object(Nn.jsxs)(Yc.a.Body,{children:[Object(Nn.jsx)(Yc.a.Title,{className:"text-nowrap text-truncate",children:t}),Object(Nn.jsx)(Yc.a.Subtitle,{hidden:void 0===n,className:"small text-nowrap text-truncate",children:n})]})})},Zc=function(e){var t=e.type,n=e.children,r=["pr-4"];return r.push("warning"===t?"text-warning":"text-muted"),Object(Nn.jsx)(Tn.a.Text,{className:r.join(" "),children:n})},$c=function(e){var t=e.placeholder,n=e.disabled,r=e.beforeStaged,a=e.controlled,c=e.override,i=e.password,s=e.settingKey,o=Hc(s,ee,c),l=Lc(),u=Gc();return Object(Nn.jsx)(Tn.a.Control,{type:i?"password":"text",placeholder:null===t||void 0===t?void 0:t.toString(),disabled:n,defaultValue:a?void 0:null!==o&&void 0!==o?o:void 0,value:a&&null!==o&&void 0!==o?o:void 0,onChange:function(e){var t=e.currentTarget.value;u(t.toString());var n=r?r(t):t;l(n,s)}})},ei=function(e){var t=e.label,n=e.inline,r=e.override,c=e.disabled,i=e.settingKey,s=Lc(),o=Gc(),l=Hc(i,$.isBoolean,r);return Object(a.useEffect)((function(){return o(null!==l&&void 0!==l&&l)}),[o,l]),Object(Nn.jsx)(Tn.a.Check,{custom:!0,type:"checkbox",id:i,inline:n,label:t,onChange:function(e){var t=e.currentTarget.checked;s(t,i)},disabled:c,checked:null!==l&&void 0!==l?l:void 0})};function ti(e){return Object($.isString)(e)||Object($.isNumber)(e)||Object($.isArray)(e)}function ni(e){var t=Lc(),n=Gc(),r=e.settingKey,c=e.override,i=e.beforeStaged,s=Object(kn.a)(e,["settingKey","override","beforeStaged"]),o=Hc(r,ti,c);return Object(a.useEffect)((function(){(Object($.isString)(o)||Object($.isNull)(o))&&n(null!==o&&void 0!==o?o:"")})),Object(Nn.jsx)(Ln,Object(f.a)(Object(f.a)({},s),{},{defaultValue:o,onChange:function(e){e=i?i(e):e,t(e,r)}}))}var ri=function(e){var t=e.settingKey,n=e.override,r=Object(kn.a)(e,["settingKey","override"]),a=Lc(),c=Hc(t,$.isNumber,n);return Object(Nn.jsx)(Un,Object(f.a)({onAfterChange:function(e){a(e,t)},defaultValue:null!==c&&void 0!==c?c:void 0},r))},ai=function(e){var t=e.settingKey,n=e.override,r=Object(kn.a)(e,["settingKey","override"]),a=Lc(),c=Hc(t,$.isArray,n);return Object(Nn.jsx)(Pn,Object(f.a)({defaultValue:null!==c&&void 0!==c?c:void 0,onChange:function(e){a(e,t)}},r))},ci=function(e){var t=e.onClick,n=e.settingKey,r=Object(kn.a)(e,["onClick","settingKey"]),a=Hc(n,$.isString),c=Lc();return Object(Nn.jsx)(Ke.a,Object(f.a)({onClick:function(){t&&t(c,n,null!==a&&void 0!==a?a:void 0)}},r))},ii=function(e){var t=e.category,n=Object(a.useState)("Test"),r=Object(Z.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)("primary"),o=Object(Z.a)(s,2),l=o[0],u=o[1],d=Hc("settings-".concat(t,"-ip"),$.isString),j=Hc("settings-".concat(t,"-port"),$.isNumber),b=Hc("settings-".concat(t,"-base_url"),$.isString),h=Hc("settings-".concat(t,"-apikey"),$.isString),O=Hc("settings-".concat(t,"-ssl"),$.isBoolean),f=Object(a.useCallback)((function(){if(d&&h&&null!==O){var e;e=j?"".concat(d,":").concat(j).concat(null!==b&&void 0!==b?b:""):"".concat(d).concat(null!==b&&void 0!==b?b:"");var t={protocol:O?"https":"http",url:e,params:{apikey:h}};t.url.endsWith("/")||(t.url+="/"),nt.urlTest(t.protocol,t.url,t.params).then((function(e){e.status?(i("Version: ".concat(e.version)),u("success")):(i(e.error),u("danger"))}))}}),[d,j,b,h,O]);return Object(Nn.jsx)(Ke.a,{onClick:f,variant:l,title:c,className:"text-truncate text-nowrap",children:c})},si=[{label:"Basic",value:"basic"},{label:"Form",value:"form"}],oi=[{label:"Socks5",value:"socks5"},{label:"HTTP(S)",value:"http"}],li=[{label:"master",value:"master"},{label:"development",value:"development"}],ui="abcdef0123456789",di="settings-auth-apikey",ji=function(e){var t,n;return null!==(t=null===(n=e.general.base_url)||void 0===n?void 0:n.slice(1))&&void 0!==t?t:""},bi=function(){var e=Object(a.useState)(!1),t=Object(Z.a)(e,2),n=t[0],r=t[1],c=window.Bazarr.canUpdate;return Object(Nn.jsxs)(Dc,{title:"General - Bazarr (Settings)",children:[Object(Nn.jsxs)(Vc,{header:"Host",children:[Object(Nn.jsxs)(Qc,{name:"Address",children:[Object(Nn.jsx)($c,{placeholder:"0.0.0.0",settingKey:"settings-general-ip"}),Object(Nn.jsx)(Zc,{children:"Valid IPv4 address or '0.0.0.0' for all interfaces"})]}),Object(Nn.jsx)(Qc,{name:"Port",children:Object(Nn.jsx)($c,{placeholder:6767,settingKey:"settings-general-port"})}),Object(Nn.jsxs)(Qc,{name:"Base URL",children:[Object(Nn.jsxs)(gr.a,{children:[Object(Nn.jsx)(gr.a.Prepend,{children:Object(Nn.jsx)(gr.a.Text,{children:"/"})}),Object(Nn.jsx)($c,{settingKey:"settings-general-base_url",override:ji,beforeStaged:function(e){return"/"+e}})]}),Object(Nn.jsx)(Zc,{children:"Reverse proxy support"})]})]}),Object(Nn.jsxs)(Vc,{header:"Security",children:[Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Qc,{name:"Authentication",children:Object(Nn.jsx)(ni,{clearable:!0,options:si,settingKey:"settings-auth-type",beforeStaged:function(e){return null===e?"None":e}})})}),Object(Nn.jsxs)(Wc.Content,{on:function(e){return""!==e&&"None"!==e},children:[Object(Nn.jsx)(Qc,{name:"Username",children:Object(Nn.jsx)($c,{settingKey:"settings-auth-username"})}),Object(Nn.jsx)(Qc,{name:"Password",children:Object(Nn.jsx)($c,{password:!0,settingKey:"settings-auth-password"})})]})]}),Object(Nn.jsx)(Qc,{name:"API Key",children:Object(Nn.jsxs)(gr.a,{children:[Object(Nn.jsx)($c,{disabled:!0,controlled:!0,settingKey:di}),Object(Nn.jsxs)(gr.a.Append,{children:[Object(Nn.jsx)(ci,{variant:n?"success":"light",settingKey:di,onClick:function(e,t,n){n&&(function(e){var t=document.createElement("textarea");t.innerText=e,document.body.appendChild(t),t.select(),t.setSelectionRange(0,9999),document.execCommand("copy"),t.remove()}(n),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e(!n),setTimeout((function(){return e(n)}),t)}(r,1500))},children:Object(Nn.jsx)(Me.a,{icon:n?Te.h:Te.k})}),Object(Nn.jsx)(ci,{variant:"danger",settingKey:di,onClick:function(e,t){e(Array(32).fill(null).map((function(){return ui.charAt(Math.floor(Math.random()*ui.length))})).join(""),t)},children:Object(Nn.jsx)(Me.a,{icon:Te.U})})]})]})})]}),Object(Nn.jsx)(Vc,{header:"Proxy",children:Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ni,{clearable:!0,settingKey:"settings-proxy-type",options:oi,beforeStaged:function(e){return null===e?"None":e}})})}),Object(Nn.jsxs)(Wc.Content,{on:function(e){return""!==e&&"None"!==e},children:[Object(Nn.jsx)(Qc,{name:"Host",children:Object(Nn.jsx)($c,{settingKey:"settings-proxy-url"})}),Object(Nn.jsx)(Qc,{name:"Port",children:Object(Nn.jsx)($c,{settingKey:"settings-proxy-port"})}),Object(Nn.jsx)(Qc,{name:"Username",children:Object(Nn.jsx)($c,{settingKey:"settings-proxy-username"})}),Object(Nn.jsxs)(Qc,{name:"Password",children:[Object(Nn.jsx)($c,{password:!0,settingKey:"settings-proxy-password"}),Object(Nn.jsx)(Zc,{children:"You only need to enter a username and password if one is required. Leave them blank otherwise"})]}),Object(Nn.jsxs)(Qc,{name:"Ignored Addresses",children:[Object(Nn.jsx)(ai,{settingKey:"settings-proxy-exclude"}),Object(Nn.jsx)(Zc,{children:"'*.' as a wildcard for subdomains"})]})]})]})}),Object(Nn.jsxs)(Vc,{header:"Updates",hidden:!c,children:[Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Automatic",settingKey:"settings-general-auto_update"}),Object(Nn.jsx)(Zc,{children:"Automatically download and install updates"})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ni,{options:li,settingKey:"settings-general-branch"}),Object(Nn.jsx)(Zc,{children:"Branch used by update mechanism"})]})]}),Object(Nn.jsx)(Vc,{header:"Logging",children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Debug",settingKey:"settings-general-debug"}),Object(Nn.jsx)(Zc,{children:"Debug logging should only be enabled temporarily"})]})}),Object(Nn.jsx)(Vc,{header:"Analytics",children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Enable",settingKey:"settings-analytics-enabled"}),Object(Nn.jsx)(Zc,{children:"Send anonymous usage information, nothing that can identify you. This includes information on which providers you use, what languages you search for, Bazarr, Python, Sonarr, Radarr and what OS version you are using. We will use this information to prioritize features and bug fixes. Please, keep this enabled as this is the only way we have to better understand how you use Bazarr."})]})})]})},hi=function(e){var t=e.settingKey,n=e.options,r=ki(),a=Lc();return Object(Nn.jsx)(nr,{multiple:!0,defaultValue:r,options:n,onChange:function(e){a(e,t)}})},Oi=function(e){var t=e.settingKey,n=Si(),r=Object(a.useMemo)((function(){return n.map((function(e){return{label:e.name,value:e.profileId}}))}),[n]);return Object(Nn.jsx)(ni,{clearable:!0,options:r,settingKey:t,beforeStaged:function(e){return null===e?"":e}})},fi=[{label:"Any",value:65535}];function pi(){return{profileId:-1,name:"",items:[],cutoff:null}}var xi=function(e){var t=e.update,n=Object(kn.a)(e,["update"]),r=ur(n.modalKey),c=sr(),i=ki(),s=Object(a.useState)(pi),o=Object(Z.a)(s,2),l=o[0],u=o[1];Object(a.useEffect)((function(){u(r||pi)}),[r]);var d=Object(a.useMemo)((function(){var e=Object(J.a)(fi),t=l.items.map((function(e){return{label:"ID ".concat(e.id," (").concat(e.language,")"),value:e.id}}));return e.push.apply(e,Object(J.a)(t)),e}),[l.items]),j=Object(a.useCallback)((function(e,t){var n=Object(f.a)({},l);n[e]=t,u(n)}),[l]),b=Object(a.useCallback)((function(e,t){var n=Object(J.a)(l.items);t?n[e.index]=t:n.splice(e.index,1),j("items",n)}),[l.items,j]),h=Object(a.useCallback)((function(){var e=1+l.items.reduce((function(e,t){return Math.max(t.id,e)}),0);if(i.length>0){var t={id:e,language:i[0].code2,audio_exclude:"False",hi:"False",forced:"False"},n=Object(J.a)(l.items);n.push(t),j("items",n)}}),[l.items,j,i]),O=l.name.length>0&&l.items.length>0,p=Object(Nn.jsx)(Ke.a,{disabled:!O,onClick:function(){c(),t(l)},children:"Save"}),x=Object(a.useMemo)((function(){return[{Header:"ID",accessor:"id"},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value,n=e.row,r=e.externalUpdate,c=t,s=n.original,o=Object(a.useMemo)((function(){var e;return null!==(e=i.find((function(e){return e.code2===c})))&&void 0!==e?e:null}),[c]);return Object(Nn.jsx)("div",{style:{width:"8rem"},children:Object(Nn.jsx)(nr,{options:i,value:o,onChange:function(e){e&&(s.language=e.code2,r&&r(n,s))}})})}},{Header:"Forced",accessor:"forced",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original;return Object(Nn.jsx)(Tn.a.Check,{custom:!0,id:"".concat(a.language,"-forced"),checked:"True"===n,onChange:function(e){a.forced=e.target.checked?"True":"False",r&&r(t,a)}})}},{Header:"HI",accessor:"hi",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original;return Object(Nn.jsx)(Tn.a.Check,{custom:!0,id:"".concat(a.language,"-hi"),checked:"True"===n,onChange:function(e){a.hi=e.target.checked?"True":"False",r&&r(t,a)}})}},{Header:"Exclude Audio",accessor:"audio_exclude",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original;return Object(Nn.jsx)(Tn.a.Check,{custom:!0,id:"".concat(a.language,"-audio"),checked:"True"===n,onChange:function(e){a.audio_exclude=e.target.checked?"True":"False",r&&r(t,a)}})}},{id:"action",accessor:"id",Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(Nn.jsx)(Xn,{icon:Te.Z,onClick:function(){return n&&n(t)}})}}]}),[i]);return Object(Nn.jsxs)(br,Object(f.a)(Object(f.a)({size:"lg",title:"Languages Profile",footer:p},n),{},{children:[Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(Tn.a.Control,{type:"text",placeholder:"Name",value:l.name,onChange:function(e){j("name",e.target.value)}})}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ta,{responsive:!1,columns:x,data:l.items,externalUpdate:b}),Object(Nn.jsx)(Ke.a,{block:!0,variant:"light",onClick:h,children:"Add"})]}),Object(Nn.jsxs)(Qc,{name:"Cutoff",children:[Object(Nn.jsx)(Ln,{clearable:!0,options:d,value:l.cutoff,onChange:function(e){return j("cutoff",e)}}),Object(Nn.jsx)(Zc,{children:"Ignore others if existing"})]})]}))},vi=function(e){var t=e.cutoff,n=e.item,r=e.className,c=Object(a.useMemo)((function(){var e=n.language;return"True"===n.hi?e+=":HI":"True"===n.forced&&(e+=":Forced"),e}),[n.hi,n.forced,n.language]);return Object(Nn.jsx)(Vn.a,{className:r,title:t?"Ignore others if this one is available":void 0,variant:t?"primary":"secondary",children:c})},mi=function(){var e=Si(),t=ki(),n=Object(a.useState)((function(){return Object($.cloneDeep)(e)})),r=Object(Z.a)(n,2),i=r[0],s=r[1],o=Object(a.useMemo)((function(){return 1+i.reduce((function(e,t){return Math.max(t.profileId,e)}),0)}),[i]),l=Lc(),u=ir(),d=Object(a.useCallback)((function(e){l(e,Mc),s(e)}),[l]),j=Object(a.useCallback)((function(e){var t=Object(J.a)(i),n=t.findIndex((function(t){return t.profileId===e.profileId}));-1!==n?t[n]=e:t.push(e),d(t)}),[i,d]),b=Object(a.useCallback)((function(e,t){if(t)u("profile",Object($.cloneDeep)(t));else{var n=Object(J.a)(i);n.splice(e.index,1),d(n)}}),[d,u,i]),h=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"name"},{Header:"Languages",accessor:"items",Cell:function(e){var t=e.value,n=e.row.original.cutoff;return t.map((function(e){var t=e.id===n||65535===n;return Object(Nn.jsx)(vi,{cutoff:t,className:"mx-1",item:e},e.id)}))}},{accessor:"profileId",Cell:function(e){var t=e.row,n=e.externalUpdate,r=t.original;return Object(Nn.jsxs)(yr.a,{children:[Object(Nn.jsx)(Xn,{icon:Te.cb,onClick:function(){n&&n(t,r)}}),Object(Nn.jsx)(Xn,{icon:Te.Z,onClick:function(){return n&&n(t)}})]})}}]}),[]),O=0!==t.length;return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(ta,{columns:h,data:i,externalUpdate:b}),Object(Nn.jsx)(Ke.a,{block:!0,disabled:!O,variant:"light",onClick:function(){u("profile",{profileId:o,name:"",items:[],cutoff:null})},children:O?"Add New Profile":"No Enabled Languages"}),Object(Nn.jsx)(xi,{update:j,modalKey:"profile"})]})},gi=c.a.createContext([]),yi=c.a.createContext([]);function ki(){var e=Object(a.useContext)(gi),t=Hc(Tc,$.isArray);return t||e}function Si(){var e=Object(a.useContext)(yi),t=Hc(Mc,$.isArray);return t||e}var wi=function(){var e=dn(!1),t=Object(Z.a)(e,1)[0],n=dn(!0),r=Object(Z.a)(n,1)[0],a=ln(),c=Object(Z.a)(a,1)[0];return Object(Nn.jsx)(Dc,{title:"Languages - Bazarr (Settings)",children:Object(Nn.jsx)(gi.Provider,{value:r,children:Object(Nn.jsxs)(yi.Provider,{value:c,children:[Object(Nn.jsxs)(Vc,{header:"Subtitles Language",children:[Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Single Language",settingKey:"settings-general-single_language"}),Object(Nn.jsx)(Zc,{children:"Download a single Subtitles file without adding the language code to the filename."}),Object(Nn.jsx)(Zc,{type:"warning",children:"We don't recommend enabling this option unless absolutely required (ie: media player not supporting language code in subtitles filename). Results may vary."})]}),Object(Nn.jsx)(Qc,{name:"Languages Filter",children:Object(Nn.jsx)(hi,{settingKey:Tc,options:t})})]}),Object(Nn.jsx)(Vc,{header:"Languages Profiles",children:Object(Nn.jsx)(mi,{})}),Object(Nn.jsxs)(Vc,{header:"Default Settings",children:[Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Series",settingKey:"settings-general-serie_default_enabled"}),Object(Nn.jsx)(Zc,{children:"Apply only to Series added to Bazarr after enabling this option."})]})}),Object(Nn.jsx)(Wc.Content,{indent:!0,children:Object(Nn.jsx)(Qc,{name:"Profile",children:Object(Nn.jsx)(Oi,{settingKey:"settings-general-serie_default_profile"})})})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Movies",settingKey:"settings-general-movie_default_enabled"}),Object(Nn.jsx)(Zc,{children:"Apply only to Movies added to Bazarr after enabling this option."})]})}),Object(Nn.jsx)(Wc.Content,{children:Object(Nn.jsx)(Qc,{name:"Profile",children:Object(Nn.jsx)(Oi,{settingKey:"settings-general-movie_default_profile"})})})]})]})]})})})},Ci=function(e,t){return e.name===t.name},Ni=function(e){var t,n=e.selections,r=Object(kn.a)(e,["selections"]),i=Object(a.useMemo)((function(){return n.filter((function(e){return!e.enabled})).map((function(e){return{label:e.name,value:e}}))}),[n]),s=function(e,t){var n=Lc(),r=Rc();void 0===t&&(t=$.isEqual);var c=Object(a.useMemo)((function(){return e in r?r[e]:[]}),[e,r]);return Object(a.useCallback)((function(r){var a=Object(J.a)(c),i=a.findIndex((function(e){return t(e,r)}));-1!==i?a[i]=r:a.push(r),n(a,e)}),[t,c,e,n])}(Ec,Ci),o=ur(r.modalKey),l=Object(a.useState)(null!==o&&void 0!==o?o:null),u=Object(Z.a)(l,2),d=u[0],j=u[1],b=Object(a.useCallback)((function(){return j(null!==o&&void 0!==o?o:null)}),[o]);lr(r.modalKey,b);var h=Object(a.useCallback)((function(e){if(d){var t=Object(f.a)({},d);t.url=e,j(t)}}),[d]),O=sr(),p=null!==d&&null!==(null===d||void 0===d?void 0:d.url)&&0!==(null===d||void 0===d?void 0:d.url.length),x=Object(a.useMemo)((function(){return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(Yn,{className:"mr-auto",disabled:!p,variant:"outline-secondary",promise:function(){return d&&d.url?tt.testNotification(d.name,d.url):null},children:"Test"}),Object(Nn.jsx)(Ke.a,{hidden:null===o,variant:"danger",onClick:function(){d&&(d.enabled=!1,s(d)),O()},children:"Remove"}),Object(Nn.jsx)(Ke.a,{disabled:!p,onClick:function(){d&&(d.enabled=!0,s(d)),O()},children:"Save"})]})}),[p,O,d,s,o]);return Object(Nn.jsx)(br,Object(f.a)(Object(f.a)({title:"Notification",footer:x},r),{},{children:Object(Nn.jsx)(Be.a,{fluid:!0,children:Object(Nn.jsxs)(Ee.a,{children:[Object(Nn.jsx)(oa.a,{xs:12,children:Object(Nn.jsx)(Ln,{disabled:null!==o,options:i,value:d,onChange:j,label:function(e){return e.name}})}),Object(Nn.jsx)(oa.a,{hidden:null===d,children:Object(Nn.jsx)(Tn.a.Group,{className:"mt-4",children:Object(Nn.jsx)(Tn.a.Control,{as:"textarea",rows:4,placeholder:"URL",value:null!==(t=null===d||void 0===d?void 0:d.url)&&void 0!==t?t:"",onChange:function(e){var t=e.currentTarget.value;h(t)}})})})]})})}))},Ii=function(){var e=function(e,t,n){var r=_c(e,$.isArray,n),c=Rc();void 0===t&&(t=$.isEqual);var i=void 0;return e in c&&(i=c[e]),Object(a.useMemo)((function(){return void 0!==i&&r?de(r,i,t):r}),[r,i,t])}(Ec,Ci,(function(e){return e.notifications.providers})),t=ir(),n=Object(a.useMemo)((function(){return null===e||void 0===e?void 0:e.filter((function(e){return e.enabled})).map((function(e,n){return Object(Nn.jsx)(Xc,{header:e.name,onClick:function(){return t("notifications",e)}},je(n,e.name))}))}),[e,t]);return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsxs)(Ee.a,{children:[n," ",Object(Nn.jsx)(Xc,{plus:!0,onClick:function(){return t("notifications")}})]}),Object(Nn.jsx)(Ni,{selections:null!==e&&void 0!==e?e:[],modalKey:"notifications"})]})},Pi=function(){return Object(Nn.jsxs)(Dc,{title:"Notifications - Bazarr (Settings)",children:[Object(Nn.jsxs)(ze.a,{variant:"secondary",children:["Thanks to caronc for his work on"," ",Object(Nn.jsx)("a",{href:"https://github.com/caronc/apprise",target:"_blank",rel:"noopener noreferrer",children:"apprise"}),", the core of the Bazarr notification system."]}),Object(Nn.jsxs)(ze.a,{variant:"secondary",children:["Please follow instructions on his"," ",Object(Nn.jsx)("a",{href:"https://github.com/caronc/apprise/wiki",target:"_blank",rel:"noopener noreferrer",children:"Wiki"})," ","to configure your notification providers."]}),Object(Nn.jsx)(Vc,{header:"Notifications",children:Object(Nn.jsx)(Ii,{})}),Object(Nn.jsx)(Vc,{header:"Options",children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Silent for Manual Actions",settingKey:"settings-general-dont_notify_manual_actions"}),Object(Nn.jsx)(Zc,{children:"Suppress notifications when manually download/upload subtitles."})]})})]})},Ai=[{key:"addic7ed",description:"Requires Anti-Captcha Provider",defaultKey:{username:"",password:""}},{key:"argenteam",description:"Spanish Subtitles Provider"},{key:"assrt",description:"Chinese Subtitles Provider",defaultKey:{token:""}},{key:"betaseries",name:"BetaSeries",description:"French / English Provider for TV Shows Only",defaultKey:{token:""},keyNameOverride:{token:"API KEY"}},{key:"bsplayer",name:"BSplayer"},{key:"greeksubs",name:"GreekSubs",description:"Greek Subtitles Provider"},{key:"greeksubtitles",name:"GreekSubtitles",description:"Greek Subtitles Provider"},{key:"hosszupuska",description:"Hungarian Subtitles Provider"},{key:"legendasdivx",name:"LegendasDivx",description:"Brazilian / Portuguese Subtitles Provider",defaultKey:{username:"",password:"",skip_wrong_fps:!1},keyNameOverride:{skip_wrong_fps:"Skip Wrong FPS"}},{key:"legendastv",name:"LegendasTV",description:"Brazilian / Portuguese Subtitles Provider",defaultKey:{username:"",password:""}},{key:"napiprojekt",description:"Polish Subtitles Provider"},{key:"napisy24",description:"Polish Subtitles Provider",message:"The provided credentials must have API access. Leave empty to use the defaults.",defaultKey:{username:"",password:""}},{key:"nekur",description:"Latvian Subtitles Provider"},{key:"opensubtitles",name:"OpenSubtitles.org",defaultKey:{username:"",password:"",vip:!1,ssl:!1,skip_wrong_fps:!1},keyNameOverride:{vip:"VIP",ssl:"Use SSL",skip_wrong_fps:"Skip Wrong FPS"}},{key:"opensubtitlescom",name:"OpenSubtitles.com",defaultKey:{username:"",password:"",use_hash:!1},keyNameOverride:{use_hash:"Use Hash"}},{key:"podnapisi"},{key:"regielive",name:"RegieLive",description:"Romanian Subtitles Provider"},{key:"soustitreseu",name:"Sous-Titres.eu",description:"Mostly French Subtitles Provider"},{key:"subdivx",description:"Spanish Subtitles Provider"},{key:"subssabbz",name:"Subs.sab.bz",description:"Bulgarian Subtitles Provider"},{key:"subs4free",name:"Subs4Free",description:"Greek Subtitles Provider"},{key:"subs4series",name:"Subs4Series",description:"Greek Subtitles Provider"},{key:"subscene",description:"Requires Anti-Captcha Provider",defaultKey:{username:"",password:""}},{key:"subscenter"},{key:"subsunacs",name:"Subsunacs.net",description:"Bulgarian Subtitles Provider"},{key:"subsynchro",description:"French Subtitles Provider"},{key:"subtitriid",name:"subtitri.id.lv",description:"Latvian Subtitles Provider"},{key:"subtitulamos",name:"Subtitulamos.tv",description:"Spanish Subtitles Provider"},{key:"sucha",description:"Spanish Subtitles Provider"},{key:"supersubtitles"},{key:"titlovi",defaultKey:{username:"",password:""}},{key:"titrari",name:"Titrari.ro"},{key:"tusubtitulo",name:"Tusubtitulo.com",description:"Spanish / English Subtitles Provider for TV Shows"},{key:"tvsubtitles",name:"TVSubtitles"},{key:"wizdom",description:"Wizdom.xyz Subtitles Provider."},{key:"xsubs",name:"XSubs",description:"Greek Subtitles Provider",defaultKey:{username:"",password:""}},{key:"yavkanet",name:"Yavka.net",description:"Bulgarian Subtitles Provider"},{key:"yifysubtitles",name:"YIFY Subtitles"},{key:"zimuku",description:"Chinese Subtitles Provider"}],Ti="provider-modal",Mi="settings-general-enabled_providers",Ei=function(){var e=Hc(Mi,$.isArray),t=ir(),n=Object(a.useCallback)((function(e){t(Ti,null!==e&&void 0!==e?e:null)}),[t]),r=Object(a.useMemo)((function(){return e?e.flatMap((function(e){var t=Ai.find((function(t){return t.key===e}));return t||[]})).map((function(e,t){var r;return Object(Nn.jsx)(Xc,{header:null!==(r=e.name)&&void 0!==r?r:Object($.capitalize)(e.key),subheader:e.description,onClick:function(){return n(e)}},je(t,e.name))})):[]}),[e,n]);return Object(Nn.jsx)(Be.a,{fluid:!0,children:Object(Nn.jsxs)(Ee.a,{children:[r,Object(Nn.jsx)(Xc,{plus:!0,onClick:n},"add-card")]})})},Bi=function(){var e=ur(Ti),t=Object(a.useState)({}),n=Object(Z.a)(t,2),r=n[0],i=n[1],s=Object(a.useState)(null!==e&&void 0!==e?e:null),o=Object(Z.a)(s,2),l=o[0],u=o[1],d=Object(a.useCallback)((function(){return u(null!==e&&void 0!==e?e:null)}),[e]);lr(Ti,d);var j=Hc(Mi,$.isArray),b=sr(),h=function(){var e=Object(a.useContext)(zc),t=Object(Z.a)(e,2)[1];return Object(a.useCallback)((function(e){t((function(t){return Object(f.a)(Object(f.a)({},t),e)}))}),[t])}(),p=Object(a.useCallback)((function(){if(e&&j){var t=j.findIndex((function(t){return t===e.key}));if(-1!==t){var n=Object(J.a)(j);n.splice(t,1),h(Object(O.a)({},Mi,n)),b()}}}),[e,j,h,b]),x=Object(a.useCallback)((function(){if(l&&j){var e=Object(f.a)({},r);if(void 0===j.find((function(e){return e===l.key}))){var t=[].concat(Object(J.a)(j),[l.key]);e[Mi]=t}h(e),b()}}),[l,j,r,b,h]),v=null!==l,m=Object(a.useMemo)((function(){return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(Ke.a,{hidden:!e,variant:"danger",onClick:p,children:"Delete"}),Object(Nn.jsx)(Ke.a,{disabled:!v,onClick:x,children:"Save"})]})}),[v,e,p,x]),g=Object(a.useCallback)((function(e){u(e||{key:"",description:"Unknown Provider"})}),[]),y=Object(a.useMemo)((function(){return Ai.filter((function(e){return void 0===(null===j||void 0===j?void 0:j.find((function(t){return t===e.key})))})).map((function(e){var t;return{label:null!==(t=e.name)&&void 0!==t?t:Object($.capitalize)(e.key),value:e}}))}),[j]),k=Object(a.useMemo)((function(){var e;if(null===l)return null;var t=l.defaultKey,n=null!==(e=l.keyNameOverride)&&void 0!==e?e:{};if(void 0===t)return null;var r=l.key,a=[],c=[];for(var i in t){var s=t[i],o=i;o=o in n?n[o]:Object($.capitalize)(i),ee(s)?a.push(Object(Nn.jsx)(oa.a,{xs:12,className:"mt-2",children:Object(Nn.jsx)($c,{password:"password"===i,placeholder:o,settingKey:"settings-".concat(r,"-").concat(i)})},i)):Object($.isBoolean)(s)&&c.push(Object(Nn.jsx)(ei,{inline:!0,label:o,settingKey:"settings-".concat(r,"-").concat(i)},i))}return Object(Nn.jsxs)(Ee.a,{children:[a,Object(Nn.jsx)(oa.a,{hidden:0===c.length,className:"mt-2",children:c})]})}),[l]);return Object(Nn.jsx)(br,{title:"Provider",footer:m,modalKey:Ti,children:Object(Nn.jsx)(zc.Provider,{value:[r,i],children:Object(Nn.jsxs)(Be.a,{children:[Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(oa.a,{children:Object(Nn.jsx)(Ln,{disabled:null!==e,options:y,value:l,label:function(e){var t,n;return null!==(t=null===e||void 0===e?void 0:e.name)&&void 0!==t?t:Object($.capitalize)(null!==(n=null===e||void 0===e?void 0:e.key)&&void 0!==n?n:"")},onChange:g})})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(oa.a,{className:"mb-2",children:Object(Nn.jsx)(Zc,{children:null===l||void 0===l?void 0:l.description})})}),k,Object(Nn.jsx)(Ee.a,{hidden:void 0===(null===l||void 0===l?void 0:l.message),children:Object(Nn.jsx)(oa.a,{children:Object(Nn.jsx)(Zc,{children:null===l||void 0===l?void 0:l.message})})})]})})})},Ki=function(){return Object(Nn.jsxs)(Dc,{title:"Providers - Bazarr (Settings)",children:[Object(Nn.jsx)(Vc,{header:"Providers",children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(Ei,{})})}),Object(Nn.jsx)(Bi,{})]})};var zi=function(e){var t=e.type,n=function(e){return"sonarr"===e?"settings-general-path_mappings":"settings-general-path_mappings_movie"}(t),r=Hc(n,$.isArray),i=_c(function(e){return"sonarr"===e?Bc:Kc}(t),$.isBoolean),s=Lc(),o=Object(a.useCallback)((function(e){s(e.map((function(e){return[e.from,e.to]})),n)}),[n,s]),l=Object(a.useCallback)((function(){if(r){var e=[].concat(Object(J.a)(r),[["",""]]);s(e,n)}}),[r,n,s]),u=Object(a.useMemo)((function(){var e;return null!==(e=null===r||void 0===r?void 0:r.map((function(e){return{from:e[0],to:e[1]}})))&&void 0!==e?e:[]}),[r]),d=Object(a.useMemo)((function(){return"sonarr"===t?function(e){return Qe.sonarr(e)}:function(e){return Qe.radarr(e)}}),[t]),j=Object(a.useCallback)((function(e,t){var n=Object(J.a)(u);t?n[e.index]=t:n.splice(e.index,1),o(n)}),[u,o]),b=Object(a.useMemo)((function(){return[{Header:Object($.capitalize)(t),accessor:"from",Cell:function(e){var t=e.value,n=e.row,r=e.externalUpdate;return Object(Nn.jsx)(Kn,{drop:"up",defaultValue:t,load:d,onChange:function(e){var t=Object(f.a)({},n.original);t.from=e,r&&r(n,t)}})}},{id:"arrow",className:"text-center",Cell:function(){return Object(Nn.jsx)(Me.a,{icon:Te.b})}},{Header:"Bazarr",accessor:"to",Cell:function(e){var t=e.value,n=e.row,r=e.externalUpdate;return Object(Nn.jsx)(Kn,{drop:"up",defaultValue:t,load:function(e){return Qe.bazarr(e)},onChange:function(e){var t=Object(f.a)({},n.original);t.to=e,r&&r(n,t)}})}},{id:"action",accessor:"to",Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(Nn.jsx)(Xn,{icon:Te.Z,onClick:function(){n&&n(t)}})}}]}),[t,d]);return i?Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(ta,{emptyText:"No Mapping",responsive:!1,columns:b,data:u,externalUpdate:j}),Object(Nn.jsx)(Ke.a,{block:!0,variant:"light",onClick:l,children:"Add"})]}):Object(Nn.jsx)(Zc,{children:"Path Mappings will be available after staged changes are saved"})},Di=function(){var e=Object(a.useCallback)((function(e){var t,n;return null!==(t=null===(n=e.radarr.base_url)||void 0===n?void 0:n.slice(1))&&void 0!==t?t:""}),[]);return Object(Nn.jsx)(Dc,{title:"Radarr - Bazarr (Settings)",children:Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Vc,{header:"Use Radarr",children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ei,{label:"Enabled",settingKey:Kc})})})}),Object(Nn.jsxs)(Wc.Content,{indent:!1,children:[Object(Nn.jsxs)(Vc,{header:"Host",children:[Object(Nn.jsxs)(Qc,{name:"Address",children:[Object(Nn.jsx)($c,{settingKey:"settings-radarr-ip"}),Object(Nn.jsx)(Zc,{children:"Hostname or IPv4 Address"})]}),Object(Nn.jsx)(Qc,{name:"Port",children:Object(Nn.jsx)($c,{settingKey:"settings-radarr-port"})}),Object(Nn.jsx)(Qc,{name:"Base URL",children:Object(Nn.jsxs)(gr.a,{children:[Object(Nn.jsx)(gr.a.Prepend,{children:Object(Nn.jsx)(gr.a.Text,{children:"/"})}),Object(Nn.jsx)($c,{settingKey:"settings-radarr-base_url",override:e,beforeStaged:function(e){return"/"+e}})]})}),Object(Nn.jsx)(Qc,{name:"API Key",children:Object(Nn.jsx)($c,{settingKey:"settings-radarr-apikey"})}),Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ei,{label:"SSL",settingKey:"settings-radarr-ssl"})}),Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ii,{category:"radarr"})})]}),Object(Nn.jsxs)(Vc,{header:"Options",children:[Object(Nn.jsx)(Qc,{name:"Minimum Score",children:Object(Nn.jsx)(ri,{settingKey:"settings-general-minimum_score_movie"})}),Object(Nn.jsxs)(Qc,{name:"Excluded Tags",children:[Object(Nn.jsx)(ai,{settingKey:"settings-radarr-excluded_tags"}),Object(Nn.jsx)(Zc,{children:"Movies with those tags (case sensitive) in Radarr will be excluded from automatic download of subtitles."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Download Only Monitored",settingKey:"settings-radarr-only_monitored"}),Object(Nn.jsx)(Zc,{children:"Automatic download of subtitles will only happen for monitored movies in Radarr."})]})]}),Object(Nn.jsx)(Vc,{header:"Path Mappings",children:Object(Nn.jsx)(zi,{type:"radarr"})})]})]})})},Ri=[{label:"1 Minute",value:1},{label:"5 Minutes",value:5},{label:"15 Minutes",value:15},{label:"1 Hour",value:60},{label:"3 Hours",value:180}],Li=[{label:"5 Minutes",value:5},{label:"15 Minutes",value:15},{label:"1 Hour",value:60},{label:"3 Hours",value:180},{label:"6 Hours",value:360}],_i=Li,Hi=[{label:"Manually",value:"Manually"},{label:"Daily",value:"Daily"},{label:"Weekly",value:"Weekly"}],Ui=[{label:"Monday",value:0},{label:"Tuesday",value:1},{label:"Wednesday",value:2},{label:"Thursday",value:3},{label:"Friday",value:4},{label:"Saturday",value:5},{label:"Sunday",value:6}],Fi=[{label:"3 Hours",value:3},{label:"6 Hours",value:6},{label:"12 Hours",value:12},{label:"24 Hours",value:24}],Gi=function(){var e=Object(a.useMemo)((function(){return Array(24).fill(null).map((function(e,t){return{label:"".concat(t,":00"),value:t}}))}),[]);return Object(Nn.jsxs)(Dc,{title:"Scheduler - Bazarr (Settings)",children:[Object(Nn.jsxs)(Vc,{header:"Sonarr/Radarr Sync",children:[Object(Nn.jsx)(Qc,{name:"Update Series List from Sonarr",children:Object(Nn.jsx)(ni,{options:Ri,settingKey:"settings-sonarr-series_sync"})}),Object(Nn.jsx)(Qc,{name:"Update Episodes List from Sonarr",children:Object(Nn.jsx)(ni,{options:Li,settingKey:"settings-sonarr-episodes_sync"})}),Object(Nn.jsx)(Qc,{name:"Update Movies List from Radarr",children:Object(Nn.jsx)(ni,{options:_i,settingKey:"settings-radarr-movies_sync"})})]}),Object(Nn.jsxs)(Vc,{header:"Disk Indexing",children:[Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Qc,{name:"Update all Episode Subtitles from Disk",children:Object(Nn.jsx)(ni,{settingKey:"settings-sonarr-full_update",options:Hi})})}),Object(Nn.jsx)(Wc.Content,{on:function(e){return"Weekly"===e},children:Object(Nn.jsx)(Qc,{name:"Day of The Week",children:Object(Nn.jsx)(ni,{settingKey:"settings-sonarr-full_update_day",options:Ui})})}),Object(Nn.jsx)(Wc.Content,{on:function(e){return"Daily"===e||"Weekly"===e},children:Object(Nn.jsx)(Qc,{name:"Time of The Day",children:Object(Nn.jsx)(ni,{settingKey:"settings-sonarr-full_update_hour",options:e})})})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Qc,{name:"Update all Movie Subtitles from Disk",children:Object(Nn.jsx)(ni,{settingKey:"settings-radarr-full_update",options:Hi})})}),Object(Nn.jsx)(Wc.Content,{on:function(e){return"Weekly"===e},children:Object(Nn.jsx)(Qc,{name:"Day of The Week",children:Object(Nn.jsx)(ni,{settingKey:"settings-radarr-full_update_day",options:Ui})})}),Object(Nn.jsx)(Wc.Content,{on:function(e){return"Daily"===e||"Weekly"===e},children:Object(Nn.jsx)(Qc,{name:"Time of The Day",children:Object(Nn.jsx)(ni,{settingKey:"settings-radarr-full_update_hour",options:e})})})]})]}),Object(Nn.jsxs)(Vc,{header:"Search and Upgrade Subtitles",children:[Object(Nn.jsx)(Qc,{name:"Search for Missing Series Subtitles",children:Object(Nn.jsx)(ni,{settingKey:"settings-general-wanted_search_frequency",options:Fi})}),Object(Nn.jsx)(Qc,{name:"Search for Missing Movies Subtitles",children:Object(Nn.jsx)(ni,{options:Fi,settingKey:"settings-general-wanted_search_frequency_movie"})}),Object(Nn.jsx)(Qc,{name:"Upgrade Previously Downloaded Subtitles",children:Object(Nn.jsx)(ni,{options:Fi,settingKey:"settings-general-upgrade_frequency"})})]})]})},qi=[{label:"Standard",value:"standard"},{label:"Anime",value:"anime"},{label:"Daily",value:"daily"}],Wi=function(){var e=Object(a.useCallback)((function(e){var t,n;return null!==(t=null===(n=e.sonarr.base_url)||void 0===n?void 0:n.slice(1))&&void 0!==t?t:""}),[]);return Object(Nn.jsx)(Dc,{title:"Sonarr - Bazarr (Settings)",children:Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Vc,{header:"Use Sonarr",children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ei,{label:"Enabled",settingKey:Bc})})})}),Object(Nn.jsxs)(Wc.Content,{indent:!1,children:[Object(Nn.jsxs)(Vc,{header:"Host",children:[Object(Nn.jsxs)(Qc,{name:"Address",children:[Object(Nn.jsx)($c,{settingKey:"settings-sonarr-ip"}),Object(Nn.jsx)(Zc,{children:"Hostname or IPv4 Address"})]}),Object(Nn.jsx)(Qc,{name:"Port",children:Object(Nn.jsx)($c,{settingKey:"settings-sonarr-port"})}),Object(Nn.jsx)(Qc,{name:"Base URL",children:Object(Nn.jsxs)(gr.a,{children:[Object(Nn.jsx)(gr.a.Prepend,{children:Object(Nn.jsx)(gr.a.Text,{children:"/"})}),Object(Nn.jsx)($c,{settingKey:"settings-sonarr-base_url",override:e,beforeStaged:function(e){return"/"+e}})]})}),Object(Nn.jsx)(Qc,{name:"API Key",children:Object(Nn.jsx)($c,{settingKey:"settings-sonarr-apikey"})}),Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ei,{label:"SSL",settingKey:"settings-sonarr-ssl"})}),Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ii,{category:"sonarr"})})]}),Object(Nn.jsxs)(Vc,{header:"Options",children:[Object(Nn.jsx)(Qc,{name:"Minimum Score",children:Object(Nn.jsx)(ri,{settingKey:"settings-general-minimum_score"})}),Object(Nn.jsxs)(Qc,{name:"Excluded Tags",children:[Object(Nn.jsx)(ai,{settingKey:"settings-sonarr-excluded_tags"}),Object(Nn.jsx)(Zc,{children:"Episodes from series with those tags (case sensitive) in Sonarr will be excluded from automatic download of subtitles."})]}),Object(Nn.jsxs)(Qc,{name:"Excluded Series Types",children:[Object(Nn.jsx)(ni,{settingKey:"settings-sonarr-excluded_series_types",multiple:!0,options:qi}),Object(Nn.jsx)(Zc,{children:"Episodes from series with those types in Sonarr will be excluded from automatic download of subtitles."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Download Only Monitored",settingKey:"settings-sonarr-only_monitored"}),Object(Nn.jsx)(Zc,{children:"Automatic download of subtitles will only happen for monitored episodes in Sonarr."})]})]}),Object(Nn.jsx)(Vc,{header:"Path Mappings",children:Object(Nn.jsx)(zi,{type:"sonarr"})})]})]})})},Yi=[{label:"AlongSide Media File",value:"current"},{label:"Relative Path to Media File",value:"relative"},{label:"Absolute Path",value:"absolute"}],Vi=[{label:"Anti-Captcha",value:"anti-captcha"},{label:"Death by Captcha",value:"death-by-captcha"}];function Qi(e){return"color(name=".concat(e,")")}var Xi=[{label:"White",value:Qi("white")},{label:"Light Gray",value:Qi("lightgray")},{label:"Red",value:Qi("red")},{label:"Green",value:Qi("green")},{label:"Yellow",value:Qi("yellow")},{label:"Blue",value:Qi("blue")},{label:"Magenta",value:Qi("magenta")},{label:"Cyan",value:Qi("cyan")},{label:"Black",value:Qi("black")},{label:"Dark Red",value:Qi("darkred")},{label:"Dark Green",value:Qi("darkgreen")},{label:"Dark Yellow",value:Qi("darkyellow")},{label:"Dark Blue",value:Qi("darkblue")},{label:"Dark Magenta",value:Qi("darkmagenta")},{label:"Dark Cyan",value:Qi("darkcyan")},{label:"Dark Grey",value:Qi("darkgrey")}],Ji=function(e){return function(t){var n,r;return null!==(n=null===(r=t.general.subzero_mods)||void 0===r?void 0:r.includes(e))&&void 0!==n&&n}},Zi=function(e){var t,n;return null!==(t=null===(n=e.general.subzero_mods)||void 0===n?void 0:n.find((function(e){return e.startsWith("color")})))&&void 0!==t?t:null},$i=function(){return Object(Nn.jsxs)(Dc,{title:"Subtitles - Bazarr (Settings)",children:[Object(Nn.jsxs)(Vc,{header:"Subtitles Options",children:[Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsxs)(Qc,{name:"Subtitle Folder",children:[Object(Nn.jsx)(ni,{options:Yi,settingKey:"settings-general-subfolder"}),Object(Nn.jsx)(Zc,{children:"Choose the folder you wish to store/read the subtitles"})]})}),Object(Nn.jsx)(Wc.Content,{on:function(e){return""!==e&&"current"!==e},children:Object(Nn.jsx)(Qc,{name:"Custom Subtitles Folder",children:Object(Nn.jsx)($c,{settingKey:"settings-general-subfolder_custom"})})})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Upgrade Previously Downloaded Subtitles",settingKey:"settings-general-upgrade_subs"}),Object(Nn.jsx)(Zc,{children:"Schedule a task to upgrade subtitles previously downloaded by Bazarr."})]})}),Object(Nn.jsxs)(Wc.Content,{children:[Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ri,{settingKey:"settings-general-days_to_upgrade_subs",max:30}),Object(Nn.jsx)(Zc,{children:"Number of days to go back in history to upgrade subtitles"})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Upgrade Manually Downloaded or Translated Subtitles",settingKey:"settings-general-upgrade_manual"}),Object(Nn.jsx)(Zc,{children:"Enable or disable upgrade of manually downloaded or translated subtitles."})]})]})]})]}),Object(Nn.jsx)(Vc,{header:"Anti-Captcha Options",children:Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ni,{clearable:!0,settingKey:"settings-general-anti_captcha_provider",beforeStaged:function(e){return void 0===e?"None":e},options:Vi}),Object(Nn.jsx)(Zc,{children:"Choose the anti-captcha provider you want to use"})]})}),Object(Nn.jsxs)(Wc.Content,{eventKey:"anti-captcha",children:[Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)("a",{href:"http://getcaptchasolution.com/eixxo1rsnw",children:"Anti-Captcha.com"})}),Object(Nn.jsx)(Qc,{name:"Account Key",children:Object(Nn.jsx)($c,{settingKey:"settings-anticaptcha-anti_captcha_key"})})]}),Object(Nn.jsxs)(Wc.Content,{eventKey:"death-by-captcha",children:[Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)("a",{href:"https://www.deathbycaptcha.com",children:"DeathByCaptcha.com"})}),Object(Nn.jsx)(Qc,{name:"Username",children:Object(Nn.jsx)($c,{settingKey:"settings-deathbycaptcha-username"})}),Object(Nn.jsx)(Qc,{name:"Password",children:Object(Nn.jsx)($c,{password:!0,settingKey:"settings-deathbycaptcha-password"})})]})]})}),Object(Nn.jsxs)(Vc,{header:"Performance / Optimization",children:[Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Adaptive Searching",settingKey:"settings-general-adaptive_searching"}),Object(Nn.jsx)(Zc,{children:"When searching for subtitles, Bazarr will search less frequently to limit call to providers."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Search Enabled Providers Simultaneously",settingKey:"settings-general-multithreading"}),Object(Nn.jsx)(Zc,{children:"Search multiple providers at once (Don't choose this on low powered devices)"})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Use Embedded Subtitles",settingKey:"settings-general-use_embedded_subs"}),Object(Nn.jsx)(Zc,{children:"Use embedded subtitles in media files when determining missing ones."})]})}),Object(Nn.jsxs)(Wc.Content,{children:[Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Ignore Embedded PGS Subtitles",settingKey:"settings-general-ignore_pgs_subs"}),Object(Nn.jsx)(Zc,{children:"Ignores PGS Subtitles in Embedded Subtitles detection."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Ignore Embedded VobSub Subtitles",settingKey:"settings-general-ignore_vobsub_subs"}),Object(Nn.jsx)(Zc,{children:"Ignores VobSub Subtitles in Embedded Subtitles detection."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Show Only Desired Languages",settingKey:"settings-general-embedded_subs_show_desired"}),Object(Nn.jsx)(Zc,{children:"Hide embedded subtitles for languages that are not currently desired."})]})]})]})]}),Object(Nn.jsxs)(Vc,{header:"Post-Processing",children:[Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Encode Subtitles To UTF8",settingKey:"settings-general-utf8_encode"}),Object(Nn.jsx)(Zc,{children:"Re-encode downloaded Subtitles to UTF8. Should be left enabled in most case."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Hearing Impaired",override:Ji("remove_HI"),settingKey:"subzero-remove_HI"}),Object(Nn.jsx)(Zc,{children:"Removes tags, text and characters from subtitles that are meant for hearing impaired people."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Remove Tags",override:Ji("remove_tags"),settingKey:"subzero-remove_tags"}),Object(Nn.jsx)(Zc,{children:"Removes all possible style tags from the subtitle, such as font, bold, color etc."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"OCR Fixes",override:Ji("OCR_fixes"),settingKey:"subzero-OCR_fixes"}),Object(Nn.jsx)(Zc,{children:"Fix issues that happen when a subtitle gets converted from bitmap to text through OCR."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Common Fixes",override:Ji("common"),settingKey:"subzero-common"}),Object(Nn.jsx)(Zc,{children:"Fix common and whitespace/punctuation issues in subtitles."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Fix Uppercase",override:Ji("fix_uppercase"),settingKey:"subzero-fix_uppercase"}),Object(Nn.jsx)(Zc,{children:"Tries to make subtitles that are completely uppercase readable."})]}),Object(Nn.jsxs)(Qc,{name:"Color",children:[Object(Nn.jsx)(ni,{clearable:!0,options:Xi,override:Zi,settingKey:"subzero-color"}),Object(Nn.jsx)(Zc,{children:"Adds color to your subtitles (for playback devices/software that don't ship their own color modes; only works for players that support color tags)."})]}),Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Reverse RTL",override:Ji("reverse_rtl"),settingKey:"subzero-reverse_rtl"}),Object(Nn.jsx)(Zc,{children:"Reverses the punctuation in right-to-left subtitles for problematic playback devices."})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ei,{label:"Permission (chmod)",settingKey:"settings-general-chmod_enabled"})})}),Object(Nn.jsx)(Wc.Content,{children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)($c,{placeholder:"0777",settingKey:"settings-general-chmod"}),Object(Nn.jsx)(Zc,{children:"Must be 4 digit octal"})]})})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Automatic Subtitles Synchronization",settingKey:"settings-subsync-use_subsync"}),Object(Nn.jsx)(Zc,{children:"Enable the automatic subtitles synchronization after downloading a subtitles."})]})}),Object(Nn.jsxs)(Wc.Content,{children:[Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{label:"Debug",settingKey:"settings-subsync-debug"}),Object(Nn.jsx)(Zc,{children:"Do not actually sync the subtitles but generate a .tar.gz file to be able to open an issue for ffsubsync. This file will reside alongside the media file."})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ei,{label:"Series Score Threshold",settingKey:"settings-subsync-use_subsync_threshold"})})}),Object(Nn.jsx)(Wc.Content,{indent:!1,children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ri,{settingKey:"settings-subsync-subsync_threshold"})})})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ei,{label:"Movies Score Threshold",settingKey:"settings-subsync-use_subsync_movie_threshold"})})}),Object(Nn.jsx)(Wc.Content,{indent:!1,children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ri,{settingKey:"settings-subsync-subsync_movie_threshold"})})})]})]})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsxs)(Qc,{children:[Object(Nn.jsx)(ei,{settingKey:"settings-general-use_postprocessing",label:"Custom Post-Processing"}),Object(Nn.jsx)(Zc,{children:"Enable the post-processing execution after downloading a subtitles."})]})}),Object(Nn.jsxs)(Wc.Content,{children:[Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ei,{settingKey:"settings-general-use_postprocessing_threshold",label:"Series Score Threshold"})})}),Object(Nn.jsx)(Wc.Content,{indent:!1,children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ri,{settingKey:"settings-general-postprocessing_threshold"})})})]}),Object(Nn.jsxs)(Wc,{children:[Object(Nn.jsx)(Wc.Control,{children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ei,{settingKey:"settings-general-use_postprocessing_threshold_movie",label:"Movies Score Threshold"})})}),Object(Nn.jsx)(Wc.Content,{indent:!1,children:Object(Nn.jsx)(Qc,{children:Object(Nn.jsx)(ri,{settingKey:"settings-general-postprocessing_threshold_movie"})})})]}),Object(Nn.jsx)(Qc,{name:"Command",children:Object(Nn.jsx)($c,{settingKey:"settings-general-postprocessing_cmd"})}),Object(Nn.jsx)(Zc,{children:"Variables you can use in your command"}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{directory}}"})," Full path of the episode file parent directory"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{episode}}"})," Full path of the episode file"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{episode_name}}"})," Filename of the episode without parent directory or extension"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{subtitles}}"})," Full path of the subtitles file"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{subtitles_language}}"})," Language of the subtitles file"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{subtitles_language_code2}}"})," 2-letter ISO-639 language code of the subtitles language"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{subtitles_language_code3}}"})," 3-letter ISO-639 language code of the subtitles language"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{episode_language}}"})," Audio language of the episode file"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{episode_language_code2}}"})," 2-letter ISO-639 language code of the episode audio language"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{episode_language_code3}}"})," 3-letter ISO-639 language code of the episode audio language"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{score}}"})," Score of the subtitle file"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{subtitle_id}}"})," Provider ID of the subtitle file"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{series_id}}"})," Sonarr series ID (Empty if movie)"]}),Object(Nn.jsxs)(Zc,{children:[Object(Nn.jsx)("b",{children:"{{episode_id}}"})," Sonarr episode ID or Radarr movie ID"]})]})]})]})]})},es=[{label:"25",value:25},{label:"50",value:50},{label:"100",value:100},{label:"250",value:250},{label:"500",value:500},{label:"1000",value:1e3}],ts=function(){return Object(Nn.jsx)(Dc,{title:"Interface - Bazarr (Settings)",children:Object(Nn.jsx)(Vc,{header:"UI",children:Object(Nn.jsx)(Qc,{name:"Page Size",children:Object(Nn.jsx)(ni,{options:es,settingKey:ge,override:function(e,t){return t.site.pageSize}})})})})},ns=function(){return ie(an(kt)),Object(Nn.jsxs)(l.e,{children:[Object(Nn.jsx)(l.c,{exact:!0,path:"/settings",children:Object(Nn.jsx)(l.b,{exact:!0,to:"/settings/general"})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/settings/general",children:Object(Nn.jsx)(bi,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/settings/ui",children:Object(Nn.jsx)(ts,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/settings/sonarr",children:Object(Nn.jsx)(Wi,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/settings/radarr",children:Object(Nn.jsx)(Di,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/settings/languages",children:Object(Nn.jsx)(wi,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/settings/subtitles",children:Object(Nn.jsx)($i,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/settings/scheduler",children:Object(Nn.jsx)(Gi,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/settings/providers",children:Object(Nn.jsx)(Ki,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/settings/notifications",children:Object(Nn.jsx)(Pi,{})}),Object(Nn.jsx)(l.c,{path:"/settings/*",children:Object(Nn.jsx)(l.b,{to:Ra})})]})},rs=function(e){var t=Object.assign({},e),n=ur(t.modalKey),r=Object(a.useMemo)((function(){return null===n||void 0===n?void 0:n.split("\\n").map((function(e,t){return Object(Nn.jsx)("p",{className:"text-nowrap my-1",children:e},t)}))}),[n]);return Object(Nn.jsx)(br,Object(f.a)(Object(f.a)({title:"Stack traceback"},t),{},{children:Object(Nn.jsx)("pre",{children:Object(Nn.jsx)("code",{className:"zmdi-language-python-alt",children:r})})}))};function as(e){switch(e){case"DEBUG":return Te.n;case"ERROR":return Te.f;case"INFO":return Te.A;case"WARNING":return Te.s;default:return Te.N}}var cs=function(e){var t=e.logs,n=ir(),r=Object(a.useCallback)((function(e,t){return n("system-log",t)}),[n]),i=Object(a.useMemo)((function(){return[{accessor:"type",Cell:function(e){return Object(Nn.jsx)(Me.a,{icon:as(e.value)})}},{Header:"Message",accessor:"message"},{Header:"Date",accessor:"timestamp",className:"text-nowrap"},{accessor:"exception",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate;return Object($.isUndefined)(n)?null:Object(Nn.jsx)(Xn,{icon:Te.D,onClick:function(){return r&&r(t,n)}})}}]}),[]);return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(ua,{columns:i,data:t,externalUpdate:r}),Object(Nn.jsx)(rs,{size:"xl",modalKey:"system-log"})]})},is=function(){var e=rn((function(e){return e.system.logs})),t=an(gt);ie(t);var n=Object(a.useState)(!1),r=Object(Z.a)(n,2),c=r[0],i=r[1],s=ae(!0),o=Object(a.useCallback)((function(){window.open("".concat(s,"bazarr.log"))}),[s]);return Object(Nn.jsx)(Gn,{state:e,children:function(n){return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsx)("title",{children:"Logs - Bazarr (System)"})}),Object(Nn.jsxs)(tr,{children:[Object(Nn.jsx)(tr.Button,{updating:e.updating,icon:Te.U,onClick:t,children:"Refresh"}),Object(Nn.jsx)(tr.Button,{icon:Te.q,onClick:o,children:"Download"}),Object(Nn.jsx)(tr.Button,{updating:c,icon:Te.Z,onClick:function(){i(!0),tt.deleteLogs().finally((function(){i(!1),t()}))},children:"Empty"})]}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(cs,{logs:n})})]})}})},ss=function(e){var t=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"name"},{Header:"Status",accessor:"status"},{Header:"Next Retry",accessor:"retry"}]}),[]);return Object(Nn.jsx)(ta,{columns:t,data:e.providers})},os=function(){var e=vn(),t=Object(Z.a)(e,2),n=t[0],r=t[1];return ie(r),Object(Nn.jsx)(Gn,{state:n,children:function(e){return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsx)("title",{children:"Providers - Bazarr (System)"})}),Object(Nn.jsxs)(tr,{children:[Object(Nn.jsx)(tr.Button,{updating:n.updating,icon:Te.U,onClick:r,children:"Refresh"}),Object(Nn.jsx)(tr.AsyncButton,{icon:Te.Z,promise:function(){return Ze.reset()},onSuccess:r,children:"Reset"})]}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(ss,{providers:e})})]})}})},ls="mr-2",us=function(e){var t=e.name,n=e.body,r=e.date,c=e.prerelease,i=e.current,s=Object(a.useMemo)((function(){return n.map((function(e){return e.replace(/(\s\[.*?\])\(.*?\)/,"")}))}),[n]);return Object(Nn.jsxs)(Yc.a,{className:"mb-4 mx-3 d-flex flex-grow-1",children:[Object(Nn.jsxs)(Yc.a.Header,{children:[Object(Nn.jsx)("span",{className:ls,children:t}),Object(Nn.jsx)(Vn.a,{className:ls,variant:"info",children:r}),Object(Nn.jsx)(Vn.a,{className:ls,variant:c?"danger":"success",children:c?"Development":"Master"}),Object(Nn.jsx)(Vn.a,{className:ls,hidden:!i,variant:"primary",children:"Installed"})]}),Object(Nn.jsx)(Yc.a.Body,{children:Object(Nn.jsxs)(Yc.a.Text,{children:["From newest to oldest:",s.map((function(e,t){return Object(Nn.jsx)("li",{children:e},t)}))]})})]})},ds=function(){var e=rn((function(e){return e.system.releases}));return ie(an(yt)),Object(Nn.jsx)(Gn,{state:e,children:function(e){return Object(Nn.jsxs)(Be.a,{fluid:!0,className:"px-5 py-4 bg-light",children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsx)("title",{children:"Releases - Bazarr (System)"})}),Object(Nn.jsx)(Ee.a,{children:e.map((function(e,t){return Object(Nn.jsx)(oa.a,{xs:12,children:Object(Nn.jsx)(us,Object(f.a)({},e))},je(t,e.date))}))})]})}})},js=n(171);function bs(e){var t=e.title,n=e.children;return Object(Nn.jsxs)(Ee.a,{children:[Object(Nn.jsx)(oa.a,{sm:4,children:Object(Nn.jsx)("b",{children:t})}),Object(Nn.jsx)(oa.a,{children:n})]})}function hs(e){var t=e.icon,n=e.link,r=e.children;return Object(Nn.jsxs)(c.a.Fragment,{children:[Object(Nn.jsx)(Me.a,{icon:t,style:{width:"2rem"}}),Object(Nn.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:r})]})}var Os=function(e){var t=e.title,n=e.children;return Object(Nn.jsxs)(Be.a,{className:"py-3",children:[Object(Nn.jsx)("h4",{children:t}),Object(Nn.jsx)("hr",{}),n]})},fs=function(){var e=rn((function(e){return e.system.status.data}));return ie(an(xt)),Object(Nn.jsxs)(Be.a,{className:"p-5",children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsx)("title",{children:"Status - Bazarr (System)"})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsxs)(Os,{title:"About",children:[Object(Nn.jsx)(bs,{title:"Bazarr Version",children:Object(Nn.jsx)("span",{children:null===e||void 0===e?void 0:e.bazarr_version})}),Object(Nn.jsx)(bs,{title:"Sonarr Version",children:Object(Nn.jsx)("span",{children:null===e||void 0===e?void 0:e.sonarr_version})}),Object(Nn.jsx)(bs,{title:"Radarr Version",children:Object(Nn.jsx)("span",{children:null===e||void 0===e?void 0:e.radarr_version})}),Object(Nn.jsx)(bs,{title:"Operating System",children:Object(Nn.jsx)("span",{children:null===e||void 0===e?void 0:e.operating_system})}),Object(Nn.jsx)(bs,{title:"Python Version",children:Object(Nn.jsx)("span",{children:null===e||void 0===e?void 0:e.python_version})}),Object(Nn.jsx)(bs,{title:"Bazarr Directory",children:Object(Nn.jsx)("span",{children:null===e||void 0===e?void 0:e.bazarr_directory})}),Object(Nn.jsx)(bs,{title:"Bazarr Config Directory",children:Object(Nn.jsx)("span",{children:null===e||void 0===e?void 0:e.bazarr_config_directory})})]})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsxs)(Os,{title:"More Info",children:[Object(Nn.jsx)(bs,{title:"Home Page",children:Object(Nn.jsx)(hs,{icon:Te.K,link:"https://www.bazarr.media/",children:"Bazarr Website"})}),Object(Nn.jsx)(bs,{title:"Source",children:Object(Nn.jsx)(hs,{icon:js.b,link:"https://github.com/morpheus65535/bazarr",children:"Bazarr on Github"})}),Object(Nn.jsx)(bs,{title:"Wiki",children:Object(Nn.jsx)(hs,{icon:js.c,link:"https://github.com/morpheus65535/bazarr/wiki",children:"Bazarr Wiki"})}),Object(Nn.jsx)(bs,{title:"Discord",children:Object(Nn.jsx)(hs,{icon:js.a,link:"https://discord.gg/MH2e2eb",children:"Bazarr on Discord"})})]})})]})},ps=function(e){var t=e.tasks,n=an(mt),r=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"name",className:"text-nowrap"},{Header:"Interval",accessor:"interval",className:"text-nowrap"},{Header:"Next Execution",accessor:"next_run_in",className:"text-nowrap"},{accessor:"job_running",Cell:function(e){var t=e.row.original.job_id;return Object(Nn.jsx)(Yn,{promise:function(){return tt.runTask(t)},onSuccess:function(){return n(t)},variant:"light",size:"sm",disabled:e.value,children:Object(Nn.jsx)(Me.a,{icon:Te.U,spin:e.value})})}}]}),[n]);return Object(Nn.jsx)(ta,{columns:r,data:t})},xs=function(){var e=rn((function(e){return e.system.tasks})),t=an(vt);return ie(t,1e4),Object(Nn.jsx)(Gn,{state:e,children:function(n){return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsx)("title",{children:"Tasks - Bazarr (System)"})}),Object(Nn.jsx)(tr,{children:Object(Nn.jsx)(tr.Button,{updating:e.updating,icon:Te.U,onClick:t,children:"Refresh"})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(ps,{tasks:n})})]})}})},vs=function(){return Object(Nn.jsxs)(l.e,{children:[Object(Nn.jsx)(l.c,{exact:!0,path:"/system/tasks",children:Object(Nn.jsx)(xs,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/system/status",children:Object(Nn.jsx)(fs,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/system/providers",children:Object(Nn.jsx)(os,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/system/logs",children:Object(Nn.jsx)(is,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:"/system/releases",children:Object(Nn.jsx)(ds,{})}),Object(Nn.jsx)(l.c,{path:"/system/*",children:Object(Nn.jsx)(l.b,{to:Ra})})]})},ms=function(e){var t=e.type,n=e.columns,r=e.state,c=e.update,i=e.loader,s=e.searchAll,o=Object($.capitalize)(t),l=Object(a.useMemo)((function(){return ue(r.data)}),[r.data]),u=Object(a.useCallback)((function(e,t){c(t)}),[c]);return Object(Nn.jsxs)(Be.a,{fluid:!0,children:[Object(Nn.jsx)(_a.a,{children:Object(Nn.jsxs)("title",{children:["Wanted ",o," - Bazarr"]})}),Object(Nn.jsx)(tr,{children:Object(Nn.jsx)(tr.AsyncButton,{disabled:0===l.length,promise:s,onSuccess:c,icon:Te.R,children:"Search All"})}),Object(Nn.jsx)(Ee.a,{children:Object(Nn.jsx)(ua,{async:!0,asyncState:r,asyncId:le,asyncLoader:i,emptyText:"No Missing ".concat(o," Subtitles"),columns:n,externalUpdate:u,data:l})})]})},gs=function(){var e=function(){var e=an(Lt);return sn(rn((function(e){return e.movie.wantedMovieList})),e)}(),t=Object(Z.a)(e,2),n=t[0],r=t[1],c=an(Rt),i=Object(a.useCallback)((function(){return Je.action({action:"search-wanted"})}),[]),s=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"title",Cell:function(e){var t="/movies/".concat(e.row.original.radarrId);return Object(Nn.jsx)(u.b,{to:t,children:Object(Nn.jsx)("span",{children:e.value})})}},{Header:"Missing",accessor:"missing_subtitles",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original,c=a.hearing_impaired,i=a.radarrId;return n.map((function(e,n){return Object(Nn.jsxs)(Yn,{as:Vn.a,className:"mx-1 mr-2",variant:"secondary",promise:function(){return Je.downloadSubtitles(i,{language:e.code2,hi:c,forced:!1})},onSuccess:function(){return r&&r(t,i)},children:[Object(Nn.jsx)(ha,{className:"pr-1",text:e}),Object(Nn.jsx)(Me.a,{size:"sm",icon:Te.R})]},je(n,e.code2))}))}}]}),[]);return Object(Nn.jsx)(ms,{type:"movies",columns:s,state:n,update:r,loader:c,searchAll:i})},ys=function(){var e=function(){var e=an(Zt);return sn(rn((function(e){return e.series.wantedEpisodesList})),e)}(),t=Object(Z.a)(e,2),n=t[0],r=t[1],c=an(Jt),i=Object(a.useCallback)((function(){return $e.action({action:"search-wanted"})}),[]),s=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"seriesTitle",Cell:function(e){var t="/series/".concat(e.row.original.sonarrSeriesId);return Object(Nn.jsx)(u.b,{to:t,children:Object(Nn.jsx)("span",{children:e.value})})}},{Header:"Episode",accessor:"episode_number"},{accessor:"episodeTitle"},{Header:"Missing",accessor:"missing_subtitles",Cell:function(e){var t=e.row,n=e.externalUpdate,r=e.value,a=t.original,c=a.hearing_impaired,i=a.sonarrSeriesId,s=a.sonarrEpisodeId;return r.map((function(e,r){return Object(Nn.jsxs)(Yn,{as:Vn.a,className:"mx-1 mr-2",variant:"secondary",promise:function(){return Ve.downloadSubtitles(i,s,{language:e.code2,hi:c,forced:!1})},onSuccess:function(){return n&&n(t,s)},children:[Object(Nn.jsx)(ha,{className:"pr-1",text:e}),Object(Nn.jsx)(Me.a,{size:"sm",icon:Te.R})]},je(r,e.code2))}))}}]}),[]);return Object(Nn.jsx)(ms,{type:"series",columns:s,state:n,update:r,loader:c,searchAll:i})},ks=function(){var e=gn(),t=yn();return Object(Nn.jsxs)(l.e,{children:[e&&Object(Nn.jsx)(l.c,{exact:!0,path:"/wanted/series",children:Object(Nn.jsx)(ys,{})}),t&&Object(Nn.jsx)(l.c,{exact:!0,path:"/wanted/movies",children:Object(Nn.jsx)(gs,{})}),Object(Nn.jsx)(l.c,{path:"/wanted/*",children:Object(Nn.jsx)(l.b,{to:Ra})})]})},Ss=function(e){var t=e.className,n=gn(),r=yn(),c=Object(a.useMemo)((function(){return n?"/series":r?"/movies":"/settings"}),[n,r]),i=Object(l.h)();return Object(a.useEffect)((function(){he()}),[i.location]),Object(Nn.jsx)("div",{className:t,children:Object(Nn.jsxs)(l.e,{children:[Object(Nn.jsx)(l.c,{exact:!0,path:"/",children:Object(Nn.jsx)(l.b,{exact:!0,to:c})}),n&&Object(Nn.jsx)(l.c,{path:"/series",children:Object(Nn.jsx)(Ac,{})}),r&&Object(Nn.jsx)(l.c,{path:"/movies",children:Object(Nn.jsx)(kc,{})}),Object(Nn.jsx)(l.c,{path:"/wanted",children:Object(Nn.jsx)(ks,{})}),Object(Nn.jsx)(l.c,{path:"/history",children:Object(Nn.jsx)(lc,{})}),Object(Nn.jsx)(l.c,{path:"/blacklist",children:Object(Nn.jsx)(qa,{})}),Object(Nn.jsx)(l.c,{path:"/settings",children:Object(Nn.jsx)(ns,{})}),Object(Nn.jsx)(l.c,{path:"/system",children:Object(Nn.jsx)(vs,{})}),Object(Nn.jsx)(l.c,{exact:!0,path:Ra,children:Object(Nn.jsx)(La,{})}),Object(Nn.jsx)(l.c,{path:"*",children:Object(Nn.jsx)(l.b,{to:Ra})})]})})},ws=c.a.createContext((function(){})),Cs=function(e){var t=e.children;return Object(Nn.jsx)(Be.a,{className:"my-3",children:Object(Nn.jsxs)(ze.a,{className:"d-flex flex-nowrap justify-content-between align-items-center",variant:"danger",children:[Object(Nn.jsxs)("div",{children:[Object(Nn.jsx)(Me.a,{className:"mr-2",icon:Te.t}),Object(Nn.jsx)("span",{children:t})]}),Object(Nn.jsx)(Ke.a,{variant:"outline-danger",onClick:be,children:"Reload"})]})})},Ns=function(){var e=an(wt),t=rn((function(e){return e.site})),n=t.initialized,r=t.auth,c=mn("has-update",10),i=window.Bazarr.hasUpdate;Object(a.useEffect)((function(){n&&i&&c({type:"info",message:"A new version of Bazarr is ready, restart is required"})}),[n,i,c]),Object(a.useEffect)((function(){e()}),[e]);var s=Object(a.useState)(!1),o=Object(Z.a)(s,2),u=o[0],d=o[1],j=Object(a.useCallback)((function(){return d(!u)}),[u]);if(!r)return Object(Nn.jsx)(l.b,{to:"/login"});if("boolean"===typeof n&&!1===n)return Object(Nn.jsx)(ba,{children:Object(Nn.jsx)("span",{children:"Please wait"})});if("string"===typeof n)return Object(Nn.jsx)(Cs,{children:n});try{return Object(Nn.jsxs)(ws.Provider,{value:j,children:[Object(Nn.jsx)(Ee.a,{noGutters:!0,className:"header-container",children:Object(Nn.jsx)(Ba,{})}),Object(Nn.jsxs)(Ee.a,{noGutters:!0,className:"flex-nowrap",children:[Object(Nn.jsx)(Aa,{open:u}),Object(Nn.jsx)(jr,{children:Object(Nn.jsx)(Ss,{className:"d-flex flex-row flex-grow-1 main-router"})})]}),Object(Nn.jsx)(Da,{})]})}catch(b){return Object(Nn.jsxs)(Be.a,{className:"d-flex flex-column align-items-center my-5",children:[Object(Nn.jsxs)("h1",{children:[Object(Nn.jsx)(Me.a,{className:"mr-2",icon:Ae.g}),"Ouch! UI is crashed!"]}),Object(Nn.jsx)(Ke.a,{href:"https://github.com/morpheus65535/bazarr/issues/new/choose",target:"_blank",variant:"light",children:"Report Issue"})]})}},Is=(n(474),function(){var e=Object(a.useState)(""),t=Object(Z.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(""),i=Object(Z.a)(c,2),s=i[0],o=i[1],u=Object(a.useState)(""),d=Object(Z.a)(u,2),j=d[0],b=d[1],h=Object(a.useState)(!1),O=Object(Z.a)(h,2),f=O[0],p=O[1],x=Object(a.useCallback)((function(e){b(e),setTimeout((function(){return b("")}),2e3)}),[]),v=an(Pt),m=rn((function(e){return e.site.auth})),g=Object(a.useCallback)((function(){p(!1),x("Login Failed")}),[x]);return m?Object(Nn.jsx)(l.b,{to:"/"}):Object(Nn.jsx)("div",{className:"d-flex bg-light vh-100 justify-content-center align-items-center",children:Object(Nn.jsx)(Yc.a,{className:"auth-card shadow",children:Object(Nn.jsxs)(Tn.a,{onSubmit:function(e){e.preventDefault(),f||(p(!0),tt.login(n,s).then(v).catch(g))},children:[Object(Nn.jsxs)(Yc.a.Body,{children:[Object(Nn.jsx)(Tn.a.Group,{className:"mb-5 d-flex justify-content-center",children:Object(Nn.jsx)(fa.a,{width:"64",height:"64",src:"data:image/png;base64,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"})}),Object(Nn.jsx)(Tn.a.Group,{children:Object(Nn.jsx)(Tn.a.Control,{disabled:f,name:"username",type:"text",placeholder:"Username",required:!0,onChange:function(e){return r(e.currentTarget.value)}})}),Object(Nn.jsx)(Tn.a.Group,{children:Object(Nn.jsx)(Tn.a.Control,{disabled:f,name:"password",type:"password",placeholder:"Password",required:!0,onChange:function(e){return o(e.currentTarget.value)}})}),Object(Nn.jsx)(ma.a,{in:0!==j.length,children:Object(Nn.jsx)("div",{children:Object(Nn.jsx)(ze.a,{variant:"danger",className:"m-0",children:j})})})]}),Object(Nn.jsx)(Yc.a.Footer,{children:Object(Nn.jsx)(Ke.a,{type:"submit",disabled:f,block:!0,children:f?Object(Nn.jsx)(Cn.a,{size:"sm",animation:"border"}):"LOGIN"})})]})})})}),Ps=function(){var e=ae();return Object(Nn.jsx)(u.a,{basename:e,children:Object(Nn.jsxs)(l.e,{children:[Object(Nn.jsx)(l.c,{exact:!0,path:"/login",children:Object(Nn.jsx)(Is,{})}),Object(Nn.jsx)(l.c,{path:"/",children:Object(Nn.jsx)(Ns,{})})]})})};s.a.render(Object(Nn.jsx)(o.a,{store:Pe,children:Object(Nn.jsx)(Ps,{})}),document.getElementById("root"))}},[[475,1,2]]]); //# sourceMappingURL=main.e1468c5f.chunk.js.map