text: (window.webpackJsonp=window.webpackJsonp||[]).push([[14],{r1hw:function(n,l,t){"use strict";t.r(l);var e=t("CcnG"),a=t("mrSG"),o=t("ZZ/e"),i=t("OZIg"),u=t("/kET"),r=t("3Nzo"),c=t("277d"),d=t("DHcw"),s=function(){function n(n,l,t,e,a,o){this.activatedRoute=n,this.tracksService=l,this.nav=t,this.toastController=e,this.xlate=a,this.ytDownloadService=o}return n.prototype.ngOnInit=function(){if(this.trackIndex=Number(this.activatedRoute.snapshot.paramMap.get("index")),this.track={name:"",videoUrl:"",markers:[]},-1!==this.trackIndex){var n=this.tracksService.tracks[this.trackIndex];this.track.name=n.name,this.track.videoUrl=n.videoUrl}},n.prototype.ionViewWillEnter=function(){var n=Object(u.a)();n&&(this.track.videoUrl=n.id.videoId,this.track.name||(this.track.name=n.snippet.title),Object(u.b)(void 0))},n.prototype.addTrack=function(){var n=this,l=!1;if(this.file)this.tracksService.addFileTrack(this.file,this.track.name),l=!0;else{if(-1!==this.trackIndex){var t=this.tracksService.tracks[this.trackIndex];t.name=this.track.name,t.videoUrl=this.track.videoUrl}else l=!0,this.tracksService.tracks.push(a.a({},this.track));this.tracksService.saveTracks()}setTimeout(function(){var t=n.nav.pop();l&&t.then(function(){return n.nav.navigateRoot(["/track",n.tracksService.tracks.length-1])})})},n.prototype.ytSearch=function(){this.nav.navigateForward("/yt-search")},n.prototype.onFileChanged=function(n){this.file=n.target.files[0],this.track.name=this.file.name},n.prototype.ytDownload=function(n){return a.b(this,void 0,void 0,function(){return a.d(this,function(l){switch(l.label){case 0:return this.downloading?[2]:(this.downloading=!0,[4,this.ytDownloadService.initateDownload(Object(c.a)(n))]);case 1:return l.sent()?[3,3]:[4,this.toastController.create({message:this.xlate.transform("C_YT_DOWNLOAD_ERROR"),showCloseButton:!0,closeButtonText:"\u2716",duration:4e3})];case 2:l.sent().present(),l.label=3;case 3:return this.downloading=!1,[2]}})})},n}(),b=function(){return function(){}}(),g=t("pMnS"),h=t("oBZk"),p=t("gIcY"),k=t("ZYCi"),v=e.qb({encapsulation:0,styles:[[".add-track-content[_ngcontent-%COMP%]{padding:16px;display:grid;grid-template-columns:auto 35px}.add-track-content[_ngcontent-%COMP%]   ion-input[_ngcontent-%COMP%]{grid-column:1}.add-track-content[_ngcontent-%COMP%]   ion-input[_ngcontent-%COMP%]:nth-child(2){color:#aaa}.add-track-content[_ngcontent-%COMP%]   ion-icon[_ngcontent-%COMP%]{grid-column:2;justify-self:end;font-size:25pt;position:relative;top:-35px;cursor:pointer}.add-track-content[_ngcontent-%COMP%]   .progress[_ngcontent-%COMP%]{grid-column:2;justify-self:end;position:relative;top:-35px}.add-track-content[_ngcontent-%COMP%]   .progress.hidden[_ngcontent-%COMP%]{visibility:hidden}.add-track-content[_ngcontent-%COMP%]   ion-icon[name=search][_ngcontent-%COMP%]{color:#aaa}.add-track-content[_ngcontent-%COMP%]   ion-icon[name=download][_ngcontent-%COMP%]{position:relative;top:-37px;color:var(--ion-color-primary);cursor:pointer}.add-track-content[_ngcontent-%COMP%]   ion-icon[name=download].hidden[_ngcontent-%COMP%]{visibility:hidden}.add-track-content[_ngcontent-%COMP%]   ion-button[_ngcontent-%COMP%]{grid-column:1/3}.add[_ngcontent-%COMP%]{margin-top:20px}.local-audio-file[_ngcontent-%COMP%]{margin-top:35px;font-size:smaller}.local-audio-file[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;padding-bottom:4px}"]],data:{}});function C(n){return e.Lb(0,[e.Eb(0,d.a,[]),(n()(),e.sb(1,0,null,null,7,"ion-header",[],null,null,null,h.x,h.f)),e.rb(2,49152,null,0,o.A,[e.h,e.k,e.z],null,null),(n()(),e.sb(3,0,null,0,5,"ion-toolbar",[],null,null,null,h.J,h.r)),e.rb(4,49152,null,0,o.Ab,[e.h,e.k,e.z],null,null),(n()(),e.sb(5,0,null,0,3,"ion-title",[],null,null,null,h.I,h.q)),e.rb(6,49152,null,0,o.yb,[e.h,e.k,e.z],null,null),(n()(),e.Jb(7,0,["",""])),e.Fb(8,1),(n()(),e.sb(9,0,null,null,33,"ion-content",[],null,null,null,h.u,h.c)),e.rb(10,49152,null,0,o.t,[e.h,e.k,e.z],null,null),(n()(),e.sb(11,0,null,0,31,"div",[["class","add-track-content"]],null,null,null,null,null)),(n()(),e.sb(12,0,null,null,7,"ion-input",[["clear-input",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"ionBlur"],[null,"ionChange"]],function(n,l,t){var a=!0,o=n.component;return"ionBlur"===l&&(a=!1!==e.Db(n,13)._handleBlurEvent()&&a),"ionChange"===l&&(a=!1!==e.Db(n,13)._handleInputEvent(t.target.value)&&a),"ngModelChange"===l&&(a=!1!==(o.track.name=t)&&a),a},h.z,h.h)),e.rb(13,16384,null,0,o.Ib,[e.k],null,null),e.Gb(1024,null,p.b,function(n){return[n]},[o.Ib]),e.rb(15,671744,null,0,p.e,[[8,null],[8,null],[8,null],[6,p.b]],{model:[0,"model"]},{update:"ngModelChange"}),e.Gb(2048,null,p.c,null,[p.e]),e.rb(17,16384,null,0,p.d,[[4,p.c]],null,null),e.rb(18,49152,null,0,o.F,[e.h,e.k,e.z],{placeholder:[0,"placeholder"]},null),e.Fb(19,1),(n()(),e.sb(20,0,null,null,7,"ion-input",[["clear-input",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"ionBlur"],[null,"ionChange"]],function(n,l,t){var a=!0,o=n.component;return"ionBlur"===l&&(a=!1!==e.Db(n,21)._handleBlurEvent()&&a),"ionChange"===l&&(a=!1!==e.Db(n,21)._handleInputEvent(t.target.value)&&a),"ngModelChange"===l&&(a=!1!==(o.track.videoUrl=t)&&a),a},h.z,h.h)),e.rb(21,16384,null,0,o.Ib,[e.k],null,null),e.Gb(1024,null,p.b,function(n){return[n]},[o.Ib]),e.rb(23,671744,null,0,p.e,[[8,null],[8,null],[8,null],[6,p.b]],{model:[0,"model"]},{update:"ngModelChange"}),e.Gb(2048,null,p.c,null,[p.e]),e.rb(25,16384,null,0,p.d,[[4,p.c]],null,null),e.rb(26,49152,null,0,o.F,[e.h,e.k,e.z],{placeholder:[0,"placeholder"]},null),e.Fb(27,1),(n()(),e.sb(28,0,null,null,1,"ion-icon",[["name","search"]],null,[[null,"click"]],function(n,l,t){var e=!0;return"click"===l&&(e=!1!==n.component.ytSearch()&&e),e},h.y,h.g)),e.rb(29,49152,null,0,o.B,[e.h,e.k,e.z],{name:[0,"name"]},null),(n()(),e.sb(30,0,null,null,1,"ion-icon",[["name","download"]],[[2,"hidden",null]],[[null,"click"]],function(n,l,t){var e=!0,a=n.component;return"click"===l&&(e=!1!==a.ytDownload(a.track.videoUrl)&&e),e},h.y,h.g)),e.rb(31,49152,null,0,o.B,[e.h,e.k,e.z],{name:[0,"name"]},null),(n()(),e.sb(32,0,null,null,1,"ion-progress-bar",[["class","progress"],["type","indeterminate"]],[[2,"hidden",null]],null,null,h.G,h.o)),e.rb(33,49152,null,0,o.X,[e.h,e.k,e.z],{type:[0,"type"]},null),(n()(),e.sb(34,0,null,null,3,"ion-button",[["class","add"]],null,[[null,"click"]],function(n,l,t){var e=!0;return"click"===l&&(e=!1!==n.component.addTrack()&&e),e},h.t,h.b)),e.rb(35,49152,null,0,o.j,[e.h,e.k,e.z],{disabled:[0,"disabled"]},null),(n()(),e.Jb(36,0,[" ",""])),e.Fb(37,1),(n()(),e.sb(38,0,null,null,4,"div",[["class","local-audio-file"]],null,null,null,null,null)),(n()(),e.sb(39,0,null,null,2,"label",[],null,null,null,null,null)),(n()(),e.Jb(40,null,["",""])),e.Fb(41,1),(n()(),e.sb(42,0,null,null,0,"input",[["accept","audio/*"],["type","file"]],null,[[null,"change"]],function(n,l,t){var e=!0;return"change"===l&&(e=!1!==n.component.onFileChanged(t)&&e),e},null,null))],function(n,l){var t=l.component;n(l,15,0,t.track.name);var a=e.Kb(l,18,0,n(l,19,0,e.Db(l,0),"C_NAME"));n(l,18,0,a),n(l,23,0,t.track.videoUrl);var o=e.Kb(l,26,0,n(l,27,0,e.Db(l,0),"C_YT_OR_VIDEO_ID"));n(l,26,0,o),n(l,29,0,"search"),n(l,31,0,"download"),n(l,33,0,"indeterminate"),n(l,35,0,!t.track.name||!t.track.videoUrl&&!t.file)},function(n,l){var t=l.component,a=e.Kb(l,7,0,n(l,8,0,e.Db(l,0),t.trackIndex<0?"C_ADD_TRACK":"C_EDIT_TRACK"));n(l,7,0,a),n(l,12,0,e.Db(l,17).ngClassUntouched,e.Db(l,17).ngClassTouched,e.Db(l,17).ngClassPristine,e.Db(l,17).ngClassDirty,e.Db(l,17).ngClassValid,e.Db(l,17).ngClassInvalid,e.Db(l,17).ngClassPending),n(l,20,0,e.Db(l,25).ngClassUntouched,e.Db(l,25).ngClassTouched,e.Db(l,25).ngClassPristine,e.Db(l,25).ngClassDirty,e.Db(l,25).ngClassValid,e.Db(l,25).ngClassInvalid,e.Db(l,25).ngClassPending),n(l,30,0,!t.track.videoUrl),n(l,32,0,!t.downloading);var o=e.Kb(l,36,0,n(l,37,0,e.Db(l,0),t.trackIndex<0?"C_ADD":"C_SAVE"));n(l,36,0,o);var i=e.Kb(l,40,0,n(l,41,0,e.Db(l,0),"C_LOCAL_AUDIO_FILE"));n(l,40,0,i)})}function m(n){return e.Lb(0,[(n()(),e.sb(0,0,null,null,1,"app-add-track",[],null,null,null,C,v)),e.rb(1,114688,null,0,s,[k.a,i.a,o.Fb,o.Jb,d.a,r.a],null,null)],function(n,l){n(l,1,0)},null)}var f=e.ob("app-add-track",s,m,{},{},[]),_=t("Ip0R"),D=t("a6Df");t.d(l,"AddTrackPageModuleNgFactory",function(){return O});var O=e.pb(b,[],function(n){return e.Ab([e.Bb(512,e.j,e.ab,[[8,[g.a,f]],[3,e.j],e.x]),e.Bb(4608,_.l,_.k,[e.u,[2,_.r]]),e.Bb(4608,p.g,p.g,[]),e.Bb(4608,o.c,o.c,[e.z,e.g]),e.Bb(4608,o.Eb,o.Eb,[o.c,e.j,e.q]),e.Bb(4608,o.Hb,o.Hb,[o.c,e.j,e.q]),e.Bb(1073742336,_.b,_.b,[]),e.Bb(1073742336,D.a,D.a,[]),e.Bb(1073742336,p.f,p.f,[]),e.Bb(1073742336,p.a,p.a,[]),e.Bb(1073742336,o.Cb,o.Cb,[]),e.Bb(1073742336,k.n,k.n,[[2,k.s],[2,k.m]]),e.Bb(1073742336,b,b,[]),e.Bb(1024,k.k,function(){return[[{path:"",component:s}]]},[])])})}}]);