text: !function(e){var i={};function a(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=i,a.d=function(e,i,t){a.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,i){if(1&i&&(e=a(e)),8&i)return e;if(4&i&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&i&&"string"!=typeof e)for(var n in e)a.d(t,n,function(i){return e[i]}.bind(null,n));return t},a.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(i,"a",i),i},a.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},a.p="",a(a.s="wrxK")}({"+1Jo":function(e,i){e.exports=tui.require("totara_engage/components/icons/access/computed/AccessIcon")},"+MEP":function(e,i){e.exports=tui.require("tui/components/profile/MiniProfileCard")},"/UPp":function(e,i,a){"use strict";a.r(i);var t=a("yHtf"),n=a.n(t),r=a("zEvk"),l=a.n(r),s={components:{PlaylistSidePanel:n.a},mixins:[l.a],computed:{playlistId:function(){return this.pageProps.playlistId}}},d=(a("E4Xa"),a("KHd+")),o=Object(d.a)(s,(function(){var e=this.$createElement,i=this._self._c||e;return i("div",{staticClass:"tui-playlistSidePanelContent"},[i("PlaylistSidePanel",{attrs:{"playlist-id":this.playlistId,interactor:this.pageProps.interactor}})],1)}),[],!1,null,null,null);o.options.__hasBlocks={script:!0,template:!0};i.default=o.exports},"/hNZ":function(e,i){e.exports=tui.require("totara_playlist/components/page/HeaderBox")},"/ph4":function(e,i){},"0caj":function(e,i){e.exports=tui.require("totara_playlist/components/contribution/Adder")},"0hQ3":function(e,i){e.exports=tui.require("totara_playlist/components/CreatePlaylist")},"12HA":function(e,i){e.exports=tui.require("tui/config")},"1HKY":function(e,i){},"2okE":function(e,i,a){"use strict";a.r(i);var t=a("JMfZ"),n=a.n(t),r=a("HuWC"),l=a.n(r),s={components:{PlaylistPopover:n.a,StarRating:l.a},props:{owned:{type:Boolean,required:!0},count:{type:Number,required:!0},rating:{type:Number,required:!0},rated:{type:Boolean,required:!0}},data:function(){return{innerValue:null}},computed:{starTitle:function(){return this.count<=1?this.$str("numberofpersonrating","totara_engage",this.count):this.$str("numberofpeoplerating","totara_engage",this.count)},showRates:function(){return 1===this.count||0===this.count?this.$str("rating","totara_playlist"):this.$str("ratings","totara_playlist")},showRatingCount:function(){return this.count},showRating:function(){return this.rating},showPopover:function(){return!this.owned&&!this.rated}}},d=(a("Xapw"),a("KHd+")),o=function(e){e.options.__langStrings={totara_playlist:["rating","ratings"],totara_engage:["numberofpeoplerating","numberofpersonrating"]}},u=Object(d.a)(s,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",{staticClass:"tui-playlistStarRating"},[a("div",{staticClass:"tui-playlistStarRating__icon"},[a("StarRating",{attrs:{"read-only":!0,"max-rating":5,increment:.1,title:e.starTitle,rating:e.showRating}})],1),e._v(" "),a("div",[a("span",{staticClass:"tui-playlistStarRating__rates"},[e._v("\n      "+e._s(e.showRatingCount)+"\n    ")]),e._v("\n\n    "+e._s(e.showRates)+"\n\n    "),e.showPopover?a("PlaylistPopover",{on:{rating:function(i){e.$emit("rating",Math.ceil(e.innerValue))}},scopedSlots:e._u([{key:"content",fn:function(){return[a("StarRating",{attrs:{"read-only":!1,increment:1,"max-rating":5},model:{value:e.innerValue,callback:function(i){e.innerValue=i},expression:"innerValue"}})]},proxy:!0}],null,!1,506935594)}):e._e()],1)])}),[],!1,null,null,null);"function"==typeof o&&o(u),u.options.__hasBlocks={script:!0,template:!0};i.default=u.exports},"2wx7":function(e,i){e.exports=tui.require("editor_weka/components/Weka")},"3Eqo":function(e,i){e.exports=tui.require("totara_playlist/index")},"3Sc5":function(e,i,a){"use strict";a.r(i);var t=a("HuWC"),n={components:{StarRating:a.n(t).a},props:{playlistId:{type:[Number,String],required:!0},name:{type:String,required:!0},url:{type:String,default:function(){return this.$url("/totara/playlist/index.php",{id:this.playlistId})}},author:{type:String,required:!0},rating:{type:[String,Number],required:!0},ratedCount:{type:[String,Number],required:!0}},computed:{ratingTitle:function(){return this.ratedCount<=1?this.$str("numberofpersonrating","totara_engage",this.ratedCount):this.$str("numberofpeoplerating","totara_engage",this.ratedCount)}}},r=(a("IwbJ"),a("KHd+")),l=function(e){e.options.__langStrings={totara_playlist:["by_author"],totara_engage:["numberofpeoplerating","numberofpersonrating"]}},s=Object(r.a)(n,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",{staticClass:"tui-summaryPlaylistCard"},[a("div",{staticClass:"tui-summaryPlaylistCard__top"},[a("a",{staticClass:"tui-summaryPlaylistCard__title",attrs:{href:e.url}},[e._v("\n      "+e._s(e.name)+"\n    ")]),e._v(" "),a("StarRating",{staticClass:"tui-summaryPlaylistCard__stars",attrs:{"read-only":!0,"max-rating":5,increment:1,rating:e.rating,title:e.ratingTitle}})],1),e._v(" "),a("p",{staticClass:"tui-summaryPlaylistCard__author"},[e._v("\n    "+e._s(e.$str("by_author","totara_playlist",e.author))+"\n  ")])])}),[],!1,null,null,null);"function"==typeof l&&l(s),s.options.__hasBlocks={script:!0,template:!0};i.default=s.exports},"4Lp8":function(e,i){e.exports=tui.require("totara_engage/mixins/container_mixin")},"4ky8":function(e,i){e.exports=tui.require("totara_engage/components/card/compute/EngageCard")},"4yhk":function(e,i){e.exports=tui.require("totara_playlist/components/form/PlaylistForm")},"58tI":function(e,i){},"5It0":function(e,i,a){var t={"./PlaylistView":"W9cx","./PlaylistView.vue":"W9cx"};function n(e){var i=r(e);return a(i)}function r(e){if(!a.o(t,e)){var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}return t[e]}n.keys=function(){return Object.keys(t)},n.resolve=r,e.exports=n,n.id="5It0"},"5h9J":function(e,i){e.exports=tui.require("tui/components/buttons/ButtonIcon")},"5v9U":function(e,i){e.exports=tui.require("totara_comment/components/box/SidePanelCommentBox")},"6HxP":function(e,i){},"707M":function(e,i,a){"use strict";a.r(i);var t=a("kQ5c"),n=a.n(t),r=a("qyfC"),l=a.n(r),s=a("ccUt"),d=a.n(s),o=a("5h9J"),u=a.n(o),m=a("Xpd9"),c=a.n(m),k=a("HuWC"),v=a.n(k),p=a("oB6E"),g=a.n(p),y=a("in8C"),f=a.n(y),_=a("sxi1"),N=a.n(_),b=a("tyu8"),h=a("+1Jo"),F=a.n(h),S=a("bxuo"),x=a.n(S),V=a("vN5C"),C={components:{AccessIcon:F.a,BaseCard:n.a,BookmarkButton:x.a,ButtonIcon:u.a,CardHeader:d.a,CommentIcon:f.a,ImageHeader:l.a,MoreIcon:N.a,ShareIcon:g.a,StarRating:v.a,StatIcon:c.a},mixins:[b.cardMixin],data:function(){return{innerBookmarked:this.bookmarked,hovered:!1,extraData:JSON.parse(this.extra),statIcons:[]}},computed:{showRating:function(){return this.rating},starTitle:function(){return this.extraData.ratingCount<=1?this.$str("numberofpersonrating","totara_engage",this.extraData.ratingCount):this.$str("numberofpeoplerating","totara_engage",this.extraData.ratingCount)},imageStyle:function(){return{backgroundImage:"url(".concat(this.extraData.image,"})")}}},created:function(){this.$_setStatIcons()},methods:{$_handleHovered:function(e){this.hovered=e},$_handleShare:function(){},$_handleMoreActions:function(){},$_setStatIcons:function(){if(!b.AccessManager.isPrivate(this.access)){var e=[{type:"comment",icon:f.a,title:this.$str("numberofcomments","totara_engage",this.totalComments),statNumber:this.totalComments}];b.AccessManager.isRestricted(this.access)?this.statIcons=e:b.AccessManager.isPublic(this.access)&&(this.statIcons=e.concat({type:"share",icon:g.a,title:this.$str("numberofshares","totara_engage",this.sharedbycount),statNumber:this.sharedbycount}))}},updateBookmark:function(){this.innerBookmarked=!this.innerBookmarked,this.$apollo.mutate({mutation:V.a,refetchAll:!1,refetchQueries:["totara_playlist_playlist_links","totara_engage_contribution_cards"],variables:{itemid:this.instanceId,component:"totara_playlist",bookmarked:this.innerBookmarked}})}}},w=(a("6HxP"),a("KHd+")),P=function(e){e.options.__langStrings={totara_engage:["numberofcomments","numberofshares","share","more","numberofpeoplerating","numberofpersonrating"]}},A=Object(w.a)(C,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("BaseCard",{staticClass:"tui-playlistCard",attrs:{"data-card-unique":e.instanceId,href:e.url,"show-footnotes":e.showFootnotes,footnotes:e.footnotes},on:{"remove-resource":function(i){return e.$emit("remove-resource",i)},mouseover:function(i){return e.$_handleHovered(!0)},mouseleave:function(i){return e.$_handleHovered(!1)}}},[a("ImageHeader",{attrs:{slot:"header-image","show-cover":e.hovered},slot:"header-image"},[a("div",{staticClass:"tui-playlistCard__imageHeader",style:e.imageStyle,attrs:{slot:"image"},slot:"image"},[a("span",{staticClass:"sr-only"},[e._v(e._s(e.name))]),e._v(" "),a("div",{staticClass:"tui-playlistCard__numberOfResourcesContainer"},[a("div",{staticClass:"tui-playlistCard__numberOfResources"},[a("p",[e._v(e._s(e.extraData.resources))])])])]),e._v(" "),a("div",{staticClass:"tui-playlistCard__icons",attrs:{slot:"actions"},slot:"actions"},[a("ButtonIcon",{attrs:{"aria-label":e.$str("share","totara_engage"),styleclass:{primary:!1,circle:!0}},on:{click:function(i){return i.preventDefault(),e.$_handleShare(i)}}},[a("ShareIcon")],1),e._v(" "),e.extraData.actions?a("ButtonIcon",{attrs:{"aria-label":e.$str("more","totara_engage"),styleclass:{primary:!1,circle:!0}},on:{click:function(i){return i.preventDefault(),e.$_handleMoreActions(i)}}},[a("MoreIcon")],1):e._e()],1)]),e._v(" "),a("CardHeader",{staticClass:"tui-playlistCard__header",attrs:{slot:"header"},slot:"header"},[a("div",{staticClass:"tui-playlistCard__bar",attrs:{slot:"first"},slot:"first"},[e.showBookmark?a("BookmarkButton",{staticClass:"tui-playlistCard__bookmark",attrs:{size:"300",bookmarked:e.innerBookmarked,primary:!1,circle:!1,small:!0,transparent:!0},on:{click:e.updateBookmark}}):e._e()],1),e._v(" "),a("a",{staticClass:"tui-playlistCard__link",attrs:{slot:"second",href:e.url},slot:"second"},[a("h4",{staticClass:"tui-playlistCard__title",attrs:{id:e.labelId}},[e._v("\n        "+e._s(e.name)+"\n      ")])])]),e._v(" "),a("StarRating",{staticClass:"tui-playlistCard__rating",attrs:{slot:"info-content",rating:e.showRating,"read-only":!0,increment:.1,"max-rating":5,title:e.starTitle},slot:"info-content"}),e._v(" "),a("div",{staticClass:"tui-playlistCard__footer",attrs:{slot:"footer"},slot:"footer"},[e._l(e.statIcons,(function(e){return a("StatIcon",{key:e.type,attrs:{title:e.title,"stat-number":e.statNumber}},[a(e.icon,{tag:"component",attrs:{title:e.title}})],1)})),e._v(" "),a("AccessIcon",{attrs:{access:e.access,size:"300","custom-class":"tui-playlistCard__visibilityIcon"}})],2)],1)}),[],!1,null,null,null);"function"==typeof P&&P(A),A.options.__hasBlocks={script:!0,template:!0};i.default=A.exports},"9G+f":function(e,i){e.exports=tui.require("tui/components/popover/Popover")},"9IU1":function(e,i){e.exports=tui.require("totara_engage/components/page/LayoutOneColumnWithSidePanel")},"AEy+":function(e,i,a){"use strict";a.r(i);var t=a("4yhk"),n=a.n(t),r=a("K59g"),l=a.n(r),s=a("tyu8"),d={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_playlist_create_playlist"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"summary"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"summary_format"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"access"}},type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_access"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"contextid"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"topics"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shares"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_recipient_in"}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"playlist"},name:{kind:"Name",value:"totara_playlist_create"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"summary"},value:{kind:"Variable",name:{kind:"Name",value:"summary"}}},{kind:"Argument",name:{kind:"Name",value:"summary_format"},value:{kind:"Variable",name:{kind:"Name",value:"summary_format"}}},{kind:"Argument",name:{kind:"Name",value:"access"},value:{kind:"Variable",name:{kind:"Name",value:"access"}}},{kind:"Argument",name:{kind:"Name",value:"contextid"},value:{kind:"Variable",name:{kind:"Name",value:"contextid"}}},{kind:"Argument",name:{kind:"Name",value:"topics"},value:{kind:"Variable",name:{kind:"Name",value:"topics"}}},{kind:"Argument",name:{kind:"Name",value:"shares"},value:{kind:"Variable",name:{kind:"Name",value:"shares"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contextid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timedescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"HTML"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rated"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"updateable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contributable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totalresources"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"manageable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasnonpublicresources"},arguments:[],directives:[]}]}}]}}]},o=a("4Lp8"),u=a.n(o),m={components:{PlaylistForm:n.a,AccessForm:l.a},mixins:[u.a],data:function(){return{stage:0,maxStage:1,playlist:{name:null,summary:null,summary_format:null},submitting:!1,defaultAccess:"PRIVATE"}},computed:{privateDisabled:function(){return!!this.containerValues.access&&!s.AccessManager.isPrivate(this.containerValues.access)},restrictedDisabled:function(){return!!this.containerValues.access&&s.AccessManager.isPublic(this.containerValues.access)}},methods:{next:function(e){var i=e.name,a=e.summary,t=e.summary_format;this.stage<this.maxStage&&(this.stage+=1),this.playlist.name=i,this.playlist.summary=a,this.playlist.summary_format=t,this.$emit("hide-tabs",!0),this.$emit("change-title",this.stage)},back:function(){this.stage>0&&(this.stage-=1),this.$emit("hide-tabs",!1),this.$emit("change-title",this.stage)},done:function(e){var i=this,a=e.access,t=e.topics,n=e.shares;this.submitting||(this.submitting=!0,this.$apollo.mutate({mutation:d,variables:{name:this.playlist.name,summary:this.playlist.summary,summary_format:this.playlist.summary_format,access:a,topics:t.map((function(e){return e.id})),shares:n},update:function(e,a){var t=a.data.playlist;i.$emit("done",{id:t.id}),window.location.href=i.$url("/totara/playlist/index.php",{id:t.id})}}).then((function(){return i.$emit("cancel")})).finally((function(){return i.submitting=!1})))}}},c=(a("Q+cF"),a("KHd+")),k=Object(c.a)(m,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",{staticClass:"tui-createPlaylist"},[a("PlaylistForm",{directives:[{name:"show",rawName:"v-show",value:0===e.stage,expression:"stage === 0"}],on:{next:e.next,cancel:function(i){return e.$emit("cancel")},"unsaved-changes":function(i){return e.$emit("unsaved-changes")}}}),e._v(" "),a("AccessForm",{directives:[{name:"show",rawName:"v-show",value:1===e.stage,expression:"stage === 1"}],attrs:{"item-id":"0",component:"totara_playlist","show-back":!0,submitting:e.submitting,"selected-access":e.containerValues.access||e.defaultAccess,"private-disabled":e.privateDisabled,"restricted-disabled":e.restrictedDisabled,container:e.container,"enable-time-view":!1},on:{done:e.done,back:e.back,cancel:function(i){return e.$emit("cancel")}}})],1)}),[],!1,null,null,null);k.options.__hasBlocks={script:!0,template:!0};i.default=k.exports},BN8m:function(e,i){e.exports=tui.require("tui/components/buttons/ButtonGroup")},"C+/B":function(e,i){e.exports=tui.require("tui/components/modal/ConfirmationModal")},C3CV:function(e,i){e.exports=tui.require("totara_playlist/components/sidepanel/Related")},D9If:function(e,i){e.exports=tui.require("tui/components/grid/GridItem")},DaLk:function(e,i){e.exports=tui.require("tui/components/drag_drop/Draggable")},E4Xa:function(e,i){},EU6u:function(e,i){},FhEx:function(e,i){e.exports=tui.require("totara_engage/components/sidepanel/media/MediaSetting")},FoZm:function(e,i){e.exports=tui.require("tui/format")},GlpC:function(e,i){},"H/tB":function(e,i){e.exports=tui.require("tui/tui")},HuWC:function(e,i){e.exports=tui.require("totara_engage/components/icons/StarRating")},IwbJ:function(e,i){},JMfZ:function(e,i){e.exports=tui.require("totara_playlist/components/popover/PlaylistPopover")},JXQf:function(e,i){e.exports=tui.require("tui/components/loading/Loader")},K59g:function(e,i){e.exports=tui.require("totara_engage/components/form/AccessForm")},KGcv:function(e,i){e.exports=tui.require("tui/components/dropdown/DropdownItem")},"KHd+":function(e,i,a){"use strict";function t(e,i,a,t,n,r,l,s){var d,o="function"==typeof e?e.options:e;if(i&&(o.render=i,o.staticRenderFns=a,o._compiled=!0),t&&(o.functional=!0),r&&(o._scopeId="data-v-"+r),l?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(l)},o._ssrRegister=d):n&&(d=s?function(){n.call(this,(o.functional?this.parent:this).$root.$options.shadowRoot)}:n),d)if(o.functional){o._injectStyles=d;var u=o.render;o.render=function(e,i){return d.call(i),u(e,i)}}else{var m=o.beforeCreate;o.beforeCreate=m?[].concat(m,d):[d]}return{exports:e,options:o}}a.d(i,"a",(function(){return t}))},LBQM:function(e,i,a){"use strict";a.r(i);var t=a("yXPU"),n=a.n(t),r=a("o0o1"),l=a.n(r),s=a("YPxT"),d=a.n(s),o=a("ULOL"),u=a.n(o),m=a("Mnur"),c=a.n(m),k=a("12HA"),v={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"totara_playlist_resources"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"playlist_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"area"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_area"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"access"}},type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_access"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"topic"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"section"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"include_footnotes"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"footnotes_type"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"footnotes_item_id"}},type:{kind:"NamedType",name:{kind:"Name",value:"core_id"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"footnotes_area"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_area"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"footnotes_component"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"cursor"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"image_preview_mode"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"theme"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"resources"},name:{kind:"Name",value:"totara_playlist_resources"},arguments:[{kind:"Argument",name:{kind:"Name",value:"playlist_id"},value:{kind:"Variable",name:{kind:"Name",value:"playlist_id"}}},{kind:"Argument",name:{kind:"Name",value:"area"},value:{kind:"Variable",name:{kind:"Name",value:"area"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"access"},value:{kind:"Variable",name:{kind:"Name",value:"access"}}},{kind:"ObjectField",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}},{kind:"ObjectField",name:{kind:"Name",value:"topic"},value:{kind:"Variable",name:{kind:"Name",value:"topic"}}},{kind:"ObjectField",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}},{kind:"ObjectField",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}},{kind:"ObjectField",name:{kind:"Name",value:"section"},value:{kind:"Variable",name:{kind:"Name",value:"section"}}}]}},{kind:"Argument",name:{kind:"Name",value:"footnotes"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_type"}}},{kind:"ObjectField",name:{kind:"Name",value:"item_id"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_item_id"}}},{kind:"ObjectField",name:{kind:"Name",value:"area"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_area"}}},{kind:"ObjectField",name:{kind:"Name",value:"component"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_component"}}}]}},{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"Variable",name:{kind:"Name",value:"cursor"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"next"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"cards"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"instanceid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"component"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tuicomponent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imagetuicomponent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"image"},arguments:[{kind:"Argument",name:{kind:"Name",value:"theme"},value:{kind:"Variable",name:{kind:"Name",value:"theme"}}},{kind:"Argument",name:{kind:"Name",value:"preview_mode"},value:{kind:"Variable",name:{kind:"Name",value:"image_preview_mode"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"comments"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reactions"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timecreated"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"extra"},arguments:[{kind:"Argument",name:{kind:"Name",value:"theme"},value:{kind:"Variable",name:{kind:"Name",value:"theme"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"footnotes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_type"}}},{kind:"Argument",name:{kind:"Name",value:"item_id"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_item_id"}}},{kind:"Argument",name:{kind:"Name",value:"area"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_area"}}},{kind:"Argument",name:{kind:"Name",value:"component"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_component"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"include_footnotes"}}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"component"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tuicomponent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"props"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"interactor"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"can_bookmark"},arguments:[],directives:[]}]}}]}}]}}]}}]},p=a("ZTUP"),g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"totara_playlist_check_items_access"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"items"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_share_item"}}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"playlist_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"result"},name:{kind:"Name",value:"totara_playlist_check_items_access"},arguments:[{kind:"Argument",name:{kind:"Name",value:"items"},value:{kind:"Variable",name:{kind:"Name",value:"items"}}},{kind:"Argument",name:{kind:"Name",value:"playlist_id"},value:{kind:"Variable",name:{kind:"Name",value:"playlist_id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"warning"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]}]}}]}}]},y=a("pxdy"),f=a.n(y),_={components:{EngageAdderModal:d.a,EngagePrivacyWarningModal:u.a,ModalPresenter:c.a},mixins:[f.a],props:{playlistId:{type:[String,Number],required:!0},showAdder:Boolean},data:function(){return{showWarningModal:this.openWarningModal,privacyWarningMessage:"",privacyWarningSelection:""}},computed:{canAdd:function(){return!this.showWarningModal&&this.showAdder}},watch:{showAdder:function(e){this.skipCardsQuery=!e},openWarningModal:function(e){this.showWarningModal=e}},created:function(){this.skipCardsQuery=!0},apollo:{contribution:{query:v,fetchPolicy:"network-only",variables:function(){return Object.assign({},this.filterValue,{playlist_id:this.playlistId,area:"adder",include_footnotes:!1,image_preview_mode:"totara_engage_adder_thumbnail",theme:k.config.theme.name})},update:function(e){var i=e.resources,a=i.cursor,t=i.cards;return{cursor:a,cards:this.canContribute?this.$_addContributeCard(t):t}},skip:function(){return this.skipCardsQuery}}},methods:{processAddToPlaylist:function(e){var i=this;return n()(l.a.mark((function a(){var t,n,r,s;return l.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return t=e.map((function(e){return JSON.parse(e)})),a.next=3,i.checkAccessSetting(t);case 3:if(n=a.sent,r=n.warning,s=n.message,!r){a.next=11;break}return i.privacyWarningMessage=s,i.privacyWarningSelection=e,i.showWarningModal=!0,a.abrupt("return");case 11:return a.next=13,i.adderUpdate(e);case 13:case"end":return a.stop()}}),a)})))()},checkAccessSetting:function(e){var i=this;return n()(l.a.mark((function a(){var t,n,r,s;return l.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,i.$apollo.query({refetchQueries:["totara_playlist_cards","totara_playlist_get_playlist"],query:g,variables:{items:e,playlist_id:i.playlistId}});case 2:return t=a.sent,n=t.data.result,r=n.warning,s=n.message,a.abrupt("return",{warning:r,message:s});case 7:case"end":return a.stop()}}),a)})))()},adderUpdate:function(e){var i=this;return n()(l.a.mark((function a(){return l.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,i.$apollo.mutate({mutation:p.a,refetchAll:!1,refetchQueries:["totara_playlist_cards","totara_playlist_get_playlist"],variables:{playlistid:i.playlistId,resources:e.map((function(e){return JSON.parse(e).itemid}))}});case 3:i.showWarningModal=!1;case 4:return a.prev=4,i.$emit("close"),a.finish(4);case 7:case"end":return a.stop()}}),a,null,[[0,,4,7]])})))()},cancelPrivacyChange:function(){this.showWarningModal=!1}}},N=a("KHd+"),b=function(e){e.options.__langStrings={totara_playlist:["selectcontent","privacywarningtitle"]}},h=Object(N.a)(_,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",[a("ModalPresenter",{attrs:{open:e.showWarningModal},on:{"request-close":function(i){e.showWarningModal=!1}}},[a("EngagePrivacyWarningModal",{attrs:{title:e.$str("privacywarningtitle","totara_playlist"),"message-content":e.privacyWarningMessage},on:{cancel:e.cancelPrivacyChange,confirm:function(i){return e.adderUpdate(e.privacyWarningSelection)}}})],1),e._v(" "),a("EngageAdderModal",{attrs:{title:e.$str("selectcontent","totara_playlist"),open:e.canAdd,cards:e.contribution.cards,"filter-value":e.filterValue,"filter-component":"totara_playlist","filter-area":"adder"},on:{added:e.processAddToPlaylist,cancel:function(i){return e.$emit("close",i)},topic:e.filterTopic,search:e.filterSearch,section:e.filterSection}})],1)}),[],!1,null,null,null);"function"==typeof b&&b(h),h.options.__hasBlocks={script:!0,template:!0};i.default=h.exports},LJiL:function(e,i){e.exports=tui.require("totara_engage/components/sidepanel/access/AccessDisplay")},Lr5u:function(e,i,a){"use strict";a.r(i);var t=a("W27q"),n=a.n(t),r=a("5v9U"),l=a.n(r),s=a("sy3s"),d=a.n(s),o=a("LJiL"),u=a.n(o),m=a("JXQf"),c=a.n(m),k=a("lKjL"),v=a.n(k),p=a("C+/B"),g=a.n(p),y=a("FhEx"),f=a.n(y),_=a("r5/8"),N=a.n(_),b=a("C3CV"),h=a.n(b),F=a("+MEP"),S=a.n(F),x=a("KGcv"),V=a.n(x),C=a("tyu8"),w=a("VOFu"),P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_playlist_update_playlist"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"access"}},type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_access"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"topics"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shares"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_recipient_in"}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"playlist"},name:{kind:"Name",value:"totara_playlist_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"access"},value:{kind:"Variable",name:{kind:"Name",value:"access"}}},{kind:"Argument",name:{kind:"Name",value:"topics"},value:{kind:"Variable",name:{kind:"Name",value:"topics"}}},{kind:"Argument",name:{kind:"Name",value:"shares"},value:{kind:"Variable",name:{kind:"Name",value:"shares"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contextid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timedescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"HTML"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rated"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"updateable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contributable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totalresources"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"manageable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasnonpublicresources"},arguments:[],directives:[]}]}}]}}]},A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_playlist_delete_playlist"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"result"},name:{kind:"Name",value:"totara_playlist_delete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[]}]}}]},D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_playlist_add_rating"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"playlistid"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"rating"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ratingarea"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"result"},name:{kind:"Name",value:"totara_playlist_add_rating"},arguments:[{kind:"Argument",name:{kind:"Name",value:"playlistid"},value:{kind:"Variable",name:{kind:"Name",value:"playlistid"}}},{kind:"Argument",name:{kind:"Name",value:"rating"},value:{kind:"Variable",name:{kind:"Name",value:"rating"}}},{kind:"Argument",name:{kind:"Name",value:"ratingarea"},value:{kind:"Variable",name:{kind:"Name",value:"ratingarea"}}}],directives:[]}]}}]},I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"totara_engage_advanced_features"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"features"},name:{kind:"Name",value:"totara_engage_advanced_features"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"library"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"recommenders"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"workspaces"},arguments:[],directives:[]}]}}]}}]},T={components:{EngageSidePanel:n.a,SidePanelCommentBox:l.a,AccessSetting:d.a,AccessDisplay:u.a,PlaylistSummary:v.a,PlaylistStarRating:N.a,PageLoader:c.a,ConfirmationModal:g.a,MediaSetting:f.a,Related:h.a,MiniProfileCard:S.a,DropdownItem:V.a},props:{playlistId:{type:[Number,String],required:!0},interactor:{type:Object,default:function(){return{user_id:0,can_bookmark:!1,can_comment:!1,can_rate:!1,can_react:!1,can_share:!1}}}},apollo:{playlist:{query:w.a,variables:function(){return{id:this.playlistId}}},features:{query:I}},data:function(){return{playlist:{},submitting:!1,deleting:!1,modal:{confirm:!1},openModalFromButtonLabel:!1}},computed:{user:function(){return this.playlist.user?this.playlist.user:{}},featureRecommenders:function(){return this.features&&this.features.recommenders},canManage:function(){return this.playlist.owned||this.playlist.manageable},canUpdate:function(){return this.playlist.updatable||this.canManage},isPrivate:function(){return C.AccessManager.isPrivate(this.playlist.access)},shareButtonLabel:function(){return this.playlist.owned?this.$str("shareplaylist","totara_playlist",this.playlist.name):this.$str("reshareplaylist","totara_playlist",this.playlist.name)}},methods:{updateAccess:function(e){var i=this,a=e.access,t=e.topics,n=e.shares;t=Array.prototype.slice.call(t),this.submitting=!0,this.$apollo.mutate({mutation:P,refetchQueries:["totara_playlist_cards","totara_playlist_get_playlist"],variables:{id:this.playlistId,access:a,topics:t.map((function(e){return e.id})),shares:n},update:function(e,a){var t=a.data;e.writeQuery({query:w.a,variables:{id:i.playlistId},data:t})}}).finally((function(){i.submitting=!1,i.$emit("playlist-updated")}))},handleDelete:function(){var e=this;this.deleting=!0,this.$apollo.mutate({mutation:A,variables:{id:this.playlistId},refetchAll:!1}).then((function(i){i.data.result&&(e.$children.openModal=!1,window.location.href=e.$url("/totara/engage/your_resources.php"))}))},createRating:function(e){var i=this;this.submitting||(this.submitting=!0),this.$apollo.mutate({mutation:D,refetchQueries:[{query:w.a,variables:{id:this.playlistId}}],variables:{playlistid:this.playlistId,rating:Math.ceil(e),ratingarea:"playlist"}}).then((function(e){e.data.result&&(i.submitting=!1)}))}}},$=(a("yijA"),a("KHd+")),q=function(e){e.options.__langStrings={totara_playlist:["reshareplaylist","shareplaylist","deletewarningmsg","deletewarningtitle"],core:["delete"]}},M=Object($.a)(T,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return e.$apollo.loading?e._e():a("EngageSidePanel",{staticClass:"tui-playlistSidePanel",attrs:{"show-related":e.featureRecommenders},scopedSlots:e._u([{key:"author-profile",fn:function(){return[a("MiniProfileCard",{staticClass:"tui-playlistSidePanel__profile",attrs:{display:e.user.card_display,"no-border":!0,"no-padding":!0},scopedSlots:e._u([e.canManage?{key:"drop-down-items",fn:function(){return[a("DropdownItem",{on:{click:function(i){e.modal.confirm=!0}}},[e._v("\n          "+e._s(e.$str("delete","core"))+"\n        ")])]},proxy:!0}:null],null,!0)})]},proxy:!0},{key:"modal",fn:function(){return[a("ConfirmationModal",{attrs:{open:e.modal.confirm,title:e.$str("deletewarningtitle","totara_playlist"),"confirm-button-text":e.$str("delete","core"),loading:e.deleting},on:{confirm:e.handleDelete,cancel:function(i){e.modal.confirm=!1}}},[e._v("\n      "+e._s(e.$str("deletewarningmsg","totara_playlist"))+"\n    ")])]},proxy:!0},{key:"overview",fn:function(){return[a("div",{staticClass:"tui-playlistSidePanel__overview"},[a("PageLoader",{attrs:{fullpage:!0,loading:e.submitting}}),e._v(" "),a("p",{staticClass:"tui-playlistSidePanel__timeDescription"},[e._v("\n        "+e._s(e.playlist.timedescription)+"\n      ")]),e._v(" "),e.canManage?a("AccessSetting",{attrs:{"item-id":e.playlistId,"has-non-public-resources":e.playlist.hasnonpublicresources,component:"totara_playlist","access-value":e.playlist.access,topics:e.playlist.topics,submitting:e.submitting,"open-access-modal":e.openModalFromButtonLabel},on:{"access-update":e.updateAccess,"close-modal":function(i){e.openModalFromButtonLabel=!1}}}):a("AccessDisplay",{attrs:{"access-value":e.playlist.access,topics:e.playlist.topics,"show-button":!1}}),e._v(" "),a("PlaylistSummary",{staticClass:"tui-playlistSidePanel__summary",attrs:{"update-able":e.canUpdate,"instance-id":e.playlist.id,summary:e.playlist.summary}}),e._v(" "),a("div",{staticClass:"tui-playlistSidePanel__setting"},[e.interactor.can_rate?a("PlaylistStarRating",{attrs:{owned:e.playlist.owned,count:e.playlist.rating.count,rating:e.playlist.rating.rating,rated:e.playlist.rating.rated},on:{rating:e.createRating}}):e._e(),e._v(" "),a("MediaSetting",{staticClass:"tui-playlistSidePanel__media",attrs:{owned:e.canManage,"access-value":e.playlist.access,"instance-id":e.playlistId,"share-button-aria-label":e.shareButtonLabel,"shared-by-count":e.playlist.sharedbycount,"show-like-button":e.interactor.can_react,"show-share-button":e.interactor.can_share,"component-name":"totara_playlist"},on:{"access-update":e.updateAccess,"access-modal":function(i){e.openModalFromButtonLabel=!0}}})],1)],1)]},proxy:!0},{key:"comments",fn:function(){return[a("SidePanelCommentBox",{staticClass:"tui-playlistSidePanel__commentBox",attrs:{component:"totara_playlist",area:"comment","editor-variant":"totara_playlist-comment","instance-id":e.playlist.id,"editor-context-id":e.playlist.contextid,"show-comment":e.interactor.can_comment}})]},proxy:!0},e.featureRecommenders?{key:"related",fn:function(){return[a("Related",{attrs:{component:"totara_playlist",area:"related","playlist-id":e.playlist.id}})]},proxy:!0}:null],null,!0)})}),[],!1,null,null,null);"function"==typeof q&&q(M),M.options.__hasBlocks={script:!0,template:!0};i.default=M.exports},M1cW:function(e,i,a){"use strict";a.r(i),i.default={xsmall:{name:"xsmall",boundaries:[0,480],gridDirection:"horizontal",cardDirection:"vertical",maxItemsPerRow:1,cardUnits:11},small:{name:"small",boundaries:[481,764],gridDirection:"horizontal",cardDirection:"vertical",maxItemsPerRow:2,cardUnits:5},medium:{name:"medium",boundaries:[765,1192],gridDirection:"horizontal",cardDirection:"horizontal",maxItemsPerRow:3,cardUnits:3},large:{name:"large",boundaries:[1193,1396],gridDirection:"horizontal",cardDirection:"horizontal",maxItemsPerRow:4,cardUnits:2},xlarge:{name:"xlarge",boundaries:[1397,1672],gridDirection:"horizontal",cardDirection:"horizontal",maxItemsPerRow:5,cardUnits:2}}},MJ2M:function(e,i,a){"use strict";a.r(i);var t=a("jJ8l"),n=a.n(t),r=a("grGL"),l=a.n(r),s=a("tyu8"),d=a("0caj"),o={components:{Adder:a.n(d).a,Card:n.a,Contribute:l.a},props:{playlistId:{type:[Number,String],required:!0},access:{type:String,required:!0,validator:function(e){return s.AccessManager.isValid(e)}}},data:function(){return{showAdder:!1}},computed:{container:function(){return{instanceId:this.playlistId,component:"totara_playlist",access:this.access,showModal:!1}}}},u=(a("W6lh"),a("KHd+")),m=function(e){e.options.__langStrings={totara_playlist:["selectexistingresource","toaddplaylist"]}},c=Object(u.a)(o,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",{staticClass:"tui-addNewPlaylistCard"},[a("Card",{staticClass:"tui-addNewPlaylistCard__card"},[a("Contribute",{attrs:{adder:{text:e.$str("selectexistingresource","totara_playlist"),destination:e.$str("toaddplaylist","totara_playlist")},"show-text":!1,"show-icon":!0,styleclass:{circle:!0,primary:!0},size:500,container:e.container},on:{done:function(i){return e.$emit("contribute",i)},"open-adder":function(i){e.showAdder=!0}}})],1),e._v(" "),a("Adder",{attrs:{"grid-direction":"horizontal","playlist-id":e.playlistId,"show-adder":e.showAdder,units:12},on:{close:function(i){e.showAdder=!1}}})],1)}),[],!1,null,null,null);"function"==typeof m&&m(c),c.options.__hasBlocks={script:!0,template:!0};i.default=c.exports},Mnur:function(e,i){e.exports=tui.require("tui/components/modal/ModalPresenter")},"Mr/p":function(e,i,a){"use strict";a.r(i);var t=a("ry4p"),n=a.n(t),r=a("R5BP"),l=a.n(r),s={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"totara_playlist_resource_playlists"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"resource_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"cursor"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"playlists"},name:{kind:"Name",value:"totara_playlist_playlists"},arguments:[{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"Variable",name:{kind:"Name",value:"cursor"}}},{kind:"Argument",name:{kind:"Name",value:"resource_id"},value:{kind:"Variable",name:{kind:"Name",value:"resource_id"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"EnumValue",value:"RATING"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contextid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timedescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rated"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"updateable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contributable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totalresources"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"manageable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"library_view"},value:{kind:"BooleanValue",value:!1}}],directives:[]}]}},{kind:"Field",alias:{kind:"Name",value:"cursor"},name:{kind:"Name",value:"totara_playlist_playlists_cursor"},arguments:[{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"Variable",name:{kind:"Name",value:"cursor"}}},{kind:"Argument",name:{kind:"Name",value:"resource_id"},value:{kind:"Variable",name:{kind:"Name",value:"resource_id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"next"},arguments:[],directives:[]}]}}]}}]},d={components:{SummaryPlaylistCard:n.a,VirtualScroll:l.a},props:{resourceId:{type:[Number,String],required:!0},urlSource:{type:String,default:""}},apollo:{box:{query:s,watchLoading:function(e){this.$emit("load-records",e)},variables:function(){return{resource_id:this.resourceId,source:this.urlSource}},update:function(e){return{playlists:e.playlists,cursor:e.cursor}},result:function(e){var i=e.data.cursor.total;i=parseInt(i,9),this.$emit("update-has-playlists",0<i)}}},data:function(){return{box:{playlists:[],cursor:null}}},methods:{loadMore:function(){this.box.cursor.next&&this.$apollo.queries.box.fetchMore({variables:{cursor:this.box.cursor.next,resource_id:this.resourceId,source:this.urlSource},updateQuery:function(e,i){var a=e.playlists,t=i.fetchMoreResult,n=t.playlists,r=t.cursor;return{playlists:Array.prototype.concat(a,n),cursor:r}}})}}},o=(a("58tI"),a("KHd+")),u=function(e){e.options.__langStrings={totara_playlist:["playlists"]}},m=Object(o.a)(d,(function(){var e=this.$createElement,i=this._self._c||e;return i("div",{staticClass:"tui-resourcePlaylistBox"},[i("VirtualScroll",{attrs:{"data-list":this.box.playlists,"data-key":"id","aria-label":this.$str("playlists","totara_playlist"),"is-loading":this.$apollo.loading},on:{scrollbottom:this.loadMore},scopedSlots:this._u([{key:"item",fn:function(e){var a=e.item;return[i("SummaryPlaylistCard",{key:a.id,staticClass:"tui-resourcePlaylistBox__card",attrs:{"data-id":a.id,name:a.name,url:a.url,"playlist-id":a.id,author:a.user.fullname,"rated-count":a.rating.count,rating:a.rating.rating}})]}}])})],1)}),[],!1,null,null,null);"function"==typeof u&&u(m),m.options.__hasBlocks={script:!0,template:!0};i.default=m.exports},Ms3t:function(e,i){e.exports=tui.require("totara_playlist/components/grid/PlaylistResourcesGrid")},NAOU:function(e,i){e.exports=tui.require("tui/components/grid/Grid")},Nbqz:function(e,i,a){"use strict";a.r(i);var t=a("vF5l"),n=a.n(t),r=a("BN8m"),l=a.n(r),s=a("nXMa"),d=a.n(s),o=a("nEm4"),u=a.n(o),m=a("i/kK"),c=a.n(m),k=a("e3MU"),v=a.n(k),p=a("oMuj"),g=a.n(p),y=a("oMGV"),f=a.n(y),_=a("2wx7"),N=a.n(_),b=a("kkOl"),h=a.n(b),F=a("FoZm"),S={components:{Button:n.a,ButtonGroup:l.a,CancelButton:d.a,Form:u.a,FormRow:c.a,InfoIconButton:v.a,InputText:g.a,UnsavedChangesWarning:f.a,Weka:N.a},props:{playlist:{type:Object,default:function(){return{name:"",summary:""}}}},data:function(){return{description:this.$id("engageContribute-description"),summary:h.a.empty(),hasUnsavedChanges:!1}},computed:{disabled:function(){return 0===this.playlist.name.length},name:function(){return this.playlist.name},hasFormData:function(){return this.playlist.name.length>0||!this.summary.isEmpty}},watch:{hasFormData:function(e){e&&(this.hasUnsavedChanges=!0,this.$emit("unsaved-changes"))}},methods:{submit:function(){var e={name:this.playlist.name,summary:this.summary.isEmpty?null:JSON.stringify(this.summary.getDoc()),summary_format:F.FORMAT_JSON_EDITOR};this.hasUnsavedChanges=!1,this.$emit("next",e)},cancel:function(){var e=this;this.hasUnsavedChanges=!1,this.$nextTick((function(){e.$emit("cancel")}))}}},x=(a("aRtW"),a("KHd+")),V=function(e){e.options.__langStrings={core:["next"],totara_core:["save"],totara_playlist:["createplaylistshort","entertitle","adddescription","playlisttitle","playlistdescription"],totara_engage:["contributetip","contributetip_help","hashtags"]}},C=Object(x.a)(S,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("Form",{staticClass:"tui-playlistForm",attrs:{vertical:!0,"input-width":"full"}},[a("FormRow",{staticClass:"tui-playlistForm__title",attrs:{label:e.$str("playlisttitle","totara_playlist"),hidden:!0,required:!0},scopedSlots:e._u([{key:"default",fn:function(i){var t=i.id;return[a("InputText",{attrs:{id:t,name:"playlist-title",maxlength:75,placeholder:e.$str("entertitle","totara_playlist"),required:!0},model:{value:e.playlist.name,callback:function(i){e.$set(e.playlist,"name",i)},expression:"playlist.name"}})]}}])}),e._v(" "),a("div",{staticClass:"tui-playlistForm__description"},[a("FormRow",{staticClass:"tui-playlistForm__description-formRow",attrs:{hidden:!0,label:e.$str("playlistdescription","totara_playlist")},scopedSlots:e._u([{key:"default",fn:function(i){var t=i.id;return[a("Weka",{staticClass:"tui-playlistForm__description-textArea",attrs:{id:t,compact:!0,"usage-identifier":{component:"totara_playlist",area:"summary"},variant:"totara_playlist-summary",placeholder:e.$str("adddescription","totara_playlist")},model:{value:e.summary,callback:function(i){e.summary=i},expression:"summary"}})]}}])}),e._v(" "),a("div",{staticClass:"tui-playlistForm__description-tip"},[a("p",[e._v(e._s(e.$str("contributetip","totara_engage")))]),e._v(" "),a("InfoIconButton",{attrs:{"is-help-for":e.$str("hashtags","totara_engage")}},[e._v("\n        "+e._s(e.$str("contributetip_help","totara_engage"))+"\n      ")])],1)],1),e._v(" "),a("ButtonGroup",{staticClass:"tui-playlistForm__buttons"},[a("Button",{attrs:{styleclass:{primary:"true"},disabled:e.disabled,"aria-label":e.$str("createplaylistshort","totara_playlist"),text:e.$str("next","core")},on:{click:e.submit}}),e._v(" "),a("CancelButton",{on:{click:e.cancel}})],1),e._v(" "),e.hasUnsavedChanges?a("UnsavedChangesWarning",{attrs:{value:{hasUnsavedChanges:e.hasUnsavedChanges}}}):e._e()],1)}),[],!1,null,null,null);"function"==typeof V&&V(C),C.options.__hasBlocks={script:!0,template:!0};i.default=C.exports},"Q+cF":function(e,i){},QGXx:function(e,i){e.exports=tui.require("totara_engage/components/buttons/DoneCancelGroup")},QzOk:function(e,i,a){"use strict";a.r(i);var t=a("nEm4"),n=a.n(t),r=a("i/kK"),l=a.n(r),s=a("oMuj"),d=a.n(s),o=a("QGXx"),u={components:{DoneCancelGroup:a.n(o).a,Form:n.a,FormRow:l.a,InputText:d.a},props:{submitting:Boolean,title:{type:String,default:""},focusInput:Boolean},data:function(){return{innerTitle:this.title}},watch:{title:function(e){this.innerTitle=e}},methods:{submit:function(){this.$emit("submit",{title:this.innerTitle})}}},m=(a("oFjh"),a("KHd+")),c=function(e){e.options.__langStrings={totara_playlist:["playlisttitle"]}},k=Object(m.a)(u,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("Form",{staticClass:"tui-playlistTitleForm",attrs:{vertical:!0,"input-width":"full"},on:{submit:function(i){return i.preventDefault(),e.submit(i)}}},[a("FormRow",{attrs:{label:e.$str("playlisttitle","totara_playlist"),hidden:!0},scopedSlots:e._u([{key:"default",fn:function(i){var t=i.id,n=i.label;return[a("InputText",{attrs:{id:t,placeholder:n,"aria-label":n,maxlength:75,autofocus:e.focusInput,name:"playlist title"},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"esc",27,i.key,["Esc","Escape"])?null:e.$emit("cancel",i)}},model:{value:e.innerTitle,callback:function(i){e.innerTitle=i},expression:"innerTitle"}})]}}])}),e._v(" "),a("DoneCancelGroup",{attrs:{loading:e.submitting,disabled:0>=e.innerTitle.length},on:{done:function(i){return i.preventDefault(),e.submit(i)},cancel:function(i){return i.preventDefault(),e.$emit("cancel",i)}}})],1)}),[],!1,null,null,null);"function"==typeof c&&c(k),k.options.__hasBlocks={script:!0,template:!0};i.default=k.exports},R5BP:function(e,i){e.exports=tui.require("tui/components/virtualscroll/VirtualScroll")},Rgjc:function(e,i){e.exports=tui.require("tui/components/drag_drop/Droppable")},RsPx:function(e,i,a){"use strict";i.a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_playlist_update_card_order"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"instanceid"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"cards"},name:{kind:"Name",value:"totara_playlist_update_order"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"instanceid"},value:{kind:"Variable",name:{kind:"Name",value:"instanceid"}}},{kind:"Argument",name:{kind:"Name",value:"order"},value:{kind:"Variable",name:{kind:"Name",value:"order"}}}],directives:[]}]}}]}},TnZe:function(e,i){},ULOL:function(e,i){e.exports=tui.require("totara_engage/components/modal/EngagePrivacyWarningModal")},UpZR:function(e,i){e.exports=tui.require("tui/apollo_client")},V8v5:function(e,i){e.exports=tui.require("totara_playlist/components/card/AddNewPlaylistCard")},VOFu:function(e,i,a){"use strict";i.a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"totara_playlist_get_playlist"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"playlist"},name:{kind:"Name",value:"totara_playlist_instance"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contextid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timedescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"catalog"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"HTML"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rated"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"updateable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contributable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totalresources"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"manageable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasnonpublicresources"},arguments:[],directives:[]}]}}]}}]}},VXX2:function(e,i){e.exports=tui.require("totara_playlist/components/card/RelatedCard")},Vr3X:function(e,i,a){"use strict";a.r(i);var t=a("VXX2"),n=a.n(t),r=a("tyu8"),l=a("12HA"),s={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ml_recommender_get_recommended_playlists"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"playlist_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"cursor"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"theme"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"cursor"},name:{kind:"Name",value:"ml_recommender_recommended_playlists_cursor"},arguments:[{kind:"Argument",name:{kind:"Name",value:"playlist_id"},value:{kind:"Variable",name:{kind:"Name",value:"playlist_id"}}},{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"Variable",name:{kind:"Name",value:"cursor"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"next"},arguments:[],directives:[]}]}},{kind:"Field",alias:{kind:"Name",value:"playlists"},name:{kind:"Name",value:"ml_recommender_recommended_playlists"},arguments:[{kind:"Argument",name:{kind:"Name",value:"playlist_id"},value:{kind:"Variable",name:{kind:"Name",value:"playlist_id"}}},{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"Variable",name:{kind:"Name",value:"cursor"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"instanceid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"component"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tuicomponent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"comments"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reactions"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timecreated"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"extra"},arguments:[{kind:"Argument",name:{kind:"Name",value:"theme"},value:{kind:"Variable",name:{kind:"Name",value:"theme"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profileimageurl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profileimagealt"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}}],directives:[]}]}}]}}]},d=a("vN5C"),o={components:{RelatedCard:n.a},props:{playlistId:{type:[Number,String],required:!0}},apollo:{articles:{query:s,refetchAll:!1,variables:function(){return{playlist_id:this.playlistId,source:r.UrlSourceType.article(this.playlistId),theme:l.config.theme.name}},update:function(e){return e.playlists.length<=0?[]:(this.$emit("show-related"),e.playlists.map((function(e){var i=e.bookmarked,a=e.extra,t=e.name,n=e.instanceid,r=e.reactions,l=e.url,s=JSON.parse(a);return{bookmarked:i,instanceid:n,image:s.image,alt:s.alt,name:t,reactions:r,timeview:s.timeview,url:l}})))}}},data:function(){return{playlists:[]}},mounted:function(){this.getRecommendations()},methods:{getRecommendations:function(){var e=this;this.$apollo.query({query:s,refetchAll:!1,variables:{playlist_id:this.playlistId,source:r.UrlSourceType.playlist(this.playlistId),theme:l.config.theme.name}}).then((function(i){var a=i.data;a.playlists.length<=0||(e.$emit("show-related"),e.playlists=a.playlists.map((function(e){var i=e.bookmarked,a=e.extra,t=e.name,n=e.instanceid,r=e.user,l=e.url,s=JSON.parse(a),d=s.image,o=s.alt,u=s.rating,m=s.resources;return{bookmarked:i,fullname:r.fullname,instanceid:n,image:d,alt:o,name:t,rating:u,resources:m,url:l}})))}))},update:function(e,i){this.$apollo.mutate({mutation:d.a,refetchAll:!1,variables:{itemid:e,component:"totara_playlist",bookmarked:i}})}}},u=(a("ucYl"),a("KHd+")),m=function(e){e.options.__langStrings={core:["noresults"]}},c=Object(u.a)(o,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return e.playlists.length>0?a("div",{staticClass:"tui-playlistRelated"},e._l(e.playlists,(function(i){var t=i.bookmarked,n=i.fullname,r=i.instanceid,l=i.image,s=i.alt,d=i.name,o=i.rating,u=i.resources,m=i.url;return a("article",{key:r},[a("RelatedCard",{attrs:{"playlist-id":r,bookmarked:t,fullname:n,image:l,"image-alt":s,name:d,rating:o,resources:u,url:m},on:{update:e.update}})],1)})),0):e.$apollo.loading?e._e():a("span",{staticClass:"tui-playlistRelated__noResults"},[e._v("\n  "+e._s(e.$str("noresults","core"))+"\n")])}),[],!1,null,null,null);"function"==typeof m&&m(c),c.options.__hasBlocks={script:!0,template:!0};i.default=c.exports},W27q:function(e,i){e.exports=tui.require("totara_engage/components/sidepanel/EngageSidePanel")},W6lh:function(e,i){},W9cx:function(e,i,a){"use strict";a.r(i);var t=a("yXPU"),n=a.n(t),r=a("o0o1"),l=a.n(r),s=a("Ms3t"),d=a.n(s),o=a("yHtf"),u=a.n(o),m=a("bxuo"),c=a.n(m),k=a("s5vj"),v=a.n(k),p=a("/hNZ"),g=a.n(p),y=a("9IU1"),f=a.n(y),_=a("w07m"),N=a.n(_),b=a("UpZR"),h=a.n(b),F=a("12HA"),S=a("VOFu"),x=a("gR9B"),V=a("vN5C"),C=a("RsPx"),w={components:{PlaylistResourcesGrid:d.a,PlaylistSidePanel:u.a,BookmarkButton:c.a,ContributionBaseContent:v.a,HeaderBox:g.a,Layout:f.a,ResourceNavigationBar:N.a},props:{playlistId:{required:!0,type:Number},backButton:{type:Object,required:!1},interactor:{type:Object,default:function(){return{user_id:0,can_bookmark:!1,can_comment:!1,can_rate:!1,can_react:!1,can_share:!1}}}},apollo:{playlist:{query:S.a,variables:function(){return{id:this.playlistId}},result:function(e){var i=e.data.playlist;this.bookmarked=i.bookmarked}},contribution:{query:x.a,variables:function(){return{id:this.playlistId,source:"pl."+this.playlistId,footnotes_type:"playlist",footnotes_item_id:this.playlistId,include_footnotes:!0,theme:F.config.theme.name}}}},data:function(){return{playlist:{},bookmarked:!1,contribution:{cursor:{total:0,next:null},cards:[]},isLoadMoreVisible:!1,loadingMore:!1}},computed:{canUpdate:function(){return this.playlist.owned||this.playlist.manageable}},methods:{updateBookmark:function(){this.bookmarked=!this.bookmarked,this.$apollo.mutate({mutation:V.a,refetchAll:!1,variables:{itemid:this.playlistId,component:"totara_playlist",bookmarked:this.bookmarked}})},refetchCards:function(){this.$apollo.queries.contribution.refetch()},refetchCardsAndPlaylist:function(){this.$apollo.queries.contribution.refetch(),this.$apollo.queries.playlist.refetch()},resourceReordered:function(e){var i=e.list,a=e.instanceid,t=e.destinationIndex,n=e.playlistId;this.contribution=Object.assign({},this.contribution,{cards:i}),this.$apollo.mutate({mutation:C.a,variables:{id:n,instanceid:a,order:t}})},scrolledToBottom:function(){var e=this;return n()(l.a.mark((function i(){return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!e.isLoadMoreVisible){i.next=2;break}return i.abrupt("return");case 2:return i.next=4,e.loadMoreItems();case 4:e.isLoadMoreVisible=!0;case 5:case"end":return i.stop()}}),i)})))()},loadMore:function(){var e=this;return n()(l.a.mark((function i(){return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.loadMoreItems();case 2:e.isLoadMoreVisible=!1;case 3:case"end":return i.stop()}}),i)})))()},loadMoreItems:function(){var e=this;return n()(l.a.mark((function i(){return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.contribution.cursor.next){i.next=2;break}return i.abrupt("return");case 2:e.loadingMore=!0,e.$apollo.queries.contribution.fetchMore({variables:{id:e.pageProps.playlistId,cursor:e.contribution.cursor.next},updateQuery:function(i,a){var t=a.fetchMoreResult,n=i.contribution,r=t.contribution,l=n.cards.concat(r.cards);return e.loadingMore=!1,{contribution:{cursor:r.cursor,cards:l}}}});case 4:case"end":return i.stop()}}),i)})))()},updatePlaylist:function(e){h.a.writeQuery({query:S.a,variables:{id:this.playlistId},data:{playlist:e}})}}},P=(a("xr2R"),a("KHd+")),A=function(e){e.options.__langStrings={totara_engage:["resourcecount"],engage_article:["loadmore","viewedresources"]}},D=Object(P.a)(w,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("Layout",{staticClass:"tui-playlistView",scopedSlots:e._u([{key:"column",fn:function(i){var t=i.units,n=i.boundaryName;return[a("ContributionBaseContent",{attrs:{units:t,loading:!!e.$apollo.loading,"loading-more":e.loadingMore,"total-cards":e.contribution.cursor.total,"show-heading":!e.$apollo.loading,"grid-direction":"horizontal"},scopedSlots:e._u([{key:"buttons",fn:function(){return[a("ResourceNavigationBar",{attrs:{"back-button":e.backButton}})]},proxy:!0},{key:"heading",fn:function(){return[a("HeaderBox",{attrs:{"playlist-id":e.playlistId,title:e.playlist.name,"update-able":e.canUpdate},on:{"update-playlist":e.updatePlaylist}})]},proxy:!0},{key:"bookmark",fn:function(){return[e.interactor.can_bookmark?a("BookmarkButton",{staticClass:"tui-playlistView__bookmark",attrs:{primary:!1,circle:!0,bookmarked:e.bookmarked,size:"300"},on:{click:e.updateBookmark}}):e._e()]},proxy:!0},e.contribution.cards&&e.playlist.access?{key:"cards",fn:function(){return[a("PlaylistResourcesGrid",{attrs:{"max-units":t,"playlist-id":e.playlistId,size:n,cards:e.contribution.cards,contributable:e.playlist.contributable,access:e.playlist.access,"update-able":e.canUpdate,"is-loading":e.$apollo.loading},on:{refetch:e.refetchCards,"resource-added":e.refetchCardsAndPlaylist,"resource-reordered":e.resourceReordered}}),e._v(" "),e.isLoadMoreVisible&&e.contribution.cards.length<e.contribution.cursor.total&&!e.$apollo.loading?a("div",{staticClass:"tui-playlistView__loadMoreContainer"},[a("div",{staticClass:"tui-playlistView__viewedResources"},[e._v("\n            "+e._s(e.$str("viewedresources","engage_article",e.contribution.cards.length))+"\n            "+e._s(e.$str("resourcecount","totara_engage",e.contribution.cursor.total))+"\n          ")]),e._v(" "),a("Button",{staticClass:"tui-playlistView__loadMore",attrs:{text:e.$str("loadmore","engage_article")},on:{click:e.loadMore}})],1):e._e()]},proxy:!0}:null],null,!0)})]}},{key:"sidepanel",fn:function(){return[a("PlaylistSidePanel",{attrs:{"playlist-id":e.playlistId,interactor:e.interactor},on:{"playlist-updated":e.refetchCards}})]},proxy:!0}])})}),[],!1,null,null,null);"function"==typeof A&&A(D),D.options.__hasBlocks={script:!0,template:!0};i.default=D.exports},Xapw:function(e,i){},Xpd9:function(e,i){e.exports=tui.require("totara_engage/components/icons/StatIcon")},YPxT:function(e,i){e.exports=tui.require("totara_engage/components/modal/EngageAdderModal")},YyZ1:function(e,i,a){"use strict";a.r(i);var t=a("NAOU"),n=a.n(t),r=a("DaLk"),l=a.n(r),s=a("nnnb"),d=a.n(s),o=a("Rgjc"),u=a.n(o),m=a("D9If"),c=a.n(m),k=a("nWvO"),v=a.n(k),p=a("4ky8"),g=a.n(p),y=a("tyu8"),f=a("V8v5"),_=a.n(f),N=a("3Eqo"),b=a("ZTUP"),h={components:{AddNewPlaylistCard:_.a,CoreGrid:n.a,Draggable:l.a,DragHandleIcon:d.a,Droppable:u.a,EngageCard:g.a,GridItem:c.a,PropsProvider:v.a},props:{access:{type:String,required:!0},cards:{type:Array,required:!0},contributable:{type:Boolean,default:!0},libraryView:Boolean,maxUnits:{type:[String,Number],required:!0},playlistId:{type:[Number,String],required:!0},size:{type:String,required:!0},updateAble:Boolean},data:function(){return{loadingComponents:!1}},computed:{gridSize:function(){return N.playlistGrid[this.size]},itemsPerRow:function(){if(1>=this.maxUnits)return 1;var e=Math.floor(this.maxUnits/this.cardUnits),i=this.gridSize.maxItemsPerRow;return e>i?i:1>=e?"small"===this.size&&this.libraryView?2:1:e},rows:function(){return Object(y.calculateRow)(this.allCards,this.itemsPerRow,!0)},cardUnits:function(){return"small"===this.size&&this.libraryView?Math.floor(this.maxUnits/2):this.gridSize.cardUnits},gridDirection:function(){if(this.libraryView){if("small"===this.size)return"horizontal";if("xsmall"===this.size)return"vertical"}return this.gridSize.cardDirection},allCards:function(){return this.contributable?[{component:"AddNewPlaylistCard"}].concat(this.cards):this.cards}},methods:{addResource:function(e){var i=this,a=e.resourceId;this.$apollo.mutate({mutation:b.a,refetchAll:!1,refetchQueries:["totara_playlist_cards","totara_playlist_get_playlist"],variables:{playlistid:this.playlistId,resources:[a]}}).then((function(){i.$emit("resource-added")}))},handleDrop:function(e){if(e.destination.sourceId==e.source.sourceId){var i=this.cards.slice(),a=i.splice(e.source.index-1,1)[0];i.splice(e.destination.index-1,0,a);var t=a.instanceid,n=e.destination.index-1,r=this.playlistId;this.$emit("resource-reordered",{list:i,instanceid:t,destinationIndex:n,playlistId:r})}}}},F=(a("cWRG"),a("KHd+")),S=function(e){e.options.__langStrings={totara_playlist:["playlist_resource","move_element"]}},x=Object(F.a)(h,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",{staticClass:"tui-playlistResourcesGrid",attrs:{"data-max-units":e.maxUnits,"data-single-card-units":e.cardUnits,"data-size":e.size}},[e.$apollo.loading?e._e():[a("Droppable",{attrs:{"source-id":e.$id("playlist-grid"),"source-name":"Playlist Resources Grid","accept-drop":function(){return e.updateAble},"layout-interaction":"grid-line",axis:"horizontal"},on:{drop:e.handleDrop},scopedSlots:e._u([{key:"default",fn:function(i){var t=i.attrs,n=i.events;return[a("div",e._g(e._b({},"div",t,!1),n),e._l(e.rows,(function(i,t){return a("CoreGrid",{key:i.index,staticClass:"tui-playlistResourcesGrid__row",attrs:{direction:e.gridDirection,"max-units":e.maxUnits}},e._l(i.items,(function(i,n){return a("GridItem",{key:n,staticClass:"tui-playlistResourcesGrid__card",attrs:{grows:!0,units:e.cardUnits}},["AddNewPlaylistCard"===i.component?[a("AddNewPlaylistCard",{attrs:{"playlist-id":e.playlistId,access:e.access},on:{contribute:e.addResource}})]:"FillSlot"!==i.component?[a("Draggable",{attrs:{index:t*e.itemsPerRow+n,type:"playlist-grid-item",value:i,"aria-label":e.$str("move_element","totara_playlist",i.name)},scopedSlots:e._u([{key:"default",fn:function(r){var l=r.dragging,s=r.anyDragging,d=r.attrs,o=r.events;return[a("PropsProvider",{attrs:{provide:{nativeListeners:o}}},[a("div",e._g(e._b({staticClass:"tui-playlistResourcesGrid__card-item",class:{"tui-playlistResourcesGrid__card-item--dragging":e.updateAble&&l}},"div",d,!1),o),[!e.updateAble||s&&!l?e._e():a("div",{staticClass:"tui-playlistResourcesGrid__card-item-moveIcon"},[a("DragHandleIcon")],1),e._v(" "),a("EngageCard",{attrs:{"card-attribute":i,"aria-labelledby":e.$id("row-"+t+"-"+n+"-label"),"label-id":e.$id("row-"+t+"-"+n+"-label"),"aria-posinset":t*e.itemsPerRow+n+1,"aria-setsize":e.cards.length,"show-footnotes":e.updateAble},on:{refetch:function(i){return e.$emit("refetch",i)}}})],1)])]}}],null,!0)})]:[a("AddNewPlaylistCard",{style:{visibility:"hidden"},attrs:{"playlist-id":e.playlistId,access:e.access},on:{contribute:e.addResource}})]],2)})),1)})),1)]}}],null,!1,1590938557)})]],2)}),[],!1,null,null,null);"function"==typeof S&&S(x),x.options.__hasBlocks={script:!0,template:!0};i.default=x.exports},ZTUP:function(e,i,a){"use strict";i.a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_playlist_add_resources"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"playlistid"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"resources"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"playlist"},name:{kind:"Name",value:"totara_playlist_add_resources"},arguments:[{kind:"Argument",name:{kind:"Name",value:"playlistid"},value:{kind:"Variable",name:{kind:"Name",value:"playlistid"}}},{kind:"Argument",name:{kind:"Name",value:"resources"},value:{kind:"Variable",name:{kind:"Name",value:"resources"}}}],directives:[]}]}}]}},aRtW:function(e,i){},ajlF:function(e,i){e.exports=tui.require("totara_playlist/components/modal/ContributeModal")},bxuo:function(e,i){e.exports=tui.require("totara_engage/components/buttons/BookmarkButton")},c0Rk:function(e,i,a){"use strict";a.r(i);var t=a("dtfu"),n=a.n(t),r=a("s5vj"),l=a.n(r),s=a("Ms3t"),d=a.n(s),o=a("/hNZ"),u=a.n(o),m=a("bxuo"),c=a.n(m),k=a("tyu8"),v=a("12HA"),p=a("VOFu"),g=a("gR9B"),y=a("vN5C"),f=a("RsPx"),_=a("zEvk"),N=a.n(_),b=a("3Eqo"),h={components:{Responsive:n.a,ContributionBaseContent:l.a,PlaylistResourcesGrid:d.a,HeaderBox:u.a,BookmarkButton:c.a},mixins:[N.a],props:{units:{type:[Number,String],required:!0},gridDirection:{type:String,required:!0}},data:function(){return{playlist:{},contribution:{cursor:{total:0,next:null},cards:[]},size:"",bookmarked:!1,loadingMore:!1}},computed:{breakPoints:function(){var e=Object.values(b.playlistGrid);return e.map((function(e){return{name:e.name,boundaries:e.boundaries}}))}},apollo:{playlist:{query:p.a,fetchPolicy:"network-only",variables:function(){return{id:this.pageProps.playlistId}},result:function(e){var i=e.data.playlist;this.bookmarked=i.bookmarked}},contribution:{query:g.a,fetchPolicy:"network-only",variables:function(){return{id:this.pageProps.playlistId,source:k.UrlSourceType.playlist(this.pageProps.playlistId),footnotes_type:"playlist",footnotes_item_id:this.pageProps.playlistId,include_footnotes:!0,theme:v.config.theme.name}}}},methods:{updateBookmark:function(){this.bookmarked=!this.bookmarked,this.$apollo.mutate({mutation:y.a,refetchQueries:["savedplaylists"],variables:{itemid:this.pageProps.playlistId,component:"totara_playlist",bookmarked:this.bookmarked}})},updatePlaylist:function(e){this.$emit("updateTitle",e.name)},resourceReordered:function(e){var i=e.list,a=e.instanceid,t=e.destinationIndex,n=e.playlistId;this.contribution=Object.assign({},this.contribution,{cards:i}),this.$apollo.mutate({mutation:f.a,refetchQueries:[{query:g.a,variables:{id:n,source:k.UrlSourceType.playlist(n),theme:v.config.theme.name,include_footnotes:!0}}],variables:{id:n,instanceid:a,order:t}})}}},F=(a("g2Xi"),a("KHd+")),S=function(e){e.options.__langStrings={totara_engage:["resourcecount"],engage_article:["loadmore","viewedresources"]}},x=Object(F.a)(h,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("Responsive",{staticClass:"tui-contributionPlaylistResources",attrs:{breakpoints:e.breakPoints},on:{"responsive-resize":function(i){e.size=i}}},[a("ContributionBaseContent",{attrs:{units:e.units,loading:!!e.$apollo.loading,"loading-more":e.loadingMore,"total-cards":e.contribution.cursor.total,"show-heading":!e.$apollo.loading&&"vertical"!==e.gridDirection,"grid-direction":e.gridDirection},scopedSlots:e._u([{key:"heading",fn:function(){return[a("HeaderBox",{attrs:{"playlist-id":e.pageProps.playlistId,title:e.playlist.name,owned:e.playlist.owned},on:{"update-playlist":e.updatePlaylist}})]},proxy:!0},{key:"bookmark",fn:function(){return[e.pageProps.interactor.can_bookmark?a("BookmarkButton",{attrs:{primary:!1,circle:!0,bookmarked:e.bookmarked,size:"300"},on:{click:e.updateBookmark}}):e._e()]},proxy:!0},e.contribution.cards&&e.playlist.access?{key:"cards",fn:function(){return[a("PlaylistResourcesGrid",{attrs:{"max-units":e.units,"playlist-id":e.pageProps.playlistId,size:e.size,"library-view":!0,cards:e.contribution.cards,contributable:e.playlist.contributable,access:e.playlist.access,"update-able":e.playlist.updateable,"is-loading":e.$apollo.loading},on:{"resource-reordered":e.resourceReordered}})]},proxy:!0}:null],null,!0)})],1)}),[],!1,null,null,null);"function"==typeof S&&S(x),x.options.__hasBlocks={script:!0,template:!0};i.default=x.exports},cWRG:function(e,i){},ccUt:function(e,i){e.exports=tui.require("totara_engage/components/card/CardHeader")},"d+XU":function(e,i,a){var t={".":"kcYD","./":"kcYD","./index":"kcYD","./index.js":"kcYD","./playlist_grid":"M1cW","./playlist_grid.js":"M1cW"};function n(e){var i=r(e);return a(i)}function r(e){if(!a.o(t,e)){var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}return t[e]}n.keys=function(){return Object.keys(t)},n.resolve=r,e.exports=n,n.id="d+XU"},dtfu:function(e,i){e.exports=tui.require("tui/components/responsive/Responsive")},e3MU:function(e,i){e.exports=tui.require("tui/components/buttons/InfoIconButton")},fPwS:function(e,i){e.exports=tui.require("tui/components/icons/Loading")},g0Fk:function(e,i){e.exports=tui.require("totara_engage/components/form/InlineEditing")},g2Xi:function(e,i){},gR9B:function(e,i,a){"use strict";i.a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"totara_playlist_cards"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"cursor"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"include_footnotes"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"footnotes_type"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"footnotes_item_id"}},type:{kind:"NamedType",name:{kind:"Name",value:"core_id"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"footnotes_area"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_area"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"footnotes_component"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"theme"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"contribution"},name:{kind:"Name",value:"totara_playlist_cards"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"Variable",name:{kind:"Name",value:"cursor"}}},{kind:"Argument",name:{kind:"Name",value:"footnotes"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_type"}}},{kind:"ObjectField",name:{kind:"Name",value:"item_id"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_item_id"}}},{kind:"ObjectField",name:{kind:"Name",value:"area"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_area"}}},{kind:"ObjectField",name:{kind:"Name",value:"component"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_component"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"next"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"cards"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"instanceid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profileimagealt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profileimageurl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"comments"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tuicomponent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"component"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reactions"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"comments"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"extra"},arguments:[{kind:"Argument",name:{kind:"Name",value:"theme"},value:{kind:"Variable",name:{kind:"Name",value:"theme"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timecreated"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"footnotes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_type"}}},{kind:"Argument",name:{kind:"Name",value:"item_id"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_item_id"}}},{kind:"Argument",name:{kind:"Name",value:"area"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_area"}}},{kind:"Argument",name:{kind:"Name",value:"component"},value:{kind:"Variable",name:{kind:"Name",value:"footnotes_component"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"include_footnotes"}}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"component"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tuicomponent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"props"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"interactor"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"can_bookmark"},arguments:[],directives:[]}]}}]}}]}}]}}]}},grGL:function(e,i){e.exports=tui.require("totara_engage/components/contribution/Contribute")},"i/kK":function(e,i){e.exports=tui.require("tui/components/form/FormRow")},i0Ff:function(e,i,a){var t={"./CreatePlaylist":"AEy+","./CreatePlaylist.vue":"AEy+","./box/ResourcePlaylistBox":"Mr/p","./box/ResourcePlaylistBox.vue":"Mr/p","./card/AddNewPlaylistCard":"MJ2M","./card/AddNewPlaylistCard.vue":"MJ2M","./card/PlaylistCard":"707M","./card/PlaylistCard.vue":"707M","./card/PlaylistCardImage":"tDnt","./card/PlaylistCardImage.vue":"tDnt","./card/PlaylistFootnote":"qEZ+","./card/PlaylistFootnote.vue":"qEZ+","./card/RelatedCard":"mt9Y","./card/RelatedCard.vue":"mt9Y","./card/SummaryPlaylistCard":"3Sc5","./card/SummaryPlaylistCard.vue":"3Sc5","./contribution/Adder":"LBQM","./contribution/Adder.vue":"LBQM","./contribution/PlaylistResources":"c0Rk","./contribution/PlaylistResources.vue":"c0Rk","./form/PlaylistForm":"Nbqz","./form/PlaylistForm.vue":"Nbqz","./form/PlaylistTitleForm":"QzOk","./form/PlaylistTitleForm.vue":"QzOk","./grid/PlaylistResourcesGrid":"YyZ1","./grid/PlaylistResourcesGrid.vue":"YyZ1","./modal/ContributeModal":"xwzm","./modal/ContributeModal.vue":"xwzm","./page/HeaderBox":"kKh8","./page/HeaderBox.vue":"kKh8","./popover/PlaylistPopover":"zff/","./popover/PlaylistPopover.vue":"zff/","./sidepanel/PlaylistNavigation":"tciR","./sidepanel/PlaylistNavigation.vue":"tciR","./sidepanel/PlaylistSidePanel":"Lr5u","./sidepanel/PlaylistSidePanel.vue":"Lr5u","./sidepanel/PlaylistStarRating":"2okE","./sidepanel/PlaylistStarRating.vue":"2okE","./sidepanel/PlaylistSummary":"y++F","./sidepanel/PlaylistSummary.vue":"y++F","./sidepanel/Related":"Vr3X","./sidepanel/Related.vue":"Vr3X","./sidepanel/content/Playlist":"/UPp","./sidepanel/content/Playlist.vue":"/UPp"};function n(e){var i=r(e);return a(i)}function r(e){if(!a.o(t,e)){var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}return t[e]}n.keys=function(){return Object.keys(t)},n.resolve=r,e.exports=n,n.id="i0Ff"},in8C:function(e,i){e.exports=tui.require("tui/components/icons/Comment")},jJ8l:function(e,i){e.exports=tui.require("tui/components/card/Card")},kKh8:function(e,i,a){"use strict";a.r(i);var t=a("yXPU"),n=a.n(t),r=a("o0o1"),l=a.n(r),s=a("g0Fk"),d=a.n(s),o=a("kL7T"),u=a.n(o),m=a("vyVp"),c={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_playlist_update_playlist_name"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"playlist"},name:{kind:"Name",value:"totara_playlist_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contextid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timedescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"HTML"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rated"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"updateable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contributable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totalresources"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"manageable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasnonpublicresources"},arguments:[],directives:[]}]}}]}}]},k={components:{InlineEditing:d.a,PlaylistTitleForm:u.a},props:{playlistId:{type:Number,required:!0},title:{type:String,required:!0},updateAble:{type:Boolean,default:!0}},data:function(){return{editing:!1,submitting:!1,focusEditButton:!1}},watch:{editing:function(e){this.focusEditButton=!e}},methods:{updatePlaylistTitle:function(e){var i=this,a=e.title;return n()(l.a.mark((function e(){var t,n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.submitting){e.next=2;break}return e.abrupt("return");case 2:return i.submitting=!0,e.prev=3,e.next=6,i.$apollo.mutate({mutation:c,refetchAll:!1,variables:{id:i.playlistId,name:a}});case 6:t=e.sent,n=t.data.playlist,i.editing=!1,i.$emit("update-playlist",n),e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(3),e.next=16,Object(m.notify)({message:i.$str("error:update","totara_playlist"),type:"error"});case 16:return e.prev=16,i.submitting=!1,e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[3,12,16,19]])})))()}}},v=(a("EU6u"),a("KHd+")),p=function(e){e.options.__langStrings={totara_playlist:["error:update","edit_playlist_title"]}},g=Object(v.a)(k,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("section",{staticClass:"tui-playlistPageHeaderBox"},[e.editing?a("PlaylistTitleForm",{attrs:{title:e.title,"focus-input":!0,submitting:e.submitting},on:{submit:e.updatePlaylistTitle,cancel:function(i){e.editing=!1}}}):a("InlineEditing",{staticClass:"tui-playlistPageHeaderBox__titleBox",attrs:{"update-able":e.updateAble,"button-aria-label":e.$str("edit_playlist_title","totara_playlist"),"focus-button":e.focusEditButton},on:{click:function(i){e.editing=!0}}},[a("h1",{staticClass:"tui-playlistPageHeaderBox__title",attrs:{slot:"content"},slot:"content"},[e._v("\n      "+e._s(e.title)+"\n    ")])])],1)}),[],!1,null,null,null);"function"==typeof p&&p(g),g.options.__hasBlocks={script:!0,template:!0};i.default=g.exports},kL7T:function(e,i){e.exports=tui.require("totara_playlist/components/form/PlaylistTitleForm")},kQ5c:function(e,i){e.exports=tui.require("totara_engage/components/card/BaseCard")},kcYD:function(e,i,a){"use strict";a.r(i);var t=a("M1cW");a.d(i,"playlistGrid",(function(){return t.default}))},kkOl:function(e,i){e.exports=tui.require("editor_weka/WekaValue")},lKjL:function(e,i){e.exports=tui.require("totara_playlist/components/sidepanel/PlaylistSummary")},ls82:function(e,i,a){var t=function(e){"use strict";var i=Object.prototype,a=i.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",l=t.toStringTag||"@@toStringTag";function s(e,i,a){return Object.defineProperty(e,i,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[i]}try{s({},"")}catch(e){s=function(e,i,a){return e[i]=a}}function d(e,i,a,t){var n=i&&i.prototype instanceof m?i:m,r=Object.create(n.prototype),l=new F(t||[]);return r._invoke=function(e,i,a){var t="suspendedStart";return function(n,r){if("executing"===t)throw new Error("Generator is already running");if("completed"===t){if("throw"===n)throw r;return x()}for(a.method=n,a.arg=r;;){var l=a.delegate;if(l){var s=N(l,a);if(s){if(s===u)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===t)throw t="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);t="executing";var d=o(e,i,a);if("normal"===d.type){if(t=a.done?"completed":"suspendedYield",d.arg===u)continue;return{value:d.arg,done:a.done}}"throw"===d.type&&(t="completed",a.method="throw",a.arg=d.arg)}}}(e,a,l),r}function o(e,i,a){try{return{type:"normal",arg:e.call(i,a)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var u={};function m(){}function c(){}function k(){}var v={};v[n]=function(){return this};var p=Object.getPrototypeOf,g=p&&p(p(S([])));g&&g!==i&&a.call(g,n)&&(v=g);var y=k.prototype=m.prototype=Object.create(v);function f(e){["next","throw","return"].forEach((function(i){s(e,i,(function(e){return this._invoke(i,e)}))}))}function _(e,i){var t;this._invoke=function(n,r){function l(){return new i((function(t,l){!function t(n,r,l,s){var d=o(e[n],e,r);if("throw"!==d.type){var u=d.arg,m=u.value;return m&&"object"==typeof m&&a.call(m,"__await")?i.resolve(m.__await).then((function(e){t("next",e,l,s)}),(function(e){t("throw",e,l,s)})):i.resolve(m).then((function(e){u.value=e,l(u)}),(function(e){return t("throw",e,l,s)}))}s(d.arg)}(n,r,t,l)}))}return t=t?t.then(l,l):l()}}function N(e,i){var a=e.iterator[i.method];if(void 0===a){if(i.delegate=null,"throw"===i.method){if(e.iterator.return&&(i.method="return",i.arg=void 0,N(e,i),"throw"===i.method))return u;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var t=o(a,e.iterator,i.arg);if("throw"===t.type)return i.method="throw",i.arg=t.arg,i.delegate=null,u;var n=t.arg;return n?n.done?(i[e.resultName]=n.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=void 0),i.delegate=null,u):n:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,u)}function b(e){var i={tryLoc:e[0]};1 in e&&(i.catchLoc=e[1]),2 in e&&(i.finallyLoc=e[2],i.afterLoc=e[3]),this.tryEntries.push(i)}function h(e){var i=e.completion||{};i.type="normal",delete i.arg,e.completion=i}function F(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function S(e){if(e){var i=e[n];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var t=-1,r=function i(){for(;++t<e.length;)if(a.call(e,t))return i.value=e[t],i.done=!1,i;return i.value=void 0,i.done=!0,i};return r.next=r}}return{next:x}}function x(){return{value:void 0,done:!0}}return c.prototype=y.constructor=k,k.constructor=c,c.displayName=s(k,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var i="function"==typeof e&&e.constructor;return!!i&&(i===c||"GeneratorFunction"===(i.displayName||i.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,s(e,l,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},f(_.prototype),_.prototype[r]=function(){return this},e.AsyncIterator=_,e.async=function(i,a,t,n,r){void 0===r&&(r=Promise);var l=new _(d(i,a,t,n),r);return e.isGeneratorFunction(a)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},f(y),s(y,l,"Generator"),y[n]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var i=[];for(var a in e)i.push(a);return i.reverse(),function a(){for(;i.length;){var t=i.pop();if(t in e)return a.value=t,a.done=!1,a}return a.done=!0,a}},e.values=S,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(h),!e)for(var i in this)"t"===i.charAt(0)&&a.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function t(a,t){return l.type="throw",l.arg=e,i.next=a,t&&(i.method="next",i.arg=void 0),!!t}for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n],l=r.completion;if("root"===r.tryLoc)return t("end");if(r.tryLoc<=this.prev){var s=a.call(r,"catchLoc"),d=a.call(r,"finallyLoc");if(s&&d){if(this.prev<r.catchLoc)return t(r.catchLoc,!0);if(this.prev<r.finallyLoc)return t(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return t(r.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return t(r.finallyLoc)}}}},abrupt:function(e,i){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=i&&i<=r.finallyLoc&&(r=null);var l=r?r.completion:{};return l.type=e,l.arg=i,r?(this.method="next",this.next=r.finallyLoc,u):this.complete(l)},complete:function(e,i){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&i&&(this.next=i),u},finish:function(e){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),h(a),u}},catch:function(e){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc===e){var t=a.completion;if("throw"===t.type){var n=t.arg;h(a)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,a){return this.delegate={iterator:S(e),resultName:i,nextLoc:a},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},mt9Y:function(e,i,a){"use strict";a.r(i);var t=a("jJ8l"),n=a.n(t),r=a("bxuo"),l=a.n(r),s=a("HuWC"),d=a.n(s),o={components:{BookmarkButton:l.a,Card:n.a,StarRating:d.a},props:{bookmarked:{type:Boolean,default:!1},fullname:{type:String,required:!0},image:{type:String,required:!0},imageAlt:String,name:{type:String,required:!0},playlistId:{type:[Number,String],required:!0},rating:{type:Number,required:!0},resources:{type:Number,required:!0},url:{type:String,required:!0}},data:function(){return{innerBookmarked:this.bookmarked}},computed:{imageStyle:function(){return{backgroundImage:"url(".concat(this.image,"})")}}},methods:{handleClickBookmark:function(){this.innerBookmarked=!this.innerBookmarked,this.$emit("update",this.playlistId,this.innerBookmarked)},handleClickCard:function(){window.location.href=this.url}}},u=(a("GlpC"),a("KHd+")),m=Object(u.a)(o,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("Card",{staticClass:"tui-playlistRelatedCard",attrs:{clickable:!0},on:{click:e.handleClickCard}},[a("a",{attrs:{href:e.url}}),e._v(" "),a("div",{staticClass:"tui-playlistRelatedCard__header",style:e.imageStyle},[e.imageAlt?a("span",{staticClass:"sr-only"},[e._v(e._s(e.imageAlt))]):e._e(),e._v(" "),a("span",{staticClass:"tui-playlistRelatedCard__resourceCount"},[e._v("\n      "+e._s(e.resources)+"\n    ")])]),e._v(" "),a("section",{staticClass:"tui-playlistRelatedCard__content"},[a("span",[e._v(e._s(e.name))]),e._v(" "),a("span",[e._v(e._s(e.fullname))]),e._v(" "),a("StarRating",{attrs:{rating:e.rating,"read-only":!0,increment:.1,"max-rating":5}})],1),e._v(" "),a("BookmarkButton",{staticClass:"tui-playlistRelatedCard__bookmark",attrs:{size:"300",bookmarked:e.innerBookmarked,primary:!1,circle:!1,small:!0,transparent:!0},on:{click:e.handleClickBookmark}})],1)}),[],!1,null,null,null);m.options.__hasBlocks={script:!0,template:!0};i.default=m.exports},nEm4:function(e,i){e.exports=tui.require("tui/components/form/Form")},nHte:function(e,i){},nWvO:function(e,i){e.exports=tui.require("tui/components/util/PropsProvider")},nXMa:function(e,i){e.exports=tui.require("tui/components/buttons/Cancel")},nnnb:function(e,i){e.exports=tui.require("tui/components/icons/DragHandle")},o0o1:function(e,i,a){e.exports=a("ls82")},oB6E:function(e,i){e.exports=tui.require("tui/components/icons/Share")},oFjh:function(e,i){},oMGV:function(e,i){e.exports=tui.require("totara_engage/components/form/UnsavedChangesWarning")},oMuj:function(e,i){e.exports=tui.require("tui/components/form/InputText")},oQSm:function(e,i){e.exports=tui.require("totara_engage/mixins/navigation_mixin")},pxdy:function(e,i){e.exports=tui.require("totara_engage/mixins/contribution_mixin")},"qEZ+":function(e,i,a){"use strict";a.r(i);var t=a("yXPU"),n=a.n(t),r=a("o0o1"),l=a.n(r),s=a("vH83"),d=a.n(s),o=a("5h9J"),u=a.n(o),m=a("fPwS"),c=a.n(m),k={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_playlist_remove_resource"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"instanceid"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"result"},name:{kind:"Name",value:"totara_playlist_remove_resource"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"instanceid"},value:{kind:"Variable",name:{kind:"Name",value:"instanceid"}}}],directives:[]}]}}]},v={components:{Delete:d.a,ButtonIcon:u.a,Loading:c.a},props:{instanceId:{type:Number,required:!0},playlistId:{type:Number,required:!0}},data:function(){return{loading:!1}},methods:{removeResouce:function(){var e=this;return n()(l.a.mark((function i(){return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e.loading||(e.loading=!0),i.prev=1,i.next=4,e.$apollo.mutate({mutation:k,refetchQueries:["totara_playlist_cards","totara_playlist_get_playlist"],variables:{id:e.playlistId,instanceid:e.instanceId}});case 4:return i.prev=4,e.loading=!1,i.finish(4);case 7:case"end":return i.stop()}}),i,null,[[1,,4,7]])})))()}}},p=(a("nHte"),a("KHd+")),g=function(e){e.options.__langStrings={totara_playlist:["removeitem"]}},y=Object(p.a)(v,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",{staticClass:"tui-playlistFootnote"},[a("ButtonIcon",{staticClass:"tui-playlistFootnote__button",attrs:{"aria-label":e.$str("removeitem","totara_playlist"),styleclass:{small:!0,transparentNoPadding:!0,alert:!0},disabled:e.loading},on:{click:function(i){return i.preventDefault(),e.removeResouce(i)}}},[e.loading?a("Loading"):a("Delete")],1)],1)}),[],!1,null,null,null);"function"==typeof g&&g(y),y.options.__hasBlocks={script:!0,template:!0};i.default=y.exports},qyfC:function(e,i){e.exports=tui.require("totara_engage/components/card/ImageHeader")},"r5/8":function(e,i){e.exports=tui.require("totara_playlist/components/sidepanel/PlaylistStarRating")},ry4p:function(e,i){e.exports=tui.require("totara_playlist/components/card/SummaryPlaylistCard")},s5vj:function(e,i){e.exports=tui.require("totara_engage/components/contribution/BaseContent")},sxi1:function(e,i){e.exports=tui.require("tui/components/icons/More")},sy3s:function(e,i){e.exports=tui.require("totara_engage/components/sidepanel/access/AccessSetting")},tDnt:function(e,i,a){"use strict";a.r(i);var t={mixins:[a("tyu8").imageMixin]},n=(a("vTST"),a("KHd+")),r=function(e){e.options.__langStrings={totara_playlist:["image_alt"]}},l=Object(n.a)(t,(function(){var e=this.$createElement,i=this._self._c||e;return i("div",{staticClass:"tui-engagePlaylistImage"},[i("img",{staticClass:"tui-engagePlaylistImage__img",attrs:{src:this.image,alt:this.$str("image_alt","totara_playlist",this.name)}})])}),[],!1,null,null,null);"function"==typeof r&&r(l),l.options.__hasBlocks={script:!0,template:!0};i.default=l.exports},tciR:function(e,i,a){"use strict";a.r(i);var t=a("grGL"),n=a.n(t),r=a("ajlF"),l=a.n(r),s={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"totara_playlist_playlist_links"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"own_playlists"},name:{kind:"Name",value:"totara_playlist_playlists"},arguments:[{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"StringValue",value:"eyJsaW1pdCI6MCwicGFnZSI6MX0=",block:!1}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"EnumValue",value:"OWN"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[{kind:"Argument",name:{kind:"Name",value:"library_view"},value:{kind:"BooleanValue",value:!0}}],directives:[]}]}},{kind:"Field",alias:{kind:"Name",value:"saved_playlists"},name:{kind:"Name",value:"totara_playlist_playlists"},arguments:[{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"StringValue",value:"eyJsaW1pdCI6MCwicGFnZSI6MX0=",block:!1}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"EnumValue",value:"BOOKMARKED"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[{kind:"Argument",name:{kind:"Name",value:"library_view"},value:{kind:"BooleanValue",value:!0}}],directives:[]}]}}]}}]},d=a("oQSm"),o=a.n(d),u={components:{Contribute:n.a,ContributeModal:l.a},mixins:[o.a],data:function(){return{collection:{own:[],saved:[]}}},apollo:{collection:{query:s,update:function(e){return{saved:e.saved_playlists,own:e.own_playlists}}}}},m=(a("/ph4"),a("KHd+")),c=function(e){e.options.__langStrings={totara_playlist:["yourplaylists","savedplaylists","contributeplaylist"]}},k=Object(m.a)(u,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("section",{staticClass:"tui-playlistNavigation"},[a("div",{staticClass:"tui-engageNavigationPanel__category tui-engageNavigationPanel__contribute"},[a("h3",{staticClass:"tui-engageNavigationPanel__header"},[e._v("\n      "+e._s(e.$str("yourplaylists","totara_playlist"))+"\n    ")]),e._v(" "),e.showContribute?a("Contribute",{attrs:{"show-text":!1,"show-icon":!0,styleclass:{circle:!0,xsmall:!0,primary:!1},"aria-label":e.$str("contributeplaylist","totara_playlist")},scopedSlots:e._u([{key:"modal",fn:function(){return[a("ContributeModal")]},proxy:!0}],null,!1,3432429443)}):e._e()],1),e._v(" "),e.$apollo.loading?e._e():e._l(e.collection.own,(function(i,t){return a("div",{key:"playlistLink_"+t,class:e.getNavigationLinkClass("playlist_"+i.id,t)},[a("a",{staticClass:"tui-engageNavigationPanel__link-text",attrs:{href:i.url}},[e._v("\n        "+e._s(i.name)+"\n      ")])])})),e._v(" "),a("div",{staticClass:"tui-engageNavigationPanel__category"},[a("h3",{staticClass:"tui-engageNavigationPanel__header"},[e._v("\n      "+e._s(e.$str("savedplaylists","totara_playlist"))+"\n    ")])]),e._v(" "),e.$apollo.loading?e._e():e._l(e.collection.saved,(function(i,t){return a("div",{key:"playlistSaved_"+t,class:e.getNavigationLinkClass("playlist_"+i.id,t)},[a("a",{staticClass:"tui-engageNavigationPanel__link-text",attrs:{href:i.url}},[e._v("\n        "+e._s(i.name)+"\n      ")])])}))],2)}),[],!1,null,null,null);"function"==typeof c&&c(k),k.options.__hasBlocks={script:!0,template:!0};i.default=k.exports},tkAW:function(e,i){e.exports=tui.require("tui/components/modal/Modal")},tyu8:function(e,i){e.exports=tui.require("totara_engage/index")},u5iS:function(e,i){e.exports=tui.require("tui/components/modal/ModalContent")},ucYl:function(e,i){},uwJF:function(e,i){},vF5l:function(e,i){e.exports=tui.require("tui/components/buttons/Button")},vH83:function(e,i){e.exports=tui.require("tui/components/icons/Delete")},vN5C:function(e,i,a){"use strict";i.a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_engage_update_bookmark"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"itemid"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"component"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"bookmarked"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_boolean"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"result"},name:{kind:"Name",value:"totara_engage_update_bookmark"},arguments:[{kind:"Argument",name:{kind:"Name",value:"itemid"},value:{kind:"Variable",name:{kind:"Name",value:"itemid"}}},{kind:"Argument",name:{kind:"Name",value:"component"},value:{kind:"Variable",name:{kind:"Name",value:"component"}}},{kind:"Argument",name:{kind:"Name",value:"bookmarked"},value:{kind:"Variable",name:{kind:"Name",value:"bookmarked"}}}],directives:[]}]}}]}},vTST:function(e,i){},vyVp:function(e,i){e.exports=tui.require("tui/notifications")},w07m:function(e,i){e.exports=tui.require("totara_engage/components/header/ResourceNavigationBar")},wrxK:function(e,i,a){!function(){"use strict";"undefined"!=typeof tui&&tui._bundle.isLoaded("totara_playlist")?console.warn('[tui bundle] The bundle "totara_playlist" is already loaded, skipping initialisation.'):(tui._bundle.register("totara_playlist"),tui._bundle.addModulesFromContext("totara_playlist",a("d+XU")),tui._bundle.addModulesFromContext("totara_playlist/components",a("i0Ff")),tui._bundle.addModulesFromContext("totara_playlist/pages",a("5It0")))}()},xr2R:function(e,i){},xwzm:function(e,i,a){"use strict";a.r(i);var t=a("tkAW"),n=a.n(t),r=a("u5iS"),l=a.n(r),s=a("0hQ3"),d={components:{CreatePlaylist:a.n(s).a,Modal:n.a,ModalContent:l.a},data:function(){return{size:"large",dismissable:{overlayClose:!1,esc:!0,backdropClick:!1},hideTabs:!1,stage:0}},computed:{getTitle:function(){return 1===this.stage?this.$str("accesssettings","totara_playlist"):this.$str("contribute","totara_playlist")}}},o=(a("1HKY"),a("KHd+")),u=function(e){e.options.__langStrings={totara_playlist:["accesssettings","pluginname","contribute"]}},m=Object(o.a)(d,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("Modal",{attrs:{size:"large","aria-labelledby":e.$id("title"),dismissable:e.dismissable}},[a("ModalContent",{staticClass:"tui-playlistContributeModal",attrs:{"close-button":!1,title:e.getTitle,"content-padding":!1}},[a("div",{staticClass:"tui-playlistContributeModal__content"},[a("CreatePlaylist",{on:{cancel:function(i){return e.$emit("request-close")},"change-title":function(i){e.stage=i}}})],1)])],1)}),[],!1,null,null,null);"function"==typeof u&&u(m),m.options.__hasBlocks={script:!0,template:!0};i.default=m.exports},"y++F":function(e,i,a){"use strict";a.r(i);var t=a("H/tB"),n=a.n(t),r=a("FoZm"),l=a("2wx7"),s=a.n(l),d=a("kkOl"),o=a.n(d),u=a("QGXx"),m=a.n(u),c=a("g0Fk"),k=a.n(c),v=a("oMGV"),p=a.n(v),g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"totara_playlist_get_playlist_raw"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"playlist"},name:{kind:"Name",value:"totara_playlist_instance"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"RAW"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"summaryformat"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}}]}}]},y={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_playlist_update_playlist_summary"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"summary"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"summary_format"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"playlist"},name:{kind:"Name",value:"totara_playlist_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"summary"},value:{kind:"Variable",name:{kind:"Name",value:"summary"}}},{kind:"Argument",name:{kind:"Name",value:"summary_format"},value:{kind:"Variable",name:{kind:"Name",value:"summary_format"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contextid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timedescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"HTML"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rated"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"updateable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contributable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totalresources"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"manageable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasnonpublicresources"},arguments:[],directives:[]}]}}]}}]},f={components:{DoneCancelGroup:m.a,InlineEditing:k.a,Weka:s.a,UnsavedChangesWarning:p.a},props:{instanceId:{type:[String,Number],required:!0},summary:{type:String,default:null},updateAble:{type:Boolean,default:!1}},data:function(){return{editing:!1,submitting:!1,content:o.a.empty()}},apollo:{playlist:{query:g,fetchPolicy:"network-only",skip:function(){return!this.editing},variables:function(){return{id:this.instanceId}},result:function(e){var i=e.data.playlist;i&&i.summary&&(this.content=o.a.fromDoc(JSON.parse(i.summary)))}}},mounted:function(){this.$_scan()},updated:function(){this.$_scan()},methods:{handleUpdate:function(e){this.$_readJson(e)},submit:function(){var e=this;this.submitting=!0,this.$apollo.mutate({mutation:y,variables:{id:this.instanceId,summary:JSON.stringify(this.content.getDoc()),summary_format:r.FORMAT_JSON_EDITOR},updateQuery:function(i,a){i.writeQuery({query:g,variables:{id:e.instanceId},data:a})}}).finally((function(){e.editing=!1,e.submitting=!1}))},$_scan:function(){if(this.$refs.content){var e=this.$refs.content;n.a.scan(e)}}}},_=(a("TnZe"),a("KHd+")),N=function(e){e.options.__langStrings={totara_playlist:["adddescription"]}},b=Object(_.a)(f,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",{staticClass:"tui-playlistSummary"},[e.editing?a("Form",[e.content.isEmpty||e.submitting?e._e():a("UnsavedChangesWarning",{attrs:{value:e.content}}),e._v(" "),a("Weka",{staticClass:"tui-playlistSummary__editor",attrs:{"usage-identifier":{component:"totara_playlist",area:"summary",instanceId:e.instanceId},compact:!0,variant:"totara_playlist-summary",placeholder:e.$str("adddescription","totara_playlist")},model:{value:e.content,callback:function(i){e.content=i},expression:"content"}}),e._v(" "),a("DoneCancelGroup",{attrs:{loading:e.submitting,disabled:e.submitting},on:{done:e.submit,cancel:function(i){e.editing=!1}}})],1):a("InlineEditing",{attrs:{"full-width":!0,"update-able":e.updateAble,"button-aria-label":e.$str("adddescription","totara_playlist")},on:{click:function(i){e.editing=!0}},scopedSlots:e._u([{key:"content",fn:function(){return[e.summary?a("div",{ref:"content",staticClass:"tui-playlistSummary__content",domProps:{innerHTML:e._s(e.summary)}}):!e.summary&&e.updateAble?a("div",{staticClass:"tui-playlistSummary__placeholder"},[e._v("\n        "+e._s(e.$str("adddescription","totara_playlist"))+"\n      ")]):e._e()]},proxy:!0}],null,!1,3412677065)})],1)}),[],!1,null,null,null);"function"==typeof N&&N(b),b.options.__hasBlocks={script:!0,template:!0};i.default=b.exports},yHtf:function(e,i){e.exports=tui.require("totara_playlist/components/sidepanel/PlaylistSidePanel")},yXPU:function(e,i){function a(e,i,a,t,n,r,l){try{var s=e[r](l),d=s.value}catch(e){return void a(e)}s.done?i(d):Promise.resolve(d).then(t,n)}e.exports=function(e){return function(){var i=this,t=arguments;return new Promise((function(n,r){var l=e.apply(i,t);function s(e){a(l,n,r,s,d,"next",e)}function d(e){a(l,n,r,s,d,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},yijA:function(e,i){},zEvk:function(e,i){e.exports=tui.require("totara_engage/mixins/library_mixin")},"zff/":function(e,i,a){"use strict";a.r(i);var t=a("9G+f"),n=a.n(t),r=a("vF5l"),l=a.n(r),s={components:{Popover:n.a,Button:l.a},methods:{$_handleClick:function(e){e(),this.$emit("rating")}}},d=(a("uwJF"),a("KHd+")),o=function(e){e.options.__langStrings={totara_playlist:["addrating"],totara_engage:["done"],core:["cancel"]}},u=Object(d.a)(s,(function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",{staticClass:"tui-playlistPopover"},[a("Popover",{attrs:{triggers:["click"]},scopedSlots:e._u([{key:"trigger",fn:function(){return[a("Button",{attrs:{text:e.$str("addrating","totara_playlist"),styleclass:{small:!0,transparent:!0}}})]},proxy:!0},{key:"buttons",fn:function(i){var t=i.close;return[a("div",{staticClass:"tui-playlistPopover__buttons"},[a("Button",{staticClass:"tui-playlistPopover__yes",attrs:{text:e.$str("done","totara_engage"),styleclass:{primary:!0,small:!0}},on:{click:function(i){return e.$_handleClick(t)}}}),e._v(" "),a("Button",{attrs:{text:e.$str("cancel","core"),styleclass:{small:!0}},on:{click:t}})],1)]}}])},[e._v(" "),e._t("content")],2)],1)}),[],!1,null,null,null);"function"==typeof o&&o(u),u.options.__hasBlocks={script:!0,template:!0};i.default=u.exports}});