@clickview/library-editor 1.1.25-rc.0 → 1.1.25-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.
- package/dist/en.json +1 -1
- package/dist/libs/analytics/src/interfaces/AnalyticsTypes.d.ts +2 -1
- package/dist/libs/shared/src/images/svg/ImportedSvgs.d.ts +1 -0
- package/dist/libs/shared/src/images/svg/actions/index.d.ts +2 -1
- package/dist/libs/shared/src/interfaces/app-variables/BaseSearchAppVariables.d.ts +1 -0
- package/dist/projects/library-editor/src/app.d.ts +1 -0
- package/dist/projects/library-editor/src/apps/search/models/SearchAppVariables.d.ts +1 -0
- package/dist/scripts/{0-dd080b8dd5.chunk.js → 0-a4a2b6c3bd.chunk.js} +1 -1
- package/dist/scripts/{1-2769675f63.chunk.js → 1-7fbeb68bb8.chunk.js} +1 -1
- package/dist/scripts/{10-d66102df51.chunk.js → 10-4a5f3c9702.chunk.js} +1 -1
- package/dist/scripts/{11-3dec7d2c7e.chunk.js → 11-1c9df40232.chunk.js} +1 -1
- package/dist/scripts/{12-02d7efcd86.chunk.js → 12-1f38b67e32.chunk.js} +1 -1
- package/dist/scripts/{13-15a6288f53.chunk.js → 13-86cbeb77cb.chunk.js} +1 -1
- package/dist/scripts/{14-eb6626a81b.chunk.js → 14-9cf0887b65.chunk.js} +1 -1
- package/dist/scripts/{15-6974063e7c.chunk.js → 15-6515f3f172.chunk.js} +1 -1
- package/dist/scripts/{16-4c2367d5b4.chunk.js → 16-ab912b4a8c.chunk.js} +1 -1
- package/dist/scripts/{17-03fac7bf0e.chunk.js → 17-ecfedb0bf1.chunk.js} +1 -1
- package/dist/scripts/{2-7cc9176e8a.chunk.js → 2-c2310c1339.chunk.js} +1 -1
- package/dist/scripts/{20-69adc5c45e.chunk.js → 20-af0a5a2512.chunk.js} +1 -1
- package/dist/scripts/{21-3f73bd4963.chunk.js → 21-59ed31ffc5.chunk.js} +1 -1
- package/dist/scripts/{22-e2709aa055.chunk.js → 22-347456c689.chunk.js} +1 -1
- package/dist/scripts/{23-3a2522560f.chunk.js → 23-ebd9557286.chunk.js} +1 -1
- package/dist/scripts/{24-9f2e804a4b.chunk.js → 24-e16d0547e9.chunk.js} +1 -1
- package/dist/scripts/{25-03e6b9522a.chunk.js → 25-92f6215cb3.chunk.js} +1 -1
- package/dist/scripts/{26-b81589abce.chunk.js → 26-8a977a08e5.chunk.js} +1 -1
- package/dist/scripts/{27-df81c2e7c1.chunk.js → 27-85df941a2d.chunk.js} +1 -1
- package/dist/scripts/{28-07e079ba04.chunk.js → 28-f80c699fd6.chunk.js} +1 -1
- package/dist/scripts/{29-fd803946fe.chunk.js → 29-fc294d0849.chunk.js} +1 -1
- package/dist/scripts/{3-48930cb051.chunk.js → 3-6349335935.chunk.js} +1 -1
- package/dist/scripts/{30-dbab3b295d.chunk.js → 30-614613e387.chunk.js} +1 -1
- package/dist/scripts/{31-c14b71f5ca.chunk.js → 31-9b9810e4b9.chunk.js} +1 -1
- package/dist/scripts/{32-f4acad5c9e.chunk.js → 32-ea2d20688f.chunk.js} +1 -1
- package/dist/scripts/{33-c9f3484f54.chunk.js → 33-48146a93d0.chunk.js} +1 -1
- package/dist/scripts/{34-12aba75d7c.chunk.js → 34-de371c7472.chunk.js} +1 -1
- package/dist/scripts/{35-63ce5a25a5.chunk.js → 35-ab09598a5e.chunk.js} +1 -1
- package/dist/scripts/{36-561e322665.chunk.js → 36-a721ef081a.chunk.js} +1 -1
- package/dist/scripts/{37-2451f55a4a.chunk.js → 37-bc8245a60f.chunk.js} +1 -1
- package/dist/scripts/{38-b50c359332.chunk.js → 38-0bbac3f327.chunk.js} +1 -1
- package/dist/scripts/{39-a3368e9bf6.chunk.js → 39-9795f31fd0.chunk.js} +1 -1
- package/dist/scripts/{4-54e34ec4fc.chunk.js → 4-cb2a8dd5c5.chunk.js} +1 -1
- package/dist/scripts/{40-0c75e94f5f.chunk.js → 40-fbd60b155a.chunk.js} +1 -1
- package/dist/scripts/{41-f48815756a.chunk.js → 41-76b58a8008.chunk.js} +1 -1
- package/dist/scripts/{42-05c0d6f68d.chunk.js → 42-b11b8c5c55.chunk.js} +1 -1
- package/dist/scripts/{43-5d3df32736.chunk.js → 43-09ce311680.chunk.js} +1 -1
- package/dist/scripts/{44-c594b13413.chunk.js → 44-cd7d2a83da.chunk.js} +1 -1
- package/dist/scripts/{45-c98d90f764.chunk.js → 45-73ba6fa3cf.chunk.js} +1 -1
- package/dist/scripts/{46-47928b6814.chunk.js → 46-4111e431b3.chunk.js} +1 -1
- package/dist/scripts/{47-c2c3799c21.chunk.js → 47-9c0dff1aba.chunk.js} +1 -1
- package/dist/scripts/{48-5ee33992e3.chunk.js → 48-383d86be74.chunk.js} +1 -1
- package/dist/scripts/{49-6d6b215a6c.chunk.js → 49-0022ee9cb4.chunk.js} +1 -1
- package/dist/scripts/{5-c94e635750.chunk.js → 5-30bdab1fb6.chunk.js} +1 -1
- package/dist/scripts/{50-b05e39e1ce.chunk.js → 50-5344223128.chunk.js} +1 -1
- package/dist/scripts/{51-d7f62133a3.chunk.js → 51-cdc41ed2aa.chunk.js} +1 -1
- package/dist/scripts/{52-9e113c0b9b.chunk.js → 52-6be7674ae7.chunk.js} +1 -1
- package/dist/scripts/{53-1a0ed3a091.chunk.js → 53-2e0636fd3d.chunk.js} +1 -1
- package/dist/scripts/{54-d6ecf13242.chunk.js → 54-e04b2608dc.chunk.js} +1 -1
- package/dist/scripts/{55-f75b3084d8.chunk.js → 55-528e7df3ee.chunk.js} +1 -1
- package/dist/scripts/{56-9057b7ad17.chunk.js → 56-6ad0985763.chunk.js} +1 -1
- package/dist/scripts/{57-a8a8a2f2fb.chunk.js → 57-3816402932.chunk.js} +1 -1
- package/dist/scripts/{58-cbf1c26046.chunk.js → 58-b6e8c901b9.chunk.js} +1 -1
- package/dist/scripts/{59-1143d7c0a7.chunk.js → 59-09beaa76ca.chunk.js} +1 -1
- package/dist/scripts/{6-bc118be8ac.chunk.js → 6-de4014bef6.chunk.js} +1 -1
- package/dist/scripts/{60-759140faac.chunk.js → 60-1632b0f38f.chunk.js} +1 -1
- package/dist/scripts/{61-2822527b5c.chunk.js → 61-2a01ca4079.chunk.js} +1 -1
- package/dist/scripts/{62-1ac0e06d12.chunk.js → 62-a5d84c95f6.chunk.js} +1 -1
- package/dist/scripts/{63-ac2dc94370.chunk.js → 63-dd8ef946d1.chunk.js} +1 -1
- package/dist/scripts/{64-15350ac3f2.chunk.js → 64-51a86e8b9d.chunk.js} +1 -1
- package/dist/scripts/{65-2b2062090f.chunk.js → 65-8d0cc95f45.chunk.js} +1 -1
- package/dist/scripts/{66-5dda85ed0a.chunk.js → 66-a2799a0335.chunk.js} +1 -1
- package/dist/scripts/{67-14d2e9e0cf.chunk.js → 67-4d5ad4433e.chunk.js} +1 -1
- package/dist/scripts/{68-b65159ae17.chunk.js → 68-3ad046babc.chunk.js} +1 -1
- package/dist/scripts/{69-b3d0ff4822.chunk.js → 69-473acc7355.chunk.js} +1 -1
- package/dist/scripts/{7-a7f23db29e.chunk.js → 7-ec813915e4.chunk.js} +1 -1
- package/dist/scripts/{70-dadedb2918.chunk.js → 70-e4621c1b09.chunk.js} +1 -1
- package/dist/scripts/{71-8b18c1c2ea.chunk.js → 71-66838d7dc9.chunk.js} +1 -1
- package/dist/scripts/{72-47fc6183f7.chunk.js → 72-7a394ea64f.chunk.js} +1 -1
- package/dist/scripts/{8-1a4336774f.chunk.js → 8-9afbbfa151.chunk.js} +1 -1
- package/dist/scripts/{9-46c6596669.chunk.js → 9-dbc4581d0f.chunk.js} +1 -1
- package/dist/scripts/bundle-9d9551fe59.min.js +8 -0
- package/dist/scripts/bundles.json +2 -2
- package/dist/scripts/polyfills-166a090fdf.min.js +1 -0
- package/package.json +2 -2
- package/dist/scripts/bundle-e4843c72a5.min.js +0 -8
- package/dist/scripts/polyfills-3925f7f33d.min.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[8],{1027:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(2),o=n(246);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 c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(e,t){return(u=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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=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}}),t&&u(e,t)}(a,e);var t,n,r,i=l(a);function a(){return c(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"defaults",value:function(){return e={},t=o.c.Disabled,n=!0,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var e,t,n}}])&&s(t.prototype,n),r&&s(t,r),a}(r.a.Model)},1039:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(1),o=n(2),i=n(287);function c(e){return(c="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 s(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 u(e,t){return(u=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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=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}}),t&&u(e,t)}(a,e);var t,n,o,c=l(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c.call(this,e)}return t=a,(n=[{key:"initialize",value:function(){this.listenTo(this.options.channelName,"center:dropdown",this.centerSelectedItem)}},{key:"getExtraClasses",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.alignment,n=void 0===t?"left":t,r=e.extraClasses,o="dropdown-menu-".concat(n);return r&&(o="".concat(o," ").concat(r)),o}},{key:"centerSelectedItem",value:function(){var e=this.$el.find(".active");if(e.length){var t=this.$el.scrollTop()+e.position().top,n=.5*this.$el.height()+.5*e.height();this.$el.scrollTop(t-n)}}},{key:"name",get:function(){return"DropdownCollectionComponent"}},{key:"className",get:function(){return"dropdown-menu items-viewpart ".concat(this.getExtraClasses(this.options.displayOptions))}},{key:"attributes",get:function(){return{"aria-labelledby":"dropdownSelector"}}},{key:"childView",get:function(){return i.a}},{key:"childViewOptions",get:function(){var e={channelName:this.options.channelName,analyticsHelper:this.options.analyticsHelper};return r.extend(e,this.options.childOptions)}}])&&s(t.prototype,n),o&&s(t,o),a}(o.a.ComponentCollection)},1187:function(e,t,n){e.exports={select:"_1rbBR",selectButton:"htYy7",svgContainer:"_1sQ7D",groupButton:"_2CM1D",groupButtons:"_3uv-z",groupButtonSelected:"uC5RG",buttonDisabled:"_3-I1L",mediumWeight:"_10amI"}},1241: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,c=e.lambda,s=e.escapeExpression;return'<label for="'+s(c(null!=(i=null!=t?t.options:t)?i.buttonId:i,t))+'" class="control-label">'+s(c(null!=(i=null!=t?t.options:t)?i.labelText:i,t))+"</label>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.labelText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'<button class="dropdown-toggle form-control btn-block text-left '+s(c(null!=(i=null!=t?t.options:t)?i.buttonClass:i,t))+'" type="button" id="'+s(c(null!=(i=null!=t?t.options:t)?i.buttonId:i,t))+'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\r\n '+s(c(null!=(i=null!=t?t.options:t)?i.selected:i,t))+'\r\n</button>\r\n<div class="dropdown-menu-region"></div>'},useData:!0})},1242: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){return'<div class="year-group-region"></div>\r\n<div name="year" class="mt-3"></div>'},useData:!0})},1243:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){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,n,r,o){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return'<div class="d-flex align-items-center">\r\n<label class="control-label m-0 pb-2">'+s(c(null!=(i=null!=t?t.options:t)?i.restrictFromLabel:i,t))+"</label>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.supportUrl:i,{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.noop,data:o}))?i:"")+'</div>\r\n<div class="dropdown-region '+s(c(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.select:i,t))+' mb-3"></div>\r\n<div class="access-view-region"></div>\r\n'},4:function(e,t,n,r,o){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return'<a \r\n class="d-inline-block ml-1 mb-3 '+s(c(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'"\r\n title="'+s((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"findOutMore",{name:"lang",hash:{},data:o}))+'"\r\n href="'+s(c(null!=(i=null!=t?t.options:t)?i.supportUrl:i,t))+'" \r\n target="_blank"\r\n>\r\n '+(null!=(i=c(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+"\r\n</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return null!=(i=n.unless.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.dataFetched:i,{name:"unless",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o}))?i:""},useData:!0})},1459:function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(6),i=n(2),c=n(5),s=n(3),u=n(15),l=n(135),a=n(1027),f=n(283),p=n(4),h=n(42),d=n(13),y=n(309),g=n(0),m=n(136),b=n(187),v=n(8),w=n(246),k=n(1039),S=n(1241),O=n.n(S);function C(e){return(C="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 R(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){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return D(this,n)}}function D(e,t){return!t||"object"!==C(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=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}}),t&&I(e,t)}(i,e);var t,n,r,o=_(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:"initialize",value:function(){var e=this.model?this.model.get("id"):"";d.c.setSelected(e,this.collection),this.listenTo(this.options.channelName,this.options.eventName,this.onSelect)}},{key:"regions",value:function(){return{dropdown:{el:".dropdown-menu-region",replaceElement:!0}}}},{key:"onSelect",value:function(e){d.c.setSelected(e.get("id"),this.collection),this.render()}},{key:"viewOptions",value:function(){var e=d.c.getSelected(this.collection);return Object.assign({selected:e&&e.get("name")},this.options)}},{key:"getIsOptionDisabledFn",value:function(){var e=d.c.getSelected(this.collection),t=e&&e.id;return function(){return!!t&&(t=t.toString(),this.model.get("id").toString()===t)}}},{key:"renderChannelDropdown",value:function(){this.showChildView("dropdown",new k.a({collection:this.collection,channelName:this.options.channelName,childOptions:{titleProperty:this.options.titleProperty,isDisabled:this.getIsOptionDisabledFn(),eventName:this.options.eventName},displayOptions:this.options.displayOptions,analyticsHelper:this.options.analyticsHelper}))}},{key:"onRender",value:function(){this.renderChannelDropdown()}},{key:"name",get:function(){return"DropdownComponent"}},{key:"template",get:function(){return O.a}},{key:"className",get:function(){return this.options.buttonClass?"select-channel ".concat(this.options.buttonClass):"select-channel"}}])&&R(t.prototype,n),r&&R(t,r),i}(i.a.Component),j=n(1187),x=n.n(j),N=n(1242),T=n.n(N);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 A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(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 M(e,t,n){return t&&G(e.prototype,t),n&&G(e,n),e}function B(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}}),t&&F(e,t)}function F(e,t){return(F=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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=L(e);if(t){var o=L(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Y(this,n)}}function Y(e,t){return!t||"object"!==V(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var z=function(e){B(n,e);var t=U(n);function n(){return A(this,n),t.apply(this,arguments)}return M(n,[{key:"events",value:function(){return{click:"onClick"}}},{key:"onClick",value:function(){o.Radio.channel(this.options.channelName).trigger("group:selected",this.model)}},{key:"name",get:function(){return"RestrictAccessYearGroupItemView"}},{key:"className",get:function(){var e="btn text-center p-0 pb-1 pt-1 ".concat(x.a.groupButton);return this.model.get("selected")&&(e+=" ".concat(x.a.groupButtonSelected)),e}},{key:"tagName",get:function(){return"button"}},{key:"attributes",get:function(){var e=100/this.model.collection.length;return{type:"button",style:"width: ".concat(e,"%")}}},{key:"template",get:function(){var e=this.model.get("year");return"<span>".concat(e,"</span>")}}]),n}(i.a.Component),H=function(e){B(n,e);var t=U(n);function n(){return A(this,n),t.apply(this,arguments)}return M(n,[{key:"initialize",value:function(){this.bindListeners()}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"group:selected",this.onYearGroupSelected)}},{key:"onYearGroupSelected",value:function(e){this.collection.each((function(t){return t.set("selected",t.get("groupId")<=e.get("groupId"))})),this.model.set("groupId",e.get("groupId")),this.model.set("yearGroup",e.get("groupId")),this.render()}},{key:"onBeforeRender",value:function(){var e=this.model.get("yearGroup")||this.model.get("groupId");e&&(this.collection.each((function(t){return t.set("selected",t.get("groupId")<=e)})),this.model.set("groupId",e))}},{key:"name",get:function(){return"RestrictAccessYearGroupComponentCollection"}},{key:"className",get:function(){return"btn-group w-100 ".concat(x.a.groupButtons)}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"childView",get:function(){return z}},{key:"childViewOptions",get:function(){return{channelName:this.channelName}}}]),n}(i.a.CollectionView),q=function(e){B(n,e);var t=U(n);function n(){return A(this,n),t.apply(this,arguments)}return M(n,[{key:"initialize",value:function(){this.configDataService=c.a.getInstance(g.g.Config,this)}},{key:"regions",value:function(){return{yearGroupList:{replaceElement:!0,el:".year-group-region"}}}},{key:"viewOptions",value:function(){return{styles:x.a}}},{key:"onBeforeRender",value:function(){var e=this;this.yearGroups||this.getYearGroups(),r.some(this.yearGroups,(function(t){return t.groupId===e.model.get("groupId")}))||this.model.set("groupId",void 0)}},{key:"onRender",value:function(){this.stickit(),this.showChildView("yearGroupList",new H({model:this.model,collection:new i.a.Collection(this.yearGroups)}))}},{key:"onBeforeDestroy",value:function(){this.unstickit()}},{key:"getYearGroups",value:function(){var e=this,t=this.configDataService.getCustomerYearGroups(this.currentUser.get("countryCode"));this.yearGroups=[],r.keys(v.p).forEach((function(n){var o=parseInt(n,10);if(!r.isNaN(o)&&r.contains(t,o)){var i=o===v.p.Kindergarten?"K":v.p[o].replace("Year","Y");e.yearGroups.push({year:i,groupId:o})}}))}},{key:"buildGroupMessage",value:function(e){if(e){var t=d.n.mapYearGroupToName(e);return s.a.getPhrase(this.lang,"selectedYearGroups",{classNames:x.a.mediumWeight,groupName:t})}return s.a.getPhrase(this.lang,"selectYearGroups")}},{key:"name",get:function(){return"RestrictAccessGroupComponent"}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"props",get:function(){return["configDataService","currentUser"]}},{key:"template",get:function(){return T.a}},{key:"bindings",get:function(){var e=this;return{"[name=year]":{observe:"groupId",onGet:function(t){return e.buildGroupMessage(t)},updateMethod:"html",escape:!1}}}},{key:"requiredResources",get:function(){return{currentUser:m.b.currentUser}}}]),n}(i.a.Component);function $(e){return($="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 J(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K(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 Q(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Z(e);if(t){var o=Z(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return X(this,n)}}function X(e,t){return!t||"object"!==$(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ee,te=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}}),t&&W(e,t)}(i,e);var t,n,r,o=Q(i);function i(){return J(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"getTemplateText",value:function(){return s.a.getPhrase(this.lang,"groupNoAccess",{groupName:d.n.mapYearGroupToName(this.model.get("groupId"))})}},{key:"name",get:function(){return"RestrictAccessComponent"}},{key:"template",get:function(){return"<p>".concat(this.getTemplateText(),"</p>")}},{key:"lang",get:function(){return"shared.restrictAccess"}}])&&K(t.prototype,n),r&&K(t,r),i}(i.a.Component),ne=n(1243),re=n.n(ne);function oe(e){return(oe="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 ie(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 ce(e,t){return(ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function se(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=le(e);if(t){var o=le(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ue(this,n)}}function ue(e,t){return!t||"object"!==oe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"RestrictAccessView",(function(){return ae})),function(e){e.Students="Students",e.Groups="Certain year groups",e.All="Students and staff"}(ee||(ee={}));var ae=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}}),t&&ce(e,t)}(O,e);var t,n,k,S=se(O);function O(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,O),S.call(this,e)}return t=O,(n=[{key:"initialize",value:function(){this.restriction=new y.a({groupId:v.p.Students}),this.selected=ee.Students,this.bindListeners(),this.videoDataService=c.a.getInstance(g.g.Video,this),this.restrictedVideoDataService=c.a.getInstance(g.g.RestrictedVideo,this),this.videoMixinService=c.a.getInstance(g.x.VideoMixin,this)}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"dropdown:selected",this.onOptionSelected),this.listenTo(this.restriction,"change:groupId",this.onGroupChanged),this.listenTo(g.e.VIDEO,"".concat(g.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(g.e.RESTRICTED_VIDEO,"".concat(g.f.RESTRICTED_OBJECTS,":").concat(this.options.videoId,":sync"),this.render)}},{key:"events",value:function(){return{submit:"onSubmit","click .allow-full-access":"onAllowFullAccess"}}},{key:"regions",value:function(){return{dropdown:".dropdown-region",accessView:{replaceElement:!0,el:".access-view-region"}}}},{key:"getAllowFullAccessBtnClassName",value:function(){var e="btn btn-link cursor-pointer mr-2 allow-full-access";return this.dataFetched()&&!this.spinnerModel.get(w.c.ShowSpinner)||(e+=" disabled"),e}},{key:"getSubmitBtnTooltipOptions",value:function(){if(this.dataFetched()&&this.spinnerModel.get(w.c.Disabled))return{title:s.a.getPhrase(this.lang,"selectYear")}}},{key:"onOptionSelected",value:function(e){this.refreshRestriction();var t=this.getAccessView(e.get("name"));this.showChildView("accessView",new t({model:this.restriction,currentUser:this.currentUser})),this.renderDropdown()}},{key:"onGroupChanged",value:function(e){this.isRendered()&&this.spinnerModel.set(w.c.Disabled,r.isUndefined(e.get("groupId")))}},{key:"getAccessView",value:function(e){switch(this.selected=e,e){case ee.Students:return this.restriction.set("groupId",v.p.Students),te;case ee.Groups:return q;case ee.All:return this.restriction.set("groupId",v.p.All),te}}},{key:"getSelection",value:function(e){switch(e){case v.p.All:case v.p.Staff:return ee.All;case v.p.Students:return ee.Students;default:return ee.Groups}}},{key:"refreshRestriction",value:function(){if(this.restrictedObjectCollection&&this.restrictedObjectCollection.length&&this.model){this.videoMixinService.mixinVideoRestriction(this.model,this.restrictedObjectCollection);var e=this.model.restrictions.last();e&&r.isNumber(e.get("groupId"))&&(this.restriction.set("groupId",e.get("groupId")),this.selected=this.getSelection(e.get("groupId")))}}},{key:"onSubmit",value:function(e){var t=this;if(e&&e.preventDefault(),r.isUndefined(this.restriction.get("groupId")))return!1;o.Radio.channel(this.channelName).trigger(w.b.ShowSpinner),this.restrictedVideoDataService.updateVideoRestriction(this.options.videoId,this.restriction.get("groupId"),this.currentUser.get("customerId"),this.currentUser.get("id"),(function(){t.triggerMethod("hide"),o.Radio.channel(g.e.RESTRICTED_VIDEO).trigger("cache:cleared")})),this.logAction(this.restriction.get("groupId"))}},{key:"onAllowFullAccess",value:function(){this.dataFetched()&&!this.spinnerModel.get(w.c.ShowSpinner)&&(this.spinnerModel.set(w.c.Disabled,!0),this.restriction.set("groupId",v.p.All),this.restrictedVideoDataService.deleteVideoRestriction(this.options.videoId,(function(){o.Radio.channel(g.e.RESTRICTED_VIDEO).trigger("cache:cleared")})),this.triggerMethod("hide"),this.logAction())}},{key:"logAction",value:function(e){var t={location:p.k.Popup,actionType:p.q.SetAccess,entity:p.e.Video,workflowPhase:p.r.Complete},n={id:this.model.get("id"),restriction:!!r.isNumber(e)&&v.p[e]};h.a.logUserAction(n,t)}},{key:"dataFetched",value:function(){return!!this.model&&!!this.restrictedObjectCollection}},{key:"renderDropdown",value:function(){var e=this;this.collection=new i.a.Collection([{name:ee.Students},{name:ee.Groups},{name:ee.All}]),this.collection.each((function(t){return t.set("selected",t.get("name")===e.selected)})),this.showChildView("dropdown",new P({titleProperty:"name",eventName:"dropdown:selected",buttonId:"select-btn",collection:this.collection,channelName:this.channelName,buttonClass:x.a.selectButton,displayOptions:{extraClasses:"w-100"},analyticsHelper:h.a}))}},{key:"onBeforeRender",value:function(){this.model=this.videoDataService.getVideo(this.options.videoId),this.restrictedObjectCollection=this.restrictedVideoDataService.getVideoRestrictions([this.options.videoId]),this.model&&this.restrictedObjectCollection&&this.refreshRestriction(),this.dataFetched()&&this.spinnerModel.set(w.c.Disabled,!1)}},{key:"viewOptions",value:function(){var e=this.config?"".concat(this.config.get("supportSiteUrl")).concat(g.y.VIDEO_ACCESS):"";return{styles:x.a,supportUrl:e,svg:u.a.getSvg(u.b.Info),dataFetched:this.dataFetched(),spinnerEl:d.q.getSpinner({size:d.r.Large,extraClasses:"mx-auto"}),restrictFromLabel:s.a.getPhrase(this.lang,"popupSubheading")}}},{key:"onRender",value:function(){this.dataFetched()&&(this.renderDropdown(),this.onOptionSelected(new i.a.Model({name:this.selected})))}},{key:"name",get:function(){return"RestrictAccessView"}},{key:"title",get:function(){return s.a.getPhrase(this.lang,"title")}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"tagName",get:function(){return"form"}},{key:"className",get:function(){return"form-group"}},{key:"channelName",get:function(){return d.k.generateUniqueChannelName(this)}},{key:"template",get:function(){return re.a}},{key:"behaviors",get:function(){var e=this;return[{behaviorClass:f.f,title:s.a.getPhrase(this.lang,"popupHeading"),modalClasses:x.a.modal,hideCloseButton:!0,size:"modal-md",spinnerButtonOptions:{channelName:this.channelName,model:this.spinnerModel=new a.a,buttonText:s.a.getPhrase(this.lang,"updateAccess"),tooltip:function(){return e.getSubmitBtnTooltipOptions()},onClick:function(t){return e.onSubmit(t)}},buttons:[{text:s.a.getPhrase(this.lang,"allowFullAccess"),getClassName:function(){return e.getAllowFullAccessBtnClassName()}}]},{behaviorClass:l.a,selector:".".concat(x.a.svgContainer),title:s.a.getPhrase(this.lang,"findOutMore")}]}},{key:"elements",get:function(){return{submit:"submit"}}},{key:"requiredResources",get:function(){return{config:b.b.config,currentUser:m.b.currentUser}}}])&&ie(t.prototype,n),k&&ie(t,k),O}(i.a.View)}}]);
|
|
1
|
+
(window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[8],{1029:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(2),o=n(246);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 c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(e,t){return(u=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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=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}}),t&&u(e,t)}(a,e);var t,n,r,i=l(a);function a(){return c(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"defaults",value:function(){return e={},t=o.c.Disabled,n=!0,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var e,t,n}}])&&s(t.prototype,n),r&&s(t,r),a}(r.a.Model)},1041:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(1),o=n(2),i=n(287);function c(e){return(c="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 s(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 u(e,t){return(u=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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=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}}),t&&u(e,t)}(a,e);var t,n,o,c=l(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c.call(this,e)}return t=a,(n=[{key:"initialize",value:function(){this.listenTo(this.options.channelName,"center:dropdown",this.centerSelectedItem)}},{key:"getExtraClasses",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.alignment,n=void 0===t?"left":t,r=e.extraClasses,o="dropdown-menu-".concat(n);return r&&(o="".concat(o," ").concat(r)),o}},{key:"centerSelectedItem",value:function(){var e=this.$el.find(".active");if(e.length){var t=this.$el.scrollTop()+e.position().top,n=.5*this.$el.height()+.5*e.height();this.$el.scrollTop(t-n)}}},{key:"name",get:function(){return"DropdownCollectionComponent"}},{key:"className",get:function(){return"dropdown-menu items-viewpart ".concat(this.getExtraClasses(this.options.displayOptions))}},{key:"attributes",get:function(){return{"aria-labelledby":"dropdownSelector"}}},{key:"childView",get:function(){return i.a}},{key:"childViewOptions",get:function(){var e={channelName:this.options.channelName,analyticsHelper:this.options.analyticsHelper};return r.extend(e,this.options.childOptions)}}])&&s(t.prototype,n),o&&s(t,o),a}(o.a.ComponentCollection)},1189:function(e,t,n){e.exports={select:"_1rbBR",selectButton:"htYy7",svgContainer:"_1sQ7D",groupButton:"_2CM1D",groupButtons:"_3uv-z",groupButtonSelected:"uC5RG",buttonDisabled:"_3-I1L",mediumWeight:"_10amI"}},1243: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,c=e.lambda,s=e.escapeExpression;return'<label for="'+s(c(null!=(i=null!=t?t.options:t)?i.buttonId:i,t))+'" class="control-label">'+s(c(null!=(i=null!=t?t.options:t)?i.labelText:i,t))+"</label>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.labelText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'<button class="dropdown-toggle form-control btn-block text-left '+s(c(null!=(i=null!=t?t.options:t)?i.buttonClass:i,t))+'" type="button" id="'+s(c(null!=(i=null!=t?t.options:t)?i.buttonId:i,t))+'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\r\n '+s(c(null!=(i=null!=t?t.options:t)?i.selected:i,t))+'\r\n</button>\r\n<div class="dropdown-menu-region"></div>'},useData:!0})},1244: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){return'<div class="year-group-region"></div>\r\n<div name="year" class="mt-3"></div>'},useData:!0})},1245:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){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,n,r,o){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return'<div class="d-flex align-items-center">\r\n<label class="control-label m-0 pb-2">'+s(c(null!=(i=null!=t?t.options:t)?i.restrictFromLabel:i,t))+"</label>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.supportUrl:i,{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.noop,data:o}))?i:"")+'</div>\r\n<div class="dropdown-region '+s(c(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.select:i,t))+' mb-3"></div>\r\n<div class="access-view-region"></div>\r\n'},4:function(e,t,n,r,o){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return'<a \r\n class="d-inline-block ml-1 mb-3 '+s(c(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'"\r\n title="'+s((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"findOutMore",{name:"lang",hash:{},data:o}))+'"\r\n href="'+s(c(null!=(i=null!=t?t.options:t)?i.supportUrl:i,t))+'" \r\n target="_blank"\r\n>\r\n '+(null!=(i=c(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+"\r\n</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return null!=(i=n.unless.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.dataFetched:i,{name:"unless",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o}))?i:""},useData:!0})},1461:function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(6),i=n(2),c=n(5),s=n(3),u=n(15),l=n(135),a=n(1029),f=n(283),p=n(4),h=n(42),d=n(13),y=n(309),g=n(0),m=n(136),b=n(187),v=n(8),w=n(246),k=n(1041),S=n(1243),O=n.n(S);function C(e){return(C="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 R(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){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return D(this,n)}}function D(e,t){return!t||"object"!==C(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=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}}),t&&I(e,t)}(i,e);var t,n,r,o=_(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:"initialize",value:function(){var e=this.model?this.model.get("id"):"";d.c.setSelected(e,this.collection),this.listenTo(this.options.channelName,this.options.eventName,this.onSelect)}},{key:"regions",value:function(){return{dropdown:{el:".dropdown-menu-region",replaceElement:!0}}}},{key:"onSelect",value:function(e){d.c.setSelected(e.get("id"),this.collection),this.render()}},{key:"viewOptions",value:function(){var e=d.c.getSelected(this.collection);return Object.assign({selected:e&&e.get("name")},this.options)}},{key:"getIsOptionDisabledFn",value:function(){var e=d.c.getSelected(this.collection),t=e&&e.id;return function(){return!!t&&(t=t.toString(),this.model.get("id").toString()===t)}}},{key:"renderChannelDropdown",value:function(){this.showChildView("dropdown",new k.a({collection:this.collection,channelName:this.options.channelName,childOptions:{titleProperty:this.options.titleProperty,isDisabled:this.getIsOptionDisabledFn(),eventName:this.options.eventName},displayOptions:this.options.displayOptions,analyticsHelper:this.options.analyticsHelper}))}},{key:"onRender",value:function(){this.renderChannelDropdown()}},{key:"name",get:function(){return"DropdownComponent"}},{key:"template",get:function(){return O.a}},{key:"className",get:function(){return this.options.buttonClass?"select-channel ".concat(this.options.buttonClass):"select-channel"}}])&&R(t.prototype,n),r&&R(t,r),i}(i.a.Component),j=n(1189),x=n.n(j),N=n(1244),T=n.n(N);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 A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(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 M(e,t,n){return t&&G(e.prototype,t),n&&G(e,n),e}function B(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}}),t&&F(e,t)}function F(e,t){return(F=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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=L(e);if(t){var o=L(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Y(this,n)}}function Y(e,t){return!t||"object"!==V(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var z=function(e){B(n,e);var t=U(n);function n(){return A(this,n),t.apply(this,arguments)}return M(n,[{key:"events",value:function(){return{click:"onClick"}}},{key:"onClick",value:function(){o.Radio.channel(this.options.channelName).trigger("group:selected",this.model)}},{key:"name",get:function(){return"RestrictAccessYearGroupItemView"}},{key:"className",get:function(){var e="btn text-center p-0 pb-1 pt-1 ".concat(x.a.groupButton);return this.model.get("selected")&&(e+=" ".concat(x.a.groupButtonSelected)),e}},{key:"tagName",get:function(){return"button"}},{key:"attributes",get:function(){var e=100/this.model.collection.length;return{type:"button",style:"width: ".concat(e,"%")}}},{key:"template",get:function(){var e=this.model.get("year");return"<span>".concat(e,"</span>")}}]),n}(i.a.Component),H=function(e){B(n,e);var t=U(n);function n(){return A(this,n),t.apply(this,arguments)}return M(n,[{key:"initialize",value:function(){this.bindListeners()}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"group:selected",this.onYearGroupSelected)}},{key:"onYearGroupSelected",value:function(e){this.collection.each((function(t){return t.set("selected",t.get("groupId")<=e.get("groupId"))})),this.model.set("groupId",e.get("groupId")),this.model.set("yearGroup",e.get("groupId")),this.render()}},{key:"onBeforeRender",value:function(){var e=this.model.get("yearGroup")||this.model.get("groupId");e&&(this.collection.each((function(t){return t.set("selected",t.get("groupId")<=e)})),this.model.set("groupId",e))}},{key:"name",get:function(){return"RestrictAccessYearGroupComponentCollection"}},{key:"className",get:function(){return"btn-group w-100 ".concat(x.a.groupButtons)}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"childView",get:function(){return z}},{key:"childViewOptions",get:function(){return{channelName:this.channelName}}}]),n}(i.a.CollectionView),q=function(e){B(n,e);var t=U(n);function n(){return A(this,n),t.apply(this,arguments)}return M(n,[{key:"initialize",value:function(){this.configDataService=c.a.getInstance(g.g.Config,this)}},{key:"regions",value:function(){return{yearGroupList:{replaceElement:!0,el:".year-group-region"}}}},{key:"viewOptions",value:function(){return{styles:x.a}}},{key:"onBeforeRender",value:function(){var e=this;this.yearGroups||this.getYearGroups(),r.some(this.yearGroups,(function(t){return t.groupId===e.model.get("groupId")}))||this.model.set("groupId",void 0)}},{key:"onRender",value:function(){this.stickit(),this.showChildView("yearGroupList",new H({model:this.model,collection:new i.a.Collection(this.yearGroups)}))}},{key:"onBeforeDestroy",value:function(){this.unstickit()}},{key:"getYearGroups",value:function(){var e=this,t=this.configDataService.getCustomerYearGroups(this.currentUser.get("countryCode"));this.yearGroups=[],r.keys(v.p).forEach((function(n){var o=parseInt(n,10);if(!r.isNaN(o)&&r.contains(t,o)){var i=o===v.p.Kindergarten?"K":v.p[o].replace("Year","Y");e.yearGroups.push({year:i,groupId:o})}}))}},{key:"buildGroupMessage",value:function(e){if(e){var t=d.n.mapYearGroupToName(e);return s.a.getPhrase(this.lang,"selectedYearGroups",{classNames:x.a.mediumWeight,groupName:t})}return s.a.getPhrase(this.lang,"selectYearGroups")}},{key:"name",get:function(){return"RestrictAccessGroupComponent"}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"props",get:function(){return["configDataService","currentUser"]}},{key:"template",get:function(){return T.a}},{key:"bindings",get:function(){var e=this;return{"[name=year]":{observe:"groupId",onGet:function(t){return e.buildGroupMessage(t)},updateMethod:"html",escape:!1}}}},{key:"requiredResources",get:function(){return{currentUser:m.b.currentUser}}}]),n}(i.a.Component);function $(e){return($="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 J(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K(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 Q(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Z(e);if(t){var o=Z(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return X(this,n)}}function X(e,t){return!t||"object"!==$(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ee,te=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}}),t&&W(e,t)}(i,e);var t,n,r,o=Q(i);function i(){return J(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"getTemplateText",value:function(){return s.a.getPhrase(this.lang,"groupNoAccess",{groupName:d.n.mapYearGroupToName(this.model.get("groupId"))})}},{key:"name",get:function(){return"RestrictAccessComponent"}},{key:"template",get:function(){return"<p>".concat(this.getTemplateText(),"</p>")}},{key:"lang",get:function(){return"shared.restrictAccess"}}])&&K(t.prototype,n),r&&K(t,r),i}(i.a.Component),ne=n(1245),re=n.n(ne);function oe(e){return(oe="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 ie(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 ce(e,t){return(ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function se(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=le(e);if(t){var o=le(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ue(this,n)}}function ue(e,t){return!t||"object"!==oe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"RestrictAccessView",(function(){return ae})),function(e){e.Students="Students",e.Groups="Certain year groups",e.All="Students and staff"}(ee||(ee={}));var ae=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}}),t&&ce(e,t)}(O,e);var t,n,k,S=se(O);function O(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,O),S.call(this,e)}return t=O,(n=[{key:"initialize",value:function(){this.restriction=new y.a({groupId:v.p.Students}),this.selected=ee.Students,this.bindListeners(),this.videoDataService=c.a.getInstance(g.g.Video,this),this.restrictedVideoDataService=c.a.getInstance(g.g.RestrictedVideo,this),this.videoMixinService=c.a.getInstance(g.x.VideoMixin,this)}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"dropdown:selected",this.onOptionSelected),this.listenTo(this.restriction,"change:groupId",this.onGroupChanged),this.listenTo(g.e.VIDEO,"".concat(g.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(g.e.RESTRICTED_VIDEO,"".concat(g.f.RESTRICTED_OBJECTS,":").concat(this.options.videoId,":sync"),this.render)}},{key:"events",value:function(){return{submit:"onSubmit","click .allow-full-access":"onAllowFullAccess"}}},{key:"regions",value:function(){return{dropdown:".dropdown-region",accessView:{replaceElement:!0,el:".access-view-region"}}}},{key:"getAllowFullAccessBtnClassName",value:function(){var e="btn btn-link cursor-pointer mr-2 allow-full-access";return this.dataFetched()&&!this.spinnerModel.get(w.c.ShowSpinner)||(e+=" disabled"),e}},{key:"getSubmitBtnTooltipOptions",value:function(){if(this.dataFetched()&&this.spinnerModel.get(w.c.Disabled))return{title:s.a.getPhrase(this.lang,"selectYear")}}},{key:"onOptionSelected",value:function(e){this.refreshRestriction();var t=this.getAccessView(e.get("name"));this.showChildView("accessView",new t({model:this.restriction,currentUser:this.currentUser})),this.renderDropdown()}},{key:"onGroupChanged",value:function(e){this.isRendered()&&this.spinnerModel.set(w.c.Disabled,r.isUndefined(e.get("groupId")))}},{key:"getAccessView",value:function(e){switch(this.selected=e,e){case ee.Students:return this.restriction.set("groupId",v.p.Students),te;case ee.Groups:return q;case ee.All:return this.restriction.set("groupId",v.p.All),te}}},{key:"getSelection",value:function(e){switch(e){case v.p.All:case v.p.Staff:return ee.All;case v.p.Students:return ee.Students;default:return ee.Groups}}},{key:"refreshRestriction",value:function(){if(this.restrictedObjectCollection&&this.restrictedObjectCollection.length&&this.model){this.videoMixinService.mixinVideoRestriction(this.model,this.restrictedObjectCollection);var e=this.model.restrictions.last();e&&r.isNumber(e.get("groupId"))&&(this.restriction.set("groupId",e.get("groupId")),this.selected=this.getSelection(e.get("groupId")))}}},{key:"onSubmit",value:function(e){var t=this;if(e&&e.preventDefault(),r.isUndefined(this.restriction.get("groupId")))return!1;o.Radio.channel(this.channelName).trigger(w.b.ShowSpinner),this.restrictedVideoDataService.updateVideoRestriction(this.options.videoId,this.restriction.get("groupId"),this.currentUser.get("customerId"),this.currentUser.get("id"),(function(){t.triggerMethod("hide"),o.Radio.channel(g.e.RESTRICTED_VIDEO).trigger("cache:cleared")})),this.logAction(this.restriction.get("groupId"))}},{key:"onAllowFullAccess",value:function(){this.dataFetched()&&!this.spinnerModel.get(w.c.ShowSpinner)&&(this.spinnerModel.set(w.c.Disabled,!0),this.restriction.set("groupId",v.p.All),this.restrictedVideoDataService.deleteVideoRestriction(this.options.videoId,(function(){o.Radio.channel(g.e.RESTRICTED_VIDEO).trigger("cache:cleared")})),this.triggerMethod("hide"),this.logAction())}},{key:"logAction",value:function(e){var t={location:p.k.Popup,actionType:p.q.SetAccess,entity:p.e.Video,workflowPhase:p.r.Complete},n={id:this.model.get("id"),restriction:!!r.isNumber(e)&&v.p[e]};h.a.logUserAction(n,t)}},{key:"dataFetched",value:function(){return!!this.model&&!!this.restrictedObjectCollection}},{key:"renderDropdown",value:function(){var e=this;this.collection=new i.a.Collection([{name:ee.Students},{name:ee.Groups},{name:ee.All}]),this.collection.each((function(t){return t.set("selected",t.get("name")===e.selected)})),this.showChildView("dropdown",new P({titleProperty:"name",eventName:"dropdown:selected",buttonId:"select-btn",collection:this.collection,channelName:this.channelName,buttonClass:x.a.selectButton,displayOptions:{extraClasses:"w-100"},analyticsHelper:h.a}))}},{key:"onBeforeRender",value:function(){this.model=this.videoDataService.getVideo(this.options.videoId),this.restrictedObjectCollection=this.restrictedVideoDataService.getVideoRestrictions([this.options.videoId]),this.model&&this.restrictedObjectCollection&&this.refreshRestriction(),this.dataFetched()&&this.spinnerModel.set(w.c.Disabled,!1)}},{key:"viewOptions",value:function(){var e=this.config?"".concat(this.config.get("supportSiteUrl")).concat(g.y.VIDEO_ACCESS):"";return{styles:x.a,supportUrl:e,svg:u.a.getSvg(u.b.Info),dataFetched:this.dataFetched(),spinnerEl:d.q.getSpinner({size:d.r.Large,extraClasses:"mx-auto"}),restrictFromLabel:s.a.getPhrase(this.lang,"popupSubheading")}}},{key:"onRender",value:function(){this.dataFetched()&&(this.renderDropdown(),this.onOptionSelected(new i.a.Model({name:this.selected})))}},{key:"name",get:function(){return"RestrictAccessView"}},{key:"title",get:function(){return s.a.getPhrase(this.lang,"title")}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"tagName",get:function(){return"form"}},{key:"className",get:function(){return"form-group"}},{key:"channelName",get:function(){return d.k.generateUniqueChannelName(this)}},{key:"template",get:function(){return re.a}},{key:"behaviors",get:function(){var e=this;return[{behaviorClass:f.f,title:s.a.getPhrase(this.lang,"popupHeading"),modalClasses:x.a.modal,hideCloseButton:!0,size:"modal-md",spinnerButtonOptions:{channelName:this.channelName,model:this.spinnerModel=new a.a,buttonText:s.a.getPhrase(this.lang,"updateAccess"),tooltip:function(){return e.getSubmitBtnTooltipOptions()},onClick:function(t){return e.onSubmit(t)}},buttons:[{text:s.a.getPhrase(this.lang,"allowFullAccess"),getClassName:function(){return e.getAllowFullAccessBtnClassName()}}]},{behaviorClass:l.a,selector:".".concat(x.a.svgContainer),title:s.a.getPhrase(this.lang,"findOutMore")}]}},{key:"elements",get:function(){return{submit:"submit"}}},{key:"requiredResources",get:function(){return{config:b.b.config,currentUser:m.b.currentUser}}}])&&ie(t.prototype,n),k&&ie(t,k),O}(i.a.View)}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[9],{1030: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 m})),n.d(t,"e",(function(){return h})),n.d(t,"j",(function(){return b})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return E})),n.d(t,"b",(function(){return R})),n.d(t,"d",(function(){return k})),n.d(t,"f",(function(){return P})),n.d(t,"h",(function(){return y}));var r=n(2),i=n(1),o=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=i.reduce(e,(function(e,n,r){var o=t[r];return n||o?i.isObject(n)&&i.isObject(o)&&!i.isUndefined(n.id)&&n.id===o.id?e:i.isArray(n)?f(n,o).length?e.concat(r):e:i.isEqual(n,o)?e:e.concat(r):e}),[]);if(n.length)return i.object(i.map(n,(function(n){return i.isArray(t[n])?[n,f(e[n],t[n])]:[n,t[n]]})))}}function f(e,t){var n=[];return i.each(t,(function(t){var r=i.findWhere(e,{id:t.id});if(!i.isUndefined(r)||0!==Object.keys(t).length){var o=i.isUndefined(r)?t:l(r,t);o&&(t.id<0&&!t.value||(!r||t.id<0?n.push(t):(o.id=t.id,n.push(o))))}})),n}var d={getChanges:function(e,t){var n=l(i.omit(e.toJSON(),c),i.omit(t.toJSON(),c));if(n)return i.object(i.map(i.keys(n),(function(e){return[e,d.formatChanges(e,n[e])]})))},formatChanges:function(e,t){if(!t)return null;if(i.isObject(t)&&i.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 i.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":return;default:r.a.ErrorHelper.throw(new o.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var o=["distributors","producers","directors","productionCompanies"];for(var a in i.each(i.keys(n),(function(e){o.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(i.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 i.each(i.keys(e.toJSON()),(function(o){if(i.contains(n,o)){var a=e.get(o).map((function(e){return e.id})),u=t.get(o).map((function(e){return e.id})),s=i.filter(a,(function(e){return e&&!i.contains(u,e)}));s.length&&(r[o]=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:65535,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(),h={productionYear:function(e,t,n){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):""}},m={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"resourceNameRequired")}}]},b={suggestion:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditRequired")}},{maxLength:65535,msg:function(){return u.a.getPhrase(s,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditReasonRequired")}},{maxLength:65535,msg:function(){return u.a.getPhrase(s,"suggestEditReasonExceeds")}}]},y={number:function(e,t,n){return e?+e<1?u.a.getPhrase(s,"seasonLessThanOne"):+e>255?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:65535,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")}}]},E={name:[{maxLength:128,msg:function(){return u.a.getPhrase(s,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"fieldValueExceeds")}}]},R={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":u.a.getPhrase(s,"fieldsInvalid"):""}};function k(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1031:function(e,t,n){"use strict";var r=n(1037),i=n(1030),o=(n(1035),n(3),n(1038)),a=(n(1040),n(1036)),u=n(82),s={getVideoDownloadUrl:function(e,t){return u.a.safeUrlConcat(u.a.makeHttps(e),"/download?token=".concat(t))}};n.d(t,"a",(function(){return r.a})),n.d(t,"e",(function(){return i.g})),n.d(t,"h",(function(){return i.j})),n.d(t,"g",(function(){return i.i})),n.d(t,"d",(function(){return i.f})),n.d(t,"f",(function(){return i.h})),n.d(t,"c",(function(){return o.a})),n.d(t,"i",(function(){return a.a})),n.d(t,"b",(function(){return s}))},1035:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(1),i=n(49),o=n(160),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?i.a.calculateDestinationFolderDepth(e,n,t)>o.a.MAX_FOLDER_DEPTH?a.a.getPhrase(u,"maxFolderDepth",{maxDepth:o.a.MAX_FOLDER_DEPTH}):"":a.a.getPhrase(u,"selectParentFolder")}}},l=function(e){var t=e.validateName,n=e.validateParent,i=e.folder,o=e.collection;return t&&n?r.extend({},s,c(i,o)):t?s:n?c(i,o):void 0}},1036:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(15),i=n(3),o=n(186),a=n(1048),u=n(8);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-success";case e<80:return"bg-info";case e<96:return"bg-danger";case e<128:return"bg-pink";case e>=128:return"bg-warning";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.get("type")){case u.h.HostedLibrary:case u.h.CustomLibrary:return e.get("name");case u.h.Exchange:return i.a.getPhrase(l,"exchange");case u.h.Workspace:return i.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case u.h.HostedLibrary:case u.h.CustomLibrary:return"bg-info";case u.h.Exchange:return"bg-success";case u.h.Workspace:default:return"bg-danger"}},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 i.a.getPhrase(l,"pdf");case c.Image:return i.a.getPhrase(l,"image");case c.Document:return i.a.getPhrase(l,"document");case c.Excel:return i.a.getPhrase(l,"spreadsheet");case c.PowerPoint:return i.a.getPhrase(l,"presentation");case c.Zip:return i.a.getPhrase(l,"zipArchive");case c.File:return i.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 o.e.VideoTitle:t+="VideoTitle";break;case o.e.Description:t+="Description";break;case o.e.Rating:t+="Rating";break;case o.e.SeriesTitle:t+="SeriesTitle";break;case o.e.Season:t+="SeasonNumber";break;case o.e.EpisodeNumber:t+="EpisodeNumber";break;case o.e.BroadcastDate:t+="BroadcastDate";break;case o.e.Channel:t+="Channel";break;case o.e.ProductionYear:t+="ProductionYear";break;case o.e.Distributors:t+="Distributors";break;case o.e.ProductionCompanies:t+="ProductionCompanies";break;case o.e.Directors:t+="Directors";break;case o.e.Producers:t+="Producers";break;case o.e.Other:t+="Other"}return i.a.getPhrase(l,t)}}},1037:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(1),i=n(13),o=n(3),a="libraryEditor.utils",u={isValidChapterTime:function(e,t,n,o){if(o){if(!r.isNumber(t))return s.StartTime.Invalid();if(t<0)return s.StartTime.Invalid();if(t>i.w.millisecondsToSeconds(n))return s.StartTime.Exceeds();if(o.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 o.a.getPhrase(a,"chapterNameInvalid")},Exists:function(){return o.a.getPhrase(a,"chapterNameExists")},MaxLength:function(){return o.a.getPhrase(a,"chapterNameExceeds")}},StartTime:{Invalid:function(){return o.a.getPhrase(a,"chapterStartTimeInvalid")},Exists:function(){return o.a.getPhrase(a,"chapterStartTimeExists")},Exceeds:function(){return o.a.getPhrase(a,"chapterStartTimeExceeds")}}}},1038:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),i="libraryEditor.utils",o={name:[{required:!0,msg:function(){return r.a.getPhrase(i,"libraryNameRequired")}},{maxLength:255,msg:function(){return r.a.getPhrase(i,"libraryNameExceeds")}}]}},1040:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),i=n(1030),o=r.a.encloseNamespace("libraryEditor.utils"),a={name:[{required:!0,msg:function(){return o("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return o("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return o("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?o("episodeNumberLessThanOne"):e&&e>255?o("episodeNumberExceeds"):e&&e%1!=0?o("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?o("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":o("seasonNoEpisodeNumber")},productionYear:function(){return i.e.productionYear.apply(null,arguments)}}},1048: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 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 a(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return c}));var c=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}}),t&&o(e,t)}(n,e);var t=a(n);function n(){return i(this,n),t.apply(this,arguments)}return n}(n(2).a.Collection)},1093: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"}},1189:function(e,t,n){e.exports={selectRating:"_1I6jj",removeRating:"_1ze5G",disabled:"_2hO8J",disabledSelected:"mnQ5O"}},1192:function(e,t,n){"use strict";var r=n(1),i=n(6),o=n(2),a=n(135),u=n(410),s=n(1244),c=n.n(s),l=n(1189),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 h(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m(this,n)}}function m(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}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}}),t&&g(e,t)}(u,e);var t,n,r,o=h(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),o.call(this,e)}return t=u,(n=[{key:"events",value:function(){return{click:"onClick"}}},{key:"onClick",value:function(e){this.options.editable&&i.Radio.channel(this.options.channelName).trigger("select:rating",this.model)}},{key:"onRender",value:function(){this.resetClassName()}},{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:"behaviors",get:function(){var e=this.options.editable?this.options.model.get("name"):"";return[{behaviorClass:a.a,title:e}]}}])&&p(t.prototype,n),r&&p(t,r),u}(o.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 E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function R(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=w(e);if(t){var i=w(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return k(this,n)}}function k(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=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}}),t&&E(e,t)}(o,e);var t,n,r,i=R(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,e)}return t=o,(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),o}(o.a.ComponentCollection),N=n(13),S=n(3),C=n(0),O=n(186),_=n(1245),T=n.n(_),j=n(1093),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 q(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 L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=V(e);if(t){var i=V(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M(this,n)}}function M(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function V(e){return(V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return J}));var J=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}}),t&&L(e,t)}(c,e);var t,n,o,s=F(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:"events",value:function(){return{"click .remove-rating":"onRemoveRating"}}},{key:"regions",value:function(){return{ratings:{el:".ratings-region",replaceElement:!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){N.l.setRating(e,this.viewCollection)}},{key:"onRatingSelected",value:function(e){this.setCurrentRating(e);var t=N.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){i.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=N.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 x({collection:this.viewCollection,channelName:this.channelName,editable:this.options.editable}))}},{key:"onRender",value:function(){this.renderRatingCollectionComponent()}},{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:"template",get:function(){return T.a}},{key:"behaviors",get:function(){return[{behaviorClass:a.a,selector:".remove-rating",title:S.a.getPhrase(this.lang,"removeTooltip")}]}},{key:"appLinks",get:function(){return{".suggest-rating":{application:C.b.LIBRARY_EDITOR,action:C.a.LibraryEditor.SUGGEST_AN_EDIT,args:[this.options.videoId],params:{metadata:O.e.Rating}}}}},{key:"defaults",get:function(){return{editable:!0}}}])&&q(t.prototype,n),o&&q(t,o),c}(o.a.Component)},1244: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,i){var o;e.propertyIsEnumerable;return"\r\n"+e.escapeExpression("function"==typeof(o=null!=(o=n.code||(null!=t?t.code:t))?o:e.hooks.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"code",hash:{},data:i}):o)},useData:!0})},1245:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,i){e.propertyIsEnumerable;var o,a=null!=t?t:e.nullContext||{};return' <label class="'+(null!=(o=n.unless.call(a,null!=(o=null!=t?t.options:t)?o.editable:o,{name:"unless",hash:{},fn:e.program(2,i,0),inverse:e.noop,data:i}))?o:"")+'">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(a,"rating",{name:"lang",hash:{},data:i}))+"</label>\r\n "+(null!=(o=n.unless.call(a,null!=(o=null!=t?t.options:t)?o.editable:o,{name:"unless",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?o:"")+"\r\n"},2:function(e,t,n,r,i){return"d-inline-block"},4:function(e,t,n,r,i){e.propertyIsEnumerable;var o,a=e.escapeExpression;return'<span class="'+a(e.lambda(null!=(o=null!=(o=null!=t?t.options:t)?o.styles:o)?o.suggestEdit:o,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:i}))+"</a></span><br>"},6:function(e,t,n,r,i){e.propertyIsEnumerable;var o,a=e.escapeExpression;return'<span class="text-muted mx-2 remove-rating '+a(e.lambda(null!=(o=null!=(o=null!=t?t.options:t)?o.styles:o)?o.removeRating:o,t))+'">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"remove",{name:"lang",hash:{},data:i}))+"</span>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,i){e.propertyIsEnumerable;var o,a=e.lambda,u=e.escapeExpression,s=null!=t?t:e.nullContext||{};return'<div class="edit-rating form-group '+u(a(null!=(o=null!=(o=null!=t?t.options:t)?o.styles:o)?o.selectRating:o,t))+" "+u(a(null!=(o=null!=(o=null!=t?t.options:t)?o.styles:o)?o.rating:o,t))+'">\r\n'+(null!=(o=n.unless.call(s,null!=(o=null!=t?t.options:t)?o.hideHeaderText:o,{name:"unless",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?o:"")+' <div>\r\n <div class="ratings-region" name="rating"></div>\r\n '+(null!=(o=n.if.call(s,null!=(o=null!=t?t.options:t)?o.showRemove:o,{name:"if",hash:{},fn:e.program(6,i,0),inverse:e.noop,data:i}))?o:"")+'\r\n <div class="form-feedback"></div>\r\n </div>\r\n</div>'},useData:!0})}}]);
|
|
1
|
+
(window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[9],{1032: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 m})),n.d(t,"e",(function(){return h})),n.d(t,"j",(function(){return b})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return E})),n.d(t,"b",(function(){return R})),n.d(t,"d",(function(){return k})),n.d(t,"f",(function(){return P})),n.d(t,"h",(function(){return y}));var r=n(2),i=n(1),o=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=i.reduce(e,(function(e,n,r){var o=t[r];return n||o?i.isObject(n)&&i.isObject(o)&&!i.isUndefined(n.id)&&n.id===o.id?e:i.isArray(n)?f(n,o).length?e.concat(r):e:i.isEqual(n,o)?e:e.concat(r):e}),[]);if(n.length)return i.object(i.map(n,(function(n){return i.isArray(t[n])?[n,f(e[n],t[n])]:[n,t[n]]})))}}function f(e,t){var n=[];return i.each(t,(function(t){var r=i.findWhere(e,{id:t.id});if(!i.isUndefined(r)||0!==Object.keys(t).length){var o=i.isUndefined(r)?t:l(r,t);o&&(t.id<0&&!t.value||(!r||t.id<0?n.push(t):(o.id=t.id,n.push(o))))}})),n}var d={getChanges:function(e,t){var n=l(i.omit(e.toJSON(),c),i.omit(t.toJSON(),c));if(n)return i.object(i.map(i.keys(n),(function(e){return[e,d.formatChanges(e,n[e])]})))},formatChanges:function(e,t){if(!t)return null;if(i.isObject(t)&&i.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 i.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":return;default:r.a.ErrorHelper.throw(new o.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var o=["distributors","producers","directors","productionCompanies"];for(var a in i.each(i.keys(n),(function(e){o.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(i.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 i.each(i.keys(e.toJSON()),(function(o){if(i.contains(n,o)){var a=e.get(o).map((function(e){return e.id})),u=t.get(o).map((function(e){return e.id})),s=i.filter(a,(function(e){return e&&!i.contains(u,e)}));s.length&&(r[o]=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:65535,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(),h={productionYear:function(e,t,n){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):""}},m={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"resourceNameRequired")}}]},b={suggestion:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditRequired")}},{maxLength:65535,msg:function(){return u.a.getPhrase(s,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditReasonRequired")}},{maxLength:65535,msg:function(){return u.a.getPhrase(s,"suggestEditReasonExceeds")}}]},y={number:function(e,t,n){return e?+e<1?u.a.getPhrase(s,"seasonLessThanOne"):+e>255?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:65535,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")}}]},E={name:[{maxLength:128,msg:function(){return u.a.getPhrase(s,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"fieldValueExceeds")}}]},R={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":u.a.getPhrase(s,"fieldsInvalid"):""}};function k(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1033:function(e,t,n){"use strict";var r=n(1039),i=n(1032),o=(n(1037),n(3),n(1040)),a=(n(1042),n(1038)),u=n(82),s={getVideoDownloadUrl:function(e,t){return u.a.safeUrlConcat(u.a.makeHttps(e),"/download?token=".concat(t))}};n.d(t,"a",(function(){return r.a})),n.d(t,"e",(function(){return i.g})),n.d(t,"h",(function(){return i.j})),n.d(t,"g",(function(){return i.i})),n.d(t,"d",(function(){return i.f})),n.d(t,"f",(function(){return i.h})),n.d(t,"c",(function(){return o.a})),n.d(t,"i",(function(){return a.a})),n.d(t,"b",(function(){return s}))},1037:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(1),i=n(49),o=n(160),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?i.a.calculateDestinationFolderDepth(e,n,t)>o.a.MAX_FOLDER_DEPTH?a.a.getPhrase(u,"maxFolderDepth",{maxDepth:o.a.MAX_FOLDER_DEPTH}):"":a.a.getPhrase(u,"selectParentFolder")}}},l=function(e){var t=e.validateName,n=e.validateParent,i=e.folder,o=e.collection;return t&&n?r.extend({},s,c(i,o)):t?s:n?c(i,o):void 0}},1038:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(15),i=n(3),o=n(186),a=n(1050),u=n(8);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-success";case e<80:return"bg-info";case e<96:return"bg-danger";case e<128:return"bg-pink";case e>=128:return"bg-warning";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.get("type")){case u.h.HostedLibrary:case u.h.CustomLibrary:return e.get("name");case u.h.Exchange:return i.a.getPhrase(l,"exchange");case u.h.Workspace:return i.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case u.h.HostedLibrary:case u.h.CustomLibrary:return"bg-info";case u.h.Exchange:return"bg-success";case u.h.Workspace:default:return"bg-danger"}},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 i.a.getPhrase(l,"pdf");case c.Image:return i.a.getPhrase(l,"image");case c.Document:return i.a.getPhrase(l,"document");case c.Excel:return i.a.getPhrase(l,"spreadsheet");case c.PowerPoint:return i.a.getPhrase(l,"presentation");case c.Zip:return i.a.getPhrase(l,"zipArchive");case c.File:return i.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 o.e.VideoTitle:t+="VideoTitle";break;case o.e.Description:t+="Description";break;case o.e.Rating:t+="Rating";break;case o.e.SeriesTitle:t+="SeriesTitle";break;case o.e.Season:t+="SeasonNumber";break;case o.e.EpisodeNumber:t+="EpisodeNumber";break;case o.e.BroadcastDate:t+="BroadcastDate";break;case o.e.Channel:t+="Channel";break;case o.e.ProductionYear:t+="ProductionYear";break;case o.e.Distributors:t+="Distributors";break;case o.e.ProductionCompanies:t+="ProductionCompanies";break;case o.e.Directors:t+="Directors";break;case o.e.Producers:t+="Producers";break;case o.e.Other:t+="Other"}return i.a.getPhrase(l,t)}}},1039:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(1),i=n(13),o=n(3),a="libraryEditor.utils",u={isValidChapterTime:function(e,t,n,o){if(o){if(!r.isNumber(t))return s.StartTime.Invalid();if(t<0)return s.StartTime.Invalid();if(t>i.w.millisecondsToSeconds(n))return s.StartTime.Exceeds();if(o.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 o.a.getPhrase(a,"chapterNameInvalid")},Exists:function(){return o.a.getPhrase(a,"chapterNameExists")},MaxLength:function(){return o.a.getPhrase(a,"chapterNameExceeds")}},StartTime:{Invalid:function(){return o.a.getPhrase(a,"chapterStartTimeInvalid")},Exists:function(){return o.a.getPhrase(a,"chapterStartTimeExists")},Exceeds:function(){return o.a.getPhrase(a,"chapterStartTimeExceeds")}}}},1040:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),i="libraryEditor.utils",o={name:[{required:!0,msg:function(){return r.a.getPhrase(i,"libraryNameRequired")}},{maxLength:255,msg:function(){return r.a.getPhrase(i,"libraryNameExceeds")}}]}},1042:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),i=n(1032),o=r.a.encloseNamespace("libraryEditor.utils"),a={name:[{required:!0,msg:function(){return o("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return o("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return o("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?o("episodeNumberLessThanOne"):e&&e>255?o("episodeNumberExceeds"):e&&e%1!=0?o("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?o("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":o("seasonNoEpisodeNumber")},productionYear:function(){return i.e.productionYear.apply(null,arguments)}}},1050: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 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 a(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return c}));var c=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}}),t&&o(e,t)}(n,e);var t=a(n);function n(){return i(this,n),t.apply(this,arguments)}return n}(n(2).a.Collection)},1095: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"}},1191:function(e,t,n){e.exports={selectRating:"_1I6jj",removeRating:"_1ze5G",disabled:"_2hO8J",disabledSelected:"mnQ5O"}},1194:function(e,t,n){"use strict";var r=n(1),i=n(6),o=n(2),a=n(135),u=n(411),s=n(1246),c=n.n(s),l=n(1191),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 h(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m(this,n)}}function m(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}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}}),t&&g(e,t)}(u,e);var t,n,r,o=h(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),o.call(this,e)}return t=u,(n=[{key:"events",value:function(){return{click:"onClick"}}},{key:"onClick",value:function(e){this.options.editable&&i.Radio.channel(this.options.channelName).trigger("select:rating",this.model)}},{key:"onRender",value:function(){this.resetClassName()}},{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:"behaviors",get:function(){var e=this.options.editable?this.options.model.get("name"):"";return[{behaviorClass:a.a,title:e}]}}])&&p(t.prototype,n),r&&p(t,r),u}(o.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 E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function R(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=w(e);if(t){var i=w(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return k(this,n)}}function k(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=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}}),t&&E(e,t)}(o,e);var t,n,r,i=R(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,e)}return t=o,(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),o}(o.a.ComponentCollection),N=n(13),S=n(3),C=n(0),O=n(186),_=n(1247),T=n.n(_),j=n(1095),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 q(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 L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=V(e);if(t){var i=V(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M(this,n)}}function M(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function V(e){return(V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return J}));var J=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}}),t&&L(e,t)}(c,e);var t,n,o,s=F(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:"events",value:function(){return{"click .remove-rating":"onRemoveRating"}}},{key:"regions",value:function(){return{ratings:{el:".ratings-region",replaceElement:!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){N.l.setRating(e,this.viewCollection)}},{key:"onRatingSelected",value:function(e){this.setCurrentRating(e);var t=N.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){i.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=N.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 x({collection:this.viewCollection,channelName:this.channelName,editable:this.options.editable}))}},{key:"onRender",value:function(){this.renderRatingCollectionComponent()}},{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:"template",get:function(){return T.a}},{key:"behaviors",get:function(){return[{behaviorClass:a.a,selector:".remove-rating",title:S.a.getPhrase(this.lang,"removeTooltip")}]}},{key:"appLinks",get:function(){return{".suggest-rating":{application:C.b.LIBRARY_EDITOR,action:C.a.LibraryEditor.SUGGEST_AN_EDIT,args:[this.options.videoId],params:{metadata:O.e.Rating}}}}},{key:"defaults",get:function(){return{editable:!0}}}])&&q(t.prototype,n),o&&q(t,o),c}(o.a.Component)},1246: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,i){var o;e.propertyIsEnumerable;return"\r\n"+e.escapeExpression("function"==typeof(o=null!=(o=n.code||(null!=t?t.code:t))?o:e.hooks.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"code",hash:{},data:i}):o)},useData:!0})},1247:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,i){e.propertyIsEnumerable;var o,a=null!=t?t:e.nullContext||{};return' <label class="'+(null!=(o=n.unless.call(a,null!=(o=null!=t?t.options:t)?o.editable:o,{name:"unless",hash:{},fn:e.program(2,i,0),inverse:e.noop,data:i}))?o:"")+'">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(a,"rating",{name:"lang",hash:{},data:i}))+"</label>\r\n "+(null!=(o=n.unless.call(a,null!=(o=null!=t?t.options:t)?o.editable:o,{name:"unless",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?o:"")+"\r\n"},2:function(e,t,n,r,i){return"d-inline-block"},4:function(e,t,n,r,i){e.propertyIsEnumerable;var o,a=e.escapeExpression;return'<span class="'+a(e.lambda(null!=(o=null!=(o=null!=t?t.options:t)?o.styles:o)?o.suggestEdit:o,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:i}))+"</a></span><br>"},6:function(e,t,n,r,i){e.propertyIsEnumerable;var o,a=e.escapeExpression;return'<span class="text-muted mx-2 remove-rating '+a(e.lambda(null!=(o=null!=(o=null!=t?t.options:t)?o.styles:o)?o.removeRating:o,t))+'">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"remove",{name:"lang",hash:{},data:i}))+"</span>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,i){e.propertyIsEnumerable;var o,a=e.lambda,u=e.escapeExpression,s=null!=t?t:e.nullContext||{};return'<div class="edit-rating form-group '+u(a(null!=(o=null!=(o=null!=t?t.options:t)?o.styles:o)?o.selectRating:o,t))+" "+u(a(null!=(o=null!=(o=null!=t?t.options:t)?o.styles:o)?o.rating:o,t))+'">\r\n'+(null!=(o=n.unless.call(s,null!=(o=null!=t?t.options:t)?o.hideHeaderText:o,{name:"unless",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?o:"")+' <div>\r\n <div class="ratings-region" name="rating"></div>\r\n '+(null!=(o=n.if.call(s,null!=(o=null!=t?t.options:t)?o.showRemove:o,{name:"if",hash:{},fn:e.program(6,i,0),inverse:e.noop,data:i}))?o:"")+'\r\n <div class="form-feedback"></div>\r\n </div>\r\n</div>'},useData:!0})}}]);
|