@clickview/library-editor 1.2.0-rc.0 → 1.2.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[35],{1043:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(2),a=r(265);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f(e);if(t){var a=f(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return l(this,r)}}function l(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(l,e);var t,r,n,i=c(l);function l(){return o(this,l),i.apply(this,arguments)}return t=l,(r=[{key:"defaults",value:function(){return e={},t=a.c.Disabled,r=!0,t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e;var e,t,r}}])&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),l}(n.a.Model)},1049:function(e,t,r){"use strict";var n=r(1053),a=r(1050),i=(r(1051),r(3),r(1054)),o=(r(1056),r(1052));r.d(t,"a",(function(){return n.a})),r.d(t,"d",(function(){return a.g})),r.d(t,"g",(function(){return a.j})),r.d(t,"f",(function(){return a.i})),r.d(t,"c",(function(){return a.f})),r.d(t,"e",(function(){return a.h})),r.d(t,"b",(function(){return i.a})),r.d(t,"h",(function(){return o.a}))},1050:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"g",(function(){return g})),r.d(t,"e",(function(){return b})),r.d(t,"j",(function(){return h})),r.d(t,"i",(function(){return v})),r.d(t,"c",(function(){return w})),r.d(t,"b",(function(){return E})),r.d(t,"d",(function(){return x})),r.d(t,"f",(function(){return P})),r.d(t,"h",(function(){return y}));var n=r(2),a=r(1),i=r(19),o=r(29),u=r(3),s="libraryEditor.utils",c=["tags","thumbnail","chapters","resources","subtitles","disabled","links","restrictions","categories"];function l(e,t){if(e){var r=a.reduce(e,(function(e,r,n){var i=t[n];return r||i?a.isObject(r)&&a.isObject(i)&&!a.isUndefined(r.id)&&r.id===i.id?e:a.isArray(r)?f(r,i).length?e.concat(n):e:a.isEqual(r,i)?e:e.concat(n):e}),[]);if(r.length)return a.object(a.map(r,(function(r){return a.isArray(t[r])?[r,f(e[r],t[r])]:[r,t[r]]})))}}function f(e,t){var r=[];return a.each(t,(function(t){var n=a.findWhere(e,{id:t.id});if(!a.isUndefined(n)||0!==Object.keys(t).length){var i=a.isUndefined(n)?t:l(n,t);i&&(t.id<0&&!t.value||(!n||t.id<0?r.push(t):(i.id=t.id,r.push(i))))}})),r}var d={getChanges:function(e,t){var r=l(a.omit(e.toJSON(),c),a.omit(t.toJSON(),c));if(r)return a.object(a.map(a.keys(r),(function(e){return[e,d.formatChanges(e,r[e])]})))},formatChanges:function(e,t){if(!t)return null;if(a.isObject(t)&&a.isEmpty(t))return null;switch(e){case"name":case"description":case"productionYear":case"dateBroadcast":case"fields":case"episodeNumber":return t;case"channel":case"series":case"rating":case"season":return{id:t.id};case"distributors":case"producers":case"directors":case"productionCompanies":return a.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":case"seriesSort":return;default:n.a.ErrorHelper.throw(new i.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,r){var i=["distributors","producers","directors","productionCompanies"];for(var o in a.each(a.keys(r),(function(e){i.includes(e)&&(r[e]=t.get(e).toJSON())})),t.set(a.clone(r),{silent:!0}),e.set(t.toJSON(),{silent:!0}),r){if(!r[o]&&e.associations[o]){var u=e.get(o);(u instanceof n.a.Model||u instanceof n.a.NestedModel)&&u.clear()}}},getRemovedObjectIds:function(e,t){var r=["distributors","productionCompanies","producers","directors"],n={};return a.each(a.keys(e.toJSON()),(function(i){if(a.contains(r,i)){var o=e.get(i).map((function(e){return e.id})),u=t.get(i).map((function(e){return e.id})),s=a.filter(o,(function(e){return e&&!a.contains(u,e)}));s.length&&(n[i]=s)}})),n}},p={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"videoTitleRequired")}},{maxLength:255,msg:function(){return u.a.getPhrase(s,"videoTitleExceeds")}}],description:[{required:!1},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"videoDescriptionExceeds")}}],episodeNumber:function(e,t,r){return e&&e<1?u.a.getPhrase(s,"episodeNumberLessThanOne"):e&&e>2147483647?u.a.getPhrase(s,"episodeNumberExceeds"):e%1!=0?u.a.getPhrase(s,"episodeNumberNotWhole"):r.season&&r.season.get("number")>=0&&null===e?u.a.getPhrase(s,"episodeNumberNoSeason"):""},season:function(e,t,r){return r.season&&r.season.get("number")||e&&e.number||!r.episodeNumber?"":u.a.getPhrase(s,"seasonNoEpisodeNumber")}},m=o().year(),b={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>m?u.a.getPhrase(s,"validProductionYears",{currentYear:m}):void 0):""}},g={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"resourceNameRequired")}}]},h={suggestion:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditReasonRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"suggestEditReasonExceeds")}}]},y={number:function(e){return e?+e<1?u.a.getPhrase(s,"seasonLessThanOne"):+e>3e3?u.a.getPhrase(s,"seasonExceeds"):+e%1!=0?u.a.getPhrase(s,"seasonNotWhole"):"":u.a.getPhrase(s,"seasonRequired")}},v={empty:function(){return u.a.getPhrase(s,"suggestEditRatingRequired")},original:function(){return u.a.getPhrase(s,"suggestEditRatingInvalid")}},P={url:[{required:!0,pattern:"url",msg:function(){return u.a.getPhrase(s,"linkUrlRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"linkUrlExceeds")}}],name:[{required:!0,msg:function(){return u.a.getPhrase(s,"linkNameRequired")}},{maxLength:255,msg:function(){return u.a.getPhrase(s,"linkNameExceeds")}}]},w={name:[{maxLength:128,msg:function(){return u.a.getPhrase(s,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"fieldValueExceeds")}}]},E={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":u.a.getPhrase(s,"fieldsInvalid"):""}};function x(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1051:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(1),a=r(48),i=r(169),o=r(3),u="libraryEditor.utils",s={name:[{required:!0,msg:function(){return o.a.getPhrase(u,"folderNameRequired")}},{maxLength:255,msg:function(){return o.a.getPhrase(u,"folderNameExceeds")}}]},c=function(e,t){return{parentId:function(r){return r?a.a.calculateDestinationFolderDepth(e,r,t)>i.a.MAX_FOLDER_DEPTH?o.a.getPhrase(u,"maxFolderDepth",{maxDepth:i.a.MAX_FOLDER_DEPTH}):"":o.a.getPhrase(u,"selectParentFolder")}}},l=function(e){var t=e.validateName,r=e.validateParent,a=e.folder,i=e.collection;return t&&r?n.extend({},s,c(a,i)):t?s:r?c(a,i):void 0}},1052:function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(16),a=r(3),i=r(200),o=r(1069),u=r(62);function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c,l="libraryEditor.utils";!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(c||(c={}));var f={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.get("type")){case u.a.HostedLibrary:case u.a.CustomLibrary:return e.get("name");case u.a.Exchange:return a.a.getPhrase(l,"exchange");case u.a.Workspace:return a.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case u.a.HostedLibrary:case u.a.CustomLibrary:return"bg-info";case u.a.Exchange:return"bg-green";case u.a.Workspace:default:return"bg-red"}},isInteractive:function(e){return!(!e||!e.interactives)&&!!e.interactives.length},mapTypeToSvg:function(e){var t,r=(s(t={},c.Pdf,n.b.FilePDF),s(t,c.Image,n.b.FileImg),s(t,c.PowerPoint,n.b.FilePowerpoint),s(t,c.Document,n.b.FileWord),s(t,c.Excel,n.b.FileExcel),s(t,c.Zip,n.b.FileZip),s(t,c.File,n.b.File),t)[e];return r||(r=n.b.Folder),n.a.getSvg(r)},mapTypeToClass:function(e){switch(e){case c.Pdf:return"icon-red";case c.Image:return"icon-purple";case c.Document:return"icon-blue";case c.Excel:return"icon-green";case c.PowerPoint:return"icon-orange";case c.Zip:return"icon-teal";case c.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case c.Pdf:return a.a.getPhrase(l,"pdf");case c.Image:return a.a.getPhrase(l,"image");case c.Document:return a.a.getPhrase(l,"document");case c.Excel:return a.a.getPhrase(l,"spreadsheet");case c.PowerPoint:return a.a.getPhrase(l,"presentation");case c.Zip:return a.a.getPhrase(l,"zipArchive");case c.File:return a.a.getPhrase(l,"file");default:return""}},translateMetadataCollectionNames:function(e){return new o.a(e.map((function(e){return Object.assign(Object.assign({},e.toJSON()),{name:f.translateMetadataName(e.get("name"))})})))},translateMetadataName:function(e){var t="suggestEdit";switch(e){case i.MetadataType.VideoTitle:t+="VideoTitle";break;case i.MetadataType.Description:t+="Description";break;case i.MetadataType.Rating:t+="Rating";break;case i.MetadataType.SeriesTitle:t+="SeriesTitle";break;case i.MetadataType.Season:t+="SeasonNumber";break;case i.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case i.MetadataType.BroadcastDate:t+="BroadcastDate";break;case i.MetadataType.Channel:t+="Channel";break;case i.MetadataType.ProductionYear:t+="ProductionYear";break;case i.MetadataType.Distributors:t+="Distributors";break;case i.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case i.MetadataType.Directors:t+="Directors";break;case i.MetadataType.Producers:t+="Producers";break;case i.MetadataType.Other:t+="Other"}return a.a.getPhrase(l,t)}}},1053:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(1),a=r(12),i=r(3),o="libraryEditor.utils",u={isValidChapterTime:function(e,t,r,i){if(i){if(!n.isNumber(t))return s.StartTime.Invalid();if(t<0)return s.StartTime.Invalid();if(t>a.x.millisecondsToSeconds(r))return s.StartTime.Exceeds();if(i.some((function(r){return!(r.id&&r.id===e.id||r.cid===e.cid)&&r.get("startTime")===t})))return s.StartTime.Exists()}},isValidChapterName:function(e,t,r){return t?t.length>255?s.Name.MaxLength():r.some((function(r){return!(r.id&&r.id===e.id||r.cid===e.cid)&&r.get("name").trim()===t.trim()}))?s.Name.Exists():n.isEmpty(t.trim())?s.Name.Invalid():void 0:s.Name.Invalid()},mapPhysicalChapters:function(e){var t=0;return n.map(e,(function(e,r){var n={name:e.title,startTime:t,index:r,isPhysicalChapter:!0};return t+=e.duration,n}))}},s={Name:{Invalid:function(){return i.a.getPhrase(o,"chapterNameInvalid")},Exists:function(){return i.a.getPhrase(o,"chapterNameExists")},MaxLength:function(){return i.a.getPhrase(o,"chapterNameExceeds")}},StartTime:{Invalid:function(){return i.a.getPhrase(o,"chapterStartTimeInvalid")},Exists:function(){return i.a.getPhrase(o,"chapterStartTimeExists")},Exceeds:function(){return i.a.getPhrase(o,"chapterStartTimeExceeds")}}}},1054:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(3),a="libraryEditor.utils",i={name:[{required:!0,msg:function(){return n.a.getPhrase(a,"libraryNameRequired")}},{maxLength:255,msg:function(){return n.a.getPhrase(a,"libraryNameExceeds")}}]}},1056:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),a=r(1050),i=n.a.encloseNamespace("libraryEditor.utils"),o={name:[{required:!0,msg:function(){return i("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return i("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return i("uploadLibraryRequired")}}],episodeNumber:function(e,t,r){return e&&e<1?i("episodeNumberLessThanOne"):e&&e>255?i("episodeNumberExceeds"):e&&e%1!=0?i("episodeNumberNotWhole"):r.season&&r.season.get("number")>=0&&null===e?i("episodeNumberNoSeason"):""},season:function(e,t,r){return r.season&&r.season.get("number")||e&&e.number||!r.episodeNumber?"":i("seasonNoEpisodeNumber")},productionYear:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a.e.productionYear.apply(null,t)}}},1069:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=c(e);if(t){var a=c(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s(this,r)}}function s(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,"a",(function(){return l}));var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(c,e);var t,r,n,s=u(c);function c(){return i(this,c),s.apply(this,arguments)}return t=c,r&&a(t.prototype,r),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(2).a.Collection)},1304:function(e,t,r){var n=r(10);e.exports=(n.default||n).template({1:function(e,t,r,n,a){var i;e.propertyIsEnumerable;return(null!=(i=e.lambda(null!=(i=null!=t?t.options:t)?i.spinnerEl:i,t))?i:"")+"\r\n"},3:function(e,t,r,n,a){e.propertyIsEnumerable;var i=null!=t?t:e.nullContext||{},o=e.hooks.helperMissing,u=e.escapeExpression;return'<form>\r\n <div class="form-group">\r\n <label for="name" class="control-label">'+u((r.lang||t&&t.lang||o).call(i,"libraryName",{name:"lang",hash:{},data:a}))+'</label>\r\n <input name="name" id="name" type="text" class="form-control" placeholder="'+u((r.lang||t&&t.lang||o).call(i,"secondaryLibrary",{name:"lang",hash:{},data:a}))+'" autocomplete="off" autofocus/>\r\n <div class="form-feedback"></div>\r\n </div>\r\n</form>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,r,n,a){var i;e.propertyIsEnumerable;return null!=(i=r.unless.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.dataFetched:i,{name:"unless",hash:{},fn:e.program(1,a,0),inverse:e.program(3,a,0),data:a}))?i:""},useData:!0})},1438:function(e,t,r){"use strict";r.r(t),r.d(t,"NewLibraryView",(function(){return k}));var n=r(6),a=r(2),i=r(5),o=r(30),u=r(3),s=r(68),c=r(305),l=r(144),f=r(0),d=r(265),p=r(137),m=r(1043),b=r(12),g=r(1049),h=r(146),y=r(206),v=r(1304),P=r.n(v);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function N(e,t){return(N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=S(e);if(t){var a=S(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return T(this,r)}}function T(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N(e,t)}(T,e);var t,r,v,w=O(T);function T(){return E(this,T),w.apply(this,arguments)}return t=T,(r=[{key:"initialize",value:function(){this.model=o.a.get("new:library",null,{ctor:p.a}),this.bindListeners(),this.settingsDataService=i.a.getInstance(f.g.Settings,this),this.libraryDataService=i.a.getInstance(f.g.Library,this)}},{key:"bindListeners",value:function(){this.listenTo(f.e.SEARCH,"".concat(f.f.SETTINGS,":sync"),this.render)}},{key:"name",get:function(){return"NewLibraryView"}},{key:"title",get:function(){return u.a.getPhrase(this.lang,"title")}},{key:"lang",get:function(){return"libraryEditor.newLibrary"}},{key:"template",get:function(){return P.a}},{key:"channelName",get:function(){return b.k.generateUniqueChannelName(this)}},{key:"behaviors",get:function(){var e=this;return[{behaviorClass:c.a,modelValidation:g.b},{behaviorClass:c.f},{behaviorClass:c.e,title:u.a.getPhrase(this.lang,"heading"),spinnerButtonOptions:{model:this.spinnerModel=new m.a,channelName:this.channelName,buttonText:u.a.getPhrase(this.lang,"save"),onClick:function(t){return e.onSubmit(t)}}}]}},{key:"bindings",get:function(){return{"[name=name]":{observe:"name",setOptions:{validate:!0}}}}},{key:"events",value:function(){return{submit:"onSubmit"}}},{key:"onSubmit",value:function(e){e&&e.preventDefault(),this.model.validate(),this.model.isValid()&&(n.Radio.channel(this.channelName).trigger(d.b.ShowSpinner),this.createLibrary())}},{key:"createLibrary",value:function(){this.libraryDataService.createLibrary(this.currentUser.get("customerId"),this.model,(function(e){o.a.clear("new:library"),a.a.AppLinkHelper.trigger({application:f.b.LIBRARY_EDITOR,action:f.a.LibraryEditor.LIBRARY,args:[e.id]})}))}},{key:"requiredResources",get:function(){return{currentUser:l.b.currentUser,libraries:h.b.libraries}}},{key:"onBeforeRender",value:function(){this.maxCustomLibraries=this.settingsDataService.getSetting(this.currentUser.get("customerId"),s.a.MaxCustomLibraries),this.libraries.length>=this.maxCustomLibraries.get("value")?a.a.ErrorHelper.throw(new y.j(this.libraries.length,this.maxCustomLibraries.get("value"))):this.maxCustomLibraries&&this.spinnerModel.set(d.c.Disabled,!1)}},{key:"viewOptions",value:function(){return{dataFetched:!!this.maxCustomLibraries,spinnerEl:b.r.getSpinner({size:b.s.Large,extraClasses:"mx-auto"})}}}])&&x(t.prototype,r),v&&x(t,v),Object.defineProperty(t,"prototype",{writable:!1}),T}(a.a.View)}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[9],{1049:function(e,t,n){"use strict";var r=n(1053),o=n(1050),i=(n(1051),n(3),n(1054)),a=(n(1056),n(1052));n.d(t,"a",(function(){return r.a})),n.d(t,"d",(function(){return o.g})),n.d(t,"g",(function(){return o.j})),n.d(t,"f",(function(){return o.i})),n.d(t,"c",(function(){return o.f})),n.d(t,"e",(function(){return o.h})),n.d(t,"b",(function(){return i.a})),n.d(t,"h",(function(){return a.a}))},1050:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"k",(function(){return p})),n.d(t,"g",(function(){return h})),n.d(t,"e",(function(){return m})),n.d(t,"j",(function(){return b})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return w})),n.d(t,"b",(function(){return E})),n.d(t,"d",(function(){return R})),n.d(t,"f",(function(){return P})),n.d(t,"h",(function(){return y}));var r=n(2),o=n(1),i=n(19),a=n(29),u=n(3),s="libraryEditor.utils",c=["tags","thumbnail","chapters","resources","subtitles","disabled","links","restrictions","categories"];function l(e,t){if(e){var n=o.reduce(e,(function(e,n,r){var i=t[r];return n||i?o.isObject(n)&&o.isObject(i)&&!o.isUndefined(n.id)&&n.id===i.id?e:o.isArray(n)?f(n,i).length?e.concat(r):e:o.isEqual(n,i)?e:e.concat(r):e}),[]);if(n.length)return o.object(o.map(n,(function(n){return o.isArray(t[n])?[n,f(e[n],t[n])]:[n,t[n]]})))}}function f(e,t){var n=[];return o.each(t,(function(t){var r=o.findWhere(e,{id:t.id});if(!o.isUndefined(r)||0!==Object.keys(t).length){var i=o.isUndefined(r)?t:l(r,t);i&&(t.id<0&&!t.value||(!r||t.id<0?n.push(t):(i.id=t.id,n.push(i))))}})),n}var d={getChanges:function(e,t){var n=l(o.omit(e.toJSON(),c),o.omit(t.toJSON(),c));if(n)return o.object(o.map(o.keys(n),(function(e){return[e,d.formatChanges(e,n[e])]})))},formatChanges:function(e,t){if(!t)return null;if(o.isObject(t)&&o.isEmpty(t))return null;switch(e){case"name":case"description":case"productionYear":case"dateBroadcast":case"fields":case"episodeNumber":return t;case"channel":case"series":case"rating":case"season":return{id:t.id};case"distributors":case"producers":case"directors":case"productionCompanies":return o.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":case"seriesSort":return;default:r.a.ErrorHelper.throw(new i.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var i=["distributors","producers","directors","productionCompanies"];for(var a in o.each(o.keys(n),(function(e){i.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(o.clone(n),{silent:!0}),e.set(t.toJSON(),{silent:!0}),n){if(!n[a]&&e.associations[a]){var u=e.get(a);(u instanceof r.a.Model||u instanceof r.a.NestedModel)&&u.clear()}}},getRemovedObjectIds:function(e,t){var n=["distributors","productionCompanies","producers","directors"],r={};return o.each(o.keys(e.toJSON()),(function(i){if(o.contains(n,i)){var a=e.get(i).map((function(e){return e.id})),u=t.get(i).map((function(e){return e.id})),s=o.filter(a,(function(e){return e&&!o.contains(u,e)}));s.length&&(r[i]=s)}})),r}},p={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"videoTitleRequired")}},{maxLength:255,msg:function(){return u.a.getPhrase(s,"videoTitleExceeds")}}],description:[{required:!1},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"videoDescriptionExceeds")}}],episodeNumber:function(e,t,n){return e&&e<1?u.a.getPhrase(s,"episodeNumberLessThanOne"):e&&e>2147483647?u.a.getPhrase(s,"episodeNumberExceeds"):e%1!=0?u.a.getPhrase(s,"episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?u.a.getPhrase(s,"episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":u.a.getPhrase(s,"seasonNoEpisodeNumber")}},g=a().year(),m={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>g?u.a.getPhrase(s,"validProductionYears",{currentYear:g}):void 0):""}},h={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"resourceNameRequired")}}]},b={suggestion:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditReasonRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"suggestEditReasonExceeds")}}]},y={number:function(e){return e?+e<1?u.a.getPhrase(s,"seasonLessThanOne"):+e>3e3?u.a.getPhrase(s,"seasonExceeds"):+e%1!=0?u.a.getPhrase(s,"seasonNotWhole"):"":u.a.getPhrase(s,"seasonRequired")}},v={empty:function(){return u.a.getPhrase(s,"suggestEditRatingRequired")},original:function(){return u.a.getPhrase(s,"suggestEditRatingInvalid")}},P={url:[{required:!0,pattern:"url",msg:function(){return u.a.getPhrase(s,"linkUrlRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"linkUrlExceeds")}}],name:[{required:!0,msg:function(){return u.a.getPhrase(s,"linkNameRequired")}},{maxLength:255,msg:function(){return u.a.getPhrase(s,"linkNameExceeds")}}]},w={name:[{maxLength:128,msg:function(){return u.a.getPhrase(s,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"fieldValueExceeds")}}]},E={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":u.a.getPhrase(s,"fieldsInvalid"):""}};function R(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1051:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(1),o=n(48),i=n(169),a=n(3),u="libraryEditor.utils",s={name:[{required:!0,msg:function(){return a.a.getPhrase(u,"folderNameRequired")}},{maxLength:255,msg:function(){return a.a.getPhrase(u,"folderNameExceeds")}}]},c=function(e,t){return{parentId:function(n){return n?o.a.calculateDestinationFolderDepth(e,n,t)>i.a.MAX_FOLDER_DEPTH?a.a.getPhrase(u,"maxFolderDepth",{maxDepth:i.a.MAX_FOLDER_DEPTH}):"":a.a.getPhrase(u,"selectParentFolder")}}},l=function(e){var t=e.validateName,n=e.validateParent,o=e.folder,i=e.collection;return t&&n?r.extend({},s,c(o,i)):t?s:n?c(o,i):void 0}},1052:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(16),o=n(3),i=n(200),a=n(1069),u=n(62);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c,l="libraryEditor.utils";!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(c||(c={}));var f={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.get("type")){case u.a.HostedLibrary:case u.a.CustomLibrary:return e.get("name");case u.a.Exchange:return o.a.getPhrase(l,"exchange");case u.a.Workspace:return o.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case u.a.HostedLibrary:case u.a.CustomLibrary:return"bg-info";case u.a.Exchange:return"bg-green";case u.a.Workspace:default:return"bg-red"}},isInteractive:function(e){return!(!e||!e.interactives)&&!!e.interactives.length},mapTypeToSvg:function(e){var t,n=(s(t={},c.Pdf,r.b.FilePDF),s(t,c.Image,r.b.FileImg),s(t,c.PowerPoint,r.b.FilePowerpoint),s(t,c.Document,r.b.FileWord),s(t,c.Excel,r.b.FileExcel),s(t,c.Zip,r.b.FileZip),s(t,c.File,r.b.File),t)[e];return n||(n=r.b.Folder),r.a.getSvg(n)},mapTypeToClass:function(e){switch(e){case c.Pdf:return"icon-red";case c.Image:return"icon-purple";case c.Document:return"icon-blue";case c.Excel:return"icon-green";case c.PowerPoint:return"icon-orange";case c.Zip:return"icon-teal";case c.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case c.Pdf:return o.a.getPhrase(l,"pdf");case c.Image:return o.a.getPhrase(l,"image");case c.Document:return o.a.getPhrase(l,"document");case c.Excel:return o.a.getPhrase(l,"spreadsheet");case c.PowerPoint:return o.a.getPhrase(l,"presentation");case c.Zip:return o.a.getPhrase(l,"zipArchive");case c.File:return o.a.getPhrase(l,"file");default:return""}},translateMetadataCollectionNames:function(e){return new a.a(e.map((function(e){return Object.assign(Object.assign({},e.toJSON()),{name:f.translateMetadataName(e.get("name"))})})))},translateMetadataName:function(e){var t="suggestEdit";switch(e){case i.MetadataType.VideoTitle:t+="VideoTitle";break;case i.MetadataType.Description:t+="Description";break;case i.MetadataType.Rating:t+="Rating";break;case i.MetadataType.SeriesTitle:t+="SeriesTitle";break;case i.MetadataType.Season:t+="SeasonNumber";break;case i.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case i.MetadataType.BroadcastDate:t+="BroadcastDate";break;case i.MetadataType.Channel:t+="Channel";break;case i.MetadataType.ProductionYear:t+="ProductionYear";break;case i.MetadataType.Distributors:t+="Distributors";break;case i.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case i.MetadataType.Directors:t+="Directors";break;case i.MetadataType.Producers:t+="Producers";break;case i.MetadataType.Other:t+="Other"}return o.a.getPhrase(l,t)}}},1053:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(1),o=n(12),i=n(3),a="libraryEditor.utils",u={isValidChapterTime:function(e,t,n,i){if(i){if(!r.isNumber(t))return s.StartTime.Invalid();if(t<0)return s.StartTime.Invalid();if(t>o.x.millisecondsToSeconds(n))return s.StartTime.Exceeds();if(i.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("startTime")===t})))return s.StartTime.Exists()}},isValidChapterName:function(e,t,n){return t?t.length>255?s.Name.MaxLength():n.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("name").trim()===t.trim()}))?s.Name.Exists():r.isEmpty(t.trim())?s.Name.Invalid():void 0:s.Name.Invalid()},mapPhysicalChapters:function(e){var t=0;return r.map(e,(function(e,n){var r={name:e.title,startTime:t,index:n,isPhysicalChapter:!0};return t+=e.duration,r}))}},s={Name:{Invalid:function(){return i.a.getPhrase(a,"chapterNameInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterNameExists")},MaxLength:function(){return i.a.getPhrase(a,"chapterNameExceeds")}},StartTime:{Invalid:function(){return i.a.getPhrase(a,"chapterStartTimeInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterStartTimeExists")},Exceeds:function(){return i.a.getPhrase(a,"chapterStartTimeExceeds")}}}},1054:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),o="libraryEditor.utils",i={name:[{required:!0,msg:function(){return r.a.getPhrase(o,"libraryNameRequired")}},{maxLength:255,msg:function(){return r.a.getPhrase(o,"libraryNameExceeds")}}]}},1056:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(1050),i=r.a.encloseNamespace("libraryEditor.utils"),a={name:[{required:!0,msg:function(){return i("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return i("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return i("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?i("episodeNumberLessThanOne"):e&&e>255?i("episodeNumberExceeds"):e&&e%1!=0?i("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?i("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":i("seasonNoEpisodeNumber")},productionYear:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o.e.productionYear.apply(null,t)}}},1069:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}function s(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return l}));var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(c,e);var t,n,r,s=u(c);function c(){return i(this,c),s.apply(this,arguments)}return t=c,n&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(n(2).a.Collection)},1109:function(e,t,n){e.exports={requiredStar:"_3S5iJ",disabled:"_3iZQ5",formGroup:"B4xS9",suggestEdit:"_3n3sM",programTitle:"_3bWJB",description:"_3qayV",seriesTitle:"_3ojjo",broadcastDate:"_2hA-0",channel:"_1SMGG",rating:"_3AkUv",productionYear:"_1DYCl",distributors:"_2CbiR",productionCompanies:"_3hB5o",directors:"ksEaA",producers:"h7P2B",episodeNumber:"_3fMUg",seasonNumber:"GwqaB",icon:"quxL2",infoSvgContainer:"_18UDY"}},1204:function(e,t,n){e.exports={selectRating:"_1I6jj",removeRating:"_1ze5G",disabled:"_2hO8J",disabledSelected:"mnQ5O"}},1207:function(e,t,n){"use strict";var r=n(1),o=n(6),i=n(2),a=n(143),u=n(492),s=n(1263),c=n.n(s),l=n(1204),f=n.n(l);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}function h(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(u,e);var t,n,r,i=m(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),i.call(this,e)}return t=u,(n=[{key:"name",get:function(){return"SelectRatingItemComponent"}},{key:"template",get:function(){return c.a}},{key:"tagName",get:function(){return"li"}},{key:"attributes",get:function(){return{title:this.options.editable?this.model.get("name"):""}}},{key:"className",get:function(){var e="";return e+="btn ".concat(this.options.editable?"btn-light":"".concat(f.a.disabled)),this.model.get("selected")&&(e+=this.options.editable?" active":" ".concat(f.a.disabledSelected)),e}},{key:"events",value:function(){return{click:"onClick"}}},{key:"behaviors",get:function(){var e=this.options.editable?this.options.model.get("name"):"";return[{behaviorClass:a.a,title:e}]}},{key:"onClick",value:function(){this.options.editable&&o.Radio.channel(this.options.channelName).trigger("select:rating",this.model)}},{key:"onRender",value:function(){this.resetClassName()}}])&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(i.a.Component);function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=x(e);if(t){var o=x(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R(this,n)}}function R(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(i,e);var t,n,r,o=E(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"SelectRatingCollectionComponent"}},{key:"tagName",get:function(){return"ul"}},{key:"className",get:function(){return"rating-group btn-group p-0 m-0"}},{key:"childView",get:function(){return y}},{key:"childViewOptions",get:function(){return{channelName:this.options.channelName,currentRatingId:this.options.currentRatingId,editable:this.options.editable}}}])&&P(t.prototype,n),r&&P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.a.ComponentCollection),O=n(12),N=n(3),T=n(0),S=n(200),C=n(1264),_=n.n(C),j=n(1109),D=n.n(j);function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=B(e);if(t){var o=B(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return F(this,n)}}function F(e,t){if(t&&("object"===I(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return A}));var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q(e,t)}(c,e);var t,n,i,s=L(c);function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,e)}return t=c,(n=[{key:"name",get:function(){return"SelectRatingComponent"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"lang",get:function(){return"shared.selectRating"}},{key:"events",value:function(){return{"click .remove-rating":"onRemoveRating"}}},{key:"regions",value:function(){return{ratings:{el:".ratings-region",replaceElement:!0}}}},{key:"template",get:function(){return _.a}},{key:"behaviors",get:function(){return[{behaviorClass:a.a,selector:".remove-rating",title:N.a.getPhrase(this.lang,"removeTooltip")}]}},{key:"appLinks",get:function(){return{".suggest-rating":{application:T.b.LIBRARY_EDITOR,action:T.a.LibraryEditor.SUGGEST_AN_EDIT,args:[this.options.videoId],params:{metadata:S.MetadataType.Rating}}}}},{key:"defaults",get:function(){return{editable:!0}}},{key:"initialize",value:function(){this.setViewCollection(),this.setCurrentRating(this.model),this.bindListeners()}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"select:rating",this.onRatingSelected)}},{key:"setCurrentRating",value:function(e){O.l.setRating(e,this.viewCollection)}},{key:"onRatingSelected",value:function(e){this.setCurrentRating(e);var t=O.c.getSelected(this.viewCollection);this.updateRating(t)}},{key:"onRemoveRating",value:function(e){e.preventDefault(),this.$(".remove-rating").tooltip("dispose"),this.setCurrentRating(null);var t=this.collection.findWhere({value:0});return this.updateRating(t),!1}},{key:"updateRating",value:function(e){o.Radio.channel(this.options.parentChannelName).trigger("select:rating",e),this.render()}},{key:"setViewCollection",value:function(){var e=r.filter(this.collection.toJSON(),(function(e){return 0!==e.value}));return this.viewCollection=new u.a(e)}},{key:"viewOptions",value:function(){var e=O.c.getSelected(this.viewCollection);return{styles:r.extend(D.a,f.a),showRemove:!this.options.hideRemove&&e&&this.options.editable,editable:this.options.editable,hideHeaderText:this.options.hideHeaderText}}},{key:"renderRatingCollectionComponent",value:function(){this.showChildView("ratings",new k({collection:this.viewCollection,channelName:this.channelName,editable:this.options.editable}))}},{key:"onRender",value:function(){this.renderRatingCollectionComponent()}}])&&M(t.prototype,n),i&&M(t,i),Object.defineProperty(t,"prototype",{writable:!1}),c}(i.a.Component)},1263:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"\r\n"+e.escapeExpression("function"==typeof(i=null!=(i=n.code||(null!=t?t.code:t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"code",hash:{},data:o}):i)},useData:!0})},1264:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=null!=t?t:e.nullContext||{};return' <label class="'+(null!=(i=n.unless.call(a,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(2,o,0),inverse:e.noop,data:o}))?i:"")+'">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(a,"rating",{name:"lang",hash:{},data:o}))+"</label>\r\n "+(null!=(i=n.unless.call(a,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(4,o,0),inverse:e.noop,data:o}))?i:"")+"\r\n"},2:function(e,t,n,r,o){return"d-inline-block"},4:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.escapeExpression;return'<span class="'+a(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.suggestEdit:i,t))+'">- <a class="suggest-rating">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"suggestEdit",{name:"lang",hash:{},data:o}))+"</a></span><br>"},6:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.escapeExpression;return'<span class="text-muted mx-2 remove-rating '+a(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.removeRating:i,t))+'">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"remove",{name:"lang",hash:{},data:o}))+"</span>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,u=e.escapeExpression,s=null!=t?t:e.nullContext||{};return'<div class="edit-rating form-group '+u(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.selectRating:i,t))+" "+u(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.rating:i,t))+'">\r\n'+(null!=(i=n.unless.call(s,null!=(i=null!=t?t.options:t)?i.hideHeaderText:i,{name:"unless",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+' <div>\r\n <div class="ratings-region" name="rating"></div>\r\n '+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.showRemove:i,{name:"if",hash:{},fn:e.program(6,o,0),inverse:e.noop,data:o}))?i:"")+'\r\n <div class="form-feedback"></div>\r\n </div>\r\n</div>'},useData:!0})}}]);