(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["songs"],{"059f":function(t,e,n){"use strict";n("4c3a")},"4c3a":function(t,e,n){},"82d2":function(t,e,n){"use strict";n.r(e);var s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"outgoing"},[n("v-container",[n("PageTitle"),n("SongsTable")],1)],1)},i=[],a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("v-data-table",{staticClass:"elevation-2",attrs:{headers:t.columns,items:t.songs,"disable-pagination":!0,"disable-sort":!0,"item-key":"id","show-expand":"","single-expand":"",expanded:t.expanded},on:{"update:expanded":function(e){t.expanded=e}},scopedSlots:t._u([{key:"item.songwriting",fn:function(e){var s=e.item;return[n("div",{staticClass:"percentage",class:{over:s.songwriting>100,full:100===s.songwriting,partial:s.songwriting>0,none:!s.songwriting}},[t._v(t._s(s.formatted.songwriting))])]}},{key:"item.mastering",fn:function(e){var s=e.item;return[n("div",{staticClass:"percentage",class:{over:s.mastering>100,full:100===s.mastering,partial:s.mastering>0,none:!s.mastering}},[t._v(t._s(s.formatted.mastering))])]}},{key:"item.publishing",fn:function(e){var s=e.item;return[n("div",{staticClass:"percentage",class:{over:s.publishing>100,full:100===s.publishing,partial:s.publishing>0,none:!s.publishing}},[t._v(t._s(s.formatted.publishing))])]}},{key:"item.full_royalties",fn:function(e){var s=e.item;return[n("div",{staticClass:"royalties-status"},[n("v-icon",{directives:[{name:"show",rawName:"v-show",value:s.full_royalties,expression:"item.full_royalties"}],staticClass:"full-royalties"},[t._v("mdi-check")]),n("v-icon",{directives:[{name:"show",rawName:"v-show",value:!s.full_royalties,expression:"!item.full_royalties"}],staticClass:"not-full-royalties"},[t._v("mdi-close")])],1)]}},{key:"expanded-item",fn:function(e){var s=e.headers;e.item;return[n("td",{staticClass:"details",attrs:{colspan:s.length}},[n("v-data-table",{staticClass:"elevation-0",attrs:{headers:t.columnsDropdown,items:t.people,"disable-pagination":!0,"disable-sort":!0,"item-key":"id"},scopedSlots:t._u([{key:"item.songwriting",fn:function(e){var s=e.item;return[n("div",{staticClass:"percentage"},[t._v(t._s(s.formatted.songwriting))])]}},{key:"item.mastering",fn:function(e){var s=e.item;return[n("div",{staticClass:"percentage"},[t._v(t._s(s.formatted.mastering))])]}},{key:"item.publishing",fn:function(e){var s=e.item;return[n("div",{staticClass:"percentage"},[t._v(t._s(s.formatted.publishing))])]}}],null,!0)})],1)]}},{key:"header.name",fn:function(e){var s=e.header;return[t._v(t._s(s.text)),n("v-menu",{attrs:{"close-on-content-click":!1},on:{input:function(e){return t.hide(e,"name")}},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on,i=e.attrs;return[n("v-icon",t._g(t._b({class:{active:t.filters.name.value}},"v-icon",i,!1),s),[t._v("mdi-magnify")])]}}],null,!0),model:{value:t.filters.name.dropdown,callback:function(e){t.$set(t.filters.name,"dropdown",e)},expression:"filters.name.dropdown"}},[n("div",{staticClass:"v-menu__content--filter"},[n("v-subheader",[t._v("Song name")]),n("v-text-field",{attrs:{label:"Filter by name",dense:""},model:{value:t.filters.name.input,callback:function(e){t.$set(t.filters.name,"input",e)},expression:"filters.name.input"}}),n("v-btn",{attrs:{color:"primary"},on:{click:function(e){return t.filter("name")}}},[t._v("Filter")]),n("v-btn",{directives:[{name:"show",rawName:"v-show",value:t.filters.name.value,expression:"filters.name.value"}],attrs:{color:"primary",small:"",text:""},on:{click:function(e){return t.reset("name")}}},[t._v("Reset")])],1)])]}},{key:"header.artist",fn:function(e){var s=e.header;return[t._v(t._s(s.text)),n("v-menu",{staticClass:"artists-filter",attrs:{"close-on-content-click":!1},on:{input:function(e){return t.hide(e,"artists")}},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on,i=e.attrs;return[n("v-icon",t._g(t._b({class:{active:t.filters.artists.value.length}},"v-icon",i,!1),s),[t._v("mdi-filter")])]}}],null,!0),model:{value:t.filters.artists.dropdown,callback:function(e){t.$set(t.filters.artists,"dropdown",e)},expression:"filters.artists.dropdown"}},[n("div",{staticClass:"v-menu__content--filter"},[n("v-list",{attrs:{dense:""}},[n("v-subheader",[t._v("Artists")]),n("v-autocomplete",{attrs:{items:t.artists,"item-text":"name","item-value":"id",multiple:""},on:{input:t.filterByArtists},scopedSlots:t._u([{key:"selection",fn:function(e){var s=e.item,i=e.index;return[0===i?n("v-chip",[n("span",[t._v(t._s(s.name))])]):t._e(),1===i?n("span",{staticClass:"grey--text text-caption"},[t._v("(+"+t._s(t.filters.artists.input.length-1)+" hidden)")]):t._e()]}}],null,!0),model:{value:t.filters.artists.input,callback:function(e){t.$set(t.filters.artists,"input",e)},expression:"filters.artists.input"}})],1),n("v-btn",{directives:[{name:"show",rawName:"v-show",value:t.filters.artists.value.length,expression:"filters.artists.value.length"}],attrs:{color:"primary",small:"",text:""},on:{click:function(e){return t.reset("artists")}}},[t._v("Reset")])],1)])]}},{key:"header.full_royalties",fn:function(e){var s=e.header;return[n("div",{staticClass:"full-royalties-title"},[t._v(t._s(s.text)),n("v-menu",{attrs:{"close-on-content-click":!1},on:{input:function(e){return t.hide(e,"not_full")}},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on,i=e.attrs;return[n("v-icon",t._g(t._b({class:{active:t.filters.not_full.value}},"v-icon",i,!1),s),[t._v("mdi-filter")])]}}],null,!0),model:{value:t.filters.not_full.dropdown,callback:function(e){t.$set(t.filters.not_full,"dropdown",e)},expression:"filters.not_full.dropdown"}},[n("div",{staticClass:"v-menu__content--filter"},[n("v-subheader",[t._v("Filter by royalty status")]),n("v-checkbox",{attrs:{label:"Songs without full royalties only",dense:""},model:{value:t.filters.not_full.input,callback:function(e){t.$set(t.filters.not_full,"input",e)},expression:"filters.not_full.input"}}),n("v-btn",{attrs:{color:"primary"},on:{click:function(e){return t.filter("not_full")}}},[t._v("Filter")]),n("v-btn",{directives:[{name:"show",rawName:"v-show",value:t.filters.not_full.value,expression:"filters.not_full.value"}],attrs:{color:"primary",small:"",text:""},on:{click:function(e){return t.reset("not_full")}}},[t._v("Reset")])],1)])],1)]}}])}),n("v-pagination",{attrs:{circle:"",length:t.songData.total_pages,"total-visible":"10"},model:{value:t.filters.page.value,callback:function(e){t.$set(t.filters.page,"value",e)},expression:"filters.page.value"}})],1)},r=[],l=n("1da1"),o=n("53ca"),u=n("5530"),c=(n("96cf"),n("2f62")),f={data:function(){return{filters:{name:{dropdown:!1,value:null,input:null},artists:{dropdown:!1,value:[],input:[]},not_full:{dropdown:!1,value:!1,input:!1},page:{value:1}},shown:null,expanded:[],people:[],columns:[],columnsDropdown:[]}},computed:Object(u["a"])({},Object(c["c"])({songData:function(t){return t.songs.fullSongs},songs:function(t){return t.songs.fullSongs.items},artists:function(t){return t.songs.artists}})),methods:{filter:function(t){this.filters[t].value=this.filters[t].input,this.filters[t].dropdown=!1,this.filters.page.value=1,this.getSongs()},filterByArtists:function(){this.filters.artists.value=this.filters.artists.input,this.filters.page.value=1,this.getSongs()},reset:function(t){"object"===Object(o["a"])(this.filters[t].value)?(this.filters[t].input=[],this.filters[t].value=[]):(this.filters[t].input=null,this.filters[t].value=null),this.filters[t].dropdown=!1,this.filters.page.value=1,this.getSongs()},hide:function(t,e){t||(this.filters[e].input=this.filters[e].value)},setupTable:function(){this.columns=[{text:"Name",value:"name"},{text:"Artist",value:"artist"},{text:"Songwriting",value:"songwriting"},{text:"Publishing",value:"publishing"},{text:"Master",value:"mastering"},{text:"Full royalties",value:"full_royalties"},{text:"Expand",value:"data-table-expand"}],this.columnsDropdown=[{text:"ID",value:"id"},{text:"Name",value:"name"},{text:"Songwriting",value:"songwriting"},{text:"Publishing",value:"publishing"},{text:"Master",value:"mastering"}]},getSongs:function(){var t=this;return Object(l["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("songs/getFullSongs",t.filters);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))()},getPeopleForSong:function(){var t=this;return Object(l["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("songs/getPeopleForSong",t.shown);case 2:t.people=e.sent;case 3:case"end":return e.stop()}}),e)})))()}},mounted:function(){var t=this;return Object(l["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getSongs();case 2:t.setupTable();case 3:case"end":return e.stop()}}),e)})))()},watch:{expanded:function(t){var e=this;return Object(l["a"])(regeneratorRuntime.mark((function n(){var s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return s=t[0],e.shown=s.id,e.people=[],n.next=5,e.getPeopleForSong();case 5:case"end":return n.stop()}}),n)})))()},"filters.page.value":function(){this.getSongs()},$route:{handler:function(){this.getSongs()},immediate:!0}}},v=f,d=(n("059f"),n("2877")),p=n("6544"),m=n.n(p),g=n("c6a6"),h=n("8336"),_=n("ac7c"),w=n("cc20"),b=n("8fea"),x=n("132d"),y=n("8860"),k=n("e449"),S=n("891e"),C=n("e0c7"),V=n("8654"),$=Object(d["a"])(v,a,r,!1,null,"bf1cc0a4",null),R=$.exports;m()($,{VAutocomplete:g["a"],VBtn:h["a"],VCheckbox:_["a"],VChip:w["a"],VDataTable:b["a"],VIcon:x["a"],VList:y["a"],VMenu:k["a"],VPagination:S["a"],VSubheader:C["a"],VTextField:V["a"]});var j=n("89dd"),F={components:{PageTitle:j["a"],SongsTable:R}},O=F,P=n("a523"),T=Object(d["a"])(O,s,i,!1,null,null,null);e["default"]=T.exports;m()(T,{VContainer:P["a"]})}}]);
//# sourceMappingURL=songs.ac3591ca.js.map